Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeiZhen-Java
peizhen-java
Commits
c8663b2b
Commit
c8663b2b
authored
Sep 15, 2023
by
邹磊浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
035bee93
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
262 additions
and
150 deletions
+262
-150
pz-accompany/src/main/java/com/pz/accompany/AccompanyMessageController.java
+0
-106
pz-applet/src/main/java/com/pz/applet/AccompanyMessageController.java
+48
-0
pz-applet/src/main/java/com/pz/applet/AppletSessionListController.java
+45
-4
pz-applet/src/main/java/com/pz/applet/WebSocketOneToOneController.java
+5
-8
pz-applet/src/main/java/com/pz/websocket/SpringContextUtil.java
+1
-1
pz-applet/src/main/java/com/pz/websocket/WebSocketData.java
+1
-1
pz-system/src/main/java/com/pz/system/domain/Services.java
+7
-1
pz-system/src/main/java/com/pz/system/domain/bo/BusinessBo.java
+2
-1
pz-system/src/main/java/com/pz/system/domain/bo/ServicesBo.java
+7
-1
pz-system/src/main/java/com/pz/system/domain/vo/ArticleVo.java
+5
-0
pz-system/src/main/java/com/pz/system/domain/vo/AvatarUserNameVo.java
+34
-0
pz-system/src/main/java/com/pz/system/domain/vo/DbwzOrderItemVo.java
+1
-0
pz-system/src/main/java/com/pz/system/domain/vo/InformationVo.java
+2
-0
pz-system/src/main/java/com/pz/system/domain/vo/MessageVo.java
+6
-0
pz-system/src/main/java/com/pz/system/domain/vo/ServicesVo.java
+5
-7
pz-system/src/main/java/com/pz/system/domain/vo/TotalOrderVo.java
+5
-0
pz-system/src/main/java/com/pz/system/service/IMessageService.java
+11
-0
pz-system/src/main/java/com/pz/system/service/impl/ArticleServiceImpl.java
+20
-13
pz-system/src/main/java/com/pz/system/service/impl/BusinessServiceImpl.java
+4
-0
pz-system/src/main/java/com/pz/system/service/impl/HospitalServiceImpl.java
+5
-3
pz-system/src/main/java/com/pz/system/service/impl/MessageServiceImpl.java
+33
-0
pz-system/src/main/java/com/pz/system/service/impl/ServicesServiceImpl.java
+1
-1
pz-system/src/main/java/com/pz/system/service/impl/StoreGoodsCategoryServiceImpl.java
+1
-1
pz-system/src/main/java/com/pz/system/service/impl/StoreGoodsTagServiceImpl.java
+1
-1
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
+7
-1
pz-system/src/main/resources/mapper/system/DbwzOrderMapper.xml
+2
-0
pz-system/src/main/resources/mapper/system/StoreIncomeMapper.xml
+3
-0
No files found.
pz-accompany/src/main/java/com/pz/accompany/AccompanyMessageController.java
deleted
100644 → 0
View file @
035bee93
//package com.pz.accompany;
//
//import java.util.List;
//import java.util.Arrays;
//
//import lombok.RequiredArgsConstructor;
//import javax.servlet.http.HttpServletResponse;
//import javax.validation.constraints.*;
//import cn.dev33.satoken.annotation.SaCheckPermission;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.validation.annotation.Validated;
//import com.pz.common.annotation.RepeatSubmit;
//import com.pz.common.annotation.Log;
//import com.pz.common.core.controller.BaseController;
//import com.pz.common.core.domain.PageQuery;
//import com.pz.common.core.domain.R;
//import com.pz.common.core.validate.AddGroup;
//import com.pz.common.core.validate.EditGroup;
//import com.pz.common.enums.BusinessType;
//import com.pz.common.utils.poi.ExcelUtil;
//import com.pz.system.domain.vo.MessageVo;
//import com.pz.system.domain.bo.MessageBo;
//import com.pz.system.service.IMessageService;
//import com.pz.common.core.page.TableDataInfo;
//
///**
// * 业务消息
// *
// * @author ruoyi
// * @date 2023-09-15
// */
//@Validated
//@RequiredArgsConstructor
//@RestController
//@RequestMapping("/system/message")
//public class AccompanyMessageController extends BaseController {
//
// private final IMessageService iMessageService;
//
// /**
// * 查询业务消息列表
// */
// @SaCheckPermission("system:message:list")
// @GetMapping("/list")
// public TableDataInfo<MessageVo> list(MessageBo bo, PageQuery pageQuery) {
// return iMessageService.queryPageList(bo, pageQuery);
// }
//
// /**
// * 导出业务消息列表
// */
// @SaCheckPermission("system:message:export")
// @Log(title = "业务消息", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// public void export(MessageBo bo, HttpServletResponse response) {
// List<MessageVo> list = iMessageService.queryList(bo);
// ExcelUtil.exportExcel(list, "业务消息", MessageVo.class, response);
// }
//
// /**
// * 获取业务消息详细信息
// *
// * @param id 主键
// */
// @SaCheckPermission("system:message:query")
// @GetMapping("/{id}")
// public R<MessageVo> getInfo(@NotNull(message = "主键不能为空")
// @PathVariable Long id) {
// return R.ok(iMessageService.queryById(id));
// }
//
// /**
// * 新增业务消息
// */
// @SaCheckPermission("system:message:add")
// @Log(title = "业务消息", businessType = BusinessType.INSERT)
// @RepeatSubmit()
// @PostMapping()
// public R<Void> add(@Validated(AddGroup.class) @RequestBody MessageBo bo) {
// return toAjax(iMessageService.insertByBo(bo));
// }
//
// /**
// * 修改业务消息
// */
// @SaCheckPermission("system:message:edit")
// @Log(title = "业务消息", businessType = BusinessType.UPDATE)
// @RepeatSubmit()
// @PutMapping()
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody MessageBo bo) {
// return toAjax(iMessageService.updateByBo(bo));
// }
//
// /**
// * 删除业务消息
// *
// * @param ids 主键串
// */
// @SaCheckPermission("system:message:remove")
// @Log(title = "业务消息", businessType = BusinessType.DELETE)
// @DeleteMapping("/{ids}")
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
// @PathVariable Long[] ids) {
// return toAjax(iMessageService.deleteWithValidByIds(Arrays.asList(ids), true));
// }
//}
pz-applet/src/main/java/com/pz/applet/AccompanyMessageController.java
0 → 100644
View file @
c8663b2b
package
com
.
pz
.
applet
;
import
java.util.List
;
import
java.util.Arrays
;
import
lombok.RequiredArgsConstructor
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.constraints.*
;
import
cn.dev33.satoken.annotation.SaCheckPermission
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.validation.annotation.Validated
;
import
com.pz.common.annotation.RepeatSubmit
;
import
com.pz.common.annotation.Log
;
import
com.pz.common.core.controller.BaseController
;
import
com.pz.common.core.domain.PageQuery
;
import
com.pz.common.core.domain.R
;
import
com.pz.common.core.validate.AddGroup
;
import
com.pz.common.core.validate.EditGroup
;
import
com.pz.common.enums.BusinessType
;
import
com.pz.common.utils.poi.ExcelUtil
;
import
com.pz.system.domain.vo.MessageVo
;
import
com.pz.system.domain.bo.MessageBo
;
import
com.pz.system.service.IMessageService
;
import
com.pz.common.core.page.TableDataInfo
;
/**
* 业务消息
*
* @author ruoyi
* @date 2023-09-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping
(
"/applet/message"
)
public
class
AccompanyMessageController
extends
BaseController
{
private
final
IMessageService
iMessageService
;
/**
* 查询消息列表
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
<
MessageVo
>
list
(
MessageBo
bo
,
PageQuery
pageQuery
)
{
bo
.
setSender
(
getUserId
());
return
iMessageService
.
queryPageList
(
bo
,
pageQuery
);
}
}
pz-applet/src/main/java/com/pz/applet/AppletSessionListController.java
View file @
c8663b2b
...
...
@@ -12,14 +12,19 @@ import com.pz.common.core.validate.AddGroup;
import
com.pz.common.enums.BusinessType
;
import
com.pz.system.domain.SessionList
;
import
com.pz.system.domain.bo.SessionListBo
;
import
com.pz.system.domain.vo.AvatarUserNameVo
;
import
com.pz.system.domain.vo.SessionListVo
;
import
com.pz.system.mapper.SessionListMapper
;
import
com.pz.system.mapper.SysOssMapper
;
import
com.pz.system.mapper.SysUserMapper
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotEmpty
;
import
java.util.List
;
import
java.util.Optional
;
/**
* 会话列
...
...
@@ -35,6 +40,8 @@ public class AppletSessionListController extends BaseController {
private
final
SessionListMapper
sessionListMapper
;
private
final
SysUserMapper
sysUserMapper
;
/**
* 查询会话列列表
*/
...
...
@@ -43,6 +50,33 @@ public class AppletSessionListController extends BaseController {
return
sessionListMapper
.
selectVoPage
(
pageQuery
.
build
(),
Wrappers
.<
SessionList
>
lambdaQuery
().
eq
(
SessionList:
:
getUserId
,
getUserId
()).
or
().
eq
(
SessionList:
:
getToUserId
,
getUserId
()));
}
/**
* 获取聊天头像与名称
*
* @param toUserId
* @return
*/
@GetMapping
(
"/getAvatarUserName/{toUserId}"
)
public
R
<
AvatarUserNameVo
>
getAvatarUserNameVo
(
@PathVariable
Integer
toUserId
)
{
AvatarUserNameVo
avatarUserNameVo
=
new
AvatarUserNameVo
();
//获取我的信息
Optional
.
ofNullable
(
sysUserMapper
.
selectUserById
(
getUserId
())).
ifPresent
(
sysUser
->
{
avatarUserNameVo
.
setUserName
(
sysUser
.
getNickName
());
avatarUserNameVo
.
setAvatar
(
sysUser
.
getAvatar
());
}
);
//获取对方信息
Optional
.
ofNullable
(
sysUserMapper
.
selectUserById
(
toUserId
.
longValue
())).
ifPresent
(
sysUser
->
{
avatarUserNameVo
.
setToUserName
(
sysUser
.
getNickName
());
avatarUserNameVo
.
setToAvatar
(
sysUser
.
getAvatar
());
}
);
avatarUserNameVo
.
setToUserId
(
toUserId
);
return
R
.
ok
(
avatarUserNameVo
);
}
/**
* 创建会话
...
...
@@ -52,7 +86,13 @@ public class AppletSessionListController extends BaseController {
@PostMapping
(
"/createSession"
)
@SaIgnore
@Transactional
public
R
<
Void
>
add
(
@Validated
(
AddGroup
.
class
)
@RequestBody
SessionListBo
bo
)
{
public
R
<
Long
>
add
(
@Validated
(
AddGroup
.
class
)
@RequestBody
SessionListBo
bo
)
{
//判断我和对方是否创建过会话
Integer
res
=
sessionListMapper
.
selectIdByUser
(
bo
.
getUserId
(),
bo
.
getToUserId
());
if
(
res
!=
null
&&
res
>
0
)
{
//有则直接返回
return
R
.
ok
(
res
.
longValue
());
}
// 创建会话列表对象
SessionList
sessionList
=
new
SessionList
();
sessionList
.
setUserId
(
bo
.
getUserId
());
...
...
@@ -62,17 +102,18 @@ public class AppletSessionListController extends BaseController {
// 插入会话列表记录
sessionListMapper
.
insert
(
sessionList
);
Integer
id
=
sessionListMapper
.
selectIdByUser
(
bo
.
getToUserId
(),
bo
.
getUserId
());
// 判断对方和我建立会话没有,如果没有则建立
boolean
hasSession
=
sessionListMapper
.
selectIdByUser
(
bo
.
getToUserId
(),
bo
.
getUserId
())
>
0
;
if
(!
hasSession
)
{
if
(
id
==
null
)
{
// 新建会话列表对象
SessionList
newSessionList
=
new
SessionList
();
newSessionList
.
setUserId
(
bo
.
getToUserId
());
newSessionList
.
setToUserId
(
bo
.
getUserId
());
newSessionList
.
setUnReadCount
(
0L
);
// 插入新的会话列表记录
sessionListMapper
.
insert
(
newSessionList
);
}
return
R
.
ok
();
return
R
.
ok
(
sessionList
.
getId
()
);
}
...
...
pz-a
dmin/src/main/java/com/pz/web/controller/system
/WebSocketOneToOneController.java
→
pz-a
pplet/src/main/java/com/pz/applet
/WebSocketOneToOneController.java
View file @
c8663b2b
package
com
.
pz
.
web
.
controller
.
system
;
package
com
.
pz
.
applet
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.pz.common.core.domain.entity.SysUser
;
import
com.pz.common.utils.DateUtils
;
import
com.pz.system.domain.Message
;
import
com.pz.system.domain.SessionList
;
import
com.pz.system.mapper.MessageMapper
;
import
com.pz.system.mapper.SessionListMapper
;
import
com.pz.system.mapper.SysUserMapper
;
import
com.pz.system.service.ISysUserService
;
import
com.pz.web.controller.websocket.SpringContextUtil
;
import
com.pz.websocket.SpringContextUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.websocket.*
;
...
...
@@ -44,7 +39,7 @@ import java.util.concurrent.ConcurrentHashMap;
@ServerEndpoint
(
"/webSocketOneToOne/{sendId}/{roomId}"
)
public
class
WebSocketOneToOneController
{
// 静态变量,用来记录当前在线连接数
。应该把它设计成线程安全的。
// 静态变量,用来记录当前在线连接数
·
private
static
int
onlineCount
;
//实现服务端与单一客户端通信的话,可以使用Map来存放,其中Key为用户标识
private
static
final
Map
<
Long
,
WebSocketOneToOneController
>
connections
=
new
ConcurrentHashMap
<>();
...
...
@@ -199,6 +194,8 @@ public class WebSocketOneToOneController {
if
(
list
==
null
||
list
.
isEmpty
())
{
//增加对方未读数
sessionListMapper
.
addUnReadCount
(
receiveId
,
sendId
);
//发送消息
sendMessage
(
sessionList
,
message
);
}
else
{
Integer
toId
=
Integer
.
valueOf
((
String
)
list
.
get
(
0
));
if
(
Integer
.
valueOf
(
sessionId
).
equals
(
toId
))
{
...
...
pz-a
dmin/src/main/java/com/pz/web/controller
/websocket/SpringContextUtil.java
→
pz-a
pplet/src/main/java/com/pz
/websocket/SpringContextUtil.java
View file @
c8663b2b
package
com
.
pz
.
web
.
controller
.
web
socket
;
package
com
.
pz
.
websocket
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
...
...
pz-a
dmin/src/main/java/com/pz/web/controller
/websocket/WebSocketData.java
→
pz-a
pplet/src/main/java/com/pz
/websocket/WebSocketData.java
View file @
c8663b2b
package
com
.
pz
.
web
.
controller
.
web
socket
;
package
com
.
pz
.
websocket
;
import
lombok.Data
;
...
...
pz-system/src/main/java/com/pz/system/domain/Services.java
View file @
c8663b2b
...
...
@@ -5,6 +5,7 @@ import com.pz.common.core.domain.BaseEntity;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
...
...
@@ -39,9 +40,14 @@ public class Services extends BaseEntity {
*/
private
String
cover
;
/**
* 高价
*/
private
BigDecimal
highPrice
;
/**
* 价格
*/
private
String
price
;
private
BigDecimal
price
;
/**
* 分成比例
*/
...
...
pz-system/src/main/java/com/pz/system/domain/bo/BusinessBo.java
View file @
c8663b2b
...
...
@@ -4,6 +4,7 @@ import com.pz.common.core.domain.BaseEntity;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.*
;
import
java.util.List
;
/**
...
...
@@ -32,5 +33,5 @@ public class BusinessBo extends BaseEntity {
*/
private
String
name
;
private
List
<
Integer
>
hospitalsIdsList
;
}
pz-system/src/main/java/com/pz/system/domain/bo/ServicesBo.java
View file @
c8663b2b
...
...
@@ -5,6 +5,7 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.*
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
...
...
@@ -40,9 +41,14 @@ public class ServicesBo extends BaseEntity {
private
String
cover
;
/**
* 高价
*/
private
BigDecimal
highPrice
;
/**
* 价格
*/
private
String
price
;
private
BigDecimal
price
;
/**
* 分成比例
...
...
pz-system/src/main/java/com/pz/system/domain/vo/ArticleVo.java
View file @
c8663b2b
...
...
@@ -70,6 +70,11 @@ public class ArticleVo {
private
Integer
appreciateNum
;
/**
* 评论数
*/
private
Integer
plNum
;
/**
* 收藏数
*/
private
Integer
collectNum
;
...
...
pz-system/src/main/java/com/pz/system/domain/vo/AvatarUserNameVo.java
0 → 100644
View file @
c8663b2b
package
com
.
pz
.
system
.
domain
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
AvatarUserNameVo
implements
Serializable
{
/**
* 我的头像
*/
private
String
avatar
;
/**
* 对方头像
*/
private
String
toAvatar
;
/**
* 我的名称
*/
private
String
userName
;
/**
* 对方名称
*/
private
String
toUserName
;
/**
* 接收用户id
*/
private
Integer
toUserId
;
}
pz-system/src/main/java/com/pz/system/domain/vo/DbwzOrderItemVo.java
View file @
c8663b2b
...
...
@@ -81,4 +81,5 @@ public class DbwzOrderItemVo extends OrderCommonVo {
*/
private
String
postTreatmentCondition
;
private
Integer
userId
;
}
pz-system/src/main/java/com/pz/system/domain/vo/InformationVo.java
View file @
c8663b2b
...
...
@@ -63,4 +63,6 @@ public class InformationVo {
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
createTime
;
private
Date
updateTime
;
}
pz-system/src/main/java/com/pz/system/domain/vo/MessageVo.java
View file @
c8663b2b
package
com
.
pz
.
system
.
domain
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pz.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
public
class
MessageVo
implements
Serializable
{
...
...
@@ -57,4 +60,7 @@ public class MessageVo implements Serializable {
* 备注
*/
private
String
remark
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
)
private
Date
createTime
;
}
pz-system/src/main/java/com/pz/system/domain/vo/ServicesVo.java
View file @
c8663b2b
...
...
@@ -49,12 +49,15 @@ public class ServicesVo {
*/
@ExcelProperty
(
value
=
"封面图"
)
private
String
cover
;
/**
* 高价
*/
private
BigDecimal
highPrice
;
/**
* 价格
*/
@ExcelProperty
(
value
=
"价格"
)
private
String
price
;
private
BigDecimal
price
;
/**
* 分成比例
...
...
@@ -69,11 +72,6 @@ public class ServicesVo {
private
Integer
duration
;
/**
* 高价
*/
private
BigDecimal
highPrice
;
/**
* 超时计费,每30分钟
*/
@ExcelProperty
(
value
=
"超时计费,每30分钟"
)
...
...
pz-system/src/main/java/com/pz/system/domain/vo/TotalOrderVo.java
View file @
c8663b2b
...
...
@@ -307,4 +307,9 @@ public class TotalOrderVo {
* 发货状态
*/
private
Object
object
;
/**
* 陪诊员ID
*/
private
Integer
eUserId
;
}
pz-system/src/main/java/com/pz/system/service/IMessageService.java
View file @
c8663b2b
package
com
.
pz
.
system
.
service
;
import
com.pz.common.core.domain.PageQuery
;
import
com.pz.common.core.page.TableDataInfo
;
import
com.pz.system.domain.bo.InformationBo
;
import
com.pz.system.domain.bo.MessageBo
;
import
com.pz.system.domain.vo.InformationVo
;
import
com.pz.system.domain.vo.MessageVo
;
public
interface
IMessageService
{
/**
* 分页查询是否有聊天内容
*/
TableDataInfo
<
MessageVo
>
queryPageList
(
MessageBo
bo
,
PageQuery
pageQuery
);
}
pz-system/src/main/java/com/pz/system/service/impl/ArticleServiceImpl.java
View file @
c8663b2b
...
...
@@ -72,7 +72,7 @@ public class ArticleServiceImpl implements IArticleService {
List
<
ArticleCommentVo
>
articleCommentVos
=
articleCommentMapper
.
selectVoList
(
Wrappers
.<
ArticleComment
>
lambdaQuery
().
eq
(
ArticleComment:
:
getAid
,
id
).
eq
(
ArticleComment:
:
getUid
,
LoginHelper
.
getLoginUser
().
getUserId
().
intValue
()));
for
(
ArticleCommentVo
articleCommentVo
:
articleCommentVos
)
{
if
(
null
!=
articleCommentVo
.
getUid
())
{
if
(
null
!=
articleCommentVo
.
getUid
())
{
SysUser
sysUser
=
sysUserMapper
.
selectById
(
LoginHelper
.
getLoginUser
().
getUserId
().
intValue
());
articleCommentVo
.
setAvatar
(
sysUser
.
getAvatar
());
articleCommentVo
.
setUserName
(
sysUser
.
getUserName
());
...
...
@@ -90,6 +90,12 @@ public class ArticleServiceImpl implements IArticleService {
LambdaQueryWrapper
<
Article
>
lqw
=
buildQueryWrapper
(
bo
);
Page
<
ArticleVo
>
result
=
baseMapper
.
selectVoPage
(
pageQuery
.
build
(),
lqw
);
Optional
.
ofNullable
(
result
.
getRecords
()).
ifPresent
(
articleVos
->
{
articleVos
.
forEach
(
articleVo
->
{
List
<
ArticleCommentVo
>
articleCommentVos
=
articleCommentMapper
.
selectVoList
(
Wrappers
.<
ArticleComment
>
lambdaQuery
().
eq
(
ArticleComment:
:
getAid
,
articleVo
.
getId
()));
if
(
CollectionUtils
.
isNotEmpty
(
articleCommentVos
))
{
articleVo
.
setPlNum
(
articleCommentVos
.
size
());
}
});
// 获取所有文章id集合
List
<
Integer
>
articleIds
=
articleVos
.
stream
()
.
map
(
ArticleVo:
:
getId
)
...
...
@@ -101,11 +107,12 @@ public class ArticleServiceImpl implements IArticleService {
Map
<
Integer
,
Integer
>
appreciateNumMap
=
new
HashMap
<>();
Map
<
Integer
,
Integer
>
collectNumMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
articleIds
))
{
if
(
CollectionUtils
.
isNotEmpty
(
articleIds
))
{
List
<
CityVo
>
cityVos
=
cityMapper
.
selectVoBatchIds
(
articleIds
);
for
(
CityVo
cityVo
:
cityVos
)
{
cityMap
.
put
(
cityVo
.
getId
(),
cityVo
.
getName
());
}
List
<
UserAppreciate
>
userAppreciates
=
userAppreciateMapper
.
selectList
(
Wrappers
.<
UserAppreciate
>
lambdaQuery
().
in
(
UserAppreciate:
:
getAid
,
articleIds
));
List
<
UserCollect
>
userCollects
=
userCollectMapper
.
selectList
(
Wrappers
.<
UserCollect
>
lambdaQuery
().
in
(
UserCollect:
:
getAid
,
articleIds
));
...
...
@@ -144,15 +151,15 @@ public class ArticleServiceImpl implements IArticleService {
int
userId
=
1
;
Page
<
ArticleVo
>
result
=
new
Page
<>();
//判断是否展示收藏文章
if
(
bo
.
getIsCollect
()
==
1
)
{
List
<
UserCollect
>
Collect
=
userCollectMapper
.
selectList
(
Wrappers
.<
UserCollect
>
lambdaQuery
().
eq
(
UserCollect:
:
getUid
,
userId
).
eq
(
UserCollect:
:
getDelFlag
,
0
));
if
(
bo
.
getIsCollect
()
==
1
)
{
List
<
UserCollect
>
Collect
=
userCollectMapper
.
selectList
(
Wrappers
.<
UserCollect
>
lambdaQuery
().
eq
(
UserCollect:
:
getUid
,
userId
).
eq
(
UserCollect:
:
getDelFlag
,
0
));
// 获取所有文章id集合
List
<
Integer
>
articleIds
=
Collect
.
stream
()
.
map
(
UserCollect:
:
getAid
)
.
collect
(
Collectors
.
toList
());
if
(
articleIds
.
size
()
!=
0
)
{
if
(
articleIds
.
size
()
!=
0
)
{
//查询用户收藏的所有文章
bo
.
setArticleId
(
articleIds
);
...
...
@@ -160,7 +167,7 @@ public class ArticleServiceImpl implements IArticleService {
result
=
baseMapper
.
selectVoPage
(
pageQuery
.
build
(),
lqw
);
}
}
else
if
(
bo
.
getIsCollect
()
==
0
)
{
}
else
if
(
bo
.
getIsCollect
()
==
0
)
{
result
=
baseMapper
.
selectVoPage
(
pageQuery
.
build
(),
lqw
);
}
Optional
.
ofNullable
(
result
.
getRecords
()).
ifPresent
(
articleVos
->
{
...
...
@@ -174,8 +181,8 @@ public class ArticleServiceImpl implements IArticleService {
if
(
CollectionUtils
.
isNotEmpty
(
articleIds
))
{
List
<
UserAppreciate
>
userAppreciates
=
userAppreciateMapper
.
selectList
(
Wrappers
.<
UserAppreciate
>
lambdaQuery
().
in
(
UserAppreciate:
:
getAid
,
articleIds
).
eq
(
UserAppreciate:
:
getDelFlag
,
0
));
List
<
UserCollect
>
userCollects
=
userCollectMapper
.
selectList
(
Wrappers
.<
UserCollect
>
lambdaQuery
().
in
(
UserCollect:
:
getAid
,
articleIds
).
eq
(
UserCollect:
:
getDelFlag
,
0
));
List
<
UserAppreciate
>
userAppreciates
=
userAppreciateMapper
.
selectList
(
Wrappers
.<
UserAppreciate
>
lambdaQuery
().
in
(
UserAppreciate:
:
getAid
,
articleIds
).
eq
(
UserAppreciate:
:
getDelFlag
,
0
));
List
<
UserCollect
>
userCollects
=
userCollectMapper
.
selectList
(
Wrappers
.<
UserCollect
>
lambdaQuery
().
in
(
UserCollect:
:
getAid
,
articleIds
).
eq
(
UserCollect:
:
getDelFlag
,
0
));
for
(
UserAppreciate
userAppreciate
:
userAppreciates
)
{
Integer
articleId
=
userAppreciate
.
getAid
();
...
...
@@ -228,7 +235,7 @@ public class ArticleServiceImpl implements IArticleService {
LambdaQueryWrapper
<
Article
>
lqw
=
Wrappers
.
lambdaQuery
();
lqw
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getTitle
()),
Article:
:
getTitle
,
bo
.
getTitle
());
lqw
.
eq
(!
Objects
.
isNull
(
bo
.
getCityId
()),
Article:
:
getCityId
,
bo
.
getCityId
());
if
(
null
!=
bo
.
getArticleId
()
&&
bo
.
getArticleId
().
size
()
!=
0
)
{
if
(
null
!=
bo
.
getArticleId
()
&&
bo
.
getArticleId
().
size
()
!=
0
)
{
lqw
.
in
(
Article:
:
getId
,
bo
.
getArticleId
());
}
return
lqw
;
...
...
@@ -240,8 +247,8 @@ public class ArticleServiceImpl implements IArticleService {
@Override
public
Boolean
insertByAppreciate
(
UserAppreciateBo
bo
)
{
UserAppreciate
add
=
BeanUtil
.
toBean
(
bo
,
UserAppreciate
.
class
);
UserAppreciate
userAppreciate
=
userAppreciateMapper
.
selectOne
(
new
LambdaQueryWrapper
<
UserAppreciate
>().
eq
(
UserAppreciate:
:
getUid
,
bo
.
getUid
()).
eq
(
UserAppreciate:
:
getAid
,
bo
.
getAid
()).
eq
(
UserAppreciate:
:
getDelFlag
,
0
));
if
(
null
!=
userAppreciate
)
{
UserAppreciate
userAppreciate
=
userAppreciateMapper
.
selectOne
(
new
LambdaQueryWrapper
<
UserAppreciate
>().
eq
(
UserAppreciate:
:
getUid
,
bo
.
getUid
()).
eq
(
UserAppreciate:
:
getAid
,
bo
.
getAid
()).
eq
(
UserAppreciate:
:
getDelFlag
,
0
));
if
(
null
!=
userAppreciate
)
{
userAppreciateMapper
.
deleteById
(
userAppreciate
.
getId
());
return
true
;
}
...
...
@@ -258,8 +265,8 @@ public class ArticleServiceImpl implements IArticleService {
@Override
public
Boolean
insertByCollect
(
UserCollectBo
bo
)
{
UserCollect
add
=
BeanUtil
.
toBean
(
bo
,
UserCollect
.
class
);
UserCollect
userCollect
=
userCollectMapper
.
selectOne
(
new
LambdaQueryWrapper
<
UserCollect
>().
eq
(
UserCollect:
:
getUid
,
bo
.
getUid
()).
eq
(
UserCollect:
:
getAid
,
bo
.
getAid
()).
eq
(
UserCollect:
:
getDelFlag
,
0
));
if
(
null
!=
userCollect
)
{
UserCollect
userCollect
=
userCollectMapper
.
selectOne
(
new
LambdaQueryWrapper
<
UserCollect
>().
eq
(
UserCollect:
:
getUid
,
bo
.
getUid
()).
eq
(
UserCollect:
:
getAid
,
bo
.
getAid
()).
eq
(
UserCollect:
:
getDelFlag
,
0
));
if
(
null
!=
userCollect
)
{
userCollectMapper
.
deleteById
(
userCollect
.
getId
());
return
true
;
}
...
...
pz-system/src/main/java/com/pz/system/service/impl/BusinessServiceImpl.java
View file @
c8663b2b
...
...
@@ -121,6 +121,10 @@ public class BusinessServiceImpl implements IBusinessService {
@Override
public
Boolean
updateByBo
(
BusinessBo
bo
)
{
Business
update
=
BeanUtil
.
toBean
(
bo
,
Business
.
class
);
if
(
CollectionUtils
.
isNotEmpty
(
bo
.
getHospitalsIdsList
()))
{
String
jsonString
=
JsonUtils
.
toJsonString
(
bo
.
getHospitalsIdsList
());
update
.
setHospitals
(
jsonString
);
}
validEntityBeforeSave
(
update
);
return
baseMapper
.
updateById
(
update
)
>
0
;
}
...
...
pz-system/src/main/java/com/pz/system/service/impl/HospitalServiceImpl.java
View file @
c8663b2b
...
...
@@ -75,10 +75,10 @@ public class HospitalServiceImpl implements IHospitalService {
public
TableDataInfo
<
HospitalVo
>
queryPageList
(
HospitalBo
bo
,
PageQuery
pageQuery
)
{
LambdaQueryWrapper
<
Hospital
>
lqw
=
new
LambdaQueryWrapper
<>();
Page
<
HospitalVo
>
result
=
new
Page
<>();
if
(
null
==
bo
.
getId
())
{
if
(
null
==
bo
.
getId
())
{
lqw
=
buildQueryWrapper
(
bo
);
result
=
baseMapper
.
selectVoPage
(
pageQuery
.
build
(),
lqw
);
}
else
{
}
else
{
Business
business
=
businessMapper
.
selectById
(
bo
.
getId
());
if
(
StringUtils
.
isNotBlank
(
business
.
getHospitals
()))
{
List
<
Integer
>
ids
=
JsonUtils
.
parseArray
(
business
.
getHospitals
(),
Integer
.
class
);
...
...
@@ -167,7 +167,9 @@ public class HospitalServiceImpl implements IHospitalService {
@Override
public
Boolean
updateByBo
(
HospitalBo
bo
)
{
Hospital
update
=
BeanUtil
.
toBean
(
bo
,
Hospital
.
class
);
validEntityBeforeSave
(
update
);
if
(
CollectionUtils
.
isNotEmpty
(
bo
.
getDepartments
()))
{
update
.
setDepartments
(
JsonUtils
.
toJsonString
(
bo
.
getDepartments
()));
}
return
baseMapper
.
updateById
(
update
)
>
0
;
}
...
...
pz-system/src/main/java/com/pz/system/service/impl/MessageServiceImpl.java
View file @
c8663b2b
...
...
@@ -5,12 +5,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.pz.common.core.domain.PageQuery
;
import
com.pz.common.core.page.TableDataInfo
;
import
com.pz.system.domain.Department
;
import
com.pz.system.domain.Hospital
;
import
com.pz.system.domain.Information
;
import
com.pz.system.domain.Message
;
import
com.pz.system.domain.bo.DepartmentBo
;
import
com.pz.system.domain.bo.MessageBo
;
import
com.pz.system.domain.vo.DepartmentVo
;
import
com.pz.system.domain.vo.InformationVo
;
import
com.pz.system.domain.vo.MessageVo
;
import
com.pz.system.mapper.DepartmentMapper
;
import
com.pz.system.mapper.HospitalMapper
;
import
com.pz.system.mapper.MessageMapper
;
import
com.pz.system.service.IDepartmentService
;
import
com.pz.system.service.IMessageService
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -28,4 +37,28 @@ import java.util.*;
@Service
public
class
MessageServiceImpl
implements
IMessageService
{
private
final
MessageMapper
baseMapper
;
@Override
public
TableDataInfo
<
MessageVo
>
queryPageList
(
MessageBo
bo
,
PageQuery
pageQuery
)
{
Page
<
MessageVo
>
result
=
baseMapper
.
selectVoPage
(
pageQuery
.
build
(),
new
LambdaQueryWrapper
<
Message
>().
eq
(
Message:
:
getSender
,
bo
.
getSender
())
.
eq
(
Message:
:
getReceiver
,
bo
.
getReceiver
()).
or
().
eq
(
Message:
:
getSender
,
bo
.
getReceiver
()).
eq
(
Message:
:
getReceiver
,
bo
.
getSender
()));
List
<
MessageVo
>
records
=
result
.
getRecords
();
List
<
Message
>
messageList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
records
))
{
records
.
forEach
(
res
->
{
if
(
res
.
getIsRead
().
equals
(
"0"
)
&&
res
.
getReceiver
().
equals
(
bo
.
getSender
()))
{
res
.
setIsRead
(
"1"
);
messageList
.
add
(
BeanUtil
.
toBean
(
res
,
Message
.
class
));
}
});
}
//批量更新已读
if
(
CollectionUtils
.
isNotEmpty
(
messageList
))
{
baseMapper
.
updateBatchById
(
messageList
);
}
return
TableDataInfo
.
build
(
result
);
}
}
pz-system/src/main/java/com/pz/system/service/impl/ServicesServiceImpl.java
View file @
c8663b2b
...
...
@@ -75,7 +75,7 @@ public class ServicesServiceImpl implements IServicesService {
lqw
.
eq
(
bo
.
getBid
()
!=
null
,
Services:
:
getBid
,
bo
.
getBid
());
lqw
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getName
()),
Services:
:
getName
,
bo
.
getName
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getCover
()),
Services:
:
getCover
,
bo
.
getCover
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPrice
()),
Services:
:
getPrice
,
bo
.
getPrice
());
lqw
.
eq
(
bo
.
getFenmo
()
!=
null
,
Services:
:
getFenmo
,
bo
.
getFenmo
());
lqw
.
eq
(
bo
.
getDuration
()
!=
null
,
Services:
:
getDuration
,
bo
.
getDuration
());
lqw
.
eq
(
bo
.
getOvertime
()
!=
null
,
Services:
:
getOvertime
,
bo
.
getOvertime
());
...
...
pz-system/src/main/java/com/pz/system/service/impl/StoreGoodsCategoryServiceImpl.java
View file @
c8663b2b
...
...
@@ -62,7 +62,7 @@ public class StoreGoodsCategoryServiceImpl implements IStoreGoodsCategoryService
Map
<
String
,
Object
>
params
=
bo
.
getParams
();
LambdaQueryWrapper
<
StoreGoodsCategory
>
lqw
=
Wrappers
.
lambdaQuery
();
lqw
.
eq
(
bo
.
getStoreId
()
!=
null
,
StoreGoodsCategory:
:
getStoreId
,
bo
.
getStoreId
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getTitle
()),
StoreGoodsCategory:
:
getTitle
,
bo
.
getTitle
());
lqw
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getTitle
()),
StoreGoodsCategory:
:
getTitle
,
bo
.
getTitle
());
return
lqw
;
}
...
...
pz-system/src/main/java/com/pz/system/service/impl/StoreGoodsTagServiceImpl.java
View file @
c8663b2b
...
...
@@ -62,7 +62,7 @@ public class StoreGoodsTagServiceImpl implements IStoreGoodsTagService {
Map
<
String
,
Object
>
params
=
bo
.
getParams
();
LambdaQueryWrapper
<
StoreGoodsTag
>
lqw
=
Wrappers
.
lambdaQuery
();
lqw
.
eq
(
bo
.
getStoreId
()
!=
null
,
StoreGoodsTag:
:
getStoreId
,
bo
.
getStoreId
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getTitle
()),
StoreGoodsTag:
:
getTitle
,
bo
.
getTitle
());
lqw
.
like
(
StringUtils
.
isNotBlank
(
bo
.
getTitle
()),
StoreGoodsTag:
:
getTitle
,
bo
.
getTitle
());
return
lqw
;
}
...
...
pz-system/src/main/java/com/pz/system/service/impl/TotalOrderServiceImpl.java
View file @
c8663b2b
...
...
@@ -22,6 +22,7 @@ import com.pz.common.enums.ShopOrderStatus;
import
com.pz.common.enums.TotalOrderStatus
;
import
com.pz.common.exception.ServiceException
;
import
com.pz.common.utils.HttpUtils
;
import
com.pz.merchant.domain.vo.EmployeesVo
;
import
com.pz.merchant.domain.vo.SonOrderVo
;
import
com.pz.merchant.mapper.EmployeesMapper
;
import
com.pz.merchant.service.ISonOrderService
;
...
...
@@ -123,13 +124,18 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
public
TotalOrderVo
queryByAppId
(
Integer
id
)
{
// TODO 待优化
TotalOrderVo
totalOrderVo
=
baseMapper
.
selectByOrderId
(
id
);
//获取陪诊员用户id
Optional
.
ofNullable
(
employeesMapper
.
selectVoById
(
totalOrderVo
.
getEmId
()))
.
map
(
EmployeesVo:
:
getUid
)
.
ifPresent
(
totalOrderVo:
:
setEUserId
);
if
(
totalOrderVo
.
getBusinessId
()
==
1
)
{
// 预约陪诊
YypzOrder
yypzOrder
=
yypzOrderMapper
.
selectOne
(
new
LambdaQueryWrapper
<
YypzOrder
>().
eq
(
YypzOrder:
:
getOrderId
,
totalOrderVo
.
getId
()));
totalOrderVo
.
setServiceStatus
(
yypzOrder
.
getStatus
()
);
//
totalOrderVo = BeanUtil.toBean(yypzOrder, TotalOrderVo.class);
//totalOrderVo = BeanUtil.toBean(yypzOrder, TotalOrderVo.class);
totalOrderVo
.
setHospital
(
hospitalMapper
.
selectById
(
yypzOrder
.
getHid
()).
getName
());
totalOrderVo
.
setVisitor
(
userVsitorMapper
.
selectById
(
yypzOrder
.
getVisitor
()).
getName
());
totalOrderVo
.
setDepartment
(
departmentMapper
.
selectById
(
yypzOrder
.
getDid
()).
getTitle
());
...
...
pz-system/src/main/resources/mapper/system/DbwzOrderMapper.xml
View file @
c8663b2b
...
...
@@ -90,6 +90,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
total_order.remark as description,
dbwz_order.remark,
dbwz_order.voucher,
total_order.uid as userId
dbwz_order.voucher,
dbwz_order.indications as doctor
from total_order
left join business on total_order.business_id = business.id
...
...
pz-system/src/main/resources/mapper/system/StoreIncomeMapper.xml
View file @
c8663b2b
...
...
@@ -27,6 +27,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"bo.storeId != null"
>
where si.store_id = #{storeId}
</if>
<if
test=
"bo.status != null"
>
where si.status = #{bo.status}
</if>
</select>
...
...
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