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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
38 deletions
+76
-38
ServiceHGWD001.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
+14
-2
ServiceHGWD099.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD099.java
+37
-22
HGWDTools.java
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
+25
-14
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 {
...
@@ -231,7 +231,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
if
(
StringUtils
.
isNotEmpty
(
changeContent
))
{
if
(
StringUtils
.
isNotEmpty
(
changeContent
))
{
strFileName
.
append
(
","
).
append
(
"变更内容:"
).
append
(
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
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.update"
,
"发布成功"
)});
inInfo
.
setMsgByKey
(
"ep.1000"
,
new
String
[]{
String
.
valueOf
(
i
),
I18nMessages
.
getText
(
"label.update"
,
"发布成功"
)});
...
@@ -276,7 +282,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
...
@@ -276,7 +282,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099
.
setOperStatus
(
HgWdConstant
.
OperStatus
.
S_1
);
hgwd099
.
setOperStatus
(
HgWdConstant
.
OperStatus
.
S_1
);
DaoUtils
.
insert
(
HGWD099
.
UPDATE
,
hgwd099
);
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
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
}
catch
(
Exception
e
)
{
}
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 {
...
@@ -111,7 +111,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
HGWDTools
.
HgWd001
.
updateStatus
(
hgwd001
);
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
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据新增成功!"
);
...
@@ -132,29 +137,39 @@ public class ServiceHGWD099 extends ServiceEPBase {
...
@@ -132,29 +137,39 @@ public class ServiceHGWD099 extends ServiceEPBase {
public
EiInfo
delete
(
EiInfo
inInfo
)
{
public
EiInfo
delete
(
EiInfo
inInfo
)
{
try
{
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
for
(
Map
resultRow
:
resultRows
)
{
List
<
HGWD099
>
list
=
MapUtils
.
toDaoEPBases
(
resultRows
,
HGWD099
.
class
);
HGWD099
hgdm099
=
new
HGWD099
();
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
hgdm099
.
fromMap
(
resultRow
);
List
<
String
>
bizNames
=
list
.
stream
().
map
(
HGWD099:
:
getDocName
).
distinct
().
collect
(
Collectors
.
toList
());
DaoUtils
.
update
(
HGWD099
.
DELETE
,
hgdm099
);
//逻辑删除
HGWD001
hgwd001
=
HGWDTools
.
HgWd001
.
get
(
list
.
get
(
0
).
getBizId
());
HGWD001
hgwd001
=
HGWDTools
.
HgWd001
.
get
(
hgdm099
.
getBizId
());
list
.
forEach
(
hgwd099
->
{
if
(
hgwd001
!=
null
)
{
DaoUtils
.
update
(
HGWD099
.
DELETE
,
hgwd099
.
toMap
());
//逻辑删除
HGWD001A
hgwd001a
=
new
HGWD001A
();
if
(
hgwd001
!=
null
)
{
hgwd001a
.
setCompanyCode
(
hgwd001
.
getCompanyCode
());
HGWD001A
hgwd001a
=
new
HGWD001A
();
hgwd001a
.
setCompanyName
(
hgwd001
.
getCompanyName
());
hgwd001a
.
setCompanyCode
(
hgwd001
.
getCompanyCode
());
hgwd001a
.
setProjCode
(
hgwd001
.
getProjCode
());
hgwd001a
.
setCompanyName
(
hgwd001
.
getCompanyName
());
hgwd001a
.
setProjName
(
hgwd001
.
getProjName
());
hgwd001a
.
setProjCode
(
hgwd001
.
getProjCode
());
hgwd001a
.
setChangeType
(
ChangeTypeEnum
.
UPLOAD_DELETE
.
getCode
());
hgwd001a
.
setProjName
(
hgwd001
.
getProjName
());
hgwd001a
.
setChangeContent
(
hgwd001
.
getFileName
());
hgwd001a
.
setChangeType
(
ChangeTypeEnum
.
UPLOAD_DELETE
.
getCode
());
hgwd001a
.
setChangeEnd
(
hgdm099
.
getDocName
());
hgwd001a
.
setChangeContent
(
hgwd001
.
getFileName
());
hgwd001a
.
setChangeEndCode
(
hgdm099
.
getDocId
());
hgwd001a
.
setChangeEnd
(
hgwd099
.
getDocName
());
hgwd001a
.
setMatId
(
hgwd001
.
getId
());
hgwd001a
.
setChangeEndCode
(
hgwd099
.
getDocId
());
hgwd001a
.
setAcceId
(
hgdm099
.
getId
().
toString
());
hgwd001a
.
setMatId
(
hgwd001
.
getId
());
HGWDTools
.
HgWd001
.
addHGWD001A
(
hgwd001a
);
hgwd001a
.
setAcceId
(
hgwd099
.
getId
().
toString
());
HGWDTools
.
HgWd001
.
addHGWD001A
(
hgwd001a
);
hgwd001
.
setStatus
(
HgWdConstant
.
FileStatus
.
S_0
);
hgwd001
.
setStatus
(
HgWdConstant
.
FileStatus
.
S_0
);
HGWDTools
.
HgWd001
.
updateStatus
(
hgwd001
);
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
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
View file @
2a121af0
...
@@ -325,21 +325,32 @@ public class HGWDTools {
...
@@ -325,21 +325,32 @@ public class HGWDTools {
* @param changeContent 变更内容
* @param changeContent 变更内容
*/
*/
public
static
void
interaction
(
HGWD001
hgwd001
,
String
changeContent
){
public
static
void
interaction
(
HGWD001
hgwd001
,
String
changeContent
){
if
(
Objects
.
nonNull
(
hgwd001
)){
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
{
try
{
if
(
Objects
.
nonNull
(
hgwd001
)){
if
(
userIds
.
size
()>
0
){
List
<
HGWD003
>
listByFile
=
HGWDTools
.
HgWd003
.
listByFile
(
hgwd001
.
getFileId
());
//获取文件下的权限人员
DcOpenApi
.
interactionAdd
(
projName
,
//HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
changeContent
,
String
.
join
(
","
,
userIds
)
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
());
if
(
userIds
.
size
()>
0
){
DcOpenApi
.
interactionAdd
(
String
.
format
(
"[%s]项目通知"
,
hgwd001
.
getProjName
()),
changeContent
,
String
.
join
(
","
,
userIds
));
}
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
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