Commit 46104f10698680d3c0499c946e85e25da55e48f8

Authored by wangbo

Merge remote-tracking branch 'origin/master'

Showing 4 changed files

platform-operate-api/pom.xml View file @ 46104f1
1 1 <?xml version="1.0" encoding="UTF-8"?>
2   -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4 5 <parent>
5   - <groupId>com.lyms.core</groupId>
6 6 <artifactId>regional-platform</artifactId>
  7 + <groupId>com.lyms.core</groupId>
7 8 <version>1.0.1</version>
8 9 </parent>
9 10 <modelVersion>4.0.0</modelVersion>
10   - <packaging>war</packaging>
11   - <artifactId>platform-operate-api</artifactId>
  11 + <packaging>jar</packaging>
  12 + <artifactId>platform-reportData</artifactId>
12 13  
13 14 <dependencies>
14   - <!--<dependency>-->
15   - <!--<groupId>org.apache.httpcomponents</groupId>-->
16   - <!--<artifactId>httpclient</artifactId>-->
17   - <!--<version>4.5.2</version>-->
18   - <!--</dependency>-->
19   -
20   - <!--<dependency>-->
21   - <!--<groupId>commons-httpclient</groupId>-->
22   - <!--<artifactId>commons-httpclient</artifactId>-->
23   - <!--</dependency>-->
24 15 <dependency>
25   - <groupId>com.aspose</groupId>
26   - <artifactId>aspose-words</artifactId>
27   - </dependency>
28   -
29   - <dependency>
30   - <groupId>net.java.dev.jna</groupId>
31   - <artifactId>jna</artifactId>
32   - </dependency>
33   -
34   - <dependency>
35 16 <groupId>com.lyms.core</groupId>
36 17 <artifactId>platform-common</artifactId>
37   - <version>${project.version}</version>
  18 + <version>1.0.1</version>
38 19 </dependency>
39 20 <dependency>
40   - <groupId>com.lyms.core</groupId>
41   - <artifactId>platform-dal</artifactId>
42   - <version>${project.version}</version>
  21 + <groupId>com.oracle</groupId>
  22 + <artifactId>ojdbc14</artifactId>
  23 + <version>11.2.0.1.0</version>
43 24 </dependency>
44   - <dependency>
45   - <groupId>com.lyms.core</groupId>
46   - <artifactId>platform-biz-service</artifactId>
47   - <version>${project.version}</version>
48   - </dependency>
49   - <dependency>
50   - <groupId>com.lyms.core</groupId>
51   - <artifactId>platform-biz-patient-service</artifactId>
52   - <version>${project.version}</version>
53   - </dependency>
54   - <dependency>
55   - <groupId>com.lyms.core</groupId>
56   - <artifactId>platform-reportData</artifactId>
57   - <version>${project.version}</version>
58   - </dependency>
59   - <dependency>
60   - <groupId>org.apache.activemq</groupId>
61   - <artifactId>activemq-all</artifactId>
62   - <version>${org.activemq.version}</version>
63   - </dependency>
64   - <dependency>
65   - <groupId>javax.jms</groupId>
66   - <artifactId>javax.jms-api</artifactId>
67   - <version>2.0.1</version>
68   - </dependency>
69   - <dependency>
70   - <groupId>org.springframework</groupId>
71   - <artifactId>spring-jms</artifactId>
72   - <version>${org.springframework.version}</version>
73   - </dependency>
74   - <dependency>
75   - <groupId>org.apache.activemq</groupId>
76   - <artifactId>activemq-core</artifactId>
77   - <version>${org.activemq.version}</version>
78   - </dependency>
79   - <dependency>
80   - <groupId>org.apache.activemq</groupId>
81   - <artifactId>activemq-pool</artifactId>
82   - <version>${org.activemq.version}</version>
83   - </dependency>
84   - <dependency>
85   - <groupId>org.apache.commons</groupId>
86   - <artifactId>commons-lang3</artifactId>
87   - <version>3.4</version>
88   - </dependency>
89   - <dependency>
90   - <groupId>org.eclipse.jetty</groupId>
91   - <artifactId>jetty-servlets</artifactId>
92   - <version>9.3.8.v20160314</version>
93   - </dependency>
94   -
95   - <dependency>
96   - <groupId>net.sourceforge.jexcelapi</groupId>
97   - <artifactId>jxl</artifactId>
98   - <version>2.6.12</version>
99   - </dependency>
100   -
101   - <!-- https://mvnrepository.com/artifact/freemarker/freemarker -->
102   - <!-- <dependency>
103   - <groupId>freemarker</groupId>
104   - <artifactId>freemarker</artifactId>
105   - <version>2.3.9</version>
106   - </dependency>-->
107   -
108   -
109   - <!-- https://mvnrepository.com/artifact/ro.pippo/pippo-freemarker -->
110   - <!-- <dependency>
111   - <groupId>ro.pippo</groupId>
112   - <artifactId>pippo-freemarker</artifactId>
113   - <version>1.12.0</version>
114   - </dependency>-->
115   -
116 25 </dependencies>
117 26 <build>
118   - <resources>
119   - <resource>
120   - <directory>../platform-resource/resources</directory>
121   - <excludes>
122   - <exclude>
123   - **/*
124   - </exclude>
125   - </excludes>
126   - <filtering>true</filtering>
127   - </resource>
128   - <resource>
129   - <directory>src/main/resources</directory>
130   - <includes>
131   - <include>**/*</include>
132   - </includes>
133   -
134   - </resource>
135   - <!-- ่ฎพ็ฝฎๅฏนauto-config.properties๏ผŒjdbc.properties่ฟ›่กŒ่ฟ‡่™‘๏ผŒๅณ่ฟ™ไบ›ๆ–‡ไปถไธญ็š„${key}ไผš่ขซๆ›ฟๆขๆމไธบ็œŸๆญฃ็š„ๅ€ผ -->
136   - <!-- -->
137   - <resource>
138   - <directory>src/main/resources</directory>
139   - <includes>
140   - <include>database.properties</include>
141   - </includes>
142   - <filtering>true</filtering>
143   - </resource>
144   - </resources>
145 27 <plugins>
146 28 <plugin>
147 29 <groupId>org.apache.maven.plugins</groupId>
148 30  
149 31  
150 32  
151 33  
... ... @@ -149,66 +31,11 @@
149 31 <configuration>
150 32 <source>1.7</source>
151 33 <target>1.7</target>
152   - <encoding>${maven.compiler.encoding}</encoding>
153 34 </configuration>
154 35 </plugin>
155   - <plugin>
156   - <groupId>org.apache.maven.plugins</groupId>
157   - <artifactId>maven-resources-plugin</artifactId>
158   - <version>2.6</version>
159   - <configuration>
160   - <encoding>${project.build.sourceEncoding}</encoding>
161   - <!-- ๆŒ‡ๅฎš็ผ–็ ๆ ผๅผ๏ผŒๅฆๅˆ™ๅœจDOSไธ‹่ฟ่กŒmvnๅ‘ฝไปคๆ—ถๅฝ“ๅ‘็”Ÿๆ–‡ไปถ่ต„ๆบcopyๆ—ถๅฐ†ไฝฟ็”จ็ณป็ปŸ้ป˜่ฎคไฝฟ็”จGBK็ผ–็  -->
162   - </configuration>
163   - </plugin>
164   -
165   - <!-- jettyๆ’ไปถ -->
166   - <plugin>
167   - <groupId>org.eclipse.jetty</groupId>
168   - <artifactId>jetty-maven-plugin</artifactId>
169   - <version>9.3.8.v20160314</version>
170   - <configuration>
171   - <httpConnector>
172   - <port>9091</port>
173   - </httpConnector>
174   - <webAppConfig>
175   - <contextPath>/</contextPath>
176   - </webAppConfig>
177   - </configuration>
178   - </plugin>
179 36 </plugins>
180   - <finalName>platform-operate-api</finalName>
  37 + <finalName>platform-mommyData</finalName>
181 38 </build>
182   - <profiles>
183   - <profile>
184   - <id>dev</id>
185 39  
186   - <!-- ้ป˜่ฎคๆฟ€ๆดปๅผ€ๅ‘้…ๅˆถ๏ผŒไฝฟ็”จconfig-dev.propertiesๆฅๆ›ฟๆข่ฎพ็ฝฎ่ฟ‡่™‘็š„่ต„ๆบๆ–‡ไปถไธญ็š„${key} -->
187   - <activation>
188   - <activeByDefault>true</activeByDefault>
189   - </activation>
190   - <build>
191   - <filters>
192   - <filter>../platform-resource/resources/config-dev.properties</filter>
193   - </filters>
194   - </build>
195   - </profile>
196   - <profile>
197   - <id>test</id>
198   - <build>
199   - <filters>
200   - <filter>../platform-resource/resources/config-test.properties</filter>
201   - </filters>
202   - </build>
203   - </profile>
204   - <profile>
205   - <id>prod</id>
206   - <build>
207   - <filters>
208   - <filter>../platform-resource/resources/config-product.properties</filter>
209   - </filters>
210   - </build>
211   - </profile>
212   - </profiles>
213 40 </project>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SaveByV2ThreadPoolFacade.java View file @ 46104f1
1 1 package com.lyms.platform.operate.web.facade;
2 2  
  3 +import com.lyms.platform.biz.dal.IBasicConfigDao;
3 4 import com.lyms.platform.common.constants.ErrorCodeConstants;
4 5 import com.lyms.platform.common.result.BaseObjectResponse;
5 6 import com.lyms.platform.common.result.BaseResponse;
... ... @@ -39,6 +40,9 @@
39 40  
40 41 @Autowired
41 42 private MongoTemplate mongoTemplate;
  43 +
  44 + @Autowired
  45 + private IBasicConfigDao basicConfigDao;
42 46 /**
43 47 * ไฟๅญ˜ๅކๅฒๆ•ฐๆฎ๏ผŒๆ นๆฎๆ—ถ้—ดๅ’ŒๅŒป้™ขid
44 48 *
45 49  
46 50  
47 51  
48 52  
... ... @@ -46,33 +50,22 @@
46 50 * @return BaseResponse
47 51 */
48 52 public BaseResponse saveByV2(SyncV2HistoryRequest param) {
49   - //่Žทๅ–2.0ๅކๅฒๅปบๆกฃๆ•ฐๆฎ
  53 +
50 54 String startTime = param.getStartTime();
51 55 String endTime = param.getEndTime();
52   - Connection connection = null;
53 56 // ๅŒๆญฅ่ฎกๆ•ฐๅ™จ
54 57 AtomicInteger okSize=new AtomicInteger(0);
55 58 AtomicInteger existSize=new AtomicInteger(0);
56 59 AtomicInteger errorSize=new AtomicInteger(0);
57 60  
  61 + Connection connection = null;
  62 + List<SyncV2HistoryRequest> lists=null;
58 63 try {
59 64 connection = bookbuildingFacade.getConnection();
60 65 String sql = getSqlString(startTime, endTime);
61 66 QueryRunner queryRunner = new QueryRunner(true);
62   - List<SyncV2HistoryRequest> lists = queryRunner.query(connection, sql, new BeanListHandler<SyncV2HistoryRequest>(SyncV2HistoryRequest.class));
  67 + lists = queryRunner.query(connection, sql, new BeanListHandler<SyncV2HistoryRequest>(SyncV2HistoryRequest.class));
63 68  
64   - if (CollectionUtils.isNotEmpty(lists)) {
65   - int batchSize = 2;
66   - int end = 0;
67   - for (int i = 0; i < lists.size(); i += batchSize) {
68   - end = (end + batchSize);
69   - if (end > lists.size()) {
70   - end = lists.size();
71   - }
72   - Future f = commonThreadPool.submit(new SyncV2HistoryWorkerx(bookbuildingFacade, lists.subList(i, end), mongoTemplate, okSize, existSize, errorSize));
73   - }
74   - }
75   -
76 69 } catch (Exception e) {
77 70 logger.info(e.getMessage());
78 71 return new BaseResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg("็ณป็ปŸๅผ‚ๅธธ");
79 72  
... ... @@ -85,8 +78,18 @@
85 78 }
86 79 }
87 80 }
  81 + if (CollectionUtils.isNotEmpty(lists)) {
  82 + int batchSize = 2;
  83 + int end = 0;
  84 + for (int i = 0; i < lists.size(); i += batchSize) {
  85 + end = (end + batchSize);
  86 + if (end > lists.size()) {
  87 + end = lists.size();
  88 + }
  89 + Future f = commonThreadPool.submit(new SyncV2HistoryWorkerx(bookbuildingFacade, lists.subList(i, end), mongoTemplate, okSize, existSize, errorSize,basicConfigDao));
  90 + }
  91 + }
88 92 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๅŒๆญฅ็ป“ๆžœ: ok ===>" + okSize + "exist===>" + existSize + "error===>" + errorSize);
89   -
90 93 }
91 94  
92 95 private String getSqlString(String startTime, String endTime) {
... ... @@ -130,7 +133,7 @@
130 133 " (select p.* from V_SYNC_TO_V3_PATIENT p " +
131 134 " left join V_SYNC_TO_V3_PDR pdr on pdr.p_no = p.p_no " +
132 135 " where pdr.p_no is null and to_char(p.P_FILINGTIME,'YYYY-MM') BETWEEN '" + startTime + "' and '" + endTime + "' and ( p.P_ADDRESSCOUNTY='160' OR p.P_POSTPARTUMCOUNTY='160' OR p.P_RRCOUNTY ='160')" +
133   - " and p.P_LASTMENSTRUALPERIOD > sysdate - 294" +
  136 + " and p.P_LASTMENSTRUALPERIOD > sysdate - 2940" +
134 137 " union " +
135 138 " select p.* from V_SYNC_TO_V3_PATIENT p " +
136 139 " right join V_SYNC_TO_V3_PDR pdr on pdr.p_no = p.p_no " +
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/SyncV2HistoryWorkerx.java View file @ 46104f1
1 1 package com.lyms.platform.operate.web.worker;
2 2  
3 3 import com.lyms.platform.common.constants.ErrorCodeConstants;
  4 +import com.lyms.platform.biz.dal.IBasicConfigDao;
  5 +import com.lyms.platform.biz.service.AntenatalExaminationService;
  6 +import com.lyms.platform.biz.service.PatientsService;
  7 +import com.lyms.platform.biz.service.PostReviewService;
  8 +import com.lyms.platform.common.dao.operator.MongoCondition;
  9 +import com.lyms.platform.common.dao.operator.MongoOper;
  10 +import com.lyms.platform.common.enums.YnEnums;
4 11 import com.lyms.platform.common.result.BaseObjectResponse;
5 12 import com.lyms.platform.common.utils.DateUtil;
6 13 import com.lyms.platform.operate.web.facade.BookbuildingFacade;
7 14 import com.lyms.platform.operate.web.request.SyncV2HistoryRequest;
8 15 import com.lyms.platform.operate.web.request.YunBookbuildingAddRequest;
  16 +import com.lyms.platform.pojo.AntExChuModel;
  17 +import com.lyms.platform.pojo.AntenatalExaminationModel;
  18 +import com.lyms.platform.pojo.BasicConfig;
9 19 import com.lyms.platform.pojo.Patients;
  20 +import com.lyms.platform.query.AntExChuQuery;
  21 +import com.lyms.platform.query.AntExQuery;
  22 +import com.lyms.platform.query.PostReviewQuery;
  23 +import org.apache.commons.collections.CollectionUtils;
  24 +import org.springframework.beans.factory.annotation.Autowired;
  25 +import org.springframework.data.domain.Sort;
10 26 import org.springframework.data.mongodb.core.MongoTemplate;
11 27 import org.springframework.data.mongodb.core.query.Criteria;
12 28 import org.springframework.data.mongodb.core.query.Query;
13 29  
14 30  
15 31  
16 32  
17 33  
18 34  
19 35  
20 36  
21 37  
22 38  
23 39  
24 40  
... ... @@ -24,57 +40,68 @@
24 40 public class SyncV2HistoryWorkerx implements Callable {
25 41  
26 42 private BookbuildingFacade bookbuildingFacade;
27   -
28 43 private List<SyncV2HistoryRequest> lists;
29   -
30 44 private MongoTemplate mongoTemplate;
31   -
32 45 private AtomicInteger okSize;
33 46 private AtomicInteger existSize;
34 47 private AtomicInteger errorSize;
  48 + private IBasicConfigDao basicConfigDao;
35 49  
36 50 public SyncV2HistoryWorkerx(BookbuildingFacade bookbuildingFacade,
37 51 List<SyncV2HistoryRequest> lists,
38 52 MongoTemplate mongoTemplate,
39 53 AtomicInteger okSize,
40 54 AtomicInteger existSize,
41   - AtomicInteger errorSize
42   - ) {
  55 + AtomicInteger errorSize,
  56 + IBasicConfigDao basicConfigDao) {
43 57 this.bookbuildingFacade = bookbuildingFacade;
44 58 this.lists = lists;
45 59 this.mongoTemplate = mongoTemplate;
46 60 this.okSize = okSize;
47 61 this.existSize = existSize;
48 62 this.errorSize = errorSize;
49   -
  63 + this.basicConfigDao = basicConfigDao;
50 64 }
51 65  
52 66 @Override
53   - public BaseObjectResponse call() throws Exception {
54   - BaseObjectResponse p=null;
55   - for (YunBookbuildingAddRequest list : lists) {
56   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(list.getPregnantCertificateNum())), Patients.class);
57   - if (patients != null) {
58   - existSize.incrementAndGet();
59   - continue;
60   - }
  67 + public BaseObjectResponse call() throws Exception {
  68 + BaseObjectResponse p=null;
  69 + for (YunBookbuildingAddRequest list : lists) {
  70 + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(list.getPregnantCertificateNum())), Patients.class);
  71 + if (patients != null) {
  72 + existSize.incrementAndGet();
  73 + continue;
  74 + }
61 75  
62   - list.setHospitalId("216");//todo
63   - list.setBookbuildingDoctor("1000000185");//todo
64   - list.setBookbuildingDate(DateUtil.getyyyy_MM_dd(new Date()));
65   - p = bookbuildingFacade.addPregnantBookbuilding(list, null, false);
66   - if (ErrorCodeConstants.SUCCESS == p.getErrorcode()) {
67   - okSize.incrementAndGet();
68   - } else {
69   - errorSize.incrementAndGet();
  76 + list.setHospitalId("216");//todo
  77 + list.setBookbuildingDoctor("1000000185");//todo
  78 + list.setBookbuildingDate(DateUtil.getyyyy_MM_dd(new Date()));
  79 + list.setHusbandNationId(queryParentConfig(list.getHusbandNationId()));
  80 + list.setPregnantNationId(queryParentConfig(list.getPregnantNationId()));
  81 + p = bookbuildingFacade.addPregnantBookbuilding(list, null, false);
  82 + if (ErrorCodeConstants.SUCCESS == p.getErrorcode()) {
  83 + okSize.incrementAndGet();
  84 + } else {
  85 + errorSize.incrementAndGet();
  86 + }
70 87 }
  88 + return p;
71 89 }
72   - return p;
73   - }
74 90  
75 91  
76 92  
  93 + public String queryParentConfig(String name) {
  94 + List<BasicConfig> basicConfigs = basicConfigDao.queryBasicConfig(
  95 + MongoCondition.newInstance("parentId", "4bc86dd6-2217-4a33-95f4-dc22ee70f2e3", MongoOper.IS).
  96 + and("yn", YnEnums.YES.getId(), MongoOper.IS).
  97 + and("name", name, MongoOper.IS).toMongoQuery()
77 98  
  99 + );
  100 + if(basicConfigs.size()==0 || basicConfigs==null){
  101 + return "";
  102 + }
  103 + return basicConfigs.get(0).getId();
  104 + }
78 105  
79   -}
  106 + }
... ... @@ -564,7 +564,7 @@
564 564 <dependency>
565 565 <groupId>com.oracle</groupId>
566 566 <artifactId>ojdbc14</artifactId>
567   - <version>11.2.0.1.0</version>
  567 + <version>10.2.0.3.0</version>
568 568 </dependency>
569 569 <dependency>
570 570 <groupId>commons-dbutils</groupId>
... ... @@ -582,11 +582,11 @@
582 582 <version>1.2.8</version>
583 583 </dependency>
584 584  
585   - <dependency>
586   - <groupId>com.aspose</groupId>
587   - <artifactId>aspose-words</artifactId>
588   - <version>15.8.0</version>
589   - </dependency>
  585 + <!-- <dependency>
  586 + <groupId>com.aspose</groupId>
  587 + <artifactId>aspose-words</artifactId>
  588 + <version>15.8.0</version>
  589 + </dependency>-->
590 590  
591 591 </dependencies>
592 592 </project>