Commit 954b2c2f89dd771edfc2d32baaec9b737abf013a
1 parent
c87f30e418
Exists in
master
and in
6 other branches
快速测量
Showing 8 changed files with 97 additions and 23 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterOrganizationMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/OrganizationService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/MasterOrganization.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MeasureInfoRequest.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterOrganizationMapper.java
View file @
954b2c2
platform-biz-service/src/main/java/com/lyms/platform/permission/service/OrganizationService.java
View file @
954b2c2
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java
View file @
954b2c2
| ... | ... | @@ -233,6 +233,11 @@ |
| 233 | 233 | return results; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | + @Override | |
| 237 | + public List<Organization> queryHospitalIds(OrganizationQuery organizationQuery) { | |
| 238 | + return masterOrganizationMapper.queryHospitalIds(organizationQuery); | |
| 239 | + } | |
| 240 | + | |
| 236 | 241 | /** |
| 237 | 242 | * 维护用户机构权限为最新状态,机构新增、修改、删除时执行;用户新增、修改、删除时执行 |
| 238 | 243 | */ |
platform-biz-service/src/main/resources/mainOrm/master/MasterOrganization.xml
View file @
954b2c2
| ... | ... | @@ -225,6 +225,17 @@ |
| 225 | 225 | </select> |
| 226 | 226 | |
| 227 | 227 | |
| 228 | + | |
| 229 | + <select id="queryHospitalIds" resultMap="OrganizationResultMap" | |
| 230 | + parameterType="com.lyms.platform.permission.model.OrganizationQuery"> | |
| 231 | + select | |
| 232 | + id | |
| 233 | + from organization | |
| 234 | + <include refid="OrganizationCondition"/> | |
| 235 | + <include refid="orderAndLimit"/> | |
| 236 | + </select> | |
| 237 | + | |
| 238 | + | |
| 228 | 239 | <select id="queryOrganizationCount" resultType="int" |
| 229 | 240 | parameterType="com.lyms.platform.permission.model.OrganizationQuery"> |
| 230 | 241 | select count(1) from organization |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java
View file @
954b2c2
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | private MeasureInfoFacade measureInfoFacade; |
| 29 | 29 | /** |
| 30 | 30 | * 血糖和脉搏 身高和体重的值列表 |
| 31 | - * valueType 值类型: 1 体重和身高 2 血压和脉搏 3 体温 | |
| 31 | + * valueType 值类型: 1 体重和身高 2 血压和脉搏 3 体温 4血糖 | |
| 32 | 32 | * @return |
| 33 | 33 | */ |
| 34 | 34 | @RequestMapping(method = RequestMethod.GET, value = "/queryMeasureInfoList") |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
954b2c2
| ... | ... | @@ -889,17 +889,16 @@ |
| 889 | 889 | if (!StringUtils.isEmpty(bookbuildingQueryRequest.getCardNo())) { |
| 890 | 890 | patientsQuery.setCardNo(bookbuildingQueryRequest.getCardNo()); |
| 891 | 891 | |
| 892 | - | |
| 893 | - //线上唐山区域查询的时候只查询唐山医院的已有建档记录 | |
| 892 | + //只查询当前医院所在市的所有建档记录 | |
| 894 | 893 | Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId)); |
| 895 | 894 | List<String> hids = new ArrayList<>(); |
| 896 | - if (org != null && "4".equals(org.getCityId()) && "1".equals(org.getProvinceId())) | |
| 895 | + if (org != null) | |
| 897 | 896 | { |
| 898 | 897 | OrganizationQuery query = new OrganizationQuery(); |
| 899 | 898 | query.setYn(YnEnums.YES.getId()); |
| 900 | - query.setCityId("4"); | |
| 901 | - query.setProvinceId("1"); | |
| 902 | - List<Organization> list = organizationService.queryOrganization(query); | |
| 899 | + query.setCityId(org.getCityId()); | |
| 900 | + query.setProvinceId(org.getProvinceId()); | |
| 901 | + List<Organization> list = organizationService.queryHospitalIds(query); | |
| 903 | 902 | if (CollectionUtils.isNotEmpty(list)) |
| 904 | 903 | { |
| 905 | 904 | for (Organization organization : list) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
954b2c2
| ... | ... | @@ -54,6 +54,8 @@ |
| 54 | 54 | @Autowired |
| 55 | 55 | private BasicConfigService basicConfigService; |
| 56 | 56 | |
| 57 | + private static String[] blood_item = new String[]{"--","--","--","--","--","--","--","--","--"}; | |
| 58 | + | |
| 57 | 59 | private static final Integer MAX_TODAY_COUNT = 5; |
| 58 | 60 | |
| 59 | 61 | public BaseListResponse queryMeasureInfoList(String queryNo, |
| 60 | 62 | |
| 61 | 63 | |
| 62 | 64 | |
| ... | ... | @@ -246,23 +248,39 @@ |
| 246 | 248 | |
| 247 | 249 | if (CollectionUtils.isNotEmpty(list)) { |
| 248 | 250 | MeasureDataInfoModel measureDataInfoModel = list.get(0); |
| 249 | - if (DateUtil.getyyyy_MM_dd(measureDataInfoModel.getModified()).equals(DateUtil.getyyyy_MM_dd(new Date()))) { | |
| 250 | - todayCount = measureDataInfoModel.getTodayCount() + 1; | |
| 251 | - if (todayCount > MAX_TODAY_COUNT) { | |
| 252 | - baseResponse.setData(-1); | |
| 253 | - baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 254 | - baseResponse.setErrormsg("成功"); | |
| 255 | - return baseResponse; | |
| 251 | + if (measureDataInfoModel.getValueType() == 4) | |
| 252 | + { | |
| 253 | + if (DateUtil.getyyyy_MM_dd(measureDataInfoModel.getModified()).equals(DateUtil.getyyyy_MM_dd(new Date()))) { | |
| 254 | + todayCount = measureDataInfoModel.getTodayCount() + 1; | |
| 255 | + String[] items = measureDataInfoModel.getValueOne().split("/"); | |
| 256 | + dataInfoModel.setValueOne(getBloodSugar(items,measureInfoRequest.getRemarkValue(), measureInfoRequest.getValueOne())); | |
| 256 | 257 | } |
| 258 | + else | |
| 259 | + { | |
| 260 | + dataInfoModel.setValueOne(getBloodSugar(blood_item,measureInfoRequest.getRemarkValue(), measureInfoRequest.getValueOne())); | |
| 261 | + todayCount = 1; | |
| 262 | + } | |
| 257 | 263 | dataInfoModel.setTodayCount(todayCount); |
| 258 | - | |
| 259 | - dataInfoModel.setRecordContent((StringUtils.isEmpty(measureDataInfoModel.getRecordContent()) ? "" : measureDataInfoModel.getRecordContent()+ "," ) + measureInfoRequest.getValueOne()); | |
| 260 | 264 | } |
| 261 | 265 | else |
| 262 | 266 | { |
| 263 | - todayCount = 1; | |
| 264 | - dataInfoModel.setRecordContent(measureInfoRequest.getValueOne()); | |
| 265 | - dataInfoModel.setTodayCount(todayCount); | |
| 267 | + if (DateUtil.getyyyy_MM_dd(measureDataInfoModel.getModified()).equals(DateUtil.getyyyy_MM_dd(new Date()))) { | |
| 268 | + todayCount = measureDataInfoModel.getTodayCount() + 1; | |
| 269 | + if (todayCount > MAX_TODAY_COUNT) { | |
| 270 | + baseResponse.setData(-1); | |
| 271 | + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 272 | + baseResponse.setErrormsg("成功"); | |
| 273 | + return baseResponse; | |
| 274 | + } | |
| 275 | + dataInfoModel.setTodayCount(todayCount); | |
| 276 | + dataInfoModel.setRecordContent((StringUtils.isEmpty(measureDataInfoModel.getRecordContent()) ? "" : measureDataInfoModel.getRecordContent()+ "," ) + measureInfoRequest.getValueOne()); | |
| 277 | + } | |
| 278 | + else | |
| 279 | + { | |
| 280 | + todayCount = 1; | |
| 281 | + dataInfoModel.setRecordContent(measureInfoRequest.getValueOne()); | |
| 282 | + dataInfoModel.setTodayCount(todayCount); | |
| 283 | + } | |
| 266 | 284 | } |
| 267 | 285 | |
| 268 | 286 | dataInfoModel.setModified(new Date()); |
| 269 | 287 | |
| ... | ... | @@ -285,10 +303,16 @@ |
| 285 | 303 | dataInfoModel.setTodayCount(todayCount); |
| 286 | 304 | dataInfoModel.setRecordCount(1); |
| 287 | 305 | dataInfoModel.setRecordContent(measureInfoRequest.getValueOne()); |
| 306 | + | |
| 307 | + //血糖 | |
| 308 | + if (measureInfoRequest.getValueType() == 4 && measureInfoRequest.getRemarkValue() != null) | |
| 309 | + { | |
| 310 | + dataInfoModel.setValueOne(getBloodSugar(blood_item,measureInfoRequest.getRemarkValue(), measureInfoRequest.getValueOne())); | |
| 311 | + } | |
| 312 | + | |
| 288 | 313 | mysqlMeasureDataInfoService.addMeasureDataInfo(dataInfoModel); |
| 289 | 314 | } |
| 290 | - else | |
| 291 | - { | |
| 315 | + else { | |
| 292 | 316 | baseResponse.setErrorcode(ErrorCodeConstants.USER_NOT_EXISTS); |
| 293 | 317 | baseResponse.setErrormsg("您还没有录入基本信息,暂时不能测量"); |
| 294 | 318 | return baseResponse; |
| 295 | 319 | |
| ... | ... | @@ -343,8 +367,28 @@ |
| 343 | 367 | model.setValueOne(measureInfoRequest.getValueOne()); |
| 344 | 368 | model.setValueTwo(measureInfoRequest.getValueTwo()); |
| 345 | 369 | model.setValueType(measureInfoRequest.getValueType()); |
| 370 | + model.setRemarkValue(measureInfoRequest.getRemarkValue()); | |
| 346 | 371 | return model; |
| 347 | 372 | } |
| 373 | + | |
| 374 | + | |
| 375 | + private String getBloodSugar(String[] blood_item ,String remarkValue,String valueOne) | |
| 376 | + { | |
| 377 | + if (remarkValue != null) | |
| 378 | + { | |
| 379 | + blood_item[Integer.parseInt(remarkValue)-1] = valueOne; | |
| 380 | + | |
| 381 | + StringBuffer sb = new StringBuffer(); | |
| 382 | + | |
| 383 | + for (int i = 0 ; i < blood_item.length ; i++) | |
| 384 | + { | |
| 385 | + sb.append(blood_item[i]+(i == (blood_item.length-1) ? "" :"/")); | |
| 386 | + } | |
| 387 | + return sb.toString(); | |
| 388 | + } | |
| 389 | + return valueOne; | |
| 390 | + } | |
| 391 | + | |
| 348 | 392 | |
| 349 | 393 | |
| 350 | 394 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MeasureInfoRequest.java
View file @
954b2c2
| ... | ... | @@ -16,14 +16,14 @@ |
| 16 | 16 | private Integer sex; |
| 17 | 17 | //就诊卡号 |
| 18 | 18 | private String vcCardNo; |
| 19 | - //血压/体重 | |
| 19 | + //血压/体重/血糖 | |
| 20 | 20 | private String valueOne; |
| 21 | 21 | //脉搏/身高 |
| 22 | 22 | private String valueTwo; |
| 23 | 23 | //体重测量存BMI值 |
| 24 | 24 | private String valueThree; |
| 25 | 25 | |
| 26 | - //值类型: 1 体重和身高 2 血压和脉搏 3、体温 | |
| 26 | + //值类型: 1 体重和身高 2 血压和脉搏 3、体温 4、血糖 | |
| 27 | 27 | private Integer valueType; |
| 28 | 28 | |
| 29 | 29 | //医院id |
| ... | ... | @@ -52,6 +52,17 @@ |
| 52 | 52 | |
| 53 | 53 | //户籍地址 |
| 54 | 54 | private String address; |
| 55 | + | |
| 56 | + //"空腹"1, "早餐前"2, "早餐后"3, "午餐前"4, "午餐后"5, "晚餐前"6, "晚餐后"7,"夜间"8,"睡前"9 | |
| 57 | + private String remarkValue; | |
| 58 | + | |
| 59 | + public String getRemarkValue() { | |
| 60 | + return remarkValue; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setRemarkValue(String remarkValue) { | |
| 64 | + this.remarkValue = remarkValue; | |
| 65 | + } | |
| 55 | 66 | |
| 56 | 67 | public String getAddress() { |
| 57 | 68 | return address; |