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
e3b823c9
Commit
e3b823c9
authored
Sep 24, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-24
1.文档库:复制功能需支持按项目和文件夹复制附件
parent
57792d92
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
54 deletions
+32
-54
ServiceHGWD001.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
+16
-47
HGWDTools.java
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
+14
-0
HGWD001.js
src/main/webapp/HG/WD/HGWD001.js
+2
-7
No files found.
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
View file @
e3b823c9
...
...
@@ -454,36 +454,19 @@ public class ServiceHGWD001 extends ServiceEPBase {
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
));
}
// 要复制项目
List
<
HGWD001
>
hgwd001List
=
HGWDTools
.
HgWd001
.
queryByProjCode
(
queryMap
.
get
(
HGWD001
.
FIELD_PROJ_CODE
),
queryMap
.
get
(
HGWD001
.
FIELD_PARENT_ID
));
List
<
String
>
fileIds
=
hgwd001List
.
stream
().
map
(
HGWD001:
:
getFileId
).
collect
(
Collectors
.
toList
());
List
<
HGWD099
>
hgwd099List
=
HGWDTools
.
HgWd099
.
queryByBiz
(
"WD"
,
fileIds
);
StringBuilder
strFileName
=
new
StringBuilder
();
String
parentId
=
result1Rows
.
get
(
0
).
getParentId
();
// 写入数据
for
(
HGWD001
hgwd001:
hgwd001List
)
{
String
fileId
=
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
WD_FILE_ID
);
hgwd001
.
setParentId
(
result1Rows
.
get
(
0
).
getProjCode
());
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
(
","
);
addCopyFile
(
hgwd001
,
parentId
,
fileId
);
HGWD001A
hgwd001a
=
initHgwd001a
(
hgwd001
,
hgwd099
,
ChangeTypeEnum
.
UPLOAD_ADD
.
getCode
());
hgwd001a
.
setChangeEndCode
(
hgwd099
.
getDocId
());
hgwd001a
.
setChangeEnd
(
hgwd099
.
getDocName
());
HGWDTools
.
HgWd001
.
addHGWD001A
(
hgwd001a
);
}
hgwd001
.
setFileId
(
fileId
);
hgwd001
.
setStatus
(
HgWdConstant
.
FileStatus
.
S_0
);
cleanBaseInfo
(
hgwd001
);
DaoUtils
.
insert
(
HGWD001
.
INSERT
,
hgwd001
);
}
HGWDTools
.
interaction
(
result1Rows
.
get
(
0
),
strFileName
.
substring
(
0
,
strFileName
.
length
()
-
1
));
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hgwd001List
.
size
()
+
"]条数据保存成功!"
);
}
catch
(
Exception
e
)
{
...
...
@@ -492,28 +475,17 @@ public class ServiceHGWD001 extends ServiceEPBase {
return
inInfo
;
}
@OperationLogAnnotation
(
operModul
=
"文档库"
,
operType
=
"复制文件"
,
operDesc
=
"文档库-复制文件-复制文件操作"
)
public
EiInfo
save3
(
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
.
queryByProjCode
(
queryMap
.
get
(
HGWD001
.
FIELD_PROJ_CODE
),
queryMap
.
get
(
HGWD001
.
FIELD_PARENT_ID
));
List
<
String
>
fileIds
=
hgwd001List
.
stream
().
map
(
HGWD001:
:
getFileId
).
collect
(
Collectors
.
toList
());
List
<
HGWD099
>
hgwd099List
=
HGWDTools
.
HgWd099
.
queryByBiz
(
"WD"
,
fileIds
);
private
void
addCopyFile
(
HGWD001
hgwd001
,
String
parentId
,
String
fileId
){
List
<
HGWD099
>
hgwd099List
=
HGWDTools
.
HgWd099
.
queryByBiz
(
"WD"
,
hgwd001
.
getFileId
());
StringBuilder
strFileName
=
new
StringBuilder
();
// 写入数据
for
(
HGWD001
hgwd001:
hgwd001List
)
{
hgwd001
.
setParentId
(
result1Rows
.
get
(
0
).
getProjCode
());
hgwd001
.
setStatus
(
HgWdConstant
.
FileStatus
.
S_0
);
hgwd001
.
setDocVersion
(
0
);
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
(
hgwd001
.
getFileId
()
);
hgwd099
.
setBizId
(
fileId
);
hgwd099
.
setStatus
(
HgWdConstant
.
FileStatus
.
S_0
);
DaoUtils
.
insert
(
HGWD099
.
INSERT
,
hgwd099
);
strFileName
.
append
(
hgwd099
.
getDocName
()).
append
(
","
);
...
...
@@ -523,16 +495,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
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
(
result1Rows
.
get
(
0
),
strFileName
.
substring
(
0
,
strFileName
.
length
()
-
1
));
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
hgwd001List
.
size
()
+
"]条数据保存成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存失败"
);
}
return
inInfo
;
HGWDTools
.
interaction
(
hgwd001
,
strFileName
.
substring
(
0
,
strFileName
.
length
()
-
1
));
}
public
EiInfo
queryProjectManager
(
EiInfo
inInfo
)
{
...
...
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
View file @
e3b823c9
...
...
@@ -163,6 +163,20 @@ public class HGWDTools {
queryMap
.
put
(
User
.
FIELD_USER_ID
,
userId
);
}
queryMap
.
put
(
HGWD001
.
FIELD_PROJ_CODE
,
projCode
);
queryMap
.
put
(
HGWD001
.
FIELD_PARENT_ID
,
parentId
);
List
<
HGWD001
>
results
=
DaoBase
.
getInstance
().
query
(
HGWD001
.
QUERY
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
}
public
static
List
<
HGWD001
>
queryByParentId
(
String
projCode
,
String
parentId
)
{
Map
queryMap
=
new
HashMap
<>();
// 非管理员仅查询自己有权限的项目
String
userId
=
UserSessionUtils
.
getLoginName
();
if
(!
HgWdUtils
.
HgWd009
.
isManager
(
userId
))
{
queryMap
.
put
(
User
.
FIELD_USER_ID
,
userId
);
}
queryMap
.
put
(
HGWD001
.
FIELD_PROJ_CODE
,
projCode
);
queryMap
.
put
(
HGWD001
.
FIELD_FILE_ID
,
parentId
);
List
<
HGWD001
>
results
=
DaoBase
.
getInstance
().
query
(
HGWD001
.
QUERY
,
queryMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
;
...
...
src/main/webapp/HG/WD/HGWD001.js
View file @
e3b823c9
...
...
@@ -389,7 +389,8 @@ $(function () {
projCode
:
''
,
companyCode
:
''
,
leafLevel
:
''
,
type
:
''
,
leafType
:
''
,
},
// expandLevel:1,
/**
...
...
@@ -831,13 +832,11 @@ let showAuthButton = function () {
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#CHANGE_RECORD"
).
attr
(
"disabled"
,
true
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_PROT_FILE"
).
attr
(
"disabled"
,
false
);
}
else
{
$
(
"#RELEASE"
).
attr
(
"disabled"
,
true
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
true
);
$
(
"#CHANGE_RECORD"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
true
);
$
(
"#COPY_PROT_FILE"
).
attr
(
"disabled"
,
true
);
}
isProjectManager
(
parentId
);
/*let inEiInfo = new EiInfo();
...
...
@@ -1007,28 +1006,24 @@ let isProjectManager = function (parentId) {
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_PROT_FILE"
).
attr
(
"disabled"
,
false
);
break
;
case
2
:
$
(
"#RELEASE"
).
attr
(
"disabled"
,
false
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_PROT_FILE"
).
attr
(
"disabled"
,
false
);
break
;
case
3
:
$
(
"#RELEASE"
).
attr
(
"disabled"
,
true
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_PROT_FILE"
).
attr
(
"disabled"
,
false
);
break
default
:
$
(
"#RELEASE"
).
attr
(
"disabled"
,
true
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
true
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
true
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
true
);
$
(
"#COPY_PROT_FILE"
).
attr
(
"disabled"
,
true
);
}
}
}
...
...
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