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
2a121af0
Commit
2a121af0
authored
Sep 23, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-23 文档库:新增、变更、删除发送通知当前目录的用户
parent
aad91f0c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
16 deletions
+54
-16
ServiceHGWD001.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
+14
-2
ServiceHGWD099.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD099.java
+24
-9
HGWDTools.java
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
+16
-5
No files found.
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
View file @
2a121af0
...
...
@@ -231,7 +231,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
if
(
StringUtils
.
isNotEmpty
(
changeContent
))
{
strFileName
.
append
(
","
).
append
(
"变更内容:"
).
append
(
changeContent
);
}
HGWDTools
.
interaction
(
hgwd001
,
strFileName
.
toString
());
//获取文件下的权限人员
List
<
HGWD003
>
listByFile
=
HGWDTools
.
HgWd003
.
listByFile
(
hgwd001
.
getFileId
());
//排除登录用户
List
<
String
>
userIds
=
listByFile
.
stream
().
filter
(
item
->
!
item
.
getUserId
().
equals
(
UserSessionUtils
.
getUserId
()))
.
map
(
HGWD003:
:
getExtId
)
.
filter
(
ObjectUtils:
:
isNotBlank
).
distinct
().
collect
(
Collectors
.
toList
());
HGWDTools
.
interaction
(
String
.
format
(
"[%s]项目发布通知"
,
hgwd001
.
getProjName
()),
strFileName
.
toString
(),
userIds
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.update"
,
"发布成功"
)});
...
...
@@ -276,7 +282,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099
.
setOperStatus
(
HgWdConstant
.
OperStatus
.
S_1
);
DaoUtils
.
insert
(
HGWD099
.
UPDATE
,
hgwd099
);
}
HGWDTools
.
interaction
(
hgwd001
,
strFileName
.
substring
(
0
,
strFileName
.
length
()-
1
));
//获取文件下的权限人员
List
<
HGWD003
>
listByFile
=
HGWDTools
.
HgWd003
.
listByFile
(
hgwd001
.
getFileId
());
//排除登录用户
List
<
String
>
userIds
=
listByFile
.
stream
().
filter
(
item
->
!
item
.
getUserId
().
equals
(
UserSessionUtils
.
getUserId
()))
.
map
(
HGWD003:
:
getExtId
)
.
filter
(
ObjectUtils:
:
isNotBlank
).
distinct
().
collect
(
Collectors
.
toList
());
HGWDTools
.
interaction
(
String
.
format
(
"[%s]项目变更附件通知"
,
hgwd001
.
getProjName
()),
strFileName
.
substring
(
0
,
strFileName
.
length
()-
1
),
userIds
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD099.java
View file @
2a121af0
...
...
@@ -111,7 +111,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
HGWDTools
.
HgWd001
.
updateStatus
(
hgwd001
);
}
}
HGWDTools
.
interaction
(
hgwd001
,
strFileName
.
substring
(
0
,
strFileName
.
length
()
-
1
));
List
<
HGWD003
>
listByFile
=
HGWDTools
.
HgWd003
.
listByFile
(
hgwd001
.
getFileId
());
//获取文件下的权限人员
//排除登录用户
List
<
String
>
userIds
=
listByFile
.
stream
().
filter
(
item
->
!
item
.
getUserId
().
equals
(
UserSessionUtils
.
getUserId
()))
.
map
(
HGWD003:
:
getExtId
)
.
filter
(
ObjectUtils:
:
isNotBlank
).
distinct
().
collect
(
Collectors
.
toList
());
HGWDTools
.
interaction
(
String
.
format
(
"[%s]项目新增附件通知"
,
hgwd001
.
getProjName
()),
strFileName
.
substring
(
0
,
strFileName
.
length
()
-
1
),
userIds
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
...
...
@@ -132,11 +137,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
Map
resultRow
:
resultRows
)
{
HGWD099
hgdm099
=
new
HGWD099
();
hgdm099
.
fromMap
(
resultRow
);
DaoUtils
.
update
(
HGWD099
.
DELETE
,
hgdm099
);
//逻辑删除
HGWD001
hgwd001
=
HGWDTools
.
HgWd001
.
get
(
hgdm099
.
getBizId
());
List
<
HGWD099
>
list
=
MapUtils
.
toDaoEPBases
(
resultRows
,
HGWD099
.
class
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
List
<
String
>
bizNames
=
list
.
stream
().
map
(
HGWD099:
:
getDocName
).
distinct
().
collect
(
Collectors
.
toList
());
HGWD001
hgwd001
=
HGWDTools
.
HgWd001
.
get
(
list
.
get
(
0
).
getBizId
());
list
.
forEach
(
hgwd099
->
{
DaoUtils
.
update
(
HGWD099
.
DELETE
,
hgwd099
.
toMap
());
//逻辑删除
if
(
hgwd001
!=
null
)
{
HGWD001A
hgwd001a
=
new
HGWD001A
();
hgwd001a
.
setCompanyCode
(
hgwd001
.
getCompanyCode
());
...
...
@@ -145,16 +151,25 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a
.
setProjName
(
hgwd001
.
getProjName
());
hgwd001a
.
setChangeType
(
ChangeTypeEnum
.
UPLOAD_DELETE
.
getCode
());
hgwd001a
.
setChangeContent
(
hgwd001
.
getFileName
());
hgwd001a
.
setChangeEnd
(
hgdm
099
.
getDocName
());
hgwd001a
.
setChangeEndCode
(
hgdm
099
.
getDocId
());
hgwd001a
.
setChangeEnd
(
hgwd
099
.
getDocName
());
hgwd001a
.
setChangeEndCode
(
hgwd
099
.
getDocId
());
hgwd001a
.
setMatId
(
hgwd001
.
getId
());
hgwd001a
.
setAcceId
(
hgdm
099
.
getId
().
toString
());
hgwd001a
.
setAcceId
(
hgwd
099
.
getId
().
toString
());
HGWDTools
.
HgWd001
.
addHGWD001A
(
hgwd001a
);
hgwd001
.
setStatus
(
HgWdConstant
.
FileStatus
.
S_0
);
HGWDTools
.
HgWd001
.
updateStatus
(
hgwd001
);
}
});
//获取文件下的权限人员
List
<
HGWD003
>
listByFile
=
HGWDTools
.
HgWd003
.
listByFile
(
hgwd001
.
getFileId
());
//排除登录用户
List
<
String
>
userIds
=
listByFile
.
stream
().
filter
(
item
->
!
item
.
getUserId
().
equals
(
UserSessionUtils
.
getUserId
()))
.
map
(
HGWD003:
:
getExtId
)
.
filter
(
ObjectUtils:
:
isNotBlank
).
distinct
().
collect
(
Collectors
.
toList
());
HGWDTools
.
interaction
(
String
.
format
(
"[%s]项目删除附件通知"
,
hgwd001
.
getProjName
()),
String
.
format
(
"删除附件名称:%s"
,
String
.
join
(
","
,
bizNames
)),
userIds
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
View file @
2a121af0
...
...
@@ -325,21 +325,32 @@ public class HGWDTools {
* @param changeContent 变更内容
*/
public
static
void
interaction
(
HGWD001
hgwd001
,
String
changeContent
){
try
{
if
(
Objects
.
nonNull
(
hgwd001
)){
List
<
HGWD003
>
listByFile
=
HGWDTools
.
HgWd003
.
listByFile
(
hgwd001
.
getFileId
());
//获取文件下的权限人员
List
<
HGWD003
>
listByFile
=
HgWd003
.
listByFile
(
hgwd001
.
getFileId
());
//获取文件下的权限人员
//HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
List
<
String
>
userIds
=
listByFile
.
stream
().
filter
(
item
->
!
item
.
getUserId
().
equals
(
UserSessionUtils
.
getUserId
())
&&
item
.
getIsProjectManager
()
==
1
)
.
map
(
HGWD003:
:
getExtId
)
.
filter
(
ObjectUtils:
:
isNotBlank
).
distinct
().
collect
(
Collectors
.
toList
());
interaction
(
String
.
format
(
"[%s]项目通知"
,
hgwd001
.
getProjName
()),
changeContent
,
userIds
);
}
}
/**
* 附件上传通知
* @param projName 待变更的项目名称
* @param changeContent 变更内容
* @param userIds 用户ID集合
*/
public
static
void
interaction
(
String
projName
,
String
changeContent
,
List
<
String
>
userIds
){
try
{
if
(
userIds
.
size
()>
0
){
DcOpenApi
.
interactionAdd
(
String
.
format
(
"[%s]项目通知"
,
hgwd001
.
getProjName
())
,
projName
,
changeContent
,
String
.
join
(
","
,
userIds
));
}
String
.
join
(
","
,
userIds
)
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
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