Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
datav_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
廖旭伟
datav_platform
Commits
a7d8bc98
Commit
a7d8bc98
authored
Apr 17, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
統一項目和模板的接口格式
parent
2eb8e9b9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
496 additions
and
0 deletions
+496
-0
datav-manager/src/main/java/com/mortals/xhx/module/goview/model/vo/GoviewMasterplateVo.java
...rtals/xhx/module/goview/model/vo/GoviewMasterplateVo.java
+2
-0
datav-manager/src/main/java/com/mortals/xhx/module/goview/service/impl/GoviewMasterplateServiceImpl.java
...ule/goview/service/impl/GoviewMasterplateServiceImpl.java
+17
-0
datav-manager/src/main/java/com/mortals/xhx/module/goview/web/GoviewMasterplateApi.java
...m/mortals/xhx/module/goview/web/GoviewMasterplateApi.java
+413
-0
datav-manager/src/main/java/com/mortals/xhx/module/goview/web/GoviewProjectAPi.java
...a/com/mortals/xhx/module/goview/web/GoviewProjectAPi.java
+64
-0
No files found.
datav-manager/src/main/java/com/mortals/xhx/module/goview/model/vo/GoviewMasterplateVo.java
View file @
a7d8bc98
...
...
@@ -14,4 +14,6 @@ import lombok.Data;
public
class
GoviewMasterplateVo
extends
BaseEntityLong
{
/** 项目数据 */
private
String
content
;
/*** 项目名称 */
private
String
projectName
;
}
\ No newline at end of file
datav-manager/src/main/java/com/mortals/xhx/module/goview/service/impl/GoviewMasterplateServiceImpl.java
View file @
a7d8bc98
package
com.mortals.xhx.module.goview.service.impl
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.xhx.module.goview.model.*
;
import
com.mortals.xhx.module.goview.service.GoviewMasterplateDataService
;
import
com.mortals.xhx.module.goview.service.GoviewProjectDataService
;
import
com.mortals.xhx.module.goview.service.GoviewProjectService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
...
...
@@ -32,6 +34,21 @@ public class GoviewMasterplateServiceImpl extends AbstractCRUDServiceImpl<Goview
@Autowired
private
GoviewMasterplateDataService
goviewMasterplateDataService
;
@Override
protected
void
saveBefore
(
GoviewMasterplateEntity
entity
,
Context
context
)
throws
AppException
{
this
.
validData
(
entity
,
context
);
entity
.
setState
(-
1
);
}
@Override
protected
void
findAfter
(
GoviewMasterplateEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
GoviewMasterplateEntity
>
list
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
GoviewMasterplateEntity
item:
list
){
item
.
setProjectName
(
item
.
getMasterplateName
());
}
}
}
@Override
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
List
<
Long
>
masterplateIdList
=
new
ArrayList
<>();
...
...
datav-manager/src/main/java/com/mortals/xhx/module/goview/web/GoviewMasterplateApi.java
0 → 100644
View file @
a7d8bc98
This diff is collapsed.
Click to expand it.
datav-manager/src/main/java/com/mortals/xhx/module/goview/web/GoviewProjectAPi.java
View file @
a7d8bc98
...
...
@@ -347,4 +347,68 @@ public class GoviewProjectAPi extends BaseJsonBodyController {
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
/**
* 发布为模板
* @param entity
* @return
*/
@PostMapping
({
"publish/masterplate"
})
public
String
publishMasterplate
(
@RequestBody
GoviewProjectEntity
entity
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
String
busiDesc
=
"发布模板"
;
int
code
=
1
;
try
{
if
(
entity
.
getId
()==
null
){
throw
new
AppException
(
"项目ID不能为空"
);
}
goviewProjectService
.
publishMasterplate
(
entity
.
getId
(),
context
);
model
.
put
(
"id"
,
entity
.
getId
());
model
.
put
(
"entity"
,
entity
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
entity
.
getId
()
+
"]"
);
}
catch
(
Exception
var7
)
{
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
model
.
put
(
"entity"
,
entity
);
code
=
-
1
;
}
this
.
init
(
model
,
context
);
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
code
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
@RequestMapping
(
value
=
{
"delete"
},
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
}
)
public
String
delete
(
Long
[]
id
)
{
Context
context
=
this
.
getContext
();
if
(
id
==
null
)
{
return
this
.
createFailJsonResp
(
"请至少选择一条记录"
);
}
else
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
int
code
=
1
;
String
busiDesc
=
"删除項目"
;
try
{
int
iRet
=
this
.
goviewProjectService
.
remove
(
id
,
context
);
model
.
put
(
"message_info"
,
"項目信息删除成功!删除条数:"
+
iRet
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
StringUtils
.
converArray2Str
(
id
)
+
"]"
);
}
catch
(
Exception
var7
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
));
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
}
\ No newline at end of file
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