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
f7c1a124
Commit
f7c1a124
authored
Jun 24, 2021
by
wukaiqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增场站、购砂单位用户消息处理接口
parent
40d1b877
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
1 deletions
+73
-1
DinasCommonController.java
...in/java/com/xyst/dinas/biz/web/DinasCommonController.java
+73
-1
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/DinasCommonController.java
View file @
f7c1a124
...
@@ -16,6 +16,8 @@ import java.util.zip.CheckedOutputStream;
...
@@ -16,6 +16,8 @@ import java.util.zip.CheckedOutputStream;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
import
java.util.zip.ZipOutputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -26,6 +28,7 @@ import org.springframework.format.annotation.DateTimeFormat;
...
@@ -26,6 +28,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.Assert
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -50,6 +53,7 @@ import com.beecode.bcp.type.json.JSONObjectUtils;
...
@@ -50,6 +53,7 @@ import com.beecode.bcp.type.json.JSONObjectUtils;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.inz.message.internal.QueryParam
;
import
com.beecode.inz.message.internal.QueryParam
;
import
com.beecode.inz.message.service.MessageInfoService
;
import
com.beecode.inz.message.service.MessageInfoService
;
import
com.beecode.inz.message.util.MessageUtils
;
import
com.beecode.inz.message.web.info.MessageInfo
;
import
com.beecode.inz.message.web.info.MessageInfo
;
import
com.beecode.nlib.utils.StringUtils
;
import
com.beecode.nlib.utils.StringUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
...
@@ -80,10 +84,12 @@ public class DinasCommonController {
...
@@ -80,10 +84,12 @@ public class DinasCommonController {
@Autowired
@Autowired
private
MessageInfoService
messageInfoService
;
private
MessageInfoService
messageInfoService
;
@Autowired
private
HttpServletRequest
request
;
@Autowired
@Autowired
public
AttachmentService
attachmentService
;
public
AttachmentService
attachmentService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
private
final
static
String
READ
=
"read"
;
/**
/**
* @Description: 根据部门id查询全公司及其该部门的子部门(包括该部门自身)
* @Description: 根据部门id查询全公司及其该部门的子部门(包括该部门自身)
...
@@ -414,5 +420,71 @@ public class DinasCommonController {
...
@@ -414,5 +420,71 @@ public class DinasCommonController {
}
}
return
messageInfos
;
return
messageInfos
;
}
}
/**
* 根据消息的id更改消息的状态为已读(场站用户)
* @param partId
* @return
*/
@RequestMapping
(
value
=
"/warehouse/api/common/message/{msgid}"
,
method
=
RequestMethod
.
PUT
)
public
void
updateReadStatusByMsgIdWarehouse
(
@PathVariable
(
"msgid"
)
String
msgid
)
{
Assert
.
notNull
(
msgid
,
"msgid must not be null"
);
String
operation
=
request
.
getHeader
(
"operation"
);
switch
(
operation
){
case
READ:
messageInfoService
.
updateReadStatusByMsgId
(
msgid
);
break
;
default
:
throw
new
UnsupportedOperationException
(
"operation: "
+
operation
);
}
}
/**
* 根据消息的id更改消息的状态为已读(购砂单位用户)
* @param partId
* @return
*/
@RequestMapping
(
value
=
"/sand/user/common/message/{msgid}"
,
method
=
RequestMethod
.
PUT
)
public
void
updateReadStatusByMsgIdSand
(
@PathVariable
(
"msgid"
)
String
msgid
)
{
Assert
.
notNull
(
msgid
,
"msgid must not be null"
);
String
operation
=
request
.
getHeader
(
"operation"
);
switch
(
operation
){
case
READ:
messageInfoService
.
updateReadStatusByMsgId
(
msgid
);
break
;
default
:
throw
new
UnsupportedOperationException
(
"operation: "
+
operation
);
}
}
/**
* 根据当前用户的id和消息类型获取未读消息数量(场站用户)
* @param partId
* @return
* @throws Exception
*/
@RequestMapping
(
value
=
"/warehouse/api/common/message/noread/count"
,
method
=
RequestMethod
.
GET
)
public
Object
countNoReadByUserIdAndType
(
@RequestParam
String
type
,
@RequestParam
UUID
userId
)
throws
Exception
{
String
count
=
messageInfoService
.
countNoReadByUserIdAndType
(
userId
.
toString
(),
type
);
return
count
;
}
/**
* 根据当前用户的id和消息类型获取未读消息数量(购砂单位用户)
* @param partId
* @return
* @throws Exception
*/
@RequestMapping
(
value
=
"/sand/user/common/message/noread/count"
,
method
=
RequestMethod
.
GET
)
public
Object
countNoReadByUserIdAndTypeSand
(
@RequestParam
String
type
,
@RequestParam
UUID
userId
)
throws
Exception
{
//String userId = MessageUtils.gerCurrentUserId(isCustomer);
String
count
=
messageInfoService
.
countNoReadByUserIdAndType
(
userId
.
toString
(),
type
);
return
count
;
}
}
}
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