Commit a14235532071b1818ee4ccfa55bc69d58d1c71a9
1 parent
603ae45c13
Exists in
master
HIS上传逻辑事务异常处理
Showing 1 changed file with 5 additions and 2 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsHisInfoServiceImpl.java
View file @
a142355
| ... | ... | @@ -57,9 +57,10 @@ |
| 57 | 57 | if(StringUtil.isEmpty(result)){ |
| 58 | 58 | lymsHisInfo.setUpType(1); |
| 59 | 59 | lymsHisInfo.setUpTime(new Date()); |
| 60 | - final boolean b = lymsHisInfoService.updateById(lymsHisInfo); | |
| 60 | + boolean b = lymsHisInfoService.updateById(lymsHisInfo); | |
| 61 | 61 | if(!b){ |
| 62 | - result="更新HIS患者状态失败!"; | |
| 62 | + //这里想触发事务回滚需抛运行时异常 | |
| 63 | + throw new RuntimeException("更新HIS患者信息返回值失败状态!"); | |
| 63 | 64 | } |
| 64 | 65 | } |
| 65 | 66 | return result; |
| ... | ... | @@ -172,6 +173,8 @@ |
| 172 | 173 | BaseResponse baseResponse = saveOrUpdatePatient(patient2, pcase, illness); |
| 173 | 174 | if (null != baseResponse && 0 == baseResponse.getErrorcode()) { |
| 174 | 175 | log.info(">>>>>>>>>>>>>>>患者添加成功!"); |
| 176 | + }else { | |
| 177 | + throw new RuntimeException("添加患者信息/病例/病例中疾病,返回值失败状态!"); | |
| 175 | 178 | } |
| 176 | 179 | } |
| 177 | 180 | return null; |