Commit 93d761010e5dc8eb101e7ce5cff72053d5ad399d
1 parent
6c54f45bbf
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 65 additions and 52 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHighRiskService.java
View file @
93d7610
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
93d7610
... | ... | @@ -267,8 +267,18 @@ |
267 | 267 | babyModelQuery.setPid(pid); |
268 | 268 | babyModelQuery.setSource(null); |
269 | 269 | babyModelQuery.setEnable(null); |
270 | - babyModel = findBabyCond(babyModelQuery, groupsFacade.findGroupHospital(userId, false), false); | |
271 | - babyModel.setSource(babyModel.getId()); | |
270 | + babyModelQuery.setHospitalIdList(null); | |
271 | + List <BabyModel> babyModels = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery); | |
272 | + if (CollectionUtils.isNotEmpty(babyModels)) { | |
273 | + for (BabyModel model : babyModels) | |
274 | + { | |
275 | + if (StringUtils.isEmpty(model.getSource())) | |
276 | + { | |
277 | + babyModel.setSource(model.getId()); | |
278 | + break; | |
279 | + } | |
280 | + } | |
281 | + } | |
272 | 282 | babyModel.setId(null); |
273 | 283 | babyModel.setHospitalId(hospitalId); |
274 | 284 | babyModel.setCreated(new Date()); |
platform-transfer/src/main/java/com/lyms/platform/worker/BoneTransferWorker.java
View file @
93d7610
... | ... | @@ -2,13 +2,12 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.comm.ApplicationProperties; |
4 | 4 | import com.lyms.platform.comm.StringUtils; |
5 | -import com.lyms.platform.conn.BoneConnectionFactory; | |
6 | -import com.lyms.platform.conn.inf.ConnectionFactoryMethod; | |
7 | 5 | import com.lyms.platform.conn.inf.IConnection; |
8 | 6 | import org.apache.commons.httpclient.util.DateUtil; |
9 | 7 | import org.slf4j.Logger; |
10 | 8 | import org.slf4j.LoggerFactory; |
11 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | +import org.springframework.context.annotation.Scope; | |
12 | 11 | import org.springframework.stereotype.Component; |
13 | 12 | |
14 | 13 | import java.sql.*; |
... | ... | @@ -20,6 +19,7 @@ |
20 | 19 | * 骨密度 |
21 | 20 | */ |
22 | 21 | @Component |
22 | +@Scope("singleton") | |
23 | 23 | public class BoneTransferWorker extends TransferAbstract implements ITransfer{ |
24 | 24 | private static final Logger logger = LoggerFactory.getLogger(BoneTransferWorker.class); |
25 | 25 | @Autowired |
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 | String url = "jdbc:Access:///"+properties.getDataPath(); |
36 | 36 | conn = DriverManager.getConnection(url, "", ""); |
37 | 37 | } catch (Exception e) { |
38 | - logger.error("getConnection error."+e.toString()); | |
38 | + logger.error("getConnection error.",e); | |
39 | 39 | } |
40 | 40 | return conn; |
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | 47 | |
48 | 48 | |
49 | 49 | |
50 | 50 | |
51 | 51 | |
52 | 52 | |
53 | 53 | |
54 | 54 | |
... | ... | @@ -55,56 +55,59 @@ |
55 | 55 | sta = conn.createStatement(); |
56 | 56 | String sql = "select PatientID,ZScore,TScore,dbSos,dbBqi,dbRrf,dbEoa,YoungAdult,ageMatched,dbAge,PartDisplayName,PatientName from PatientInfo where status is null and DayTimeOfSave > "+ DateUtil.formatDate(new Date(),"yyyy-MM-dd"); |
57 | 57 | rst = sta.executeQuery(sql); |
58 | - while (rst.next()) { | |
59 | - Map map = new HashMap(); | |
60 | - String PatientID = rst.getString("PatientID"); //身份证后八位 | |
61 | - map.put("cardNo",PatientID); | |
58 | + if (!rst.isClosed()) | |
59 | + { | |
60 | + while (rst.next()) { | |
61 | + Map map = new HashMap(); | |
62 | + String PatientID = rst.getString("PatientID"); //身份证后八位 | |
63 | + map.put("cardNo",PatientID); | |
62 | 64 | |
63 | - String PartDisplayName = rst.getString("PartDisplayName"); | |
64 | - map.put("position",PartDisplayName); | |
65 | + String PartDisplayName = rst.getString("PartDisplayName"); | |
66 | + map.put("position",PartDisplayName); | |
65 | 67 | |
66 | - String PatientName = rst.getString("PatientName"); //孕妇姓名 | |
67 | - map.put("username",PatientName); | |
68 | + String PatientName = rst.getString("PatientName"); //孕妇姓名 | |
69 | + map.put("username",PatientName); | |
68 | 70 | |
69 | - String ZScore = rst.getString("ZScore"); | |
70 | - String TScore = rst.getString("TScore"); | |
71 | - String dbSos = rst.getString("dbSos"); | |
71 | + String ZScore = rst.getString("ZScore"); | |
72 | + String TScore = rst.getString("TScore"); | |
73 | + String dbSos = rst.getString("dbSos"); | |
72 | 74 | |
73 | - String bqi = rst.getString("dbBqi"); | |
74 | - String rrf = rst.getString("dbRrf"); | |
75 | - String eoa = rst.getString("dbEoa"); | |
75 | + String bqi = rst.getString("dbBqi"); | |
76 | + String rrf = rst.getString("dbRrf"); | |
77 | + String eoa = rst.getString("dbEoa"); | |
76 | 78 | |
77 | - String adultPercent = rst.getString("YoungAdult"); | |
78 | - String agePercent = rst.getString("ageMatched"); | |
79 | - String age = rst.getString("dbAge"); | |
79 | + String adultPercent = rst.getString("YoungAdult"); | |
80 | + String agePercent = rst.getString("ageMatched"); | |
81 | + String age = rst.getString("dbAge"); | |
80 | 82 | |
81 | - map.put("zvalue",ZScore); | |
82 | - map.put("tvalue",TScore); | |
83 | - map.put("sos",dbSos); | |
83 | + map.put("zvalue",ZScore); | |
84 | + map.put("tvalue",TScore); | |
85 | + map.put("sos",dbSos); | |
84 | 86 | |
85 | - map.put("bqi",bqi); | |
86 | - map.put("rrf",rrf); | |
87 | - map.put("eoa",eoa); | |
87 | + map.put("bqi",bqi); | |
88 | + map.put("rrf",rrf); | |
89 | + map.put("eoa",eoa); | |
88 | 90 | |
89 | - map.put("adultPercent",adultPercent); | |
90 | - map.put("agePercent",agePercent); | |
91 | - map.put("age",age); | |
92 | - map.put("type",properties.getType()); // | |
93 | - map.put("hospitalId",properties.getHospitalId()); // | |
91 | + map.put("adultPercent",adultPercent); | |
92 | + map.put("agePercent",agePercent); | |
93 | + map.put("age",age); | |
94 | + map.put("type",properties.getType()); // | |
95 | + map.put("hospitalId",properties.getHospitalId()); // | |
94 | 96 | |
95 | - if (map.size() > 0 && StringUtils.isNotEmpty(PatientID)) | |
96 | - { | |
97 | - String response = send(map, properties.getUrl() + "/saveBone"); | |
98 | - if (response.contains("0")) | |
97 | + if (map.size() > 0 && StringUtils.isNotEmpty(PatientID)) | |
99 | 98 | { |
100 | - sta.executeUpdate("update PatientInfo set status='1' where PatientID='" + PatientID + "'"); | |
101 | - conn.commit(); | |
99 | + String response = send(map, properties.getUrl() + "/saveBone"); | |
100 | + if (response.contains("0")) | |
101 | + { | |
102 | + sta.executeUpdate("update PatientInfo set status='1' where PatientID='" + PatientID + "'"); | |
103 | + conn.commit(); | |
104 | + } | |
102 | 105 | } |
103 | 106 | } |
107 | + Thread.sleep(30000); | |
104 | 108 | } |
105 | - Thread.sleep(30000); | |
106 | 109 | } catch (Exception e) { |
107 | - logger.error("getBoneRecords Exception. "+e.toString()); | |
110 | + logger.error("getBoneRecords Exception. ",e); | |
108 | 111 | } |
109 | 112 | finally { |
110 | 113 | iConnection.close(conn, sta,rst); |