Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
medical-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
aiming-medical
medical-server
Commits
d979fb09
提交
d979fb09
authored
10月 31, 2023
作者:
zhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.develop
2.fix bug
上级
8b4124e1
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
222 行增加
和
22 行删除
+222
-22
Dockerfile
Dockerfile
+3
-3
build.gradle
build.gradle
+1
-1
MedicalReport.java
...in/java/com/xwd/hospital/server/domain/MedicalReport.java
+16
-3
ReportDto.java
src/main/java/com/xwd/hospital/server/dto/ReportDto.java
+7
-0
UserController.java
...ain/java/com/xwd/hospital/server/rest/UserController.java
+28
-0
MedicalReportParam.java
.../com/xwd/hospital/server/rest/req/MedicalReportParam.java
+13
-0
UnlimitedQRCodeReq.java
...hospital/server/rest/thirdPartReq/UnlimitedQRCodeReq.java
+10
-0
UnlimitedQRCodeRes.java
...hospital/server/rest/thirdPartReq/UnlimitedQRCodeRes.java
+10
-0
MiniAppApiService.java
...va/com/xwd/hospital/server/service/MiniAppApiService.java
+18
-0
UserService.java
...ain/java/com/xwd/hospital/server/service/UserService.java
+3
-0
CouponInfoServiceImpl.java
...d/hospital/server/service/impl/CouponInfoServiceImpl.java
+22
-3
MedicalReportServiceImpl.java
...ospital/server/service/impl/MedicalReportServiceImpl.java
+1
-0
UserServiceImpl.java
...com/xwd/hospital/server/service/impl/UserServiceImpl.java
+45
-4
V1.0.0__schema.sql
src/main/resources/db/migration/V1.0.0__schema.sql
+37
-0
MedicalReportBaseMapper.xml
src/main/resources/mappers/base/MedicalReportBaseMapper.xml
+8
-8
没有找到文件。
Dockerfile
浏览文件 @
d979fb09
FROM
azul/zulu-openjdk-alpine:17-jre
ADD
build/libs/
app-0.0.1.jar /app
.jar
ADD
build/libs/
hospital-server-0.0.1.jar /hospital-server-0.0.1
.jar
ENTRYPOINT
java -jar /app.jar
\ No newline at end of file
ENTRYPOINT
java -jar /hospital-server-0.0.1.jar
\ No newline at end of file
build.gradle
浏览文件 @
d979fb09
buildscript
{
ext
{
springBootVersion
=
'3.
1.3
'
springBootVersion
=
'3.
0.2
'
springDependencyManager
=
'1.1.0'
lombokPluginVersion
=
'1.18.28'
testcontainersVersion
=
'1.19.0'
...
...
src/main/java/com/xwd/hospital/server/domain/MedicalReport.java
浏览文件 @
d979fb09
...
...
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import
com.xwd.hospital.server.base.BaseDomain
;
import
com.xwd.hospital.server.enums.SexTypeEnum
;
import
com.xwd.hospital.server.enums.ReportTypeEnum
;
import
com.xwd.hospital.server.enums.ReportStateEnum
;
import
com.xwd.hospital.server.domain.DoctorInfo
;
...
...
@@ -57,6 +58,12 @@ public class MedicalReport extends BaseDomain {
@TableField
(
value
=
"sex"
)
@Schema
(
description
=
"性别"
,
nullable
=
false
)
private
SexTypeEnum
sex
;
/**
* 报告类型
*/
@TableField
(
value
=
"report_type"
)
@Schema
(
description
=
"报告类型"
,
nullable
=
false
)
private
ReportTypeEnum
reportType
;
/**
* 患者年龄
*/
...
...
@@ -145,9 +152,6 @@ public class MedicalReport extends BaseDomain {
@Schema
(
description
=
"更新时间"
,
nullable
=
false
)
private
java
.
util
.
Date
updateTime
;
@TableField
(
exist
=
false
)
private
List
<
String
>
pictureList
;
/**
* 设置默认值
*/
...
...
@@ -156,6 +160,9 @@ public class MedicalReport extends BaseDomain {
if
(
this
.
getSex
()
==
null
)
{
this
.
setSex
(
SexTypeEnum
.
MALE
);
}
if
(
this
.
getReportType
()
==
null
)
{
this
.
setReportType
(
ReportTypeEnum
.
CT
);
}
if
(
this
.
getReportState
()
==
null
)
{
this
.
setReportState
(
ReportStateEnum
.
TO_INTERPRET
);
}
...
...
@@ -197,6 +204,12 @@ public class MedicalReport extends BaseDomain {
}
return
false
;
}
if
(
this
.
getReportType
()
==
null
)
{
if
(
throwException
)
{
throw
new
ApiCode
.
ApiException
(-
1
,
"报告类型不能为空!"
);
}
return
false
;
}
if
(
this
.
getAge
()
==
null
)
{
if
(
throwException
)
{
throw
new
ApiCode
.
ApiException
(-
1
,
"患者年龄不能为空!"
);
...
...
src/main/java/com/xwd/hospital/server/dto/ReportDto.java
浏览文件 @
d979fb09
package
com
.
xwd
.
hospital
.
server
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.xwd.hospital.server.enums.ReportTypeEnum
;
import
com.xwd.hospital.server.enums.SexTypeEnum
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
...
...
@@ -28,6 +29,12 @@ public class ReportDto {
@TableField
(
value
=
"sex"
)
@Schema
(
description
=
"性别"
,
nullable
=
false
)
private
SexTypeEnum
sex
;
/**
* 报告类型
*/
@TableField
(
value
=
"report_type"
)
@Schema
(
description
=
"报告类型"
,
nullable
=
false
)
private
ReportTypeEnum
reportType
;
/**
* 患者年龄
*/
...
...
src/main/java/com/xwd/hospital/server/rest/UserController.java
浏览文件 @
d979fb09
...
...
@@ -8,6 +8,8 @@
package
com
.
xwd
.
hospital
.
server
.
rest
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.List
;
import
java.util.Arrays
;
...
...
@@ -32,6 +34,7 @@ import com.xwd.hospital.server.service.UserService;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.annotation.Resource
;
import
jakarta.servlet.http.HttpServletResponse
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springdoc.core.annotations.ParameterObject
;
...
...
@@ -328,4 +331,29 @@ public class UserController extends BaseController<UserService, User, UserParam>
return
ApiResponse
.
ok
(
this
.
service
.
getIMSig
(
Long
.
valueOf
(
userId
.
toString
())));
}
/**
* <pre>
* 获取小程序推广码
* </pre>
*/
@Operation
(
summary
=
"获取小程序推广码"
)
@GetMapping
(
"/getWxQrCode"
)
@ApiCommon
public
ApiResponse
getWxQrCode
(
@AuthUser
User
user
,
HttpServletResponse
response
)
{
try
{
OutputStream
stream
=
null
;
Object
userId
=
StpUtil
.
getExtra
(
"userId"
);
byte
[]
result
=
this
.
service
.
getWxQrCode
(
Long
.
valueOf
(
userId
.
toString
()));
//输出图片到页面
response
.
setContentType
(
"image/png"
);
stream
=
response
.
getOutputStream
();
stream
.
write
(
result
);
stream
.
flush
();
stream
.
close
();
}
catch
(
IOException
e
){
e
.
printStackTrace
();
}
return
ApiResponse
.
ok
(
null
);
}
}
src/main/java/com/xwd/hospital/server/rest/req/MedicalReportParam.java
浏览文件 @
d979fb09
...
...
@@ -18,6 +18,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import
com.xwd.hospital.server.base.BaseParam
;
import
com.xwd.hospital.server.enums.SexTypeEnum
;
import
com.xwd.hospital.server.enums.ReportTypeEnum
;
import
com.xwd.hospital.server.enums.ReportStateEnum
;
import
com.xwd.hospital.server.domain.MedicalReport
;
...
...
@@ -57,6 +58,16 @@ public class MedicalReportParam extends BaseParam<MedicalReport> {
*/
@Parameter
(
description
=
"性别 IN值List"
)
private
List
<
String
>
sexList
;
/**
* 报告类型
*/
@Parameter
(
description
=
"报告类型"
)
private
ReportTypeEnum
reportType
;
/**
* 报告类型 IN值List
*/
@Parameter
(
description
=
"报告类型 IN值List"
)
private
List
<
String
>
reportTypeList
;
/**
* 患者年龄
*/
...
...
@@ -208,6 +219,8 @@ public class MedicalReportParam extends BaseParam<MedicalReport> {
}
wrapper
.
eq
(
this
.
getSex
()
!=
null
,
columnPrefix
+
"sex"
,
this
.
getSex
());
wrapper
.
in
(
this
.
getSexList
()
!=
null
&&
this
.
getSexList
().
size
()
>
0
,
columnPrefix
+
"sex"
,
this
.
getSexList
());
wrapper
.
eq
(
this
.
getReportType
()
!=
null
,
columnPrefix
+
"report_type"
,
this
.
getReportType
());
wrapper
.
in
(
this
.
getReportTypeList
()
!=
null
&&
this
.
getReportTypeList
().
size
()
>
0
,
columnPrefix
+
"report_type"
,
this
.
getReportTypeList
());
wrapper
.
eq
(
this
.
getAge
()
!=
null
,
columnPrefix
+
"age"
,
this
.
getAge
());
if
(
this
.
getReportItem
()
!=
null
)
{
if
(
this
.
getReportItem
().
startsWith
(
"%"
)
&&
this
.
getReportItem
().
endsWith
(
"%"
))
{
...
...
src/main/java/com/xwd/hospital/server/rest/thirdPartReq/UnlimitedQRCodeReq.java
0 → 100644
浏览文件 @
d979fb09
package
com
.
xwd
.
hospital
.
server
.
rest
.
thirdPartReq
;
import
lombok.Data
;
@Data
public
class
UnlimitedQRCodeReq
{
private
String
scene
;
private
String
page
;
private
String
env_version
;
}
src/main/java/com/xwd/hospital/server/rest/thirdPartReq/UnlimitedQRCodeRes.java
0 → 100644
浏览文件 @
d979fb09
package
com
.
xwd
.
hospital
.
server
.
rest
.
thirdPartReq
;
import
lombok.Data
;
@Data
public
class
UnlimitedQRCodeRes
{
private
byte
[]
buffer
;
private
String
errmsg
;
private
Integer
errcode
;
}
src/main/java/com/xwd/hospital/server/service/MiniAppApiService.java
0 → 100644
浏览文件 @
d979fb09
package
com
.
xwd
.
hospital
.
server
.
service
;
import
com.google.gson.JsonObject
;
import
com.squareup.okhttp.ResponseBody
;
import
com.xwd.hospital.server.rest.thirdPartReq.BindIMUserReq
;
import
com.xwd.hospital.server.rest.thirdPartReq.UnlimitedQRCodeReq
;
import
com.xwd.hospital.server.rest.thirdPartReq.UnlimitedQRCodeRes
;
import
retrofit2.Call
;
import
retrofit2.http.Body
;
import
retrofit2.http.POST
;
import
retrofit2.http.Query
;
public
interface
MiniAppApiService
{
@POST
(
"/wxa/getwxacodeunlimit"
)
Call
<?>
getUnlimitedQRCode
(
@Body
UnlimitedQRCodeReq
body
,
@Query
(
"access_token"
)
String
accessToken
);
}
src/main/java/com/xwd/hospital/server/service/UserService.java
浏览文件 @
d979fb09
...
...
@@ -8,6 +8,7 @@
package
com
.
xwd
.
hospital
.
server
.
service
;
import
java.nio.Buffer
;
import
java.util.List
;
import
com.xwd.hospital.server.base.BaseService
;
import
com.xwd.hospital.server.domain.User
;
...
...
@@ -83,6 +84,8 @@ public interface UserService extends BaseService<User> {
*/
String
getIMSig
(
Long
userId
);
byte
[]
getWxQrCode
(
Long
userId
);
public
void
addUserToIMSystem
(
String
imUserId
,
String
nickName
,
String
headUrl
);
}
src/main/java/com/xwd/hospital/server/service/impl/CouponInfoServiceImpl.java
浏览文件 @
d979fb09
...
...
@@ -11,6 +11,9 @@ package com.xwd.hospital.server.service.impl;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
cn.dev33.satoken.stp.StpUtil
;
import
com.xwd.hospital.server.domain.CouponSendRecord
;
import
com.xwd.hospital.server.domain.OperationLog
;
import
com.xwd.hospital.server.domain.UserCouponInfo
;
import
com.xwd.hospital.server.dto.ConsumerCouponInfoDto
;
import
com.baomidou.mybatisplus.core.enums.SqlMethod
;
...
...
@@ -18,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.baomidou.mybatisplus.extension.toolkit.SqlHelper
;
import
com.xwd.hospital.server.enums.CouponUseStateEnum
;
import
com.xwd.hospital.server.enums.YesNoEnum
;
import
com.xwd.hospital.server.service.CouponSendRecordService
;
import
com.xwd.hospital.server.service.UserCouponInfoService
;
import
jakarta.annotation.Resource
;
import
org.springframework.stereotype.Service
;
...
...
@@ -32,6 +36,8 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
@Resource
private
UserCouponInfoService
userCouponInfoService
;
@Resource
private
CouponSendRecordService
recordService
;
@Override
public
int
updateAllFieldsById
(
CouponInfo
entity
)
{
...
...
@@ -54,6 +60,7 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
@Override
public
boolean
consumerCoupons
(
ConsumerCouponInfoDto
dto
)
{
Object
userId
=
StpUtil
.
getExtra
(
"userId"
);
CouponInfo
couponInfo
=
this
.
getById
(
dto
.
getCouponId
());
//todo 全体发优惠券
if
(
dto
.
getIsAll
()){
...
...
@@ -61,7 +68,9 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
}
else
{
if
(
null
!=
dto
.
getConsumerList
()
&&
dto
.
getConsumerList
().
size
()>
0
){
ArrayList
<
UserCouponInfo
>
list
=
new
ArrayList
<>(
dto
.
getConsumerList
().
size
());
// ArrayList<UserCouponInfo> list = new ArrayList<>(dto.getConsumerList().size());
// ArrayList<CouponSendRecord> records = new ArrayList<>(dto.getConsumerList().size());
for
(
Long
consumerId:
dto
.
getConsumerList
())
{
UserCouponInfo
userCouponInfo
=
new
UserCouponInfo
();
userCouponInfo
.
setUserInfoId
(
consumerId
);
...
...
@@ -72,9 +81,19 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
userCouponInfo
.
setCouponStartDate
(
couponInfo
.
getCouponStartDate
());
userCouponInfo
.
setCouponEndDate
(
couponInfo
.
getCouponEndDate
());
userCouponInfo
.
setCouponUseState
(
CouponUseStateEnum
.
USEABLE
);
list
.
add
(
userCouponInfo
);
userCouponInfoService
.
save
(
userCouponInfo
);
CouponSendRecord
record
=
new
CouponSendRecord
();
record
.
setCouponId
(
dto
.
getCouponId
());
record
.
setUserCouponId
(
userCouponInfo
.
getId
());
record
.
setCouponName
(
couponInfo
.
getCouponName
());
record
.
setCouponType
(
couponInfo
.
getCouponType
());
record
.
setCouponDiscount
(
couponInfo
.
getCouponDiscount
());
record
.
setSendId
(
Long
.
valueOf
(
userId
.
toString
()));
record
.
setUserInfoId
(
consumerId
);
recordService
.
save
(
record
);
}
userCouponInfoService
.
saveBatch
(
list
);
}
}
...
...
src/main/java/com/xwd/hospital/server/service/impl/MedicalReportServiceImpl.java
浏览文件 @
d979fb09
...
...
@@ -116,6 +116,7 @@ public class MedicalReportServiceImpl extends ServiceImpl<MedicalReportMapper, M
medicalReport
.
setReportItem
(
dto
.
getReportItem
());
medicalReport
.
setReportDeclare
(
dto
.
getReportDeclare
());
medicalReport
.
setReportTime
(
dto
.
getReportTime
());
medicalReport
.
setReportType
(
dto
.
getReportType
());
this
.
save
(
medicalReport
);
if
(
null
!=
dto
.
getPictureList
()
...
...
src/main/java/com/xwd/hospital/server/service/impl/UserServiceImpl.java
浏览文件 @
d979fb09
...
...
@@ -11,6 +11,7 @@ package com.xwd.hospital.server.service.impl;
import
java.io.IOException
;
import
java.lang.reflect.Field
;
import
java.math.BigDecimal
;
import
java.nio.Buffer
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -24,6 +25,7 @@ import cn.hutool.core.lang.UUID;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdcardUtil
;
import
com.google.gson.JsonObject
;
import
com.squareup.okhttp.ResponseBody
;
import
com.tencentyun.TLSSigAPIv2
;
import
com.xwd.hospital.server.config.WxMaProperties
;
import
com.xwd.hospital.server.constants.Constant
;
...
...
@@ -34,10 +36,7 @@ import com.xwd.hospital.server.dto.UpdateInfoDto;
import
com.xwd.hospital.server.dto.UpdateUserInfoDto
;
import
com.xwd.hospital.server.dto.UserDto
;
import
com.xwd.hospital.server.enums.*
;
import
com.xwd.hospital.server.rest.thirdPartReq.BindIMUserReq
;
import
com.xwd.hospital.server.rest.thirdPartReq.BindNumberReq
;
import
com.xwd.hospital.server.rest.thirdPartReq.ProfileItem
;
import
com.xwd.hospital.server.rest.thirdPartReq.UpdateIMUserReq
;
import
com.xwd.hospital.server.rest.thirdPartReq.*
;
import
com.xwd.hospital.server.service.*
;
import
jakarta.annotation.Resource
;
import
com.baomidou.mybatisplus.core.enums.SqlMethod
;
...
...
@@ -50,6 +49,9 @@ import okhttp3.OkHttpClient;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.xwd.hospital.server.repository.UserMapper
;
...
...
@@ -58,6 +60,9 @@ import com.xwd.hospital.server.rest.res.ApiCode;
import
cn.dev33.satoken.secure.SaSecureUtil
;
import
com.xwd.hospital.server.repository.RoleMapper
;
import
com.xwd.hospital.server.repository.UserRoleMapper
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.client.RestTemplate
;
import
retrofit2.Call
;
import
retrofit2.Response
;
import
retrofit2.Retrofit
;
...
...
@@ -105,6 +110,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Value
(
"${tencent.IM.host}"
)
public
String
imHost
;
public
String
miniAppHost
=
"https://api.weixin.qq.com"
;
@Override
public
int
updateAllFieldsById
(
User
entity
)
{
return
this
.
getBaseMapper
().
updateAllFieldsById
(
entity
);
...
...
@@ -764,4 +771,38 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
}
@Override
public
byte
[]
getWxQrCode
(
Long
userId
)
{
//当前用户
User
sysUser
=
this
.
getById
(
userId
);
RestTemplate
rest
=
new
RestTemplate
();
log
.
info
(
"正在为用户生成小程序推广码,用户id{}"
,
sysUser
.
getId
());
//根据小程序登录源,切换相应配置
if
(
sysUser
.
getUserType
()
==
UserTypeEnum
.
PATIENT
){
wxMaService
.
switchover
(
patientAppId
);
}
else
if
(
sysUser
.
getUserType
()
==
UserTypeEnum
.
DOCTOR
){
wxMaService
.
switchover
(
doctorAppId
);
}
try
{
String
accessToken
=
wxMaService
.
getAccessToken
();
String
url
=
"https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="
+
accessToken
;
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"scene"
,
sysUser
.
getImUserId
());
param
.
put
(
"path"
,
"pages/index/index"
);
param
.
put
(
"width"
,
430
);
param
.
put
(
"auto_color"
,
true
);
log
.
info
(
"调用生成微信URL接口传参:"
+
param
);
MultiValueMap
<
String
,
String
>
headers
=
new
LinkedMultiValueMap
<>();
HttpEntity
requestEntity
=
new
HttpEntity
(
param
,
headers
);
ResponseEntity
<
byte
[]>
entity
=
rest
.
exchange
(
url
,
HttpMethod
.
POST
,
requestEntity
,
byte
[].
class
,
new
Object
[
0
]);
log
.
info
(
"调用小程序生成微信永久二维码URL接口返回结果:"
+
entity
.
getBody
());
return
entity
.
getBody
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
src/main/resources/db/migration/V1.0.0__schema.sql
浏览文件 @
d979fb09
...
...
@@ -145,6 +145,7 @@ create table `pms_user_address_info`
city
varchar
(
255
)
not
null
comment
'市'
,
district
varchar
(
255
)
not
null
comment
'区'
,
detail_address
varchar
(
255
)
not
null
comment
'详细地址'
,
default_flag
varchar
(
50
)
not
null
default
'NO'
comment
'是否默认 [YES.是 NO.否]'
,
editor_id
int
(
11
)
not
null
default
1
comment
'操作人Id'
,
editor_name
varchar
(
255
)
not
null
default
'admin'
comment
'操作人'
,
create_time
datetime
not
null
default
CURRENT_TIMESTAMP
comment
'创建时间'
,
...
...
@@ -152,6 +153,19 @@ create table `pms_user_address_info`
primary
key
(
`id`
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_general_ci
comment
=
'用户地址关系表'
;
drop
table
if
exists
`pms_invite_register_record`
;
create
table
`pms_invite_register_record`
(
id
int
(
11
)
auto_increment
not
null
comment
'Id'
,
invite_user_id
int
(
11
)
not
null
comment
'邀请人Id'
,
invited_user_id
int
(
11
)
not
null
comment
'被邀请人Id'
,
editor_id
int
(
11
)
not
null
default
1
comment
'操作人Id'
,
editor_name
varchar
(
255
)
not
null
default
'admin'
comment
'操作人'
,
create_time
datetime
not
null
default
CURRENT_TIMESTAMP
comment
'创建时间'
,
update_time
datetime
not
null
default
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
comment
'更新时间'
,
primary
key
(
`id`
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_general_ci
comment
=
'邀请信息记录表'
;
drop
table
if
exists
`pms_doctor_service_info`
;
create
table
`pms_doctor_service_info`
(
...
...
@@ -232,6 +246,7 @@ create table `pms_medical_report`
patient_name
varchar
(
32
)
not
null
comment
'患者姓名'
,
patient_id_no
varchar
(
32
)
not
null
comment
'患者身份证号码'
,
sex
varchar
(
50
)
not
null
default
'MALE'
comment
'性别 [MALE.男 FEMALE.女]'
,
report_type
varchar
(
50
)
not
null
default
'CT'
comment
'报告类型 [CT.CT报告 INSEPCTION.检验报告]'
,
age
int
(
255
)
not
null
comment
'患者年龄'
,
report_item
varchar
(
512
)
not
null
comment
'影像报告项目'
,
report_declare
varchar
(
512
)
not
null
comment
'影像说明'
,
...
...
@@ -297,6 +312,24 @@ create table `pms_user_coupon_info`
primary
key
(
`id`
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_general_ci
comment
=
'用户优惠券关系表'
;
drop
table
if
exists
`pms_coupon_send_record`
;
create
table
`pms_coupon_send_record`
(
id
int
(
11
)
auto_increment
not
null
comment
'Id'
,
coupon_id
int
(
11
)
not
null
comment
'优惠券Id'
,
user_coupon_id
int
(
11
)
not
null
comment
'用户优惠券关系id'
,
coupon_name
varchar
(
64
)
not
null
comment
'优惠券名称'
,
coupon_type
varchar
(
50
)
not
null
default
'FULL_DISCOUNT'
comment
'优惠券类型 [FULL_DISCOUNT.满减券]'
,
coupon_discount
decimal
(
12
,
2
)
not
null
comment
'优惠金额/折扣'
,
send_id
int
(
11
)
not
null
comment
'发放人员id'
,
user_info_id
int
(
11
)
not
null
comment
'接收人员id'
,
editor_id
int
(
11
)
not
null
default
1
comment
'操作人Id'
,
editor_name
varchar
(
255
)
not
null
default
'admin'
comment
'操作人'
,
create_time
datetime
not
null
default
CURRENT_TIMESTAMP
comment
'创建时间'
,
update_time
datetime
not
null
default
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
comment
'更新时间'
,
primary
key
(
`id`
)
)
engine
=
InnoDB
default
charset
=
utf8mb4
collate
=
utf8mb4_general_ci
comment
=
'优惠券发放记录表'
;
drop
table
if
exists
`pms_user_attention_info`
;
create
table
`pms_user_attention_info`
(
...
...
@@ -672,6 +705,10 @@ create index ix_user_coupon_info_coupon_id on `pms_user_coupon_info` (coupon_id)
create
index
ix_user_coupon_info_coupon_type
on
`pms_user_coupon_info`
(
coupon_type
);
create
index
ix_coupon_send_record_coupon_id
on
`pms_coupon_send_record`
(
coupon_id
);
create
index
ix_coupon_send_record_coupon_type
on
`pms_coupon_send_record`
(
coupon_type
);
create
index
ix_user_attention_info_user_info_id
on
`pms_user_attention_info`
(
user_info_id
);
create
index
ix_user_attention_info_doctor_id
on
`pms_user_attention_info`
(
doctor_id
);
...
...
src/main/resources/mappers/base/MedicalReportBaseMapper.xml
浏览文件 @
d979fb09
...
...
@@ -6,6 +6,7 @@
<result
column=
"patient_name"
jdbcType=
"VARCHAR"
property=
"patientName"
/>
<result
column=
"patient_id_no"
jdbcType=
"VARCHAR"
property=
"patientIdNo"
/>
<result
column=
"sex"
jdbcType=
"VARCHAR"
property=
"sex"
/>
<result
column=
"report_type"
jdbcType=
"VARCHAR"
property=
"reportType"
/>
<result
column=
"age"
jdbcType=
"INTEGER"
property=
"age"
/>
<result
column=
"report_hospital"
jdbcType=
"VARCHAR"
property=
"reportHospital"
/>
<result
column=
"report_doctor"
jdbcType=
"VARCHAR"
property=
"reportDoctor"
/>
...
...
@@ -23,29 +24,27 @@
<result
column=
"doctor_asks"
jdbcType=
"VARCHAR"
property=
"doctorAsks"
/>
<association
column=
"doctor_id"
property=
"doctor"
javaType=
"com.xwd.hospital.server.domain.DoctorInfo"
select=
"com.xwd.hospital.server.repository.DoctorInfoMapper.selectById"
/>
<collection
column=
"id"
property=
"pictureList"
javaType=
"list"
select=
"com.xwd.hospital.server.repository.MedicalReportPictureMapper.selectByReportId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
`id`, `patient_name`, `patient_id_no`, `sex`, `age`, `report_hospital`, `report_doctor`, `report_time`, `report_state`, `doctor_id`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `patient_name`, `patient_id_no`, `sex`, `
report_type`, `
age`, `report_hospital`, `report_doctor`, `report_time`, `report_state`, `doctor_id`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql
id=
"Base_Column_List_With_Prefix"
>
t.`id`, t.`patient_name`, t.`patient_id_no`, t.`sex`, t.`age`, t.`report_hospital`, t.`report_doctor`, t.`report_time`, t.`report_state`, t.`doctor_id`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`patient_name`, t.`patient_id_no`, t.`sex`, t.`
report_type`, t.`
age`, t.`report_hospital`, t.`report_doctor`, t.`report_time`, t.`report_state`, t.`doctor_id`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<sql
id=
"Base_Column_List_Full"
>
`id`, `patient_name`, `patient_id_no`, `sex`, `age`, `report_item`, `report_declare`, `report_hospital`, `report_doctor`, `report_time`, `report_state`, `doctor_id`, `doctor_asks`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `patient_name`, `patient_id_no`, `sex`, `
report_type`, `
age`, `report_item`, `report_declare`, `report_hospital`, `report_doctor`, `report_time`, `report_state`, `doctor_id`, `doctor_asks`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql
id=
"Base_Column_List_Full_With_Prefix"
>
t.`id`, t.`patient_name`, t.`patient_id_no`, t.`sex`, t.`age`, t.`report_item`, t.`report_declare`, t.`report_hospital`, t.`report_doctor`, t.`report_time`, t.`report_state`, t.`doctor_id`, t.`doctor_asks`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`patient_name`, t.`patient_id_no`, t.`sex`, t.`
report_type`, t.`
age`, t.`report_item`, t.`report_declare`, t.`report_hospital`, t.`report_doctor`, t.`report_time`, t.`report_state`, t.`doctor_id`, t.`doctor_asks`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert
id=
"batchInsert"
>
insert into pms_medical_report (
`patient_name`, `patient_id_no`, `sex`, `age`, `report_item`, `report_declare`, `report_hospital`, `report_doctor`, `report_time`, `report_state`, `doctor_id`, `doctor_asks`, `editor_id`, `editor_name`
`patient_name`, `patient_id_no`, `sex`, `
report_type`, `
age`, `report_item`, `report_declare`, `report_hospital`, `report_doctor`, `report_time`, `report_state`, `doctor_id`, `doctor_asks`, `editor_id`, `editor_name`
)
values
<foreach
collection=
"records"
item=
"record"
separator=
","
>
(
#{record.patientName, jdbcType=VARCHAR}, #{record.patientIdNo, jdbcType=VARCHAR}, #{record.sex, jdbcType=VARCHAR}, #{record.age, jdbcType=INTEGER}, #{record.reportItem, jdbcType=VARCHAR}, #{record.reportDeclare, jdbcType=VARCHAR}, #{record.reportHospital, jdbcType=VARCHAR}, #{record.reportDoctor, jdbcType=VARCHAR}, #{record.reportTime, jdbcType=TIMESTAMP}, #{record.reportState, jdbcType=VARCHAR}, #{record.doctorId, jdbcType=BIGINT}, #{record.doctorAsks, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.patientName, jdbcType=VARCHAR}, #{record.patientIdNo, jdbcType=VARCHAR}, #{record.sex, jdbcType=VARCHAR}, #{record.
reportType, jdbcType=VARCHAR}, #{record.
age, jdbcType=INTEGER}, #{record.reportItem, jdbcType=VARCHAR}, #{record.reportDeclare, jdbcType=VARCHAR}, #{record.reportHospital, jdbcType=VARCHAR}, #{record.reportDoctor, jdbcType=VARCHAR}, #{record.reportTime, jdbcType=TIMESTAMP}, #{record.reportState, jdbcType=VARCHAR}, #{record.doctorId, jdbcType=BIGINT}, #{record.doctorAsks, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
...
...
@@ -55,6 +54,7 @@
patient_name = #{et.patientName, jdbcType=VARCHAR},
patient_id_no = #{et.patientIdNo, jdbcType=VARCHAR},
sex = #{et.sex, jdbcType=VARCHAR},
report_type = #{et.reportType, jdbcType=VARCHAR},
age = #{et.age, jdbcType=INTEGER},
report_item = #{et.reportItem, jdbcType=VARCHAR},
report_declare = #{et.reportDeclare, jdbcType=VARCHAR},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论