Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-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
赵啸非
sample-form-platform
Commits
547ad67e
Commit
547ad67e
authored
Nov 10, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加公共庫
parent
7620efa2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
.../com/mortals/xhx/module/matter/service/MatterService.java
+1
-1
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
...als/xhx/module/matter/service/impl/MatterServiceImpl.java
+5
-1
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
...a/com/mortals/xhx/module/matter/web/MatterController.java
+6
-6
No files found.
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
View file @
547ad67e
...
...
@@ -23,5 +23,5 @@ public interface MatterService extends ICRUDService<MatterEntity,Long>{
* 推荐or取消推荐
* @param id
*/
void
recommend
(
Long
id
,
Context
context
);
Rest
<
String
>
recommend
(
Long
id
,
Context
context
);
}
\ No newline at end of file
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
View file @
547ad67e
...
...
@@ -142,11 +142,12 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
}
@Override
public
void
recommend
(
Long
id
,
Context
context
)
{
public
Rest
<
String
>
recommend
(
Long
id
,
Context
context
)
{
MatterEntity
matterEntity
=
this
.
get
(
id
,
context
);
if
(
matterEntity
==
null
)
{
throw
new
AppException
(
"数据已更改,请重试"
);
}
String
msg
=
"推荐成功!"
;
int
recommendCount
=
this
.
count
(
new
MatterQuery
().
siteId
(
matterEntity
.
getSiteId
()).
isRecommend
(
YesNoEnum
.
YES
.
getValue
()),
null
);
if
(
matterEntity
.
getIsRecommend
()
==
YesNoEnum
.
NO
.
getValue
())
{
if
(
recommendCount
>=
RECOMMEND_COUNT
)
{
...
...
@@ -155,7 +156,10 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
matterEntity
.
setIsRecommend
(
YesNoEnum
.
YES
.
getValue
());
}
else
{
matterEntity
.
setIsRecommend
(
YesNoEnum
.
NO
.
getValue
());
msg
=
"取消推荐成功!"
;
}
this
.
update
(
matterEntity
,
context
);
return
Rest
.
ok
(
msg
);
}
}
\ No newline at end of file
sample-form-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
View file @
547ad67e
...
...
@@ -100,16 +100,16 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
int
code
=
1
;
String
busiDesc
=
"推荐or取消推荐"
+
this
.
getModuleDesc
();
try
{
this
.
service
.
recommend
(
id
,
getContext
());
model
.
put
(
"message_info"
,
this
.
getModuleDesc
()
+
"推荐or取消推荐成功!"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
id
+
"]"
);
}
catch
(
Exception
var7
)
{
Rest
<
String
>
rest
=
this
.
service
.
recommend
(
id
,
getContext
());
model
.
put
(
"message_info"
,
rest
.
getMsg
()
);
this
.
recordSysLog
(
this
.
request
,
rest
.
getMsg
()
);
}
catch
(
Exception
e
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
e
);
}
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
)
);
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