Commit a1fd321c25c278bf4bceb4eaccbd8fcc60004d6a
1 parent
47e860de71
Exists in
master
and in
6 other branches
异常孕妇列表 血糖typeId和typeName返回
Showing 2 changed files with 35 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RemoteFacade.java
View file @
a1fd321
| ... | ... | @@ -87,6 +87,8 @@ |
| 87 | 87 | bloodSugarCache.put(bloodSugar.getId(), temp); |
| 88 | 88 | setTempInfo(bloodSugar.getId() + ID_SEPARATOR + bloodSugar.getModified().getTime(), temp, mongoTemplate.findById(bloodSugar.getParentId(), Patients.class), bloodSugar.getBloodSugar(), Double.parseDouble(bloodSugar.getBloodSugar()) > max ? "高血糖" : "低血糖", |
| 89 | 89 | "(" + min +"-" + max + ")", ErrorPatientEnums.BLOOD_SUGAR, bloodSugar.getModified()); |
| 90 | + temp.put("typeId", bloodSugar.getBloodSugarType()); | |
| 91 | + temp.put("typeName", BloodSugarEnums.getName(bloodSugar.getBloodSugarType())); | |
| 90 | 92 | } |
| 91 | 93 | } |
| 92 | 94 | restList.addAll(bloodSugarCache.values()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java
View file @
a1fd321
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import com.lyms.platform.biz.service.TrackDownService; |
| 4 | 4 | import com.lyms.platform.common.enums.YnEnums; |
| 5 | 5 | import com.lyms.platform.common.result.BaseResponse; |
| 6 | +import com.lyms.platform.common.result.PageResult; | |
| 6 | 7 | import com.lyms.platform.common.result.RespBuilder; |
| 7 | 8 | import com.lyms.platform.common.utils.DateUtil; |
| 8 | 9 | import com.lyms.platform.common.utils.StringUtils; |
| ... | ... | @@ -10,6 +11,7 @@ |
| 10 | 11 | import com.lyms.platform.operate.web.service.ITrackDownService; |
| 11 | 12 | import com.lyms.platform.operate.web.utils.MongoUtil; |
| 12 | 13 | import com.lyms.platform.pojo.Patients; |
| 14 | +import com.lyms.platform.pojo.ResidentsArchiveModel; | |
| 13 | 15 | import com.lyms.platform.pojo.TrackDown; |
| 14 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | 17 | import org.springframework.data.mongodb.core.MongoTemplate; |
| ... | ... | @@ -17,8 +19,7 @@ |
| 17 | 19 | import org.springframework.data.mongodb.core.query.Query; |
| 18 | 20 | import org.springframework.stereotype.Service; |
| 19 | 21 | |
| 20 | -import java.util.Date; | |
| 21 | -import java.util.List; | |
| 22 | +import java.util.*; | |
| 22 | 23 | |
| 23 | 24 | @Service |
| 24 | 25 | public class TrackDownServiceImpl extends BaseServiceImpl implements ITrackDownService { |
| 25 | 26 | |
| ... | ... | @@ -37,8 +38,11 @@ |
| 37 | 38 | |
| 38 | 39 | @Override |
| 39 | 40 | public BaseResponse all(Date buildStart, Date buildEnd, Date checkStart, Date checkEnd, Date fmStart, Date fmEnd, String key, Integer page, Integer limit, Integer userId) { |
| 41 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 40 | 42 | Criteria patientCriteria = new Criteria(); |
| 41 | 43 | Criteria residentCriteria = new Criteria(); |
| 44 | + patientCriteria.and("yn").is(1).and("hospitalId").is(hospitalId); | |
| 45 | + residentCriteria.and("yn").is(1).and("").is(hospitalId); | |
| 42 | 46 | if(buildStart != null && buildEnd != null) { |
| 43 | 47 | residentCriteria.and("buildDay").gte(buildStart).lt(DateUtil.addDay(buildEnd, 1)); |
| 44 | 48 | } |
| ... | ... | @@ -48,7 +52,33 @@ |
| 48 | 52 | if(fmStart != null && fmEnd != null) { |
| 49 | 53 | patientCriteria.and("fmDate").gte(fmStart).lt(DateUtil.addDay(fmEnd, 1)); |
| 50 | 54 | } |
| 51 | - return null; | |
| 55 | + if(StringUtils.isNotEmpty(key)) { | |
| 56 | + patientCriteria.orOperator(Criteria.where("phone").regex(key), Criteria.where("username").regex(key), Criteria.where("cardNo").is(key)); | |
| 57 | + residentCriteria.orOperator(Criteria.where("phone").regex(key), Criteria.where("username").regex(key), Criteria.where("certificateNum").is(key)); | |
| 58 | + } | |
| 59 | + List<Patients> patients = mongoTemplate.find(Query.query(patientCriteria), Patients.class); | |
| 60 | + List<ResidentsArchiveModel> residentsArchiveModels = mongoTemplate.find(Query.query(residentCriteria), ResidentsArchiveModel.class); | |
| 61 | + List<Map<String, Object>> restList = new ArrayList<>(); | |
| 62 | + for (Patients patient : patients) { // type: 1=孕期 3=产后 | |
| 63 | + Map<String, Object> temp = new HashMap<>(); | |
| 64 | + temp.put("id", patient.getId()); | |
| 65 | + temp.put("cardNo", patient.getCardNo()); | |
| 66 | + temp.put("username", patient.getUsername()); | |
| 67 | + temp.put("age", DateUtil.getAge(patient.getBirth())); | |
| 68 | + temp.put("resident", "--"); // 妇女建档 | |
| 69 | + temp.put("residentDate", "2017-10-11"); // 妇女建档日期 | |
| 70 | + temp.put("check", "--"); // 婚检 | |
| 71 | + temp.put("bookbuild", ""); // 孕期建档 1=勾勾 2=叉叉 | |
| 72 | + temp.put("bookbuildDte", DateUtil.getyyyy_MM_dd(patient.getBookbuildingDate())); | |
| 73 | + temp.put("yjcount", 0); // 孕检次数 | |
| 74 | + temp.put("cqsc", ""); // 产前筛查 1=勾勾 2=叉叉 | |
| 75 | + temp.put("fm", ""); // 分娩 1=勾勾 2=叉叉 | |
| 76 | + temp.put("fmType", ""); // 分娩方式 1=顺产, 2=剖宫产 | |
| 77 | + temp.put("chfc", ""); // 产后复查 1=勾勾 2=叉叉 | |
| 78 | + temp.put("chfcCount", ""); // 复查次数 | |
| 79 | + } | |
| 80 | + | |
| 81 | + return RespBuilder.buildSuccess(new PageResult(restList.size(), page, limit, restList)); | |
| 52 | 82 | } |
| 53 | 83 | |
| 54 | 84 | public BaseResponse add(Integer userId, TrackDown trackDown) { |