Commit 6ce26ebf8b332ba535dee60bb06a868f3ed73927
1 parent
10be9da4f8
Exists in
master
and in
6 other branches
update
Showing 7 changed files with 115 additions and 6 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IYunBookBuildingDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/YunBookbuildingDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java
- platform-dal/src/main/java/com/lyms/platform/pojo/FilePathModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HuadaCallbackModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IYunBookBuildingDao.java
View file @
6ce26eb
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/YunBookbuildingDaoImpl.java
View file @
6ce26eb
... | ... | @@ -65,6 +65,11 @@ |
65 | 65 | } |
66 | 66 | |
67 | 67 | @Override |
68 | + public FilePathModel findFilePathByBabyId(String babyId) { | |
69 | + return mongoTemplate.findOne(Query.query(Criteria.where("babyId").is(babyId)),FilePathModel.class); | |
70 | + } | |
71 | + | |
72 | + @Override | |
68 | 73 | public void updatePatient(Patients obj, String id) { |
69 | 74 | update(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery(), obj); |
70 | 75 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
View file @
6ce26eb
platform-dal/src/main/java/com/lyms/platform/pojo/BabyEyeCheck.java
View file @
6ce26eb
... | ... | @@ -304,6 +304,26 @@ |
304 | 304 | private String doctorJudgement; |
305 | 305 | |
306 | 306 | |
307 | + private FilePathModel filePath; | |
308 | + //删除文件路径 | |
309 | + private List<String> delFiles; | |
310 | + | |
311 | + public FilePathModel getFilePath() { | |
312 | + return filePath; | |
313 | + } | |
314 | + | |
315 | + public void setFilePath(FilePathModel filePath) { | |
316 | + this.filePath = filePath; | |
317 | + } | |
318 | + | |
319 | + public List<String> getDelFiles() { | |
320 | + return delFiles; | |
321 | + } | |
322 | + | |
323 | + public void setDelFiles(List<String> delFiles) { | |
324 | + this.delFiles = delFiles; | |
325 | + } | |
326 | + | |
307 | 327 | public String getApparatus() { |
308 | 328 | return apparatus; |
309 | 329 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/FilePathModel.java
View file @
6ce26eb
... | ... | @@ -23,6 +23,9 @@ |
23 | 23 | //孕妇建档id |
24 | 24 | private String patientId; |
25 | 25 | |
26 | + //儿童眼保健档案id | |
27 | + private String babyEyeId; | |
28 | + | |
26 | 29 | //孕妇身份证正面 |
27 | 30 | private String cardNoz; |
28 | 31 | //孕妇身份证反面 |
... | ... | @@ -51,6 +54,34 @@ |
51 | 54 | //丈夫面部信息 |
52 | 55 | private String hfacePatient; |
53 | 56 | |
57 | + | |
58 | + private String eyeOnePath; | |
59 | + | |
60 | + private String eyeTwoPath; | |
61 | + | |
62 | + public String getBabyEyeId() { | |
63 | + return babyEyeId; | |
64 | + } | |
65 | + | |
66 | + public void setBabyEyeId(String babyEyeId) { | |
67 | + this.babyEyeId = babyEyeId; | |
68 | + } | |
69 | + | |
70 | + public String getEyeOnePath() { | |
71 | + return eyeOnePath; | |
72 | + } | |
73 | + | |
74 | + public void setEyeOnePath(String eyeOnePath) { | |
75 | + this.eyeOnePath = eyeOnePath; | |
76 | + } | |
77 | + | |
78 | + public String getEyeTwoPath() { | |
79 | + return eyeTwoPath; | |
80 | + } | |
81 | + | |
82 | + public void setEyeTwoPath(String eyeTwoPath) { | |
83 | + this.eyeTwoPath = eyeTwoPath; | |
84 | + } | |
54 | 85 | |
55 | 86 | public String getId() { |
56 | 87 | return id; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HuadaCallbackModel.java
View file @
6ce26eb
... | ... | @@ -49,6 +49,8 @@ |
49 | 49 | private String productLines;//权限-城市 1-城市 2-客户编码 3-数据来源 4-产品线 5 产品编码 示例:[], |
50 | 50 | private String productCodes;//权限-城市 1-城市 2-客户编码 3-数据来源 4-产品线 5 产品编码 示例:[] |
51 | 51 | |
52 | + private String reportType; //报告类型 正式报告、失败报告、重取样报告 | |
53 | + | |
52 | 54 | public String getZ13ZScore() { |
53 | 55 | return z13ZScore; |
54 | 56 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
View file @
6ce26eb
1 | 1 | package com.lyms.platform.operate.web.service.impl; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.BasicConfigService; |
4 | +import com.lyms.platform.biz.service.YunBookbuildingService; | |
4 | 5 | import com.lyms.platform.common.enums.*; |
5 | 6 | import com.lyms.platform.common.pojo.SyncDataModel; |
6 | 7 | import com.lyms.platform.common.result.*; |
... | ... | @@ -9,6 +10,7 @@ |
9 | 10 | import com.lyms.platform.operate.web.facade.BasicConfigFacade; |
10 | 11 | import com.lyms.platform.operate.web.facade.OperateLogFacade; |
11 | 12 | import com.lyms.platform.operate.web.facade.OrganizationGroupsFacade; |
13 | +import com.lyms.platform.operate.web.request.YunBookbuildingAddRequest; | |
12 | 14 | import com.lyms.platform.operate.web.service.BabyAfterVisitService; |
13 | 15 | import com.lyms.platform.operate.web.service.BabyEyeCheckService; |
14 | 16 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
... | ... | @@ -19,6 +21,7 @@ |
19 | 21 | import com.lyms.platform.permission.dao.master.CouponMapper; |
20 | 22 | import com.lyms.platform.pojo.BabyEyeCheck; |
21 | 23 | import com.lyms.platform.pojo.BabyModel; |
24 | +import com.lyms.platform.pojo.FilePathModel; | |
22 | 25 | import com.lyms.platform.pojo.Patients; |
23 | 26 | import org.apache.commons.collections.map.HashedMap; |
24 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -30,6 +33,7 @@ |
30 | 33 | import org.springframework.stereotype.Service; |
31 | 34 | |
32 | 35 | import javax.servlet.http.HttpServletResponse; |
36 | +import java.io.File; | |
33 | 37 | import java.io.Serializable; |
34 | 38 | import java.util.*; |
35 | 39 | |
... | ... | @@ -44,12 +48,6 @@ |
44 | 48 | private BabyEyeCheckMapper babyEyeCheckMapper; |
45 | 49 | |
46 | 50 | @Autowired |
47 | - private BasicConfigService basicConfigService; | |
48 | - | |
49 | - @Autowired | |
50 | - private BasicConfigFacade basicConfigFacade; | |
51 | - | |
52 | - @Autowired | |
53 | 51 | private AutoMatchFacade autoMatchFacade; |
54 | 52 | |
55 | 53 | @Autowired |
56 | 54 | |
... | ... | @@ -68,8 +66,13 @@ |
68 | 66 | private BabyAfterVisitService babyAfterVisitService; |
69 | 67 | |
70 | 68 | @Autowired |
69 | + private YunBookbuildingService yunBookbuildingService; | |
70 | + | |
71 | + @Autowired | |
71 | 72 | private OperateLogFacade operateLogFacade; |
72 | 73 | |
74 | + public static final String BASE_IMG_PATH = PropertiesUtils.getPropertyValue("img_path"); | |
75 | + | |
73 | 76 | public static String mongo_crypto_key = Config.getItem("mongo_crypto_key", "0"); |
74 | 77 | |
75 | 78 | @Override |
76 | 79 | |
... | ... | @@ -168,9 +171,43 @@ |
168 | 171 | } |
169 | 172 | |
170 | 173 | } |
174 | + | |
175 | + if (CollectionUtils.isNotEmpty(babyEyeCheck.getDelFiles())) | |
176 | + { | |
177 | + deleteImg(babyEyeCheck); | |
178 | + } | |
179 | + FilePathModel filePath = babyEyeCheck.getFilePath(); | |
180 | + if (filePath != null && filePath.getId() == null) { | |
181 | + filePath.setBabyEyeId(babyEyeCheck.getBabyId()); | |
182 | + yunBookbuildingService.addFilePath(filePath); | |
183 | + } | |
184 | + else if (filePath != null) | |
185 | + { | |
186 | + yunBookbuildingService.updateFilePath(filePath); | |
187 | + } | |
188 | + | |
171 | 189 | return RespBuilder.buildSuccess(babyEyeCheck.getId()); |
172 | 190 | } |
173 | 191 | |
192 | + | |
193 | + | |
194 | + public void deleteImg(BabyEyeCheck babyEyeCheck) { | |
195 | + List<String> files = new ArrayList<>(); | |
196 | + List<String> delFiles = babyEyeCheck.getDelFiles(); | |
197 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(delFiles)) { | |
198 | + files.addAll(delFiles); | |
199 | + } | |
200 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(files)) { | |
201 | + for (String filePath : files) { | |
202 | + File filepath = new File(BASE_IMG_PATH + File.separator + filePath); | |
203 | + if (filepath.exists()) { | |
204 | + filepath.delete(); | |
205 | + } | |
206 | + } | |
207 | + } | |
208 | + | |
209 | + } | |
210 | + | |
174 | 211 | @Override |
175 | 212 | public BaseResponse info(String id) { |
176 | 213 | BabyEyeCheck babyEyeCheck = mongoTemplate.findById(id, BabyEyeCheck.class); |
... | ... | @@ -276,6 +313,9 @@ |
276 | 313 | map.put("vision2", "yang".equals(babyEyeCheck.getVision2()) ? "医生判定阳性" : ""); |
277 | 314 | map.put("y2", "yang".equals(babyEyeCheck.getY2()) ? "医生判定阳性" : ""); |
278 | 315 | map.put("refraction2", "yang".equals(babyEyeCheck.getRefraction2()) ? "医生判定阳性" : ""); |
316 | + | |
317 | + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getBabyId()); | |
318 | + map.put("filePath", filePath); | |
279 | 319 | // |
280 | 320 | CollectionUtils.removeNullValue(map); |
281 | 321 | return RespBuilder.buildSuccess(map); |
... | ... | @@ -312,6 +352,10 @@ |
312 | 352 | if (StringUtils.isNotEmpty(babyEyeCheck.getCheckMonthId())) { |
313 | 353 | map.put("checkMonthId", babyEyeCheck.getCheckMonthId() + ""); |
314 | 354 | } |
355 | + | |
356 | + FilePathModel filePath = yunBookbuildingService.findFilePathByBabyId(babyEyeCheck.getBabyId()); | |
357 | + map.put("filePath", filePath); | |
358 | + | |
315 | 359 | map.put("nextCheckTime", DateUtil.getYyyyMmDd(babyEyeCheck.getNextCheckTime())); |
316 | 360 | if (babyEyeCheck.getRiskFactorId() != null) { |
317 | 361 | List<String> riskFactorId = babyEyeCheck.getRiskFactorId(); |