Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
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
王衍超
cloud-fb
Commits
ee28bb94
Commit
ee28bb94
authored
Jun 23, 2021
by
shiwenbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加场站系统和购砂单位系统查询消息的接口
parent
3d502572
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
QueryParam.java
...ain/java/com/beecode/inz/message/internal/QueryParam.java
+13
-0
DinasCommonController.java
...in/java/com/xyst/dinas/biz/web/DinasCommonController.java
+62
-0
No files found.
backend/inz.message/src/main/java/com/beecode/inz/message/internal/QueryParam.java
View file @
ee28bb94
...
...
@@ -27,6 +27,11 @@ public class QueryParam {
*/
private
String
type
;
/**
* 用户Id
*/
private
String
userId
;
public
String
getType
()
{
...
...
@@ -69,4 +74,12 @@ public class QueryParam {
this
.
orderField
=
orderField
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/DinasCommonController.java
View file @
ee28bb94
...
...
@@ -48,7 +48,12 @@ import com.beecode.bcp.authz.service.PrivilegeService;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.bcp.type.json.JSONObjectUtils
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.inz.message.internal.QueryParam
;
import
com.beecode.inz.message.service.MessageInfoService
;
import
com.beecode.inz.message.web.info.MessageInfo
;
import
com.beecode.nlib.utils.StringUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonSyntaxException
;
import
com.xyst.dinas.biz.enumeration.PlanningCycleEnum
;
import
com.xyst.dinas.biz.service.DinasCommonService
;
import
com.xyst.dinas.biz.service.DinasOrganizationService
;
...
...
@@ -74,6 +79,9 @@ public class DinasCommonController {
PrivilegeService
privilegeService
;
@Autowired
private
MessageInfoService
messageInfoService
;
@Autowired
public
AttachmentService
attachmentService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
/**
...
...
@@ -352,5 +360,59 @@ public class DinasCommonController {
}
return
false
;
}
/**
* 获取指定消息类型指定页的消息-已读未读都包含,未读在前面(场站用户)
* @throws Exception
*/
@RequestMapping
(
value
=
"/warehouse/api/common/messages/query"
,
method
=
RequestMethod
.
POST
)
public
Object
queryByPagingWarehouse
(
@RequestBody
String
body
)
throws
Exception
{
Gson
gson
=
new
Gson
();
QueryParam
param
=
null
;
try
{
param
=
gson
.
fromJson
(
body
,
QueryParam
.
class
);
}
catch
(
JsonSyntaxException
e
){
logger
.
error
(
"Paging param is no correct"
);
throw
new
JsonSyntaxException
(
"Paging param is no correct"
,
e
);
}
if
(
param
==
null
){
logger
.
error
(
"Paging param is no correct"
);
throw
new
Exception
(
"Paging param is no correct"
);
}
String
userId
=
param
.
getUserId
();
List
<
KObject
>
lists
=
messageInfoService
.
queryByPaging
(
userId
,
param
);
List
<
MessageInfo
>
messageInfos
=
new
ArrayList
<
MessageInfo
>();
for
(
KObject
kobject
:
lists
){
messageInfos
.
add
(
new
MessageInfo
(
kobject
));
}
return
messageInfos
;
}
/**
* 获取指定消息类型指定页的消息-已读未读都包含,未读在前面(购砂单位用户)
* @throws Exception
*/
@RequestMapping
(
value
=
"/sand/user/common/messages/query"
,
method
=
RequestMethod
.
POST
)
public
Object
queryByPagingSand
(
@RequestBody
String
body
)
throws
Exception
{
Gson
gson
=
new
Gson
();
QueryParam
param
=
null
;
try
{
param
=
gson
.
fromJson
(
body
,
QueryParam
.
class
);
}
catch
(
JsonSyntaxException
e
){
logger
.
error
(
"Paging param is no correct"
);
throw
new
JsonSyntaxException
(
"Paging param is no correct"
,
e
);
}
if
(
param
==
null
){
logger
.
error
(
"Paging param is no correct"
);
throw
new
Exception
(
"Paging param is no correct"
);
}
String
userId
=
param
.
getUserId
();
List
<
KObject
>
lists
=
messageInfoService
.
queryByPaging
(
userId
,
param
);
List
<
MessageInfo
>
messageInfos
=
new
ArrayList
<
MessageInfo
>();
for
(
KObject
kobject
:
lists
){
messageInfos
.
add
(
new
MessageInfo
(
kobject
));
}
return
messageInfos
;
}
}
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