Commit 419985b9d01df952e3bef3dede80cdb736142946
1 parent
2b0271b06d
Exists in
master
对外开放接口,保存医院患者信息/getPatient/savePatient修改判定重复数据逻辑
Showing 3 changed files with 33 additions and 11 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsHisInfo.java
View file @
419985b
... | ... | @@ -113,6 +113,14 @@ |
113 | 113 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
114 | 114 | @NotNull(message = "createdtime不能为空") |
115 | 115 | private Date createdtime; |
116 | + | |
117 | + /** | |
118 | + * his系统时间 | |
119 | + */ | |
120 | + @TableField(value = "created") | |
121 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
122 | + private Date created; | |
123 | + | |
116 | 124 | /** |
117 | 125 | * 筛选开始时间 |
118 | 126 | */ |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/GetPatientInfoTask.java
View file @
419985b
... | ... | @@ -154,17 +154,30 @@ |
154 | 154 | //添加到数据后续页面处理 |
155 | 155 | LymsHisInfo hisInfoMap = (LymsHisInfo) BeanUtils.mapToObject(map, LymsHisInfo.class);//map转对象 |
156 | 156 | if (null != hisInfoMap) { |
157 | - //今天添加过不需要重复添加 | |
157 | + //his系统时间同一天添加过不需要重复添加 | |
158 | 158 | QueryWrapper qurey = new QueryWrapper(); |
159 | - qurey.eq("idCard", hisInfoMap.getIdcard()); | |
160 | - qurey.eq("diagnose", hisInfoMap.getDiagnose()); | |
161 | - qurey.eq("hospitalId", hisInfoMap.getHospitalId()); | |
162 | - Calendar calendar = Calendar.getInstance(); | |
163 | - calendar.setTime(new Date()); | |
164 | - calendar.set(Calendar.HOUR_OF_DAY, 00);//时 | |
165 | - calendar.set(Calendar.MINUTE, 00);//分 | |
166 | - calendar.set(Calendar.SECOND, 00);//秒 | |
167 | - qurey.gt("createdtime", calendar.getTime()); | |
159 | + if(StringUtil.isNotEmpty(hisInfoMap.getIdcard())){ | |
160 | + qurey.eq("idCard", hisInfoMap.getIdcard()); | |
161 | + qurey.eq("diagnose", hisInfoMap.getDiagnose()); | |
162 | + qurey.eq("hospitalId", hisInfoMap.getHospitalId()); | |
163 | + Calendar calendar = Calendar.getInstance(); | |
164 | + calendar.setTime(hisInfoMap.getCreated());//接收到的his系统时间判断 | |
165 | + calendar.set(Calendar.HOUR_OF_DAY, 00);//时 | |
166 | + calendar.set(Calendar.MINUTE, 00);//分 | |
167 | + calendar.set(Calendar.SECOND, 00);//秒 | |
168 | + qurey.gt("created", calendar.getTime()); | |
169 | + }else {//没有身份证用姓名电话判断 | |
170 | + qurey.eq("name", hisInfoMap.getName()); | |
171 | + qurey.eq("phone", hisInfoMap.getPhone()); | |
172 | + qurey.eq("diagnose", hisInfoMap.getDiagnose()); | |
173 | + qurey.eq("hospitalId", hisInfoMap.getHospitalId()); | |
174 | + Calendar calendar = Calendar.getInstance(); | |
175 | + calendar.setTime(hisInfoMap.getCreated());//接收到的his系统时间判断 | |
176 | + calendar.set(Calendar.HOUR_OF_DAY, 00);//时 | |
177 | + calendar.set(Calendar.MINUTE, 00);//分 | |
178 | + calendar.set(Calendar.SECOND, 00);//秒 | |
179 | + qurey.gt("created", calendar.getTime()); | |
180 | + } | |
168 | 181 | List<LymsHisInfo> list = lymsHisInfoService.list(qurey); |
169 | 182 | if (CollectionUtils.isEmpty(list)) { |
170 | 183 | hisInfoMap.setBirthday(StringUtil.isNotEmpty(hisInfoMap.getBirthday()) ? StringUtil.leftTruncate(hisInfoMap.getBirthday(), ' ') : null); |
talkonlineweb/src/main/resources/mapper/LymsHisInfoMapper.xml
View file @
419985b
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | <result property="doctor" column="doctor" jdbcType="VARCHAR"/> |
19 | 19 | <result property="upType" column="up_type" jdbcType="INTEGER"/> |
20 | 20 | <result property="upTime" column="up_time" jdbcType="TIMESTAMP"/> |
21 | + <result property="created" column="created" jdbcType="TIMESTAMP"/> | |
21 | 22 | <result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/> |
22 | 23 | </resultMap> |
23 | 24 | |
... | ... | @@ -25,7 +26,7 @@ |
25 | 26 | id,vcCardNo,name, |
26 | 27 | sex,birthday,phone, |
27 | 28 | idCard,dept,hospitalId,diagnose, |
28 | - doctor,up_type,up_time, | |
29 | + doctor,up_type,up_time,created, | |
29 | 30 | createdtime |
30 | 31 | </sql> |
31 | 32 | </mapper> |