Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
7718daf7
Commit
7718daf7
authored
Apr 13, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加保存页面截图接口
parent
3b8839d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
157 additions
and
5 deletions
+157
-5
portal-manager/doc/api.md
portal-manager/doc/api.md
+63
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/service/PageInfoService.java
.../com/mortals/xhx/module/page/service/PageInfoService.java
+10
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageInfoServiceImpl.java
...als/xhx/module/page/service/impl/PageInfoServiceImpl.java
+56
-1
portal-manager/src/main/java/com/mortals/xhx/module/page/web/BuryPointController.java
.../com/mortals/xhx/module/page/web/BuryPointController.java
+28
-4
No files found.
portal-manager/doc/api.md
View file @
7718daf7
...
...
@@ -4708,7 +4708,70 @@ data|object|数据对象
```
### 保存页面截图
**请求URL:**
page/bury/screen/save
**请求方式:**
POST
**内容类型:**
application/json;charset=utf-8
**简要描述:**
保存或更新产品页面配置:id为空时为新增保存,否则为更新提交
**请求参数:**
参数名称|类型|必填|描述
:---|:---|:---|:-------
deviceNum|String|否|设备编码
productId|Long|否|产品id
productName|String|否|产品名称
pageCode|String|否|页面编码(页面路由)
pageName|String|否|页面名称
screenUrl|String|否|页面截图地址
**请求样例:**
```
{
"deviceNum":"fblh4k",
"productId":427,
"productName":"oo1k4e",
"pageCode":"5fzoqc",
"pageName":"r8smsl",
"screenUrl":"feq3hw",
}
```
**响应参数:**
参数名称 |参数类型|描述
:---|:---|:------
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
 
id|Long|保存后主键id
 
entity|object|保存更新实体
  
id|Long|序号,主键,自增长
  
deviceNum|String|设备编码
  
productId|Long|产品id
  
productName|String|产品名称
  
pageCode|String|页面编码(页面路由)
  
pageName|String|页面名称
  
screenUrl|String|页面截图地址
  
createUserId|Long|创建用户
  
createTime|Date|创建时间
  
updateUserId|Long|更新用户
  
updateTime|Date|更新时间
**响应消息样例:**
```
{
"msg":"新增模块成功",
"code":1,
"data":{}
}
}
```
...
...
portal-manager/src/main/java/com/mortals/xhx/module/page/service/PageInfoService.java
View file @
7718daf7
package
com.mortals.xhx.module.page.service
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.page.model.PageInfoEntity
;
/**
...
...
@@ -11,4 +13,12 @@ import com.mortals.xhx.module.page.model.PageInfoEntity;
*/
public
interface
PageInfoService
extends
ICRUDService
<
PageInfoEntity
,
Long
>{
/**
* 埋点设备截图
* @param entity
* @param context
* @return
* @throws AppException
*/
PageInfoEntity
saveScreen
(
PageInfoEntity
entity
,
Context
context
)
throws
AppException
;
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageInfoServiceImpl.java
View file @
7718daf7
package
com.mortals.xhx.module.page.service.impl
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.module.page.model.PageInfoQuery
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
...
...
@@ -6,6 +8,9 @@ import com.mortals.framework.model.Context;
import
com.mortals.xhx.module.page.dao.PageInfoDao
;
import
com.mortals.xhx.module.page.model.PageInfoEntity
;
import
com.mortals.xhx.module.page.service.PageInfoService
;
import
java.util.Date
;
/**
* PageInfoService
* 产品页面配置 service实现
...
...
@@ -15,5 +20,55 @@ import com.mortals.xhx.module.page.service.PageInfoService;
*/
@Service
(
"pageInfoService"
)
public
class
PageInfoServiceImpl
extends
AbstractCRUDServiceImpl
<
PageInfoDao
,
PageInfoEntity
,
Long
>
implements
PageInfoService
{
@Override
protected
void
saveBefore
(
PageInfoEntity
entity
,
Context
context
)
throws
AppException
{
this
.
validData
(
entity
,
context
);
if
(
StringUtils
.
isEmpty
(
entity
.
getPageCode
())){
throw
new
AppException
(
"页面编码(路由)不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getDeviceNum
())){
throw
new
AppException
(
"设备编码不能为空"
);
}
if
(
entity
.
getProductId
()==
null
){
throw
new
AppException
(
"产品ID不能为空"
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getScreenUrl
())){
throw
new
AppException
(
"截图内容不能为空"
);
}
}
@Override
public
PageInfoEntity
saveScreen
(
PageInfoEntity
entity
,
Context
context
)
throws
AppException
{
this
.
saveBefore
(
entity
,
context
);
PageInfoQuery
query
=
new
PageInfoQuery
();
query
.
setPageCode
(
entity
.
getPageCode
());
query
.
setProductId
(
entity
.
getProductId
());
query
.
setDeviceNum
(
entity
.
getDeviceNum
());
PageInfoEntity
pageInfoEntity
=
this
.
selectOne
(
query
);
if
(
pageInfoEntity
==
null
){
entity
.
setCreateTime
(
new
Date
());
int
iRet
=
this
.
dao
.
insert
(
entity
);
if
(
iRet
==
0
)
{
throw
new
AppException
(-
1001
,
"写入数据库失败!"
);
}
else
{
this
.
saveAfter
(
entity
,
context
);
return
entity
;
}
}
else
{
PageInfoEntity
updateEntity
=
new
PageInfoEntity
();
updateEntity
.
setId
(
pageInfoEntity
.
getId
());
updateEntity
.
setScreenUrl
(
pageInfoEntity
.
getScreenUrl
());
updateEntity
.
setUpdateTime
(
new
Date
());
int
iRet
=
this
.
dao
.
update
(
updateEntity
);
if
(
iRet
==
0
)
{
throw
new
AppException
(-
1002
,
"更新失败!"
);
}
else
{
this
.
updateAfter
(
updateEntity
,
context
);
entity
.
setId
(
pageInfoEntity
.
getId
());
return
entity
;
}
}
}
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/page/web/BuryPointController.java
View file @
7718daf7
...
...
@@ -8,11 +8,9 @@ import com.mortals.framework.model.Context;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.web.BaseJsonBodyController
;
import
com.mortals.xhx.module.page.model.PageInfoEntity
;
import
com.mortals.xhx.module.page.model.pdu.BuryPointPdu
;
import
com.mortals.xhx.module.page.service.PageAccessDepthService
;
import
com.mortals.xhx.module.page.service.PageAccessService
;
import
com.mortals.xhx.module.page.service.PageEventService
;
import
com.mortals.xhx.module.page.service.PageRouteService
;
import
com.mortals.xhx.module.page.service.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -38,6 +36,8 @@ public class BuryPointController extends BaseJsonBodyController {
private
PageEventService
pageEventService
;
@Autowired
private
PageRouteService
pageRouteService
;
@Autowired
private
PageInfoService
pageInfoService
;
@PostMapping
({
"save"
})
@UnAuth
...
...
@@ -75,4 +75,28 @@ public class BuryPointController extends BaseJsonBodyController {
}
}
@PostMapping
({
"screen/save"
})
@UnAuth
public
String
saveScreen
(
@RequestBody
PageInfoEntity
pdu
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
int
code
=
1
;
String
busiDesc
=
"保存页面截图"
;
try
{
PageInfoEntity
entity
=
pageInfoService
.
saveScreen
(
pdu
,
context
);
model
.
put
(
"entity"
,
entity
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var7
)
{
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
code
=
-
1
;
model
.
put
(
"entity"
,
pdu
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
code
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
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