Commit bc9f88860f6f8f2e744f57bf26664acc6fe0035d

Authored by liquanyu
1 parent 20102e3187

床位预约

Showing 4 changed files with 32 additions and 18 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java View file @ bc9f888
... ... @@ -327,7 +327,7 @@
327 327 for (Organization organization : organizations)
328 328 {
329 329 String hname = organization.getName();
330   - if (!(hname.contains("卫生服务站") || hname.contains("卫生服务中心")))
  330 + if (!(hname.contains("卫生服务站") || hname.contains("卫生服务中心")|| hname.contains("卫生院")))
331 331 {
332 332 list.add(organization);
333 333 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientRegistrationController.java View file @ bc9f888
... ... @@ -103,8 +103,9 @@
103 103 */
104 104 @RequestMapping(value = "/queryPatientRegistrationListAll", method = RequestMethod.GET)
105 105 @ResponseBody
  106 + @TokenRequired
106 107 public BaseResponse queryPatientRegistrationListAll(@Valid PatientRegistrationModelQuery modelQuery, HttpServletRequest request) {
107   - return patientRegistrationFacade.queryPatientRegistrationListAll(modelQuery);
  108 + return patientRegistrationFacade.queryPatientRegistrationListAll(modelQuery,getUserId(request));
108 109 }
109 110  
110 111  
111 112  
... ... @@ -113,8 +114,9 @@
113 114 * @Author: 武涛涛
114 115 */
115 116 @RequestMapping(value = "/exportPatientRegistration", method = RequestMethod.GET)
  117 + @TokenRequired
116 118 public void exportPatientRegistration(@Valid PatientRegistrationModelQuery modelQuery, HttpServletRequest request, HttpServletResponse response) {
117   - patientRegistrationFacade.exportPatientRegistration(modelQuery,response);
  119 + patientRegistrationFacade.exportPatientRegistration(modelQuery,getUserId(request),response);
118 120 }
119 121 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientRegistrationFacade.java View file @ bc9f888
... ... @@ -19,6 +19,7 @@
19 19 import com.lyms.platform.operate.web.utils.CollectionUtils;
20 20 import com.lyms.platform.operate.web.utils.CommonsHelper;
21 21 import com.lyms.platform.operate.web.utils.MongoUtil;
  22 +import com.lyms.platform.permission.model.Organization;
22 23 import com.lyms.platform.permission.service.OrganizationService;
23 24 import com.lyms.platform.permission.service.UsersService;
24 25 import com.lyms.platform.pojo.AntenatalExaminationModel;
25 26  
... ... @@ -44,8 +45,9 @@
44 45 */
45 46 @Component
46 47 public class PatientRegistrationFacade extends BaseServiceImpl {
47   -
48 48 @Autowired
  49 + private OrganizationService organizationService;
  50 + @Autowired
49 51 private PatientRegistrationService patientRegistrationService;
50 52  
51 53 @Autowired
... ... @@ -69,6 +71,7 @@
69 71 private PatientRegistrationModel getPatientRegistrationModel(PatientRegistrationRequest request) {
70 72  
71 73 PatientRegistrationModel model = new PatientRegistrationModel();
  74 + model.setHospitalId(request.getHospitalId());
72 75 model.setYn(YnEnums.YES.getId());
73 76 model.setModifyDate(new Date());
74 77 model.setName(request.getName());
... ... @@ -89,6 +92,14 @@
89 92 */
90 93 public synchronized BaseResponse add(PatientRegistrationRequest request) {
91 94 BaseObjectResponse br = new BaseObjectResponse();
  95 +
  96 + if (StringUtils.isEmpty(request.getHospitalId()))
  97 + {
  98 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  99 + br.setErrormsg("失败,没有明确机构");
  100 + return br;
  101 + }
  102 +
92 103 PatientRegistrationModel model = getPatientRegistrationModel(request);
93 104  
94 105 if (StringUtils.isNotEmpty(request.getPid()))
... ... @@ -129,7 +140,6 @@
129 140 {
130 141 model.setOutType(1);
131 142 model.setCreateDate(new Date());
132   - model.setHospitalId("216");
133 143 model = patientRegistrationService.add(model);
134 144 }
135 145 createMsg(model);
... ... @@ -149,7 +159,9 @@
149 159 (model.getBedType() == 2 ? "普通房间(产前)+单人分娩产房+单间(产后)" : "普通房间(产前+产后)"));
150 160 String content = "您已成功预约"+bedType+",预约入住日期:"+DateUtil.getyyyy_MM_dd(model.getOrderDate())+",请保存本条短信后期作为预约成功凭证。";
151 161  
152   - mr.setFirst("【秦皇岛市妇幼保健院】" + content);
  162 + Organization organization = organizationService.getOrganization(Integer.parseInt(model.getHospitalId()));
  163 +
  164 + mr.setFirst("【"+organization.getName()+"】" + content);
153 165 mr.setObjType(ServiceObjEnums.YUNOBJ.getId());
154 166 mr.setPhone(model.getPhone());
155 167 mr.setTimeType(SmsTimeTypeEnums.ONTIME.getId());
156 168  
157 169  
... ... @@ -295,15 +307,16 @@
295 307 * 查询全部所有记录
296 308 * @Author: 武涛涛
297 309 */
298   - public BaseListResponse queryPatientRegistrationListAll(PatientRegistrationModelQuery modelQuery) {
  310 + public BaseListResponse queryPatientRegistrationListAll(PatientRegistrationModelQuery modelQuery,Integer userId) {
299 311  
  312 + String hospitalId = autoMatchFacade.getHospitalId(userId);
300 313 BaseListResponse br = new BaseListResponse();
301 314 List <PatientRegistrationResult> results = new ArrayList <>();
302 315 try {
303 316 List <PatientRegistrationModel> patientRegistrationModels = new ArrayList <>();
304 317  
305 318 modelQuery.setYn(YnEnums.YES.getId());
306   - modelQuery.setHospitalId(modelQuery.getHospitalId());
  319 + modelQuery.setHospitalId(hospitalId);
307 320 modelQuery.setSort(null);
308 321 modelQuery.setQueryNo(modelQuery.getQueryNo());
309 322 if (modelQuery.getOrderDateStart() != null) {
310 323  
... ... @@ -344,10 +357,10 @@
344 357  
345 358 }
346 359  
347   - public void exportPatientRegistration(PatientRegistrationModelQuery modelQuery, HttpServletResponse response) {
  360 + public void exportPatientRegistration(PatientRegistrationModelQuery modelQuery,Integer userId, HttpServletResponse response) {
348 361  
349 362 try {
350   - BaseListResponse listResponse = (BaseListResponse) queryPatientRegistrationListAll(modelQuery);
  363 + BaseListResponse listResponse = (BaseListResponse) queryPatientRegistrationListAll(modelQuery,userId);
351 364 List <PatientRegistrationResult> list = listResponse.getData();
352 365 List<Map<String, Object>> datas = new ArrayList<>();
353 366  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker.java View file @ bc9f888
... ... @@ -138,16 +138,15 @@
138 138 || String.valueOf(handDueWeekMap.get("day")).equals("0") || String.valueOf(handDueWeekMap.get("day")).equals("")) ? "" : "+"+String.valueOf(handDueWeekMap.get("day"))+"天" );
139 139 }
140 140 childbirthManagerQueryModel.setHandDueWeek(handDueWeek);
141   -
  141 + if(StringUtils.isNotEmpty(patients.getYyzyfmHospitalId())){
  142 + String organizationName = organizationService.getOrganizationName(patients.getYyzyfmHospitalId());
  143 + if(org.apache.commons.lang.StringUtils.isNotEmpty(organizationName)){
  144 + childbirthManagerQueryModel.setYyzyfmHospitalId(organizationName);
  145 + }
  146 + }
142 147 //区域妇幼管理--分挽管理---导出:增加建挡孕周、初诊孕周、艾梅乙结果,区域妇幼管理--分挽管理---列表及导出
143 148 if(isExcel){
144   - //列预约住院分娩医院(来自建档)
145   - if("2".equals(patients.getIsYyzyfmHospital()) && StringUtils.isNotEmpty(patients.getYyzyfmHospitalId())){
146   - String organizationName = organizationService.getOrganizationName(patients.getYyzyfmHospitalId());
147   - if(org.apache.commons.lang.StringUtils.isNotEmpty(organizationName)){
148   - childbirthManagerQueryModel.setYyzyfmHospitalId(organizationName);
149   - }
150   - }
  149 +
151 150  
152 151 AntExChuQuery antExChuQuery = new AntExChuQuery();
153 152 antExChuQuery.setYn(YnEnums.YES.getId());