Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-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
hp-smart
Commits
2604b973
Commit
2604b973
authored
Jan 13, 2024
by
“zhangzhichao_123”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'feat():完成HPSC001与HPSC002的数据交互'
parent
47a6907d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
114 additions
and
37 deletions
+114
-37
ServiceHPSC001.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC001.java
+67
-4
ServiceHPSC002.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
+0
-7
HPSC001.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC001.xml
+5
-1
HPSC001.js
src/main/webapp/HP/SC/HPSC001.js
+37
-2
HPSC001.jsp
src/main/webapp/HP/SC/HPSC001.jsp
+3
-3
HPSC002.js
src/main/webapp/HP/SC/HPSC002.js
+1
-19
HPSC002.jsp
src/main/webapp/HP/SC/HPSC002.jsp
+1
-1
No files found.
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC001.java
View file @
2604b973
package
com
.
baosight
.
hpjx
.
hp
.
sc
.
service
;
import
com.baosight.hpjx.hp.sc.domain.THPSC002
;
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.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.service.soa.XLocalManager
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.hpjx.hp.sc.domain.THPSC001
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.*
;
/**
*
...
...
@@ -18,7 +19,6 @@ import java.util.Map;
public
class
ServiceHPSC001
extends
ServiceBase
{
/**
* 画面初始化.
*/
...
...
@@ -110,8 +110,8 @@ public class ServiceHPSC001 extends ServiceBase {
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
hpsc001
.
fromMap
(
map
);
this
.
dao
.
delete
(
"HPPZ001.delete"
,
hpsc001
.
toMap
());
}
}
catch
(
PlatException
e
)
{
eiInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
...
...
@@ -126,4 +126,67 @@ public class ServiceHPSC001 extends ServiceBase {
return
eiInfo
;
}
/**
* 审核 反审.
*/
public
EiInfo
check
(
EiInfo
eiInfo
)
{
THPSC001
hpsc001
=
new
THPSC001
();
EiBlock
eiBlock
=
eiInfo
.
getBlock
(
EiConstant
.
resultBlock
);
try
{
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
hpsc001
.
fromMap
(
map
);
this
.
dao
.
update
(
"HPSC001.check"
,
hpsc001
.
toMap
());
if
(
hpsc001
.
getStatus
()
==
1
){
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"id"
,
hpsc001
.
getId
());
List
<
Map
>
rows
=
this
.
dao
.
query
(
"HPSC001.query"
,
sqlMap
);
eiInfo
.
getBlock
(
EiConstant
.
resultBlock
).
setRows
(
rows
);
this
.
buildHPSC002
(
eiInfo
);
}
}
}
catch
(
PlatException
e
)
{
eiInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
eiInfo
.
setMsg
(
"删除失败,原因参见详细错误描述!"
);
eiInfo
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"删除失败!"
,
e
.
getMessage
());
return
eiInfo
;
}
eiInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
eiInfo
.
setMsg
(
"删除成功!"
);
return
eiInfo
;
}
public
void
buildHPSC002
(
EiInfo
eiInfo
)
{
THPSC001
hpsc001
=
new
THPSC001
();
EiBlock
eiBlock
=
eiInfo
.
getBlock
(
EiConstant
.
resultBlock
);
List
rows
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
hpsc001
.
fromMap
(
map
);
Map
hpsc002
=
new
HashMap
();
hpsc002
.
put
(
"companyCode"
,
hpsc001
.
getCompanyCode
());
hpsc002
.
put
(
"deptCode"
,
hpsc001
.
getDepCode
());
hpsc002
.
put
(
"projCode"
,
hpsc001
.
getProjCode
());
hpsc002
.
put
(
"projName"
,
hpsc001
.
getProjName
());
hpsc002
.
put
(
"parentPrdtCode"
,
"root"
);
//固定写死
hpsc002
.
put
(
"parentPrdtName"
,
hpsc001
.
getProjName
());
hpsc002
.
put
(
"type"
,
""
);
hpsc002
.
put
(
"leaf"
,
"0"
);
hpsc002
.
put
(
"sort"
,
""
);
hpsc002
.
put
(
"icon"
,
""
);
hpsc002
.
put
(
"prdtCode"
,
hpsc001
.
getProjCode
());
hpsc002
.
put
(
"prdtName"
,
hpsc001
.
getProjName
());
rows
.
add
(
hpsc002
);
}
eiBlock
.
setRows
(
rows
);
eiInfo
.
set
(
EiConstant
.
serviceName
,
"HPSC002"
);
eiInfo
.
set
(
EiConstant
.
methodName
,
"insert"
);
EiInfo
outInfo
=
XLocalManager
.
call
(
eiInfo
);
if
(
outInfo
.
getStatus
()
<
0
)
{
throw
new
PlatException
(
outInfo
.
getMsg
());
}
}
}
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC002.java
View file @
2604b973
...
...
@@ -192,13 +192,6 @@ public class ServiceHPSC002 extends ServiceBase {
for
(
int
i
=
0
;
i
<
eiBlock
.
getRowCount
();
i
++)
{
Map
<?,
?>
map
=
eiBlock
.
getRow
(
i
);
hppz002
.
fromMap
(
map
);
Map
sqlMap
=
new
HashMap
();
sqlMap
.
put
(
"id"
,
hppz002
.
getId
());
if
(
hppz002
.
getStatus
()
==
0
){
sqlMap
.
put
(
"status"
,
1
);
}
else
{
sqlMap
.
put
(
"status"
,
0
);
}
this
.
dao
.
update
(
"HPSC002.check"
,
hppz002
.
toMap
());
}
}
catch
(
PlatException
e
)
{
...
...
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC001.xml
View file @
2604b973
...
...
@@ -163,5 +163,8 @@
</isNotEmpty>
ORDER BY PROJ_CODE
</select>
<update
id=
"check"
>
UPDATE hpjx.t_hpsc001 SET status = #status# WHERE ID = #id#
</update>
</sqlMap>
\ No newline at end of file
src/main/webapp/HP/SC/HPSC001.js
View file @
2604b973
...
...
@@ -11,5 +11,41 @@ $(function () {
pageSize
:
20
,
pageSizes
:
[
10
,
20
,
50
,
70
,
100
],
},
columns
:
[
{
field
:
"operator"
,
template
:
function
(
item
)
{
let
auditStatus
=
item
.
status
;
let
template
=
''
;
if
(
auditStatus
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+
'onclick="check('
+
item
.
id
+
',1)" >审核</a>'
;
}
else
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;" '
+
'onclick="check('
+
item
.
id
+
',0)" >反审</a>'
;
}
return
template
;
}
}
],
}
});
\ No newline at end of file
});
function
check
(
id
,
auditStatus
)
{
const
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-id"
,
id
);
inEiInfo
.
set
(
"result-0-status"
,
auditStatus
);
EiCommunicator
.
send
(
'HPSC001'
,
'check'
,
inEiInfo
,
{
onSuccess
(
response
)
{
NotificationUtil
(
response
.
msg
);
resultGrid
.
dataSource
.
page
(
1
);
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
}
);
}
src/main/webapp/HP/SC/HPSC001.jsp
View file @
2604b973
...
...
@@ -35,7 +35,7 @@
<EF:EFOption
label=
"已审核"
value=
"1"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"remark"
cname=
"备注"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
width=
"100"
enable=
"false"
readonly=
"false"
/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...
...
@@ -44,4 +44,4 @@
<script>
var
ctx
=
"${ctx}"
;
</script>
<script
src=
"${ctx}/HP/PZ/HPSC001.js"
></script>
\ No newline at end of file
<script
src=
"${ctx}/HP/SC/HPSC001.js"
></script>
\ No newline at end of file
src/main/webapp/HP/SC/HPSC002.js
View file @
2604b973
...
...
@@ -50,7 +50,7 @@ $(function () {
result
:
{
pageable
:
{
pageSize
:
10
,
pageSizes
:
[
10
,
20
,
50
,
70
,
1
00
],
pageSizes
:
[
10
,
20
,
50
,
100
,
2
00
],
},
loadComplete
:
function
(
grid
)
{
// 在Grid加载完成后,才能给Grid上的按钮绑定事件
$
(
"#SC02"
).
on
(
"click"
,
function
()
{
...
...
@@ -218,24 +218,6 @@ function openUploadFile(id) {
rowId
=
id
;
}
function
donwloadFile
(
id
,
auditStatus
)
{
const
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-id"
,
id
);
inEiInfo
.
set
(
"result-0-status"
,
auditStatus
);
EiCommunicator
.
send
(
'HPZL001'
,
'operator'
,
inEiInfo
,
{
onSuccess
(
response
)
{
NotificationUtil
(
response
.
msg
);
},
onFail
(
errorMessage
,
status
,
e
)
{
NotificationUtil
(
"执行失败!"
,
"error"
);
}
},
{
async
:
false
}
);
}
function
check
(
id
,
auditStatus
)
{
const
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-id"
,
id
);
...
...
src/main/webapp/HP/SC/HPSC002.jsp
View file @
2604b973
...
...
@@ -60,7 +60,7 @@
<EF:EFOption
label=
""
value=
"1"
></EF:EFOption>
<EF:EFOption
label=
"删除"
value=
"0"
></EF:EFOption>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
width=
"200"
readonly=
"false"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
width=
"200"
enable=
"false"
readonly=
"false"
/>
</EF:EFGrid>
</EF:EFRegion>
</div>
...
...
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