Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-yunqueyilian
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.wechat
pica-cloud-yunqueyilian
提交
00a1921d
提交
00a1921d
编写于
12月 28, 2021
作者:
minghao.wu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release' into 'master'
Release See merge request
!18
上级
5ecfa89b
604c69e1
流水线
#41008
已失败 于阶段
变更
5
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
102 行增加
和
214 行删除
+102
-214
RefreshController.java
...ueyilian/server/controller/refresh/RefreshController.java
+5
-3
RefreshService.java
...unqueyilian/server/controller/refresh/RefreshService.java
+1
-1
RefreshServiceImpl.java
...eyilian/server/controller/refresh/RefreshServiceImpl.java
+28
-76
RefreshMapper.java
...loud/wechat/yunqueyilian/server/mapper/RefreshMapper.java
+8
-13
RefreshMapper.xml
server/src/main/resources/mybatis/RefreshMapper.xml
+60
-121
未找到文件。
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/controller/refresh/RefreshController.java
浏览文件 @
00a1921d
...
@@ -68,15 +68,17 @@ public class RefreshController extends BaseController {
...
@@ -68,15 +68,17 @@ public class RefreshController extends BaseController {
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
SUCCESS
);
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
SUCCESS
);
}
}
@LoginPermission
@LoginPermission
@PostMapping
(
"/
real
"
)
@PostMapping
(
"/
delPat
"
)
public
PicaResponse
rea
lPat
(
@RequestParam
(
"id"
)
Integer
id
)
{
public
PicaResponse
de
lPat
(
@RequestParam
(
"id"
)
Integer
id
)
{
PicaUser
picaUser
=
fetchPicaUser
();
PicaUser
picaUser
=
fetchPicaUser
();
if
(
picaUser
.
getId
()
==
766
)
{
if
(
picaUser
.
getId
()
==
766
)
{
refreshService
.
rea
lPat
(
id
);
refreshService
.
de
lPat
(
id
);
}
}
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
SUCCESS
);
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
SUCCESS
);
}
}
}
}
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/controller/refresh/RefreshService.java
浏览文件 @
00a1921d
...
@@ -21,5 +21,5 @@ public interface RefreshService {
...
@@ -21,5 +21,5 @@ public interface RefreshService {
void
patDocMapping2
(
Integer
id
);
void
patDocMapping2
(
Integer
id
);
void
rea
lPat
(
Integer
id
);
void
de
lPat
(
Integer
id
);
}
}
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/controller/refresh/RefreshServiceImpl.java
浏览文件 @
00a1921d
...
@@ -58,10 +58,10 @@ public class RefreshServiceImpl implements RefreshService {
...
@@ -58,10 +58,10 @@ public class RefreshServiceImpl implements RefreshService {
if
(
CollectionUtils
.
isNotEmpty
(
patRealList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
patRealList
))
{
for
(
PatPatient
patReal
:
patRealList
)
{
for
(
PatPatient
patReal
:
patRealList
)
{
if
(
patReal
.
getId
()
!=
null
)
{
if
(
patReal
.
getId
()
!=
null
)
{
refreshMapper
.
deletePat
(
patReal
.
getId
());
//
refreshMapper.deletePat(patReal.getId());
refreshMapper
.
deletePatInfo
(
patReal
.
getId
());
//
refreshMapper.deletePatInfo(patReal.getId());
refreshMapper
.
deleteDocPat
(
patReal
.
getId
());
//
refreshMapper.deleteDocPat(patReal.getId());
refreshMapper
.
deleteDocPatInfo
(
patReal
.
getId
());
//
refreshMapper.deleteDocPatInfo(patReal.getId());
refreshMapper
.
updateRepeat
(
patReal
);
refreshMapper
.
updateRepeat
(
patReal
);
refreshIndex
++;
refreshIndex
++;
}
}
...
@@ -114,10 +114,10 @@ public class RefreshServiceImpl implements RefreshService {
...
@@ -114,10 +114,10 @@ public class RefreshServiceImpl implements RefreshService {
wechatPats
.
add
(
pat
);
wechatPats
.
add
(
pat
);
}
else
{
}
else
{
if
(
StringUtil
.
isNull
(
pat
.
getMobilePhone
()))
{
if
(
StringUtil
.
isNull
(
pat
.
getMobilePhone
()))
{
refreshMapper
.
deletePat
(
pat
.
getId
());
//
refreshMapper.deletePat(pat.getId());
refreshMapper
.
deletePatInfo
(
pat
.
getId
());
//
refreshMapper.deletePatInfo(pat.getId());
refreshMapper
.
deleteDocPat
(
pat
.
getId
());
//
refreshMapper.deleteDocPat(pat.getId());
refreshMapper
.
deleteDocPatInfo
(
pat
.
getId
());
//
refreshMapper.deleteDocPatInfo(pat.getId());
}
}
}
}
}
}
...
@@ -137,76 +137,28 @@ public class RefreshServiceImpl implements RefreshService {
...
@@ -137,76 +137,28 @@ public class RefreshServiceImpl implements RefreshService {
}
}
@Override
@Override
public
void
realPat
(
Integer
id
)
{
public
void
delPat
(
Integer
id
)
{
int
index
=
0
;
logger
.
info
(
"开始处理数据delPat:"
);
int
docIndex
=
0
;
long
start
=
System
.
currentTimeMillis
();
int
docLogIndex
=
0
;
List
<
PatPatient
>
list
=
refreshMapper
.
queryDelPatList
(
id
);
long
begin
=
System
.
currentTimeMillis
();
while
(
CollectionUtils
.
isNotEmpty
(
list
))
{
while
(
true
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
+=
100
)
{
List
<
PatPatientReal
>
list
=
refreshMapper
.
queryRealPatientList
(
id
);
int
end
=
list
.
size
()
>
(
i
+
100
)
?
(
i
+
100
)
:
list
.
size
();
if
(
CollectionUtils
.
isEmpty
(
list
))
{
List
<
PatPatient
>
subList
=
list
.
subList
(
i
,
end
);
long
end
=
System
.
currentTimeMillis
();
refreshMapper
.
deletePat
(
subList
);
logger
.
info
(
"刷新数据结束:共处理:【"
+
index
+
"】条real,【"
+
docIndex
+
"】条docPatReal, 【"
+
docLogIndex
+
"】条docPatRealLog,消耗:【"
+
(
end
-
begin
)
/
1000
+
"】s"
);
refreshMapper
.
deletePatInfo
(
subList
);
break
;
refreshMapper
.
deleteDocPat
(
subList
);
}
refreshMapper
.
deleteDocPatInfo
(
subList
);
for
(
PatPatientReal
realPatient
:
list
)
{
refreshMapper
.
deleteLabel
(
subList
);
if
(
refreshMapper
.
queryRealPatient
(
realPatient
.
getPatientId
())
==
null
)
{
refreshMapper
.
deletePlan
(
subList
);
refreshMapper
.
deletePlan2
(
subList
);
PatPatientReal
real
=
new
PatPatientReal
();
logger
.
info
(
"处理数据中delPat:"
+
i
);
real
.
setId
(
realPatient
.
getId
());
real
.
setPatientId
(
realPatient
.
getPatientId
());
real
.
setNickname
(
realPatient
.
getNickname
());
real
.
setMobilePhone
(
realPatient
.
getMobilePhone
());
real
.
setStatus
(
realPatient
.
getStatus
());
real
.
setDeleteFlag
(
realPatient
.
getDeleteFlag
());
real
.
setCreatedId
(
realPatient
.
getCreatedId
());
real
.
setCreatedTime
(
realPatient
.
getCreatedTime
());
real
.
setModifiedId
(
realPatient
.
getModifiedId
());
real
.
setModifiedTime
(
realPatient
.
getModifiedTime
());
//验真通过赋值5字段
if
(
realPatient
.
getStatus
()
==
2
)
{
//验真类型:1、验证码验真 2、短信回复验真 3、小程序验真 4、手机号姓名跟医生一致自动验真
real
.
setValidateType
(
realPatient
.
getValidateType
());
//验真的验证码:若验真类型是1和2,则有值
if
(
real
.
getValidateType
()
==
1
||
real
.
getValidateType
()
==
2
)
{
real
.
setValidateCode
(
realPatient
.
getValidateCode
());
}
//验真时间
real
.
setValidateTime
(
realPatient
.
getModifiedTime
());
//验真人类型:1、医生 2、居民 和 验真人id
if
(
real
.
getValidateType
()
==
1
||
real
.
getValidateType
()
==
4
)
{
real
.
setValidateUserType
(
1
);
real
.
setValidateUserId
(
realPatient
.
getModifiedId
());
}
else
{
real
.
setValidateUserType
(
2
);
real
.
setValidateUserId
(
realPatient
.
getPatientId
());
}
}
refreshMapper
.
insertRealPatient
(
real
);
index
++;
/**新增mapping表*/
List
<
PatDocPatReal
>
patDocList
=
refreshMapper
.
queryRealPatDocList
(
realPatient
.
getPatientId
());
if
(
CollectionUtils
.
isNotEmpty
(
patDocList
))
{
for
(
PatDocPatReal
docPatReal
:
patDocList
)
{
if
(
refreshMapper
.
queryRealPatDoc
(
docPatReal
.
getPatientId
(),
docPatReal
.
getDoctorId
())
==
null
)
{
refreshMapper
.
insertRealDocPat
(
docPatReal
);
docIndex
++;
}
refreshMapper
.
insertRealDocPatLog
(
docPatReal
);
docLogIndex
++;
}
}
logger
.
info
(
"开始处理数据:第"
+
index
+
"条, patientId="
+
realPatient
.
getPatientId
()
+
",id="
+
realPatient
.
getId
());
}
id
=
realPatient
.
getId
();
}
}
id
=
list
.
get
(
list
.
size
()
-
1
).
getId
();
list
=
refreshMapper
.
queryDelPatList
(
id
);
}
}
long
end
=
System
.
currentTimeMillis
();
logger
.
info
(
"结束处理数据delPat:消耗:"
+
(
end
-
start
)
/
1000
+
"【s】"
);
}
}
}
}
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/mapper/RefreshMapper.java
浏览文件 @
00a1921d
...
@@ -22,13 +22,13 @@ public interface RefreshMapper {
...
@@ -22,13 +22,13 @@ public interface RefreshMapper {
Integer
validateWechat
(
@Param
(
"id"
)
Integer
id
);
Integer
validateWechat
(
@Param
(
"id"
)
Integer
id
);
void
deletePat
(
@Param
(
"id"
)
Integer
id
);
void
deletePat
(
List
<
PatPatient
>
subList
);
void
deletePatInfo
(
@Param
(
"id"
)
Integer
id
);
void
deletePatInfo
(
List
<
PatPatient
>
subList
);
void
deleteDocPat
(
@Param
(
"id"
)
Integer
id
);
void
deleteDocPat
(
List
<
PatPatient
>
subList
);
void
deleteDocPatInfo
(
@Param
(
"id"
)
Integer
id
);
void
deleteDocPatInfo
(
List
<
PatPatient
>
subList
);
void
updateRepeat
(
PatPatient
info
);
void
updateRepeat
(
PatPatient
info
);
...
@@ -50,17 +50,12 @@ public interface RefreshMapper {
...
@@ -50,17 +50,12 @@ public interface RefreshMapper {
void
updateRepeatById2
(
@Param
(
"id"
)
Integer
id
);
void
updateRepeatById2
(
@Param
(
"id"
)
Integer
id
);
List
<
PatPatient
Real
>
queryRealPatien
tList
(
@Param
(
"id"
)
Integer
id
);
List
<
PatPatient
>
queryDelPa
tList
(
@Param
(
"id"
)
Integer
id
);
RealPatient
queryRealPatient
(
@Param
(
"patientId"
)
Integer
patientId
);
void
deleteLabel
(
List
<
PatPatient
>
subList
);
void
insertRealPatient
(
PatPatientReal
real
);
void
deletePlan
(
List
<
PatPatient
>
subList
);
void
insertRealDocPat
(
PatDocPatReal
docPatReal
);
void
deletePlan2
(
List
<
PatPatient
>
subList
);
List
<
PatDocPatReal
>
queryRealPatDocList
(
@Param
(
"patientId"
)
Integer
patientId
);
RealPatient
queryRealPatDoc
(
@Param
(
"patientId"
)
Integer
patientId
,
@Param
(
"doctorId"
)
Integer
doctorId
);
void
insertRealDocPatLog
(
PatDocPatReal
docPatReal
);
}
}
\ No newline at end of file
server/src/main/resources/mybatis/RefreshMapper.xml
浏览文件 @
00a1921d
...
@@ -63,7 +63,11 @@
...
@@ -63,7 +63,11 @@
set delete_flag = 2,
set delete_flag = 2,
modified_id = 3,
modified_id = 3,
modified_time = now()
modified_time = now()
where id = #{id}
where delete_flag = 1
and id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item.id}
</foreach>
</update>
</update>
<update
id=
"deletePatInfo"
parameterType=
"java.lang.Integer"
>
<update
id=
"deletePatInfo"
parameterType=
"java.lang.Integer"
>
...
@@ -71,7 +75,11 @@
...
@@ -71,7 +75,11 @@
set delete_flag = 2,
set delete_flag = 2,
modified_id = 3,
modified_id = 3,
modified_time = now()
modified_time = now()
where patient_id = #{id}
where delete_flag = 1
and patient_id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item.id}
</foreach>
</update>
</update>
<update
id=
"deleteDocPat"
parameterType=
"java.lang.Integer"
>
<update
id=
"deleteDocPat"
parameterType=
"java.lang.Integer"
>
...
@@ -79,7 +87,11 @@
...
@@ -79,7 +87,11 @@
set delete_flag = 2,
set delete_flag = 2,
modified_id = 3,
modified_id = 3,
modified_time = now()
modified_time = now()
where patient_id = #{id}
where delete_flag = 1
and patient_id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item.id}
</foreach>
</update>
</update>
<update
id=
"deleteDocPatInfo"
parameterType=
"java.lang.Integer"
>
<update
id=
"deleteDocPatInfo"
parameterType=
"java.lang.Integer"
>
...
@@ -87,7 +99,11 @@
...
@@ -87,7 +99,11 @@
set delete_flag = 2,
set delete_flag = 2,
modified_id = 3,
modified_id = 3,
modified_time = now()
modified_time = now()
where patient_id = #{id}
where delete_flag = 1
and patient_id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item.id}
</foreach>
</update>
</update>
<update
id=
"updateRepeat"
parameterType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatPatient"
>
<update
id=
"updateRepeat"
parameterType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatPatient"
>
...
@@ -200,129 +216,52 @@
...
@@ -200,129 +216,52 @@
where id = #{id}
where id = #{id}
</update>
</update>
<select
id=
"queryRealPatientList"
<select
id=
"queryDelPatList"
parameterType=
"java.lang.Object"
resultType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatPatient"
>
resultType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatPatientReal"
>
select
select id as id,
id,
patient_id as patientId,
nickname as nickname,
nickname as nickname,
mobile_phone as mobilePhone
mobile_phone as mobilePhone,
from pat_patient_del_0310
status as status,
type as type,
validate_code as validateCode,
validate_type as validateType,
delete_flag AS deleteFlag,
created_id as createdId,
created_time as createdTime,
modified_id as modifiedId,
modified_time as modifiedTime
from pica_trade.trade_mobile_phone_real
where id > #{id}
where id > #{id}
order by id
order by id
limit
0,
10000
limit 10000
</select>
</select>
<select
id=
"queryRealPatient"
resultType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.RealPatient"
>
select id as id,
patient_id as patientId
from pat_patient_real
where patient_id = #{patientId}
and delete_flag = 1
</select>
<insert
id=
"insertRealPatient"
>
insert into pat_patient_real (id, patient_id, nickname,
mobile_phone, status, validate_type,
validate_code, validate_time, validate_user_type,
validate_user_id, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{id,jdbcType=INTEGER}, #{patientId,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR},
#{mobilePhone,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{validateType,jdbcType=TINYINT},
#{validateCode,jdbcType=VARCHAR}, #{validateTime,jdbcType=TIMESTAMP}, #{validateUserType,jdbcType=INTEGER},
#{validateUserId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=TINYINT}, #{createdId,jdbcType=INTEGER},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertRealDocPat"
parameterType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatDocPatReal"
>
<update
id=
"deleteLabel"
parameterType=
"java.lang.Integer"
>
insert into pat_doc_pat_real (doctor_id, patient_id,
update lab_custom_label
type, validate_code, delete_flag,
set delete_flag = 2,
created_id, created_time, modified_id,
modified_id = 3,
modified_time)
modified_time = now()
values (#{doctorId,jdbcType=INTEGER}, #{patientId,jdbcType=INTEGER},
where delete_flag = 1
#{type,jdbcType=TINYINT}, #{validateCode,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=TINYINT},
and patient_id in
#{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER},
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{modifiedTime,jdbcType=TIMESTAMP}
#{item.id}
)
</foreach>
</insert>
</update>
<select
id=
"queryRealPatDocList"
resultType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatDocPatReal"
>
select
tmp.patient_id as patientId,
tor.prescriber_id as doctorId,
tor.user_type as type,
case when tor.user_type = 1 then tmp.validate_code else '' end as validateCode,
tmp.delete_flag AS deleteFlag,
tor.prescriber_id as createdId,
toa.created_time as createdTime,
tor.prescriber_id as modifiedId,
toa.created_time as modifiedTime
from
pica_trade.trade_mobile_phone_real tmp,
pica_trade.trade_order_address toa,
pica_trade.trade_order tor
where toa.order_no = tor.id
and tmp.patient_id = toa.patient_id
and tmp.delete_flag = 1
and toa.delete_flag = 1
and tor.delete_flag = 1
and tmp.patient_id = #{patientId}
union all
select
<update
id=
"deletePlan"
parameterType=
"java.lang.Integer"
>
tmp.patient_id as patientId,
update pica_follow_up.fu_plan_patients
fpor.doctor_id as doctorId,
set delete_flag = 2,
3 as type,
modified_id = 3,
'' as validateCode,
modified_time = now()
tmp.delete_flag AS deleteFlag,
where delete_flag = 1
fpor.doctor_id as createdId,
and patient_id in
fpor.created_time as createdTime,
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
fpor.doctor_id as modifiedId,
#{item.id}
fpor.created_time as modifiedTime
</foreach>
from
</update>
pica_trade.trade_mobile_phone_real tmp,
pica_follow_up.fu_plan_order_scales fpor
where tmp.patient_id = fpor.patient_id
and tmp.delete_flag = 1
and fpor.delete_flag = 1
and tmp.patient_id = #{patientId}
</select>
<select
id=
"queryRealPatDoc"
<update
id=
"deletePlan2"
parameterType=
"java.lang.Integer"
>
resultType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.RealPatient"
>
update pica_follow_up.fu_plan_patients_edu_push
select id as id,
set delete_flag = 2,
patient_id as patientId
modified_id = 3,
from pat_doc_pat_real
modified_time = now()
where patient_id = #{patientId}
where delete_flag = 1
and doctor_id = #{doctorId}
and patient_id in
and delete_flag = 1
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
</select>
#{item.id}
</foreach>
</update>
<insert
id=
"insertRealDocPatLog"
parameterType=
"com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatDocPatReal"
>
insert into pat_doc_pat_real_log (doctor_id, patient_id,
type, validate_code, delete_flag,
created_id, created_time, modified_id,
modified_time)
values (#{doctorId,jdbcType=INTEGER}, #{patientId,jdbcType=INTEGER},
#{type,jdbcType=TINYINT}, #{validateCode,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=TINYINT},
#{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER},
#{modifiedTime,jdbcType=TIMESTAMP}
)
</insert>
</mapper>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录