Commit e5817aca3547708208c11984419c204b7b88d804

Authored by [wangbo]
1 parent ca98e03251

高危转诊修改

Showing 4 changed files with 201 additions and 72 deletions

platform-common/src/main/java/com/lyms/platform/common/enums/ApplyOrderStatusEnums.java View file @ e5817ac
... ... @@ -4,25 +4,26 @@
4 4 * Created by Administrator on 2016/6/27 0027.
5 5 */
6 6 public enum ApplyOrderStatusEnums {
7   - CREATED("待接收","1"),
8   - O("已接收","2"),
9   - O1("建议转诊","3");
  7 + CREATED("待接收", "1"),
  8 + O("已接收", "2"),
  9 + O1("建议转诊", "3"),
  10 + O2("拒绝接收", "4");
10 11  
11 12  
12   -
13   - private ApplyOrderStatusEnums(String name,String id){
14   - this.name=name;
15   - this.id=id;
  13 + private ApplyOrderStatusEnums(String name, String id) {
  14 + this.name = name;
  15 + this.id = id;
16 16 }
17 17  
18   - public static String getTitle(Integer id){
19   - for(ApplyOrderStatusEnums enums:values()){
20   - if(enums.getId().equals(id+"")){
  18 + public static String getTitle(Integer id) {
  19 + for (ApplyOrderStatusEnums enums : values()) {
  20 + if (enums.getId().equals(id + "")) {
21 21 return enums.getName();
22 22 }
23 23 }
24 24 return null;
25 25 }
  26 +
26 27 private String name;
27 28 private String id;
28 29  
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java View file @ e5817ac
... ... @@ -55,6 +55,7 @@
55 55 private String outHospitalId;
56 56 private String hospitalId;
57 57 private String phone;
  58 +
58 59 private Integer type;
59 60 //体验会员 0非会员 1会员
60 61 private Integer expVip;
... ... @@ -313,7 +314,7 @@
313 314 public MongoQuery convertToQuery() {
314 315 MongoCondition condition = MongoCondition.newInstance();
315 316  
316   - if(CollectionUtils.isNotEmpty(parentIds)){
  317 + if (CollectionUtils.isNotEmpty(parentIds)) {
317 318 condition = condition.and("parentId", parentIds, MongoOper.IN);
318 319 }
319 320  
... ... @@ -353,8 +354,6 @@
353 354 }
354 355  
355 356  
356   -
357   -
358 357 if (null != hospitalId) {
359 358 condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
360 359 }
361 360  
... ... @@ -406,14 +405,14 @@
406 405 }
407 406 if (StringUtils.isNotEmpty(queryNo)) {
408 407 MongoCondition c1 = MongoCondition.newInstance();
409   - MongoCondition con1 = MongoCondition.newInstance("phone", queryNo, MongoOper.IS);
  408 + MongoCondition con1 = MongoCondition.newInstance("phone", queryNo, MongoOper.IS);
410 409 MongoCondition con2 = MongoCondition.newInstance("name", queryNo, MongoOper.IS);
411 410 MongoCondition con3 = MongoCondition.newInstance("mname", queryNo, MongoOper.LIKE);
412 411 MongoCondition con4 = MongoCondition.newInstance("mCardNo", queryNo, MongoOper.IS);
413   - if(c!=null) {
414   - c = c.andOperator(c1.orCondition(new MongoCondition[]{con1, con2, con3,con4}).getCriteria());
415   - }else {
416   - c = c1.orCondition(new MongoCondition[]{con1, con2, con3,con4}).getCriteria();
  412 + if (c != null) {
  413 + c = c.andOperator(c1.orCondition(new MongoCondition[]{con1, con2, con3, con4}).getCriteria());
  414 + } else {
  415 + c = c1.orCondition(new MongoCondition[]{con1, con2, con3, con4}).getCriteria();
417 416 }
418 417 }
419 418  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyOrderController.java View file @ e5817ac
... ... @@ -17,11 +17,9 @@
17 17 import javax.validation.Valid;
18 18  
19 19 /**
20   - *
21   - *
22 20 * 申请单接口
23 21 * <p>
24   - *
  22 + * <p>
25 23 * Created by Administrator on 2016/6/15 0015.
26 24 */
27 25 @Controller
28 26  
29 27  
... ... @@ -31,18 +29,18 @@
31 29 private ApplyOrderFacade applyOrderFacade;
32 30  
33 31 //查询转诊申请单
34   - @RequestMapping(method = RequestMethod.GET,value = "/referralapply")
  32 + @RequestMapping(method = RequestMethod.GET, value = "/referralapply")
35 33 @ResponseBody
36 34 @TokenRequired
37 35 public BaseResponse queryReferralApplyOrder(@RequestParam("id") String id) {
38   - if(StringUtils.isEmpty(id)){
  36 + if (StringUtils.isEmpty(id)) {
39 37 return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("id不能为空.");
40 38 }
41 39 return applyOrderFacade.queryReferralApplyOrder(id);
42 40 }
43 41  
44 42 //增加或修改转诊单的回执信息
45   - @RequestMapping(method = RequestMethod.POST,value = "/referralReceipt")
  43 + @RequestMapping(method = RequestMethod.POST, value = "/referralReceipt")
46 44 @ResponseBody
47 45 @TokenRequired
48 46 public BaseResponse addReferralReceipt(@Valid @RequestBody ReferralReceiptRequest referralReceiptRequest, HttpServletRequest request) {
49 47  
50 48  
51 49  
52 50  
53 51  
54 52  
55 53  
56 54  
... ... @@ -50,37 +48,38 @@
50 48 }
51 49  
52 50 //增加儿童转诊申请单
53   - @RequestMapping(method = RequestMethod.POST,value = "/referralapply")
  51 + @RequestMapping(method = RequestMethod.POST, value = "/referralapply")
54 52 @ResponseBody
55 53 @TokenRequired
56   - public BaseResponse addReferralApplyOrder(@Valid @RequestBody ReferralApplyOrderAddRequest applyOrderAddRequest,HttpServletRequest request) {
  54 + public BaseResponse addReferralApplyOrder(@Valid @RequestBody ReferralApplyOrderAddRequest applyOrderAddRequest, HttpServletRequest request) {
57 55 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
58 56 return applyOrderFacade.addOneReferralApplyOrder(applyOrderAddRequest, loginState.getId(), 2);
59 57 }
60 58  
61 59 //增加转诊申请单
62   - @RequestMapping(method = RequestMethod.POST,value = "/referrbapply")
  60 + @RequestMapping(method = RequestMethod.POST, value = "/referrbapply")
63 61 @ResponseBody
64 62 @TokenRequired
65   - public BaseResponse addReferralBaApplyOrder(@Valid @RequestBody ReferralApplyOrderAddRequest applyOrderAddRequest,HttpServletRequest request) {
  63 + public BaseResponse addReferralBaApplyOrder(@Valid @RequestBody ReferralApplyOrderAddRequest applyOrderAddRequest, HttpServletRequest request) {
66 64 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
67   - return applyOrderFacade.addOneReferralApplyOrder(applyOrderAddRequest, loginState.getId(),1);
  65 + return applyOrderFacade.addOneReferralApplyOrder(applyOrderAddRequest, loginState.getId(), 1);
68 66 }
69 67  
70   - @RequestMapping(method = RequestMethod.POST,value = "/sieveapply")
  68 + @RequestMapping(method = RequestMethod.POST, value = "/sieveapply")
71 69 @ResponseBody
72 70 @TokenRequired
73 71 //增加产筛申请单
74   - public BaseResponse addSieveApplyOrder(@Valid @RequestBody SieveApplyOrderAddRequest applyOrderAddRequest,HttpServletRequest request) {
  72 + public BaseResponse addSieveApplyOrder(@Valid @RequestBody SieveApplyOrderAddRequest applyOrderAddRequest, HttpServletRequest request) {
75 73 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
76 74 return applyOrderFacade.addOneSieveApplyOrder(applyOrderAddRequest, loginState.getId());
77 75 }
78   - @RequestMapping(method = RequestMethod.GET,value = "/sieveapply")
  76 +
  77 + @RequestMapping(method = RequestMethod.GET, value = "/sieveapply")
79 78 @ResponseBody
80 79 @TokenRequired
81 80 //查询转诊申请单
82 81 public BaseResponse querySieveApplyOrder(@RequestParam("id") String id) {
83   - if(StringUtils.isEmpty(id)){
  82 + if (StringUtils.isEmpty(id)) {
84 83 return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("id不能为空.");
85 84 }
86 85 return applyOrderFacade.querySieveApplyOrder(id);
87 86  
88 87  
89 88  
90 89  
91 90  
92 91  
93 92  
94 93  
... ... @@ -92,39 +91,41 @@
92 91 * @param orderQueryRequest
93 92 * @return
94 93 */
95   - @RequestMapping(method = RequestMethod.GET,value = "/applyorder")
  94 + @RequestMapping(method = RequestMethod.GET, value = "/applyorder")
96 95 @ResponseBody
97 96 @TokenRequired
98   - public BaseResponse queryApplyOrder(@Valid ApplyOrderQueryRequest orderQueryRequest,HttpServletRequest request){
  97 + public BaseResponse queryApplyOrder(@Valid ApplyOrderQueryRequest orderQueryRequest, HttpServletRequest request) {
99 98 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
100 99 return applyOrderFacade.queryApplyOrder(orderQueryRequest, loginState.getId());
101 100 }
102 101  
103 102  
104 103 /**
105   - *转诊单打印
  104 + * 转诊单打印
  105 + *
106 106 * @param id
107 107 * @return
108 108 */
109   - @RequestMapping(method = RequestMethod.GET,value = "/printRe")
  109 + @RequestMapping(method = RequestMethod.GET, value = "/printRe")
110 110 @ResponseBody
111 111 @TokenRequired
112   - public BaseResponse queryApplyOrder(@RequestParam("id") String id){
  112 + public BaseResponse queryApplyOrder(@RequestParam("id") String id) {
113 113 return applyOrderFacade.getOrderModel(id);
114 114 }
115 115  
116 116  
117 117 /**
118 118 * 导出孕妇转诊
  119 + *
119 120 * @param orderQueryRequest
120 121 * @param request
121 122 * @return
122 123 */
123   - @RequestMapping(method = RequestMethod.GET,value = "/exportYunZZ")
  124 + @RequestMapping(method = RequestMethod.GET, value = "/exportYunZZ")
124 125 @TokenRequired
125   - public void exportYunZZ(@Valid ApplyOrderQueryRequest orderQueryRequest,HttpServletRequest request,HttpServletResponse response){
  126 + public void exportYunZZ(@Valid ApplyOrderQueryRequest orderQueryRequest, HttpServletRequest request, HttpServletResponse response) {
126 127 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
127   - applyOrderFacade.exportYunZZ(orderQueryRequest, loginState.getId(),response);
  128 + applyOrderFacade.exportYunZZ(orderQueryRequest, loginState.getId(), response);
128 129 }
129 130  
130 131  
131 132  
132 133  
133 134  
134 135  
135 136  
136 137  
137 138  
138 139  
... ... @@ -134,32 +135,54 @@
134 135 * @param orderQueryRequest
135 136 * @return
136 137 */
137   - @RequestMapping(method = RequestMethod.GET,value = "/applybabyorder")
  138 + @RequestMapping(method = RequestMethod.GET, value = "/applybabyorder")
138 139 @ResponseBody
139 140 @TokenRequired
140   - public BaseResponse queryBabyApplyOrder(@Valid BabyApplyOrderQueryRequest orderQueryRequest,HttpServletRequest request){
  141 + public BaseResponse queryBabyApplyOrder(@Valid BabyApplyOrderQueryRequest orderQueryRequest, HttpServletRequest request) {
141 142 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
142 143 return applyOrderFacade.queryBabyApplyOrder(orderQueryRequest, loginState.getId());
143 144 }
144 145  
145 146 /**
146 147 * 导出儿童转诊
  148 + *
147 149 * @param orderQueryRequest
148 150 * @param request
149 151 * @return
150 152 */
151   - @RequestMapping(method = RequestMethod.GET,value = "/exportChildZZ")
  153 + @RequestMapping(method = RequestMethod.GET, value = "/exportChildZZ")
152 154 @TokenRequired
153   - public void exportChildZZ(@Valid BabyApplyOrderQueryRequest orderQueryRequest,HttpServletRequest request,HttpServletResponse response){
  155 + public void exportChildZZ(@Valid BabyApplyOrderQueryRequest orderQueryRequest, HttpServletRequest request, HttpServletResponse response) {
154 156 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
155   - applyOrderFacade.exportChildZZ(orderQueryRequest, loginState.getId(),response);
  157 + applyOrderFacade.exportChildZZ(orderQueryRequest, loginState.getId(), response);
156 158 }
157 159  
158 160  
159   - @RequestMapping(method = RequestMethod.GET,value = "/applyorderEnums")
  161 + @RequestMapping(method = RequestMethod.GET, value = "/applyorderEnums")
160 162 @ResponseBody
161   - public BaseResponse getEnums(){
  163 + public BaseResponse getEnums() {
162 164 return applyOrderFacade.getEnums();
163 165 }
  166 +
  167 + /**
  168 + * 高危转诊审核/消息接口
  169 + */
  170 + @RequestMapping(method = RequestMethod.GET, value = "/messageAudit")
  171 + @TokenRequired
  172 + @ResponseBody
  173 + public BaseResponse messageAudit(HttpServletRequest request, String type) {
  174 + return applyOrderFacade.messageAudit(getUserId(request), type);
  175 + }
  176 +
  177 + /***
  178 + * 审核高危转诊
  179 + * */
  180 + @RequestMapping(method = RequestMethod.GET, value = "/auditMessages")
  181 + @TokenRequired
  182 + @ResponseBody
  183 + public BaseResponse auditMessages(HttpServletRequest request, String id, String state) {
  184 + return applyOrderFacade.auditMessages(getUserId(request), id, state);
  185 + }
  186 +
164 187 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java View file @ e5817ac
... ... @@ -22,6 +22,7 @@
22 22 import org.springframework.beans.factory.annotation.Autowired;
23 23 import org.springframework.stereotype.Component;
24 24  
  25 +import javax.servlet.http.HttpServletRequest;
25 26 import javax.servlet.http.HttpServletResponse;
26 27 import java.io.IOException;
27 28 import java.io.OutputStream;
... ... @@ -230,7 +231,7 @@
230 231  
231 232 PatientService patientService = new PatientService();
232 233 Map<String, String> serInfo = new HashMap<>();
233   - serInfo.put("serType",PatientSerEnums.SerTypeEnums.bzfw.getId().toString());
  234 + serInfo.put("serType", PatientSerEnums.SerTypeEnums.bzfw.getId().toString());
234 235  
235 236 patientService.setSerInfos(Arrays.asList(serInfo));
236 237 patientService.setPerType(1);
... ... @@ -362,8 +363,7 @@
362 363 SieveApplyOrderModel sieveApplyOrderModel = sieveApplyOrderAddRequest.convertToDataModel();
363 364  
364 365 //修改
365   - if (StringUtils.isNotEmpty(sieveApplyOrderAddRequest.getId()))
366   - {
  366 + if (StringUtils.isNotEmpty(sieveApplyOrderAddRequest.getId())) {
367 367 sieveApplyOrderModel.setId(sieveApplyOrderAddRequest.getId());
368 368 applyOrderService.updateSieve(sieveApplyOrderModel);
369 369  
... ... @@ -373,8 +373,7 @@
373 373 List<SieveModel> sieveModels = sieveService.queryList(sieveQuery);
374 374 if (CollectionUtils.isNotEmpty(sieveModels)) {
375 375 SieveModel sieveModel = sieveModels.get(0);
376   - if (sieveModel.getSieveHospitalId() != null && !sieveModel.getSieveHospitalId().equals(sieveApplyOrderAddRequest.getSieveHospitalId()))
377   - {
  376 + if (sieveModel.getSieveHospitalId() != null && !sieveModel.getSieveHospitalId().equals(sieveApplyOrderAddRequest.getSieveHospitalId())) {
378 377 sieveModel.setSieveHospitalId(sieveApplyOrderAddRequest.getSieveHospitalId());
379 378 sieveService.updateOneChanQianDiaSieve(sieveModel);
380 379 }
... ... @@ -456,8 +455,7 @@
456 455 }
457 456 SieveApplyOrderModel sieveApplyOrderModel1 = new SieveApplyOrderModel();
458 457 sieveApplyOrderModel1.setStatus(1);
459   - for (String str : idList)
460   - {
  458 + for (String str : idList) {
461 459 sieveApplyOrderModel1.setId(str);
462 460 sieveApplyOrderModel1.setModified(new Date());
463 461 sieveApplyOrderModel1.setStatus(1);
... ... @@ -472,8 +470,7 @@
472 470 sieveQuery.setYn(YnEnums.YES.getId());
473 471 sieveQuery.setParentId(sieveApplyOrderAddRequest.getParentId());
474 472 List<SieveModel> sieveModels = sieveService.queryList(sieveQuery);
475   - if (CollectionUtils.isNotEmpty(sieveModels))
476   - {
  473 + if (CollectionUtils.isNotEmpty(sieveModels)) {
477 474 SieveModel sieveModel = sieveModels.get(0);
478 475 sieveModel.setReviceStatus(1);
479 476 sieveModel.setSieveHospitalId(sieveApplyOrderAddRequest.getSieveHospitalId());
480 477  
481 478  
482 479  
... ... @@ -999,27 +996,28 @@
999 996 }
1000 997  
1001 998 /**
1002   - *转诊通知单打印(唐山滦县)
  999 + * 转诊通知单打印(唐山滦县)
  1000 + *
1003 1001 * @param id
1004 1002 * @return
1005 1003 */
1006   - public BaseResponse getOrderModel(String id){
  1004 + public BaseResponse getOrderModel(String id) {
1007 1005 ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
1008 1006 referralApplyOrderQuery.setId(id);
1009 1007 List<ReferralApplyOrderModel> orderModels = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery);
1010 1008 if (CollectionUtils.isNotEmpty(orderModels)) {
1011 1009 ReferralApplyOrderModel reOrderModel = orderModels.get(0);
1012 1010 Patients data = patientsService.findOnePatientById(reOrderModel.getParentId());
1013   - Map<String,Object> map = new HashMap<String,Object>();
1014   - map.put("ycName",reOrderModel.getName());
1015   - map.put("age",reOrderModel.getAge());
1016   - map.put("nation",getBasicConfig(data.getPnationId()));
1017   - map.put("plevelType",getBasicConfig(data.getPlevelTypeId()));
  1011 + Map<String, Object> map = new HashMap<String, Object>();
  1012 + map.put("ycName", reOrderModel.getName());
  1013 + map.put("age", reOrderModel.getAge());
  1014 + map.put("nation", getBasicConfig(data.getPnationId()));
  1015 + map.put("plevelType", getBasicConfig(data.getPlevelTypeId()));
1018 1016 map.put("register", CommonsHelper.getResidence(data.getProvinceRegisterId(), data.getCityRegisterId(),
1019 1017 data.getAreaRegisterId(), data.getStreetRegisterId(), data.getAddressRegister(), basicConfigService));
1020   - if(StringUtils.isNotEmpty(data.getHusbandName())){
1021   - map.put("husbandName",data.getHusbandName()+",丈夫");
1022   - map.put("hPhone",data.getHusbandPhone());
  1018 + if (StringUtils.isNotEmpty(data.getHusbandName())) {
  1019 + map.put("husbandName", data.getHusbandName() + ",丈夫");
  1020 + map.put("hPhone", data.getHusbandPhone());
1023 1021 }
1024 1022 String hospital = "";
1025 1023 if (org.apache.commons.lang.StringUtils.isNotEmpty(reOrderModel.getOutHospitalId())) {
1026 1024  
... ... @@ -1028,10 +1026,10 @@
1028 1026 hospital = organization.getName();
1029 1027 }
1030 1028 }
1031   - map.put("zhuanCName",hospital);
  1029 + map.put("zhuanCName", hospital);
1032 1030 Users users = usersService.getUsers(NumberUtils.toInt(reOrderModel.getApplyDoctor()));
1033   - map.put("applyDoctor",users.getName());
1034   - map.put("create",DateUtil.getyyyy_MM_dd(reOrderModel.getCreated()));
  1031 + map.put("applyDoctor", users.getName());
  1032 + map.put("create", DateUtil.getyyyy_MM_dd(reOrderModel.getCreated()));
1035 1033 String hospital1 = "";
1036 1034 /*if (org.apache.commons.lang.StringUtils.isNotEmpty(reOrderModel.getTransferredHospital())) {
1037 1035 Organization organization = organizationService.getOrganization(Integer.parseInt(reOrderModel.getTransferredHospital()));
1038 1036  
... ... @@ -1039,11 +1037,11 @@
1039 1037 hospital1 = organization.getName();
1040 1038 }
1041 1039 }*/
1042   - map.put("zhuanRname",reOrderModel.getTransferredHospital());
  1040 + map.put("zhuanRname", reOrderModel.getTransferredHospital());
1043 1041 if (NumberUtils.isNumber(reOrderModel.getRecDoctor())) {
1044 1042 Users users1 = usersService.getUsers(NumberUtils.toInt(reOrderModel.getRecDoctor()));
1045 1043 if (null != users) {
1046   - map.put("recDoctor",users1.getName());
  1044 + map.put("recDoctor", users1.getName());
1047 1045 }
1048 1046 }
1049 1047 if (null != reOrderModel.getReceived()) {
... ... @@ -1253,5 +1251,113 @@
1253 1251 }
1254 1252 return "";
1255 1253 }
  1254 +
  1255 + /**
  1256 + * 审核高危转诊
  1257 + **/
  1258 + public BaseResponse messageAudit(Integer userId, String type) {
  1259 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  1260 + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
  1261 + //转入医院
  1262 + referralApplyOrderQuery.setTransferredHospital(hospitalId);
  1263 + referralApplyOrderQuery.setStatus(1);
  1264 + List<Map<String, Object>> message = new ArrayList<>();
  1265 + List<BabyApplyOrderResult> babyApplyOrderResults = new ArrayList<>();
  1266 + //查询是否有消息
  1267 + Map<String, Object> messageMap = new HashMap<>();
  1268 + if ("0".equals(type)) {
  1269 + //查询24小时内的消息数据
  1270 + referralApplyOrderQuery.setTransferredStart(DateUtil.addDay(new Date(), -1));
  1271 + referralApplyOrderQuery.setTransferredEnd(new Date());
  1272 + int cout = applyOrderService.queryCount(referralApplyOrderQuery);
  1273 + if (cout > 0) {
  1274 + messageMap.put("count", cout);
  1275 + messageMap.put("flag", true);
  1276 + message.add(messageMap);
  1277 + } else {
  1278 + messageMap.put("flag", false);
  1279 + message.add(messageMap);
  1280 + }
  1281 + return new BaseObjectResponse().setData(message).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("提示:您有" + cout + "条高危转诊数据未处理!");
  1282 + } else {
  1283 + List<ReferralApplyOrderModel> referralApplyOrderModels = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery);
  1284 + if (CollectionUtils.isNotEmpty(referralApplyOrderModels)) {
  1285 + for (ReferralApplyOrderModel applyOrderModel : referralApplyOrderModels) {
  1286 + BabyApplyOrderResult babyApplyOrderResult = new BabyApplyOrderResult();
  1287 + String zhuanchu = applyOrderModel.getOutHospitalId();
  1288 + String zhuanru = applyOrderModel.getTransferredHospital();
  1289 + String zhuanCName = zhuanchu;
  1290 + String zhuanRname = zhuanru;
  1291 + if (NumberUtils.isNumber(zhuanchu)) {
  1292 + try {
  1293 + Organization zhuanc = organizationService.getOrganization(Integer.valueOf(zhuanchu));
  1294 + if (null != zhuanc) {
  1295 + zhuanCName = zhuanc.getName();
  1296 + }
  1297 + } catch (Exception e) {
  1298 +
  1299 + }
  1300 + }
  1301 + if (NumberUtils.isNumber(zhuanru)) {
  1302 + try {
  1303 + Organization zhuanc1 = organizationService.getOrganization(Integer.valueOf(zhuanru));
  1304 + if (null != zhuanc1) {
  1305 + zhuanRname = zhuanc1.getName();
  1306 + }
  1307 + } catch (Exception e) {
  1308 + }
  1309 + }
  1310 + if (NumberUtils.isNumber(applyOrderModel.getApplyDoctor())) {
  1311 + Users users = usersService.getUsers(NumberUtils.toInt(applyOrderModel.getApplyDoctor()));
  1312 + if (null != users) {
  1313 + babyApplyOrderResult.setApplyDoctor(users.getName());
  1314 + }
  1315 + }
  1316 + if (NumberUtils.isNumber(applyOrderModel.getRecDoctor())) {
  1317 + Users users = usersService.getUsers(NumberUtils.toInt(applyOrderModel.getRecDoctor()));
  1318 + if (null != users) {
  1319 + babyApplyOrderResult.setRecDoctor(users.getName());
  1320 + }
  1321 + }
  1322 + babyApplyOrderResult.convert(applyOrderModel, zhuanCName, zhuanRname);
  1323 +
  1324 + BabyModel babyModel = babyService.getOneBabyById(applyOrderModel.getParentId());
  1325 + if (null != babyModel) {
  1326 + babyApplyOrderResult.setVcCardNo(babyModel.getVcCardNo());
  1327 + if (StringUtils.isNotEmpty(babyModel.getParentId())) {
  1328 + Patients patients = patientsService.findOnePatientById(babyModel.getParentId());
  1329 + if (null != patients) {
  1330 + babyApplyOrderResult.setmCardNo(patients.getCardNo());
  1331 + }
  1332 + }
  1333 + }
  1334 + String diagnose = "";
  1335 + List<String> diagnoseList = applyOrderModel.getrRisk();
  1336 + if (CollectionUtils.isNotEmpty(diagnoseList)) {
  1337 + diagnose = "";
  1338 + for (String obj : diagnoseList) {
  1339 + diagnose += obj + " ";
  1340 + }
  1341 + babyApplyOrderResult.sethRisk(diagnose);
  1342 + }
  1343 + babyApplyOrderResults.add(babyApplyOrderResult);
  1344 + }
  1345 + }
  1346 + return new BaseObjectResponse().setData(babyApplyOrderResults).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  1347 + }
  1348 + }
  1349 +
  1350 + public BaseResponse auditMessages(Integer userId, String id, String state) {
  1351 + ReferralApplyOrderModel referralApplyOrderModel = applyOrderService.findByIdReferralApplyOrder(id);
  1352 + String hospital = autoMatchFacade.getHospitalId(userId);
  1353 + if (null != referralApplyOrderModel) {
  1354 + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
  1355 + referralApplyOrderQuery.setId(id);
  1356 + referralApplyOrderModel.setStatus(Integer.parseInt(state));
  1357 + applyOrderService.updateByParentId(referralApplyOrderQuery, referralApplyOrderModel);
  1358 + }
  1359 + return new BaseObjectResponse().setData("").setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  1360 + }
  1361 +
1256 1362 }