提交 cf66717a 编写于 作者: wangyongbo's avatar wangyongbo

修改刷数据逻辑2

上级 8e213372
...@@ -108,20 +108,10 @@ public class RefreshServiceImpl implements RefreshService { ...@@ -108,20 +108,10 @@ public class RefreshServiceImpl implements RefreshService {
List<PatPatient> patPatients = refreshMapper.queryListPatByIds(strIds); List<PatPatient> patPatients = refreshMapper.queryListPatByIds(strIds);
if (CollectionUtils.isNotEmpty(patPatients)) { if (CollectionUtils.isNotEmpty(patPatients)) {
List<PatPatient> wechatPats = new ArrayList<>(); List<PatPatient> wechatPats = new ArrayList<>();
List<PatPatient> importPats = new ArrayList<>();
for (PatPatient pat : patPatients) { for (PatPatient pat : patPatients) {
/**校验是否有已存在业务,商城、服务包、微信绑定*/ /**校验是否有已存在业务,商城、服务包、微信绑定*/
if (refreshMapper.validateTradeOrder(pat.getId()) > 0 || refreshMapper.validateAddress(pat.getId()) > 0
|| refreshMapper.validateFollowUp(pat.getId()) > 0) {
continue;
} else {
if (refreshMapper.validateWechat(pat.getId()) > 0 && StringUtil.isNull(pat.getMobilePhone())) { if (refreshMapper.validateWechat(pat.getId()) > 0 && StringUtil.isNull(pat.getMobilePhone())) {
wechatPats.add(pat); wechatPats.add(pat);
} else {
if (StringUtil.isNull(pat.getMobilePhone())) {
importPats.add(pat);
}
}
} }
} }
...@@ -133,22 +123,6 @@ public class RefreshServiceImpl implements RefreshService { ...@@ -133,22 +123,6 @@ public class RefreshServiceImpl implements RefreshService {
refreshMapper.updateRepeatById2(repeat.getId()); refreshMapper.updateRepeatById2(repeat.getId());
} }
if (CollectionUtils.isNotEmpty(importPats) && importPats.size() == importPats.size()) {
importPats.remove(0);
if (CollectionUtils.isNotEmpty(importPats)) {
for (PatPatient pat : importPats) {
if (pat.getId() != null) {
refreshMapper.deletePat(pat.getId());
refreshMapper.deletePatInfo(pat.getId());
refreshMapper.deleteDocPat(pat.getId());
refreshMapper.deleteDocPatInfo(pat.getId());
refreshIndex++;
}
}
refreshMapper.updateRepeatById3(repeat.getId());
}
}
} }
} }
} }
......
...@@ -52,6 +52,4 @@ public interface RefreshMapper { ...@@ -52,6 +52,4 @@ public interface RefreshMapper {
void updateRepeatById2(@Param("id") Integer id); void updateRepeatById2(@Param("id") Integer id);
void updateRepeatById3(@Param("id") Integer id);
} }
\ No newline at end of file
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<select id="validateWechat" parameterType="java.lang.Integer" resultType="java.lang.Integer"> <select id="validateWechat" parameterType="java.lang.Integer" resultType="java.lang.Integer">
select select
count(1) count(1)
from pat_wechat_union from pat_wechat_user
where patient_id = #{id} where patient_id = #{id}
and delete_flag = 1 and delete_flag = 1
</select> </select>
...@@ -200,10 +200,5 @@ ...@@ -200,10 +200,5 @@
where id = #{id} where id = #{id}
</update> </update>
<update id="updateRepeatById3" parameterType="com.pica.cloud.wechat.yunqueyilian.server.controller.refresh.PatPatient">
update pat_patient_repeat_1102
set delete_flag = 3
where id = #{id}
</update>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册