Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
medical-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
aiming-medical
medical-server
Commits
bd4398c5
提交
bd4398c5
authored
10月 16, 2023
作者:
zhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.develop
上级
8ea24dfa
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
177 行增加
和
62 行删除
+177
-62
build.gradle
build.gradle
+6
-6
WxMaConfiguration.java
...ava/com/xwd/hospital/server/config/WxMaConfiguration.java
+9
-1
DoctorInfoDto.java
src/main/java/com/xwd/hospital/server/dto/DoctorInfoDto.java
+4
-0
PatientMiniAppHomeDto.java
...va/com/xwd/hospital/server/dto/PatientMiniAppHomeDto.java
+4
-1
DoctorInfoMapper.java
.../com/xwd/hospital/server/repository/DoctorInfoMapper.java
+2
-1
DepartmentInfoController.java
...om/xwd/hospital/server/rest/DepartmentInfoController.java
+15
-2
OrderController.java
...in/java/com/xwd/hospital/server/rest/OrderController.java
+7
-1
ApiCode.java
src/main/java/com/xwd/hospital/server/rest/res/ApiCode.java
+2
-1
DepartmentInfoService.java
...om/xwd/hospital/server/service/DepartmentInfoService.java
+2
-0
PaymentService.java
.../java/com/xwd/hospital/server/service/PaymentService.java
+2
-1
DepartmentInfoServiceImpl.java
...spital/server/service/impl/DepartmentInfoServiceImpl.java
+21
-0
DoctorInfoServiceImpl.java
...d/hospital/server/service/impl/DoctorInfoServiceImpl.java
+47
-11
PaymentServiceImpl.java
.../xwd/hospital/server/service/impl/PaymentServiceImpl.java
+9
-8
application-prod.yml
src/main/resources/application-prod.yml
+23
-9
application.yml
src/main/resources/application.yml
+2
-2
DoctorInfoMapper.xml
src/main/resources/mappers/DoctorInfoMapper.xml
+8
-2
OrderMapper.xml
src/main/resources/mappers/OrderMapper.xml
+8
-6
PatientPrescriptionInfoMapper.xml
src/main/resources/mappers/PatientPrescriptionInfoMapper.xml
+2
-2
OrderBaseMapper.xml
src/main/resources/mappers/base/OrderBaseMapper.xml
+4
-8
没有找到文件。
build.gradle
浏览文件 @
bd4398c5
...
@@ -103,13 +103,13 @@ dependencyManagement {
...
@@ -103,13 +103,13 @@ dependencyManagement {
}
}
flyway
{
flyway
{
driver
=
'com.mysql.cj.jdbc.Driver'
// driver = 'com.mysql.cj.jdbc.Driver'
url
=
'jdbc:mysql://localhost:3306/aiming-hospital?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false'
// url = 'jdbc:mysql://localhost:3306/aiming-hospital?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false'
user
=
'root'
password
=
'123456'
// url = 'jdbc:mysql://175.24.172.212:3306/hospital-server?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false'
// user = 'root'
// user = 'root'
// password = 'jgx2vgk0p!15'
// password = '123456'
url
=
'jdbc:mysql://175.24.172.212:3306/hospital-server?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false'
user
=
'root'
password
=
'jgx2vgk0p!15'
}
}
tasks
.
named
(
'test'
)
{
tasks
.
named
(
'test'
)
{
...
...
src/main/java/com/xwd/hospital/server/config/WxMaConfiguration.java
浏览文件 @
bd4398c5
...
@@ -15,6 +15,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
...
@@ -15,6 +15,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
import
me.chanjar.weixin.common.error.WxRuntimeException
;
import
me.chanjar.weixin.common.error.WxRuntimeException
;
import
org.apache.commons.pool2.impl.GenericObjectPoolConfig
;
import
org.apache.commons.pool2.impl.GenericObjectPoolConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -33,6 +34,13 @@ import java.util.stream.Collectors;
...
@@ -33,6 +34,13 @@ import java.util.stream.Collectors;
public
class
WxMaConfiguration
{
public
class
WxMaConfiguration
{
private
final
WxMaProperties
properties
;
private
final
WxMaProperties
properties
;
@Value
(
"${spring.data.redis.host}"
)
private
String
redisHost
;
private
int
redisPort
=
6379
;;
private
int
redisTimeo
=
2000
;
@Value
(
"${spring.data.redis.password}"
)
private
String
redisPassword
;
@Autowired
@Autowired
public
WxMaConfiguration
(
WxMaProperties
properties
)
{
public
WxMaConfiguration
(
WxMaProperties
properties
)
{
this
.
properties
=
properties
;
this
.
properties
=
properties
;
...
@@ -49,7 +57,7 @@ public class WxMaConfiguration {
...
@@ -49,7 +57,7 @@ public class WxMaConfiguration {
configs
.
stream
()
configs
.
stream
()
.
map
(
a
->
{
.
map
(
a
->
{
// WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
// WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
WxMaDefaultConfigImpl
config
=
new
WxMaRedisConfigImpl
(
new
JedisPool
(
new
GenericObjectPoolConfig
(),
"localhost"
,
6379
,
2000
,
"123456"
));
WxMaDefaultConfigImpl
config
=
new
WxMaRedisConfigImpl
(
new
JedisPool
(
new
GenericObjectPoolConfig
(),
redisHost
,
redisPort
,
redisTimeo
,
redisPassword
));
// 使用上面的配置时,需要同时引入jedis-lock的依赖,否则会报类无法找到的异常
// 使用上面的配置时,需要同时引入jedis-lock的依赖,否则会报类无法找到的异常
config
.
setAppid
(
a
.
getAppid
());
config
.
setAppid
(
a
.
getAppid
());
config
.
setSecret
(
a
.
getSecret
());
config
.
setSecret
(
a
.
getSecret
());
...
...
src/main/java/com/xwd/hospital/server/dto/DoctorInfoDto.java
浏览文件 @
bd4398c5
...
@@ -19,4 +19,8 @@ public class DoctorInfoDto {
...
@@ -19,4 +19,8 @@ public class DoctorInfoDto {
private
int
orderCount
;
private
int
orderCount
;
private
int
fansCount
;
private
int
fansCount
;
private
List
<
DoctorServiceInfo
>
doctorServiceInfoList
;
private
List
<
DoctorServiceInfo
>
doctorServiceInfoList
;
//是否关注
private
Boolean
attentionStatus
;
private
Long
attentionId
;
}
}
src/main/java/com/xwd/hospital/server/dto/PatientMiniAppHomeDto.java
浏览文件 @
bd4398c5
...
@@ -8,5 +8,8 @@ import java.util.List;
...
@@ -8,5 +8,8 @@ import java.util.List;
@Data
@Data
public
class
PatientMiniAppHomeDto
{
public
class
PatientMiniAppHomeDto
{
private
Long
doctorId
;
private
Long
doctorId
;
private
DoctorInfo
doctorInfo
;
private
String
DoctorName
;
private
String
title
;
private
String
departmentName
;
private
String
avatar
;
}
}
src/main/java/com/xwd/hospital/server/repository/DoctorInfoMapper.java
浏览文件 @
bd4398c5
...
@@ -27,7 +27,8 @@ public interface DoctorInfoMapper extends DoctorInfoBaseMapper {
...
@@ -27,7 +27,8 @@ public interface DoctorInfoMapper extends DoctorInfoBaseMapper {
List
<
DoctorDto
>
queryDoctorList
(
@Param
(
"sickness"
)
String
sickness
,
List
<
DoctorDto
>
queryDoctorList
(
@Param
(
"sickness"
)
String
sickness
,
@Param
(
"doctorName"
)
String
doctorName
,
@Param
(
"doctorName"
)
String
doctorName
,
@Param
(
"departmentId"
)
Long
departmentId
);
@Param
(
"departmentName"
)
String
departmentName
,
@Param
(
"departmentIdList"
)
List
<
Long
>
departmentIdList
);
DoctorInfoDto
queryDoctorDetail
(
@Param
(
"doctorId"
)
Long
doctorId
);
DoctorInfoDto
queryDoctorDetail
(
@Param
(
"doctorId"
)
Long
doctorId
);
...
...
src/main/java/com/xwd/hospital/server/rest/DepartmentInfoController.java
浏览文件 @
bd4398c5
...
@@ -93,11 +93,24 @@ public class DepartmentInfoController extends BaseController<DepartmentInfoServi
...
@@ -93,11 +93,24 @@ public class DepartmentInfoController extends BaseController<DepartmentInfoServi
*
*
* @param
* @param
*/
*/
@
Pos
tMapping
(
"/queryAllDepartment"
)
@
Ge
tMapping
(
"/queryAllDepartment"
)
@Operation
(
summary
=
"查询科室列表"
)
@Operation
(
summary
=
"查询科室列表"
)
public
ApiResponse
queryAllDepartment
(
@RequestParam
(
required
=
false
)
YesNoEnum
showHidden
)
{
public
ApiResponse
queryAllDepartment
(
@RequestParam
(
value
=
"showHidden"
,
required
=
false
)
YesNoEnum
showHidden
)
{
return
ApiResponse
.
ok
(
this
.
service
.
queryAllDepartment
(
showHidden
));
return
ApiResponse
.
ok
(
this
.
service
.
queryAllDepartment
(
showHidden
));
}
}
/**
* 隐藏或展示科室
*
* @param
*/
@PostMapping
(
"/hiddenDepartment"
)
@Operation
(
summary
=
"隐藏或展示科室"
)
public
ApiResponse
hiddenDepartment
(
@RequestParam
(
"showHidden"
)
YesNoEnum
showHidden
,
@RequestParam
(
"departmentId"
)
Long
departmentId
)
{
return
ApiResponse
.
ok
(
this
.
service
.
hiddenDepartment
(
showHidden
,
departmentId
));
}
}
}
src/main/java/com/xwd/hospital/server/rest/OrderController.java
浏览文件 @
bd4398c5
...
@@ -112,7 +112,13 @@ public class OrderController extends BaseController<OrderService, Order, OrderPa
...
@@ -112,7 +112,13 @@ public class OrderController extends BaseController<OrderService, Order, OrderPa
@Operation
(
summary
=
"创建订单"
)
@Operation
(
summary
=
"创建订单"
)
@ApiCommon
@ApiCommon
public
ApiResponse
<
Order
>
createOrder
(
@RequestBody
CreateOrderDto
createOrderDto
,
@AuthUser
User
user
)
{
public
ApiResponse
<
Order
>
createOrder
(
@RequestBody
CreateOrderDto
createOrderDto
,
@AuthUser
User
user
)
{
return
ApiResponse
.
ok
(
this
.
service
.
createOrder
(
createOrderDto
));
Order
order
=
this
.
service
.
createOrder
(
createOrderDto
);
if
(
null
==
order
){
return
ApiResponse
.
fail
(
ApiCode
.
ORDER_CREATE_FAIL
);
}
else
{
return
ApiResponse
.
ok
(
order
);
}
}
}
/**
/**
...
...
src/main/java/com/xwd/hospital/server/rest/res/ApiCode.java
浏览文件 @
bd4398c5
...
@@ -13,7 +13,8 @@ public enum ApiCode {
...
@@ -13,7 +13,8 @@ public enum ApiCode {
FAILED
(-
1
,
"fail"
),
FAILED
(-
1
,
"fail"
),
UNAUTHC
(
401
,
"You haven't signed in yet!"
),
UNAUTHC
(
401
,
"You haven't signed in yet!"
),
UNAUTHZ
(
403
,
"You are not authorized!"
),
UNAUTHZ
(
403
,
"You are not authorized!"
),
SERVER_ERROR
(
500
,
"server error!"
);
SERVER_ERROR
(
500
,
"server error!"
),
ORDER_CREATE_FAIL
(
700
,
"订单创建失败"
);
private
int
code
=
0
;
private
int
code
=
0
;
private
String
message
=
"success"
;
private
String
message
=
"success"
;
...
...
src/main/java/com/xwd/hospital/server/service/DepartmentInfoService.java
浏览文件 @
bd4398c5
...
@@ -18,4 +18,6 @@ public interface DepartmentInfoService extends BaseService<DepartmentInfo> {
...
@@ -18,4 +18,6 @@ public interface DepartmentInfoService extends BaseService<DepartmentInfo> {
List
queryAllDepartment
(
YesNoEnum
showHidden
);
List
queryAllDepartment
(
YesNoEnum
showHidden
);
boolean
hiddenDepartment
(
YesNoEnum
showHidden
,
Long
departmentId
);
}
}
src/main/java/com/xwd/hospital/server/service/PaymentService.java
浏览文件 @
bd4398c5
package
com
.
xwd
.
hospital
.
server
.
service
;
package
com
.
xwd
.
hospital
.
server
.
service
;
import
com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse
;
import
com.xwd.hospital.server.enums.PayPathEnum
;
import
com.xwd.hospital.server.enums.PayPathEnum
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.servlet.http.HttpServletResponse
;
public
interface
PaymentService
{
public
interface
PaymentService
{
String
startPay
(
String
orderNo
,
PayPathEnum
payPath
);
PrepayWithRequestPaymentResponse
startPay
(
String
orderNo
,
PayPathEnum
payPath
);
void
payNotify
(
HttpServletRequest
request
,
HttpServletResponse
response
);
void
payNotify
(
HttpServletRequest
request
,
HttpServletResponse
response
);
...
...
src/main/java/com/xwd/hospital/server/service/impl/DepartmentInfoServiceImpl.java
浏览文件 @
bd4398c5
...
@@ -80,5 +80,26 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
...
@@ -80,5 +80,26 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
return
parentDepartmentList
;
return
parentDepartmentList
;
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
hiddenDepartment
(
YesNoEnum
showHidden
,
Long
departmentId
)
{
DepartmentInfo
departmentInfo
=
this
.
getById
(
departmentId
);
if
(
null
==
departmentInfo
)
{
return
false
;
}
departmentInfo
.
setHiddenStatus
(
showHidden
);
this
.
updateById
(
departmentInfo
);
//如果是一级菜单,同时隐藏或取消下面的二级菜单
if
(
departmentInfo
.
getDepartmentLevel
()
==
DepartmentLevelEnum
.
FIRST_LEVEL
){
List
<
DepartmentInfo
>
departmentInfoList
=
this
.
list
(
Wrappers
.<
DepartmentInfo
>
query
()
.
eq
(
"parent_id"
,
departmentInfo
.
getId
()));
//从departmentInfoList中取出id生成新的list
for
(
DepartmentInfo
childDepartment
:
departmentInfoList
)
{
childDepartment
.
setHiddenStatus
(
showHidden
);
}
this
.
updateBatchById
(
departmentInfoList
);
}
return
true
;
}
}
}
src/main/java/com/xwd/hospital/server/service/impl/DoctorInfoServiceImpl.java
浏览文件 @
bd4398c5
...
@@ -13,14 +13,14 @@ import java.util.List;
...
@@ -13,14 +13,14 @@ import java.util.List;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
com.xwd.hospital.server.domain.ArticleInfo
;
import
cn.dev33.satoken.stp.StpUtil
;
import
com.xwd.hospital.server.domain.DepartmentInfo
;
import
com.xwd.hospital.server.domain.*
;
import
com.xwd.hospital.server.domain.DoctorServiceInfo
;
import
com.xwd.hospital.server.dto.DoctorDto
;
import
com.xwd.hospital.server.dto.DoctorDto
;
import
com.xwd.hospital.server.dto.DoctorInfoDto
;
import
com.xwd.hospital.server.dto.DoctorInfoDto
;
import
com.xwd.hospital.server.enums.DepartmentLevelEnum
;
import
com.xwd.hospital.server.enums.YesNoEnum
;
import
com.xwd.hospital.server.rest.req.DoctorSearchParam
;
import
com.xwd.hospital.server.rest.req.DoctorSearchParam
;
import
com.xwd.hospital.server.service.DepartmentInfoService
;
import
com.xwd.hospital.server.service.*
;
import
com.xwd.hospital.server.service.DoctorServiceInfoService
;
import
jakarta.annotation.Resource
;
import
jakarta.annotation.Resource
;
import
com.baomidou.mybatisplus.core.enums.SqlMethod
;
import
com.baomidou.mybatisplus.core.enums.SqlMethod
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
@@ -29,10 +29,8 @@ import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
...
@@ -29,10 +29,8 @@ import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.xwd.hospital.server.service.DoctorInfoService
;
import
com.xwd.hospital.server.repository.DoctorInfoMapper
;
import
com.xwd.hospital.server.repository.DoctorInfoMapper
;
import
com.xwd.hospital.server.repository.base.DoctorInfoBaseMapper
;
import
com.xwd.hospital.server.repository.base.DoctorInfoBaseMapper
;
import
com.xwd.hospital.server.domain.DoctorInfo
;
import
com.xwd.hospital.server.rest.req.DoctorInfoParam
;
import
com.xwd.hospital.server.rest.req.DoctorInfoParam
;
@Service
@Service
...
@@ -41,6 +39,10 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
...
@@ -41,6 +39,10 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
private
DepartmentInfoService
departmentInfoService
;
private
DepartmentInfoService
departmentInfoService
;
@Resource
@Resource
private
DoctorServiceInfoService
doctorServiceInfoService
;
private
DoctorServiceInfoService
doctorServiceInfoService
;
@Resource
private
UserAttentionInfoService
userAttentionInfoService
;
@Resource
private
UserInfoService
userInfoService
;
@Override
@Override
public
int
updateAllFieldsById
(
DoctorInfo
entity
)
{
public
int
updateAllFieldsById
(
DoctorInfo
entity
)
{
...
@@ -63,19 +65,53 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
...
@@ -63,19 +65,53 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
@Override
@Override
public
List
<
DoctorDto
>
queryDoctorList
(
DoctorSearchParam
param
)
{
public
List
<
DoctorDto
>
queryDoctorList
(
DoctorSearchParam
param
)
{
if
(!
StringUtils
.
isBlank
(
param
.
getDepartmentName
())
&&
null
==
param
.
getDepartmentId
()){
List
<
Long
>
departmentIdList
=
new
ArrayList
<>();
DepartmentInfo
department
=
departmentInfoService
.
getOne
(
Wrappers
.<
DepartmentInfo
>
query
().
eq
(
"department_name"
,
param
.
getDepartmentName
()));
if
(
null
!=
param
.
getDepartmentId
()){
param
.
setDepartmentId
(
department
.
getId
());
DepartmentInfo
department
=
departmentInfoService
.
getById
(
param
.
getDepartmentId
());
if
(
null
!=
department
&&
department
.
getHiddenStatus
()
==
YesNoEnum
.
NO
){
if
(
department
.
getDepartmentLevel
()
==
DepartmentLevelEnum
.
FIRST_LEVEL
)
{
//一级菜单id输入查询所以二级菜单列表
List
<
DepartmentInfo
>
departmentInfoList
=
departmentInfoService
.
list
(
Wrappers
.<
DepartmentInfo
>
query
()
.
eq
(
"parent_id"
,
param
.
getDepartmentId
())
.
eq
(
"hidden_status"
,
YesNoEnum
.
NO
));
//从departmentInfoList中取出id生成新的list
for
(
DepartmentInfo
departmentInfo
:
departmentInfoList
)
{
departmentIdList
.
add
(
departmentInfo
.
getId
());
}
}
else
{
departmentIdList
.
add
(
param
.
getDepartmentId
());
}
}
}
//param传入一级菜单departmentId,同时此一级菜单下无二级菜单,此时应无医生可查询出
if
(
departmentIdList
.
size
()
==
0
){
departmentIdList
.
add
(
0L
);
}
}
return
this
.
getBaseMapper
().
queryDoctorList
(
param
.
getSickness
(),
param
.
getDoctorName
(),
param
.
getDepartment
Id
()
);
return
this
.
getBaseMapper
().
queryDoctorList
(
param
.
getSickness
(),
param
.
getDoctorName
(),
param
.
getDepartment
Name
(),
departmentIdList
);
}
}
@Override
@Override
public
DoctorInfoDto
queryDoctorDetail
(
Long
doctorId
)
{
public
DoctorInfoDto
queryDoctorDetail
(
Long
doctorId
)
{
//当前用户
Object
userId
=
StpUtil
.
getExtra
(
"userId"
);
UserInfo
userInfo
=
userInfoService
.
getOne
(
Wrappers
.<
UserInfo
>
query
().
eq
(
"user_id"
,
Long
.
valueOf
(
userId
.
toString
())));
if
(
null
==
userInfo
){
return
null
;
}
DoctorInfoDto
doctorInfoDto
=
this
.
getBaseMapper
().
queryDoctorDetail
(
doctorId
);
DoctorInfoDto
doctorInfoDto
=
this
.
getBaseMapper
().
queryDoctorDetail
(
doctorId
);
List
<
DoctorServiceInfo
>
doctorServiceInfoList
=
doctorServiceInfoService
.
list
(
Wrappers
.<
DoctorServiceInfo
>
query
().
eq
(
"doctor_id"
,
doctorId
));
List
<
DoctorServiceInfo
>
doctorServiceInfoList
=
doctorServiceInfoService
.
list
(
Wrappers
.<
DoctorServiceInfo
>
query
().
eq
(
"doctor_id"
,
doctorId
));
doctorInfoDto
.
setDoctorServiceInfoList
(
doctorServiceInfoList
);
doctorInfoDto
.
setDoctorServiceInfoList
(
doctorServiceInfoList
);
UserAttentionInfo
attentionInfo
=
userAttentionInfoService
.
getOne
(
Wrappers
.<
UserAttentionInfo
>
query
().
eq
(
"doctor_id"
,
doctorId
)
.
eq
(
"user_info_id"
,
userInfo
.
getId
()));
if
(
null
!=
attentionInfo
){
doctorInfoDto
.
setAttentionStatus
(
true
);
doctorInfoDto
.
setAttentionId
(
attentionInfo
.
getId
());
}
else
{
doctorInfoDto
.
setAttentionStatus
(
false
);
}
return
doctorInfoDto
;
return
doctorInfoDto
;
}
}
}
}
src/main/java/com/xwd/hospital/server/service/impl/PaymentServiceImpl.java
浏览文件 @
bd4398c5
...
@@ -12,6 +12,7 @@ import com.wechat.pay.java.core.notification.NotificationConfig;
...
@@ -12,6 +12,7 @@ import com.wechat.pay.java.core.notification.NotificationConfig;
import
com.wechat.pay.java.core.notification.NotificationParser
;
import
com.wechat.pay.java.core.notification.NotificationParser
;
import
com.wechat.pay.java.core.notification.RequestParam
;
import
com.wechat.pay.java.core.notification.RequestParam
;
import
com.wechat.pay.java.service.payments.jsapi.JsapiService
;
import
com.wechat.pay.java.service.payments.jsapi.JsapiService
;
import
com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension
;
import
com.wechat.pay.java.service.payments.jsapi.model.*
;
import
com.wechat.pay.java.service.payments.jsapi.model.*
;
import
com.wechat.pay.java.service.payments.jsapi.model.Amount
;
import
com.wechat.pay.java.service.payments.jsapi.model.Amount
;
import
com.wechat.pay.java.service.payments.model.Transaction
;
import
com.wechat.pay.java.service.payments.model.Transaction
;
...
@@ -56,7 +57,7 @@ import java.util.TimeZone;
...
@@ -56,7 +57,7 @@ import java.util.TimeZone;
@Slf4j
@Slf4j
public
class
PaymentServiceImpl
implements
PaymentService
{
public
class
PaymentServiceImpl
implements
PaymentService
{
public
static
JsapiService
payService
;
public
static
JsapiService
Extension
payService
;
public
static
RefundService
refundService
;
public
static
RefundService
refundService
;
@Resource
@Resource
...
@@ -93,7 +94,7 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -93,7 +94,7 @@ public class PaymentServiceImpl implements PaymentService {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
startPay
(
String
orderNo
,
PayPathEnum
payPath
)
{
public
PrepayWithRequestPaymentResponse
startPay
(
String
orderNo
,
PayPathEnum
payPath
)
{
if
(
payPath
.
equals
(
PayPathEnum
.
WX_PAY
)){
if
(
payPath
.
equals
(
PayPathEnum
.
WX_PAY
)){
//微信支付
//微信支付
// 使用自动更新平台证书的RSA配置
// 使用自动更新平台证书的RSA配置
...
@@ -108,7 +109,7 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -108,7 +109,7 @@ public class PaymentServiceImpl implements PaymentService {
.
build
();
.
build
();
// 初始化服务
// 初始化服务
payService
=
new
JsapiService
.
Builder
().
config
(
config
).
build
();
payService
=
new
JsapiService
Extension
.
Builder
().
config
(
config
).
build
();
Order
order
=
orderService
.
getOne
(
Wrappers
.<
Order
>
query
().
eq
(
"order_no"
,
orderNo
));
Order
order
=
orderService
.
getOne
(
Wrappers
.<
Order
>
query
().
eq
(
"order_no"
,
orderNo
));
if
(
order
.
getOrderState
()
!=
OrderStateEnum
.
TO_PAY
){
if
(
order
.
getOrderState
()
!=
OrderStateEnum
.
TO_PAY
){
...
@@ -137,9 +138,8 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -137,9 +138,8 @@ public class PaymentServiceImpl implements PaymentService {
// 调用接口
// 调用接口
try
{
try
{
PrepayResponse
response
=
prepay
(
order
,
orderPay
);
PrepayWithRequestPaymentResponse
response
=
prepay
(
order
,
orderPay
);
log
.
info
(
"微信支付串"
+
response
.
getPrepayId
());
return
response
;
return
response
.
getPrepayId
();
}
catch
(
Exception
e
)
{
// 发送HTTP请求失败
}
catch
(
Exception
e
)
{
// 发送HTTP请求失败
// 调用e.getHttpRequest()获取请求打印日志或上报监控,更多方法见HttpException定义
// 调用e.getHttpRequest()获取请求打印日志或上报监控,更多方法见HttpException定义
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
());
...
@@ -353,7 +353,7 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -353,7 +353,7 @@ public class PaymentServiceImpl implements PaymentService {
payService
.
closeOrder
(
request
);
payService
.
closeOrder
(
request
);
}
}
/** JSAPI支付下单 */
/** JSAPI支付下单 */
public
PrepayResponse
prepay
(
Order
order
,
OrderPay
orderPay
)
{
public
Prepay
WithRequestPayment
Response
prepay
(
Order
order
,
OrderPay
orderPay
)
{
PrepayRequest
request
=
new
PrepayRequest
();
PrepayRequest
request
=
new
PrepayRequest
();
// 调用request.setXxx(val)设置所需参数,具体参数可见Request定义
// 调用request.setXxx(val)设置所需参数,具体参数可见Request定义
...
@@ -386,7 +386,8 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -386,7 +386,8 @@ public class PaymentServiceImpl implements PaymentService {
payer
.
setOpenid
(
order
.
getUserInfo
().
getUser
().
getOpenId
());
payer
.
setOpenid
(
order
.
getUserInfo
().
getUser
().
getOpenId
());
request
.
setPayer
(
payer
);
request
.
setPayer
(
payer
);
// 调用接口
// 调用接口
return
payService
.
prepay
(
request
);
PrepayWithRequestPaymentResponse
response
=
payService
.
prepayWithRequestPayment
(
request
);
return
response
;
}
}
/** 微信支付订单号查询订单 */
/** 微信支付订单号查询订单 */
public
static
Transaction
queryOrderById
()
{
public
static
Transaction
queryOrderById
()
{
...
...
src/main/resources/application-prod.yml
浏览文件 @
bd4398c5
...
@@ -21,20 +21,34 @@ knife4j:
...
@@ -21,20 +21,34 @@ knife4j:
wx
:
wx
:
miniapp
:
miniapp
:
configs
:
configs
:
-
appid
:
#微信小程序的appid
-
appid
:
wxc447fccb6a2745ce
secret
:
#微信小程序的Secret
secret
:
af277a664613a2276266eca024bff139
token
:
#微信小程序消息服务器配置的token
token
:
#微信小程序消息服务器配置的token
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
msgDataFormat
:
JSON
msgDataFormat
:
JSON
-
appid
:
#微信小程序的appid
-
appid
:
wxc447fccb6a2745ce
secret
:
#微信小程序的Secret
secret
:
af277a664613a2276266eca024bff139
token
:
#微信小程序消息服务器配置的token
token
:
#微信小程序消息服务器配置的token
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
msgDataFormat
:
JSON
msgDataFormat
:
JSON
pay
:
pay
:
wx
:
wx
:
appId
:
appId
:
wxc447fccb6a2745ce
merchantId
:
merchantId
:
1535738101
keyPath
:
keyPath
:
/home/ubuntu/1535738101_20231012_cert/apiclient_key.pem
merchantSerialNumber
:
merchantSerialNumber
:
52849767F52ACCC2743E0C5439F3EAFA816FA1D7
apiV3Key
:
apiV3Key
:
YG1e4n9oBPhuuYZaP7arXy232ejma6FW
payNotifyUrl
:
http://175.24.172.212:8099/pay/notify
refundNotifyUrl
:
http://175.24.172.212:8099/pay/refund/notify
tencent
:
cloud
:
secretId
:
AKIDZzDD2e4IURBhy2sUrzsXxXu4zf7LL7ex
secretKey
:
A52lGXaTAev274oMk4CBzay9C6nIbjeM
sms
:
sdkAppId
:
1400859846
templateId
:
1946431
ronglian
:
cloud
:
account
:
T00000029722
secret
:
88275dd0-6667-11ee-a6e8-a9e02a8e273e
host
:
https://openapis.7moor.com
src/main/resources/application.yml
浏览文件 @
bd4398c5
...
@@ -11,7 +11,7 @@ spring:
...
@@ -11,7 +11,7 @@ spring:
application
:
application
:
name
:
aiming-hospital-server
name
:
aiming-hospital-server
profiles
:
profiles
:
active
:
dev
active
:
prod
jackson
:
jackson
:
default-property-inclusion
:
non_null
default-property-inclusion
:
non_null
date-format
:
yyyy-MM-dd HH:mm:ss
date-format
:
yyyy-MM-dd HH:mm:ss
...
@@ -57,7 +57,7 @@ spring:
...
@@ -57,7 +57,7 @@ spring:
max-file-size
:
50MB
max-file-size
:
50MB
max-request-size
:
100MB
max-request-size
:
100MB
server
:
server
:
port
:
${port:80
88
}
port
:
${port:80
99
}
servlet
:
servlet
:
encoding
:
encoding
:
charset
:
UTF-8
charset
:
UTF-8
...
...
src/main/resources/mappers/DoctorInfoMapper.xml
浏览文件 @
bd4398c5
...
@@ -66,8 +66,14 @@
...
@@ -66,8 +66,14 @@
<if
test=
"doctorName != null and doctorName != ''"
>
<if
test=
"doctorName != null and doctorName != ''"
>
AND di.doctor_name = #{doctorName}
AND di.doctor_name = #{doctorName}
</if>
</if>
<if
test=
"departmentId != null and departmentId != ''"
>
<if
test=
"departmentName != null and departmentName != ''"
>
AND pmq.department_id = #{departmentId}
AND pmq.departmentName LIKE CONCAT('%', #{departmentName}, '%')
</if>
<if
test=
"departmentIdList != null and departmentIdList != ''"
>
AND pmq.department_id in
<foreach
collection=
"departmentIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</if>
GROUP BY di.id, di.doctor_name, h.hospital_name, d.department_name, di.expertise_area, di.introduction, pmq.title, u.avatar, s.service_price
GROUP BY di.id, di.doctor_name, h.hospital_name, d.department_name, di.expertise_area, di.introduction, pmq.title, u.avatar, s.service_price
</select>
</select>
...
...
src/main/resources/mappers/OrderMapper.xml
浏览文件 @
bd4398c5
...
@@ -6,9 +6,6 @@
...
@@ -6,9 +6,6 @@
</resultMap>
</resultMap>
<resultMap
id=
"ListResultMap"
type=
"com.xwd.hospital.server.domain.Order"
extends=
"com.xwd.hospital.server.repository.base.OrderBaseMapper.BaseResultMap"
>
<resultMap
id=
"ListResultMap"
type=
"com.xwd.hospital.server.domain.Order"
extends=
"com.xwd.hospital.server.repository.base.OrderBaseMapper.BaseResultMap"
>
</resultMap>
<resultMap
id=
"RecommendDoctorResultMap"
type=
"com.xwd.hospital.server.dto.PatientMiniAppHomeDto"
extends=
"com.xwd.hospital.server.repository.base.OrderBaseMapper.RecommendDoctorResultMap"
>
</resultMap>
</resultMap>
<!-- 根据主键查询 -->
<!-- 根据主键查询 -->
<select
id=
"selectById"
parameterType=
"java.io.Serializable"
resultMap=
"ResultMap"
>
<select
id=
"selectById"
parameterType=
"java.io.Serializable"
resultMap=
"ResultMap"
>
...
@@ -63,10 +60,15 @@
...
@@ -63,10 +60,15 @@
</if>
</if>
order by create_time desc
order by create_time desc
</select>
</select>
<select
id=
"selectDoctorListByOrderCount"
resultMap=
"RecommendDoctorResultMap"
>
<select
id=
"selectDoctorListByOrderCount"
resultType=
"com.xwd.hospital.server.dto.PatientMiniAppHomeDto"
>
select a.doctorId FROM
SELECT di.doctor_name,pmq.title,pdi.department_name,su.avatar,di.id as doctorId
FROM pms_doctor_info di
INNER JOIN pms_medical_qualifications pmq on pmq.doctor_id = di.id
INNER JOIN pms_department_info pdi on pdi.id = pmq.department_id
INNER JOIN sys_user su on su.obj_id = di.id
WHERE di.id = (select a.doctorId FROM
(SELECT count(o.id) orderNum, o.doctor_id doctorId
(SELECT count(o.id) orderNum, o.doctor_id doctorId
FROM pms_order o
FROM pms_order o
WHERE 1=1 GROUP BY o.doctor_id ORDER BY orderNum desc LIMIT 3) a
WHERE 1=1 GROUP BY o.doctor_id ORDER BY orderNum desc LIMIT 3) a
)
</select>
</select>
</mapper>
</mapper>
src/main/resources/mappers/PatientPrescriptionInfoMapper.xml
浏览文件 @
bd4398c5
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
select
select
ppi.*
ppi.*
from pms_patient_prescription_info ppi
from pms_patient_prescription_info ppi
inner join pms_prescription_order
ppo on ppi..id = ppo.
.prescription_id
inner join pms_prescription_order
_record ppo on ppi.id = ppo
.prescription_id
where ppo.id = #{orderId}
where ppo.
order_
id = #{orderId}
</select>
</select>
</mapper>
</mapper>
src/main/resources/mappers/base/OrderBaseMapper.xml
浏览文件 @
bd4398c5
...
@@ -36,23 +36,19 @@
...
@@ -36,23 +36,19 @@
</resultMap>
</resultMap>
<resultMap
id=
"ResultMap"
type=
"com.xwd.hospital.server.domain.Order"
extends=
"BaseResultMap"
>
<resultMap
id=
"ResultMap"
type=
"com.xwd.hospital.server.domain.Order"
extends=
"BaseResultMap"
>
<result
column=
"patient_self_introduce"
jdbcType=
"VARCHAR"
property=
"patientSelfIntroduce"
/>
<result
column=
"patient_self_introduce"
jdbcType=
"VARCHAR"
property=
"patientSelfIntroduce"
/>
<association
column=
"user_info_id"
property=
"userInfo"
javaType=
"com.xwd.hospital.server.domain.
PatientPrescription
Info"
<association
column=
"user_info_id"
property=
"userInfo"
javaType=
"com.xwd.hospital.server.domain.
User
Info"
select=
"com.xwd.hospital.server.repository.
PatientPrescriptionInfoMapper.selectByOrder
Id"
/>
select=
"com.xwd.hospital.server.repository.
UserInfoMapper.selectBy
Id"
/>
<!-- <association column="doctor_id" property="doctor" javaType="com.xwd.hospital.server.domain.DoctorInfo"-->
<!-- <association column="doctor_id" property="doctor" javaType="com.xwd.hospital.server.domain.DoctorInfo"-->
<!-- select="com.xwd.hospital.server.repository.DoctorInfoMapper.selectById" />-->
<!-- select="com.xwd.hospital.server.repository.DoctorInfoMapper.selectById" />-->
<!-- <association column="patient_id" property="patient" javaType="com.xwd.hospital.server.domain.PatientInfo"-->
<!-- <association column="patient_id" property="patient" javaType="com.xwd.hospital.server.domain.PatientInfo"-->
<!-- select="com.xwd.hospital.server.repository.PatientInfoMapper.selectById" />-->
<!-- select="com.xwd.hospital.server.repository.PatientInfoMapper.selectById" />-->
<!-- <association column="user_coupon_id" property="userCoupon" javaType="com.xwd.hospital.server.domain.UserCouponInfo"-->
<!-- <association column="user_coupon_id" property="userCoupon" javaType="com.xwd.hospital.server.domain.UserCouponInfo"-->
<!-- select="com.xwd.hospital.server.repository.UserCouponInfoMapper.selectById" />-->
<!-- select="com.xwd.hospital.server.repository.UserCouponInfoMapper.selectById" />-->
<association
column=
"id"
property=
"patientPrescriptionInfo"
javaType=
"com.xwd.hospital.server.domain.
User
Info"
<association
column=
"id"
property=
"patientPrescriptionInfo"
javaType=
"com.xwd.hospital.server.domain.
PatientPrescription
Info"
select=
"com.xwd.hospital.server.repository.
UserInfoMapper.selectBy
Id"
/>
select=
"com.xwd.hospital.server.repository.
PatientPrescriptionInfoMapper.selectByOrder
Id"
/>
<collection
column=
"id"
property=
"pictureList"
javaType=
"list"
<collection
column=
"id"
property=
"pictureList"
javaType=
"list"
select=
"com.xwd.hospital.server.repository.OrderPictureMapper.selectByOrderId"
/>
select=
"com.xwd.hospital.server.repository.OrderPictureMapper.selectByOrderId"
/>
</resultMap>
</resultMap>
<resultMap
id=
"RecommendDoctorResultMap"
type=
"com.xwd.hospital.server.dto.PatientMiniAppHomeDto"
>
<association
column=
"doctorId"
property=
"doctorInfo"
javaType=
"com.xwd.hospital.server.domain.DoctorInfo"
select=
"com.xwd.hospital.server.repository.DoctorInfoMapper.selectById"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
`id`, `user_info_id`, `doctor_id`, `patient_id`, `order_no`, `order_state`, `order_type`, `order_price`, `order_discount`, `order_actual_pay`, `user_coupon_id`, `appointment_date`, `service_start_time`, `service_end_time`, `hospital_name`, `department_name`, `doctor_name`, `patient_name`, `patient_sex`, `patient_id_no`, `patient_phone_number`, `patient_born_date`, `cancel_reason`, `pay_time`, `confirm_time`, `complete_time`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `user_info_id`, `doctor_id`, `patient_id`, `order_no`, `order_state`, `order_type`, `order_price`, `order_discount`, `order_actual_pay`, `user_coupon_id`, `appointment_date`, `service_start_time`, `service_end_time`, `hospital_name`, `department_name`, `doctor_name`, `patient_name`, `patient_sex`, `patient_id_no`, `patient_phone_number`, `patient_born_date`, `cancel_reason`, `pay_time`, `confirm_time`, `complete_time`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
</sql>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论