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
e9ade1a5
Commit
e9ade1a5
authored
Sep 24, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-09-24
1.文裆库新增目录时可直接选择,保留自定义新增 2.设置用户为管理员可以对所有项目进行授权和发布文件
parent
cd6434a7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
187 additions
and
8 deletions
+187
-8
ServiceHGWD001.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
+17
-5
ServiceHGWD001E.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001E.java
+12
-0
HGWD005.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD005.xml
+10
-0
HGWDTools.java
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
+37
-1
HGWD001.js
src/main/webapp/HG/WD/HGWD001.js
+43
-2
HGWD001E.js
src/main/webapp/HG/WD/HGWD001E.js
+34
-0
HGWD001F.js
src/main/webapp/HG/WD/HGWD001F.js
+34
-0
No files found.
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
View file @
e9ade1a5
...
...
@@ -23,6 +23,7 @@ import com.baosight.hggp.hg.wd.domain.HGWD001A;
import
com.baosight.hggp.hg.wd.domain.HGWD003
;
import
com.baosight.hggp.hg.wd.domain.HGWD099
;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
import
com.baosight.hggp.hg.wd.utils.HgWdUtils
;
import
com.baosight.hggp.hg.xs.domain.Org
;
import
com.baosight.hggp.util.*
;
import
com.baosight.hggp.util.contants.ACConstants
;
...
...
@@ -204,6 +205,11 @@ public class ServiceHGWD001 extends ServiceEPBase {
strFileName
.
append
(
"新发布文件名称:"
).
append
(
String
.
join
(
","
,
changeEnd
));
}
}
// 非管理员仅查询自己有权限的项目
String
userId
=
UserSessionUtils
.
getLoginName
();
if
(!
HgWdUtils
.
HgWd009
.
isManager
(
userId
))
{
HGWDTools
.
HgWd003
.
checkProjectManager
(
hgwd001
.
getFileId
());
}
for
(
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
...
...
@@ -212,11 +218,6 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099
.
setStatus
(
HgWdConstant
.
FileStatus
.
S_1
);
hgwd099
.
setReleaseDate
(
DateUtils
.
shortDateTime
());
hgwd099
.
setOperStatus
(
HgWdConstant
.
OperStatus
.
S_0
);
List
<
HGWD003
>
listByFile
=
HGWDTools
.
HgWd003
.
listByFile
(
hgwd099
.
getBizId
());
List
hgwd003s
=
listByFile
.
stream
().
map
(
HGWD003:
:
getUserId
).
distinct
().
collect
(
Collectors
.
toList
());
AssertUtils
.
isTrue
(
hgwd003s
.
size
()
<=
1
,
"文件未分配人员,请先分配人员!"
);
hgwd003s
=
listByFile
.
stream
().
filter
(
hgwd003
->
hgwd003
.
getUserId
().
equals
(
UserSessionUtils
.
getUserId
())
&&
hgwd003
.
getIsProjectManager
()
==
1
).
collect
(
Collectors
.
toList
());
AssertUtils
.
isEmpty
(
hgwd003s
,
"您不是该项目的项目经理管理员,无法发布!"
);
DaoUtils
.
update
(
HgWdSqlConstant
.
HgWd099
.
RELEASE_DATE
,
hgwd099
);
//发布附件
//添加变更记录
...
...
@@ -417,6 +418,17 @@ public class ServiceHGWD001 extends ServiceEPBase {
return
inInfo
;
}
public
EiInfo
queryProjectManager
(
EiInfo
inInfo
)
{
try
{
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
Integer
isManager
=
HGWDTools
.
HgWd003
.
isProjectManager
(
queryRow
.
get
(
HGWD001
.
FIELD_FILE_ID
).
toString
());
inInfo
.
set
(
"isManager"
,
isManager
);
}
catch
(
Exception
e
){
LogUtils
.
setMsg
(
inInfo
,
e
,
"查询失败"
);
}
return
inInfo
;
}
private
static
void
cleanBaseInfo
(
HGWD099
hgwd099
){
hgwd099
.
setCreatedBy
(
null
);
hgwd099
.
setCreatedName
(
null
);
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001E.java
View file @
e9ade1a5
...
...
@@ -11,11 +11,13 @@ import com.baosight.hggp.hg.constant.HGConstant;
import
com.baosight.hggp.hg.wd.constant.HgWdConstant
;
import
com.baosight.hggp.hg.wd.domain.HGWD001
;
import
com.baosight.hggp.hg.wd.domain.HGWD001A
;
import
com.baosight.hggp.hg.wd.domain.HGWD005
;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
import
com.baosight.hggp.hg.xs.domain.Org
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.LogUtils
;
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
;
...
...
@@ -135,4 +137,14 @@ public class ServiceHGWD001E extends ServiceEPBase {
DaoUtils
.
update
(
HGWD001
.
UPDATE
,
hgwd001
);
}
public
EiInfo
queryProductName
(
EiInfo
inInfo
){
//EiBlock block = inInfo.getBlock(EiConstant.resultBlock);
//block.set(EiConstant.limitStr,-999999);
inInfo
=
super
.
query
(
inInfo
,
"HGWD005.queryProductName"
);
EiBlock
productBlock
=
new
EiBlock
(
"product_name_block_id"
);
productBlock
.
setRows
(
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
());
inInfo
.
addBlock
(
productBlock
);
return
inInfo
;
}
}
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD005.xml
View file @
e9ade1a5
...
...
@@ -119,4 +119,14 @@
WHERE ID = #id#
</update>
<!--查询产品名称-->
<select
id=
"queryProductName"
resultClass=
"java.util.HashMap"
>
SELECT
PRODUCT_NAME as "textField"
FROM ${hggpSchema}.HGWD005
WHERE 1=1
<include
refid=
"condition"
/>
group by PRODUCT_NAME
</select>
</sqlMap>
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
View file @
e9ade1a5
...
...
@@ -15,9 +15,11 @@ 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.utils.HgWdUtils
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.io.IOException
;
...
...
@@ -213,7 +215,41 @@ public class HGWDTools {
}
return
dbWd001s
.
stream
().
collect
(
Collectors
.
groupingBy
(
HGWD003:
:
getFileId
));
}
/** 校验项目管理员
* @param fileId
*/
public
static
void
checkProjectManager
(
String
fileId
)
{
List
<
HGWD003
>
hgwd003List
=
HGWDTools
.
HgWd003
.
listByFile
(
fileId
);
List
hgwd003s
=
hgwd003List
.
stream
().
map
(
HGWD003:
:
getUserId
).
distinct
().
collect
(
Collectors
.
toList
());
AssertUtils
.
isTrue
(
hgwd003s
.
size
()
<=
1
,
"文件未分配人员,请先分配人员!"
);
hgwd003s
=
hgwd003List
.
stream
().
filter
(
hgwd003
->
hgwd003
.
getUserId
().
equals
(
UserSessionUtils
.
getUserId
())
&&
hgwd003
.
getIsProjectManager
()
==
1
).
collect
(
Collectors
.
toList
());
AssertUtils
.
isEmpty
(
hgwd003s
,
"您不是该项目的项目经理管理员,无法发布!"
);
}
/**
* 查询用户是否拥有权限
*
* @param fileId 文件ID
* @return 0 没有权限 1 是管理员,2 是项目经理,3 设计员
*/
public
static
Integer
isProjectManager
(
String
fileId
)
{
String
userId
=
UserSessionUtils
.
getLoginName
();
if
(
HgWdUtils
.
HgWd009
.
isManager
(
userId
))
{
return
1
;
}
if
(
StringUtils
.
isEmpty
(
fileId
)){
return
0
;
}
List
<
HGWD003
>
hgwd003List
=
HGWDTools
.
HgWd003
.
listByFile
(
fileId
);
List
<
HGWD003
>
hgwd003s
=
hgwd003List
.
stream
().
filter
(
hgwd003
->
hgwd003
.
getUserId
().
equals
(
userId
)
&&
hgwd003
.
getIsProjectManager
()
==
1
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
hgwd003s
)){
return
2
;
}
hgwd003s
=
hgwd003List
.
stream
().
filter
(
hgwd003
->
hgwd003
.
getUserId
().
equals
(
userId
)).
collect
(
Collectors
.
toList
());
return
!
CollectionUtils
.
isEmpty
(
hgwd003s
)
?
3
:
0
;
}
}
/**
...
...
src/main/webapp/HG/WD/HGWD001.js
View file @
e9ade1a5
...
...
@@ -822,7 +822,8 @@ let showAuthButton = function () {
$
(
"#CHANGE_RECORD"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
true
);
}
let
inEiInfo
=
new
EiInfo
();
isProjectManager
(
parentId
);
/*let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
inEiInfo.set("inqu_status-0-isProjectManager", "1");
inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
...
...
@@ -843,7 +844,7 @@ let showAuthButton = function () {
}
}, {
async: false
});
});
*/
}
/**
...
...
@@ -923,4 +924,43 @@ let preview = function () {
let
fileId
=
IPLATUI
.
EFTree
.
categoryTree
.
selectTreeNode
.
fileId
;
let
url
=
"HGWD002A?inqu_status-0-fileId="
+
fileId
;
window
.
open
(
url
,
'_blank'
);
}
let
isProjectManager
=
function
(
parentId
)
{
let
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"inqu_status-0-fileId"
,
parentId
);
//inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
EiCommunicator
.
send
(
"HGWD001"
,
"queryProjectManager"
,
inEiInfo
,
{
onSuccess
(
ei
)
{
if
(
ei
.
status
!=
-
1
){
switch
(
ei
.
extAttr
.
isManager
)
{
case
1
:
$
(
"#RELEASE"
).
attr
(
"disabled"
,
false
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
false
);
break
;
case
2
:
$
(
"#RELEASE"
).
attr
(
"disabled"
,
false
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
false
);
break
;
case
3
:
$
(
"#RELEASE"
).
attr
(
"disabled"
,
true
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
false
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
false
);
break
default
:
$
(
"#RELEASE"
).
attr
(
"disabled"
,
true
);
$
(
"#UPLOAD_FILE"
).
attr
(
"disabled"
,
true
);
$
(
"#COPY_FILE"
).
attr
(
"disabled"
,
true
);
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
true
);
}
}
}
},
{
async
:
false
})
}
\ No newline at end of file
src/main/webapp/HG/WD/HGWD001E.js
View file @
e9ade1a5
...
...
@@ -63,6 +63,40 @@ $(function () {
}
return
dataItem
[
"projCode"
];
}
},
{
field
:
"fileName"
,
editor
:
function
(
container
,
options
)
{
var
grid
=
container
.
closest
(
".k-grid"
).
data
(
"kendoGrid"
);
var
cellIndex
=
grid
.
cellIndex
(
container
);
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
let
eiInfo
=
new
EiInfo
();
var
eiblock
=
new
EiBlock
(
"result"
);
eiblock
.
set
(
EiConstant
.
LIMIT
,
-
999999
);
eiblock
.
set
(
EiConstant
.
OFFSET
,
0
);
eiInfo
.
addBlock
(
eiblock
);
var
dataSource
;
EiCommunicator
.
send
(
"HGWD001E"
,
"queryProductName"
,
eiInfo
,
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"product_name_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
input
.
kendoAutoComplete
({
dataSource
:
dataSource
,
minLength
:
0
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabelTemplate
:
"#:textField#"
,
valueTemplate
:
"#:valueField#"
,
template
:
"#:textField#"
,
filter
:
"contains"
});
input
.
data
(
"kendoAutoComplete"
).
search
();
}
}
],
exportGrid
:
{
...
...
src/main/webapp/HG/WD/HGWD001F.js
View file @
e9ade1a5
...
...
@@ -42,6 +42,40 @@ $(function () {
}
return
dataItem
[
"companyCode"
];
}
},
{
field
:
"fileName"
,
editor
:
function
(
container
,
options
)
{
var
grid
=
container
.
closest
(
".k-grid"
).
data
(
"kendoGrid"
);
var
cellIndex
=
grid
.
cellIndex
(
container
);
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
let
eiInfo
=
new
EiInfo
();
var
eiblock
=
new
EiBlock
(
"result"
);
eiblock
.
set
(
EiConstant
.
LIMIT
,
-
999999
);
eiblock
.
set
(
EiConstant
.
OFFSET
,
0
);
eiInfo
.
addBlock
(
eiblock
);
var
dataSource
;
EiCommunicator
.
send
(
"HGWD001E"
,
"queryProductName"
,
eiInfo
,
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"product_name_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
input
.
kendoAutoComplete
({
dataSource
:
dataSource
,
minLength
:
0
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabelTemplate
:
"#:textField#"
,
valueTemplate
:
"#:valueField#"
,
template
:
"#:textField#"
,
filter
:
"contains"
});
input
.
data
(
"kendoAutoComplete"
).
search
();
}
}
],
exportGrid
:
{
...
...
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