Commit 9243aaf1d6bc2db500ba29e3d9f766d223a5d636
1 parent
550b245a2f
Exists in
dev
小程序调用-产后康复
Showing 5 changed files with 163 additions and 0 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatnRehabController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MedicalRecordController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MedicalRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/MatnRehabService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/impl/MatnRehabServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatnRehabController.java
View file @
9243aaf
1 | +package com.lyms.platform.operate.web.controller; | |
2 | + | |
3 | +import com.lyms.platform.common.base.BaseController; | |
4 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
5 | +import com.lyms.platform.operate.web.matnRehabPC.service.MatnRehabService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Controller; | |
8 | +import org.springframework.web.bind.annotation.RequestMapping; | |
9 | +import org.springframework.web.bind.annotation.RequestMethod; | |
10 | +import org.springframework.web.bind.annotation.RequestParam; | |
11 | +import org.springframework.web.bind.annotation.ResponseBody; | |
12 | + | |
13 | +/** | |
14 | + * 小程序调用-产后康复用 | |
15 | + */ | |
16 | +@Controller | |
17 | +@RequestMapping("/wx/matnRehab") | |
18 | +public class MatnRehabController extends BaseController { | |
19 | + | |
20 | + @Autowired | |
21 | + private MatnRehabService matnRehabService; | |
22 | + | |
23 | + @RequestMapping(value = "/queryInfo", method = RequestMethod.GET) | |
24 | + @ResponseBody | |
25 | + public BaseObjectResponse queryInfo(@RequestParam("phone") String phone){ | |
26 | + return matnRehabService.queryInfo(phone); | |
27 | + } | |
28 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MedicalRecordController.java
View file @
9243aaf
1 | +package com.lyms.platform.operate.web.controller; | |
2 | + | |
3 | + | |
4 | +import com.lyms.platform.common.base.BaseController; | |
5 | +import com.lyms.platform.common.result.BaseResponse; | |
6 | +import com.lyms.platform.operate.web.facade.MedicalRecordFacade; | |
7 | +import com.lyms.platform.operate.web.request.HisMedicalRecordRequest; | |
8 | +import org.apache.log4j.Logger; | |
9 | +import org.springframework.beans.factory.annotation.Autowired; | |
10 | +import org.springframework.stereotype.Controller; | |
11 | +import org.springframework.web.bind.annotation.RequestBody; | |
12 | +import org.springframework.web.bind.annotation.RequestMapping; | |
13 | +import org.springframework.web.bind.annotation.RequestMethod; | |
14 | +import org.springframework.web.bind.annotation.ResponseBody; | |
15 | + | |
16 | +import java.util.List; | |
17 | + | |
18 | + | |
19 | +/* | |
20 | + * his病案数据分类写表 | |
21 | + * hrp | |
22 | + * 2024-05-07 | |
23 | + */ | |
24 | +@Controller("/hisRecord") | |
25 | +public class MedicalRecordController extends BaseController { | |
26 | + | |
27 | + private Logger log = Logger.getLogger(this.getClass()); | |
28 | + | |
29 | + @Autowired | |
30 | + private MedicalRecordFacade medicalRecordFacade; | |
31 | + | |
32 | + /** | |
33 | + * his病案数据分类写表 | |
34 | + * | |
35 | + * @return | |
36 | + */ | |
37 | + @RequestMapping(method = RequestMethod.POST, value = "/saveMedicalRecord") | |
38 | + @ResponseBody | |
39 | + public BaseResponse saveBabyDiagnose(@RequestBody List<HisMedicalRecordRequest> hisList) { | |
40 | + return medicalRecordFacade.saveHisMedicalRecord(hisList); | |
41 | + } | |
42 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MedicalRecordFacade.java
View file @
9243aaf
1 | +package com.lyms.platform.operate.web.facade; | |
2 | + | |
3 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
4 | +import com.lyms.platform.common.result.BaseResponse; | |
5 | +import com.lyms.platform.operate.web.request.HisMedicalRecordRequest; | |
6 | +import org.apache.commons.collections.CollectionUtils; | |
7 | +import org.springframework.stereotype.Component; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * | |
13 | + */ | |
14 | +@Component | |
15 | +public class MedicalRecordFacade { | |
16 | + public BaseResponse saveHisMedicalRecord(List<HisMedicalRecordRequest> hisList) { | |
17 | + if(CollectionUtils.isNotEmpty(hisList)){ | |
18 | + for(HisMedicalRecordRequest temp : hisList){ | |
19 | + if("".equals(temp.getDepartment())){ | |
20 | + | |
21 | + } | |
22 | + } | |
23 | + }else{ | |
24 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("his未返回数据"); | |
25 | + } | |
26 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
27 | + } | |
28 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/MatnRehabService.java
View file @
9243aaf
platform-operate-api/src/main/java/com/lyms/platform/operate/web/matnRehabPC/service/impl/MatnRehabServiceImpl.java
View file @
9243aaf
1 | +package com.lyms.platform.operate.web.matnRehabPC.service.impl; | |
2 | + | |
3 | +import com.lyms.platform.biz.service.MatDeliverService; | |
4 | +import com.lyms.platform.biz.service.PatientsService; | |
5 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
6 | +import com.lyms.platform.operate.web.facade.ViewFacade; | |
7 | +import com.lyms.platform.operate.web.matnRehabPC.service.MatnRehabService; | |
8 | +import com.lyms.platform.pojo.MaternalDeliverModel; | |
9 | +import com.lyms.platform.pojo.Patients; | |
10 | +import com.lyms.platform.query.MatDeliverQuery; | |
11 | +import com.lyms.platform.query.PatientsQuery; | |
12 | +import org.apache.commons.collections.CollectionUtils; | |
13 | +import org.springframework.beans.factory.annotation.Autowired; | |
14 | +import org.springframework.stereotype.Service; | |
15 | + | |
16 | +import java.util.List; | |
17 | + | |
18 | +@Service | |
19 | +public class MatnRehabServiceImpl implements MatnRehabService { | |
20 | + | |
21 | + @Autowired | |
22 | + private PatientsService patientsService; | |
23 | + | |
24 | + @Autowired | |
25 | + private ViewFacade viewFacade; | |
26 | + | |
27 | + @Autowired | |
28 | + private MatDeliverService matDeliverService; | |
29 | + | |
30 | + @Override | |
31 | + public BaseObjectResponse queryInfo(String phone) { | |
32 | + BaseObjectResponse baseObjectResponse = new BaseObjectResponse(); | |
33 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
34 | + // | |
35 | + patientsQuery.setPhone(phone); | |
36 | + patientsQuery.setType(3); | |
37 | + patientsQuery.setYn(1); | |
38 | + patientsQuery.setDesc("true"); | |
39 | + patientsQuery.setSort("created"); | |
40 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
41 | + if (CollectionUtils.isNotEmpty(patientsList)) { | |
42 | + Patients patients = patientsList.get(0); | |
43 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
44 | + matDeliverQuery.setYn(1); | |
45 | + matDeliverQuery.setParentId(patients.getId()); | |
46 | + matDeliverQuery.setPid(patients.getPid()); | |
47 | + List<MaternalDeliverModel> queryList = matDeliverService.query(matDeliverQuery); | |
48 | + if (CollectionUtils.isNotEmpty(queryList)){ | |
49 | + MaternalDeliverModel model = queryList.get(0); | |
50 | + baseObjectResponse =viewFacade.findMatDeliverData(model.getId()); | |
51 | + return baseObjectResponse; | |
52 | + } | |
53 | + } | |
54 | + return baseObjectResponse; | |
55 | + | |
56 | + } | |
57 | +} |