Commit a434f75c6be72883d5a4c9533835e54856860c74
1 parent
5fc5979c54
Exists in
master
and in
6 other branches
bug修复
Showing 2 changed files with 65 additions and 8 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
View file @
a434f75
... | ... | @@ -2,10 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.BasicConfigService; |
4 | 4 | import com.lyms.platform.common.enums.*; |
5 | -import com.lyms.platform.common.result.BaseObjectResponse; | |
6 | -import com.lyms.platform.common.result.BaseResponse; | |
7 | -import com.lyms.platform.common.result.PageResult; | |
8 | -import com.lyms.platform.common.result.RespBuilder; | |
5 | +import com.lyms.platform.common.result.*; | |
9 | 6 | import com.lyms.platform.common.utils.*; |
10 | 7 | import com.lyms.platform.common.utils.ReflectionUtils; |
11 | 8 | import com.lyms.platform.common.utils.StringUtils; |
... | ... | @@ -74,6 +71,9 @@ |
74 | 71 | @Override |
75 | 72 | public BaseResponse addOrUpdate(Integer userId, BabyEyeCheck babyEyeCheck) { |
76 | 73 | if(StringUtils.isEmpty(babyEyeCheck.getId())) { |
74 | + if(!mongoUtil.buildArchive(userId, babyEyeCheck.getBabyId())) { | |
75 | + return RespBuilder.buildSuccess(ResponseCode.NEED_BUILD); | |
76 | + } | |
77 | 77 | babyEyeCheck.setCreated(new Date()); |
78 | 78 | babyEyeCheck.setYn("1"); |
79 | 79 | babyEyeCheck.setOperaterId(userId + ""); |
80 | 80 | |
81 | 81 | |
82 | 82 | |
... | ... | @@ -144,15 +144,15 @@ |
144 | 144 | if(StringUtils.isNotEmpty(s)) { |
145 | 145 | if(StringUtils.isNotEmpty(other)) { |
146 | 146 | if("yin".equals(s)) { |
147 | - return "阴 (" + other + ")"; | |
147 | + return "- (" + other + ")"; | |
148 | 148 | } else if("yang".equals(s)) { |
149 | - return "阳 (" + other + ")"; | |
149 | + return "+ (" + other + ")"; | |
150 | 150 | } |
151 | 151 | } else { |
152 | 152 | if("yin".equals(s)) { |
153 | - return "阴"; | |
153 | + return "-"; | |
154 | 154 | } else if("yang".equals(s)) { |
155 | - return "阳"; | |
155 | + return "+"; | |
156 | 156 | } |
157 | 157 | } |
158 | 158 | } |
... | ... | @@ -200,6 +200,9 @@ |
200 | 200 | if(org.apache.commons.lang.StringUtils.isNotBlank(doctor)) { |
201 | 201 | criteria.and("doctor").is(doctor); |
202 | 202 | } |
203 | + if(StringUtils.isNotEmpty(chechMonth)) { | |
204 | + criteria.and("checkMonthId").is(chechMonth); | |
205 | + } | |
203 | 206 | if(org.apache.commons.lang.StringUtils.isNotBlank(key)) { |
204 | 207 | Criteria c = new Criteria(); |
205 | 208 | c.orOperator(Criteria.where("mphone").is(key), Criteria.where("name").regex(key), Criteria.where("mcertNo").is(key)).and("yn").ne(0); |
... | ... | @@ -377,6 +380,16 @@ |
377 | 380 | public BaseResponse listInit() { |
378 | 381 | List<Map<String, Object>> checkMonth = EnumUtil.toJson(CheckMonthEnums.class); /** 检查月龄 */ |
379 | 382 | List<Map<String, Object>> positive = new ArrayList<>(); /** 阳性项目 */ |
383 | + | |
384 | + Map<String, Object> extEyelookMap = new HashMap<>(); | |
385 | + extEyelookMap.put("id", "extEyelook"); | |
386 | + extEyelookMap.put("name", "外眼观察"); | |
387 | + positive.add(extEyelookMap); | |
388 | + | |
389 | + Map<String, Object> nystagmusMap = new HashMap<>(); | |
390 | + nystagmusMap.put("id", "nystagmus"); | |
391 | + nystagmusMap.put("name", "视动性眼震"); | |
392 | + positive.add(nystagmusMap); | |
380 | 393 | |
381 | 394 | Map<String, Object> extRightEyelookMap = new HashMap<>(); |
382 | 395 | extRightEyelookMap.put("id", "extRightEyelook"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
View file @
a434f75
... | ... | @@ -2,12 +2,16 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.utils.DateUtil; |
4 | 4 | import com.lyms.platform.common.utils.StringUtils; |
5 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
6 | +import com.lyms.platform.operate.web.facade.OrganizationGroupsFacade; | |
7 | +import com.lyms.platform.pojo.BabyModel; | |
5 | 8 | import com.lyms.platform.pojo.BasicConfig; |
6 | 9 | import com.lyms.platform.pojo.Patients; |
7 | 10 | import com.mongodb.BasicDBObject; |
8 | 11 | import com.mongodb.DBObject; |
9 | 12 | import org.apache.commons.collections.map.HashedMap; |
10 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
14 | +import org.springframework.data.domain.Sort; | |
11 | 15 | import org.springframework.data.mongodb.core.MongoTemplate; |
12 | 16 | import org.springframework.data.mongodb.core.query.BasicQuery; |
13 | 17 | import org.springframework.data.mongodb.core.query.Criteria; |
... | ... | @@ -25,6 +29,46 @@ |
25 | 29 | public class MongoUtil { |
26 | 30 | @Autowired |
27 | 31 | private MongoTemplate mongoTemplate; |
32 | + | |
33 | + @Autowired | |
34 | + AutoMatchFacade autoMatchFacade; | |
35 | + | |
36 | + @Autowired | |
37 | + private OrganizationGroupsFacade organizationGroupsFacade; | |
38 | + | |
39 | + /** | |
40 | + * 隐藏建档 | |
41 | + * @param userId | |
42 | + * @return | |
43 | + */ | |
44 | + public boolean buildArchive(Integer userId, String babyId) { | |
45 | + BabyModel b = mongoTemplate.findById(babyId, BabyModel.class); | |
46 | + String pid = b.getPid(); | |
47 | + Assert.notNull(pid, "pid 不能为null"); | |
48 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
49 | + // 如果本院已有记录 直接走正常流程 | |
50 | + BabyModel baby = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "created")), BabyModel.class); | |
51 | + if(baby != null) { | |
52 | + return true; | |
53 | + } | |
54 | + | |
55 | + List<String> hospitalIds = organizationGroupsFacade.findGroupHospital(userId, true); | |
56 | + if (CollectionUtils.isNotEmpty(hospitalIds)) { | |
57 | + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").in(hospitalIds) | |
58 | + .and("pid").is(pid).and("enable").ne("2")).with(new Sort(Sort.Direction.DESC, "created")), BabyModel.class); | |
59 | + if(babyModel == null) { | |
60 | + return false; // 需 要建档 | |
61 | + } | |
62 | + babyModel.setId(null); | |
63 | + babyModel.setHospitalId(hospitalId); | |
64 | + babyModel.setEnable("2"); | |
65 | + babyModel.setSource(babyId); | |
66 | + babyModel.setCreated(new Date()); | |
67 | + mongoTemplate.save(babyModel); | |
68 | + return true; | |
69 | + } | |
70 | + return false; | |
71 | + } | |
28 | 72 | |
29 | 73 | /** |
30 | 74 | * 查询mongo表中指定的字段 |