Commit 69a09d0aa7e94e16495aa08ade2b8036b494fec7

Authored by liquanyu
1 parent eae984ecb6
Exists in master and in 2 other branches dev, luanping

修改数据库地址

Showing 18 changed files with 117 additions and 26 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MongoSyncService.java View file @ 69a09d0
... ... @@ -335,7 +335,7 @@
335 335 classList.add(SieveResultModel.class);
336 336 classList.add(StopPregModel.class);
337 337 try {
338   - Mongo mongo = new Mongo("111.206.6.150", 10001);
  338 + Mongo mongo = new Mongo("118.193.124.187", 10001);
339 339 MongoTemplate template = new MongoTemplate(mongo, "sync-platform-data");
340 340 template.getDb().authenticate("platform", "platform123".toCharArray());
341 341 Query query = null;
platform-biz-patient-service/src/main/resources/database.properties View file @ 69a09d0
1   -mongo.db.host=111.206.6.150
  1 +mongo.db.host=118.193.124.187
2 2 mongo.db.port=10001
3 3 mongo.db.dbname=platform
4 4 mongo.db.username=platform
platform-job-index/src/main/java/com/lyms/platform/job/index/util/JDBCUtil.java View file @ 69a09d0
... ... @@ -29,7 +29,7 @@
29 29 Connection con = null;
30 30 try {
31 31 Class.forName("com.mysql.jdbc.Driver");
32   - String url = "jdbc:mysql://111.206.6.150:3306/center?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  32 + String url = "jdbc:mysql://118.193.124.187:3306/center?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
33 33 String userName = "center";
34 34 String pwd = "lyms2015";
35 35 con = DriverManager.getConnection(url, userName, pwd);
platform-job-index/src/main/resources/spring/spring-mongodb.xml View file @ 69a09d0
... ... @@ -21,7 +21,7 @@
21 21  
22 22 <mongo:db-factory mongo-ref="mongo" id="mongoDbFactory"/>
23 23  
24   - <mongo:mongo id="mongo" host="111.206.6.150" port="10001">
  24 + <mongo:mongo id="mongo" host="118.193.124.187" port="10001">
25 25 <mongo:options connections-per-host="50"
26 26 write-number="1"
27 27 write-timeout="0" write-fsync="true"/>
platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/JDBCUtil.java View file @ 69a09d0
... ... @@ -16,7 +16,7 @@
16 16 static String oracle_url = "jdbc:oracle:thin:@172.16.7.250:1521:prmi";
17 17 static String oracle_name = "LYMS_HENGSHUI_ZHENGSHI";
18 18 static String oracle_pwd = "lyms2018";
19   -// static String oracle_url = "jdbc:oracle:thin:@111.206.6.150:1522:orcl";
  19 +// static String oracle_url = "jdbc:oracle:thin:@118.193.124.187:1522:orcl";
20 20 // static String oracle_name = "LYMS_ODS";
21 21 // static String oracle_pwd = "Welcome1";
22 22  
platform-operate-api/src/main/java/com/lyms/hospitalapi/lcdcf/ConnTools.java View file @ 69a09d0
... ... @@ -14,7 +14,7 @@
14 14 private static String hisPassword = "LYMS_123";
15 15  
16 16 // private static String hisDirverClassName = "com.mysql.jdbc.Driver";
17   -// private static String hisUrl = "jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  17 +// private static String hisUrl = "jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
18 18 // private static String hisUser = "platform";
19 19 // private static String hisPassword = "platform123";
20 20  
platform-operate-api/src/main/java/com/lyms/hospitalapi/lcfy/ConnTools.java View file @ 69a09d0
... ... @@ -18,7 +18,7 @@
18 18  
19 19 //测试
20 20 private static String cslisDirverClassName = "com.mysql.jdbc.Driver";
21   - private static String cslisUrl = "jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  21 + private static String cslisUrl = "jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
22 22 private static String cslisUser = "platform";
23 23 private static String cslisPassword = "platform123";
24 24  
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/ConnTools.java View file @ 69a09d0
... ... @@ -49,7 +49,7 @@
49 49  
50 50  
51 51 private static String cslDirverClassName = "com.mysql.jdbc.Driver";
52   - private static String cslUrl = "jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  52 + private static String cslUrl = "jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
53 53 private static String cslUser = "platform";
54 54 private static String cslPassword = "platform123";
55 55  
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/JDBCUtil.java View file @ 69a09d0
... ... @@ -16,7 +16,7 @@
16 16 static String oracle_url = "jdbc:oracle:thin:@168.254.0.159:1521:prmi";
17 17 static String oracle_name = "LYMS_QHD_ORG";
18 18 static String oracle_pwd = "LYMS_QHD_ORG";
19   -// static String oracle_url = "jdbc:oracle:thin:@111.206.6.150:1522:orcl";
  19 +// static String oracle_url = "jdbc:oracle:thin:@118.193.124.187:1522:orcl";
20 20 // static String oracle_name = "LYMS_ODS";
21 21 // static String oracle_pwd = "Welcome1";
22 22  
platform-operate-api/src/main/java/com/lyms/hospitalapi/rcfy/ConnTools.java View file @ 69a09d0
... ... @@ -11,7 +11,7 @@
11 11  
12 12 //测试环境
13 13 private static String dirverClassName = "com.mysql.jdbc.Driver";
14   - private static String url = "jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  14 + private static String url = "jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
15 15 private static String user = "platform";
16 16 private static String password = "platform123";
17 17  
platform-operate-api/src/main/java/com/lyms/hospitalapi/zcfy/ConnTools.java View file @ 69a09d0
... ... @@ -24,7 +24,7 @@
24 24 private static String fmPassword = "lyms123";
25 25  
26 26 private static String csczDirverClassName = "com.mysql.jdbc.Driver";
27   - private static String csczUrl = "jdbc:mysql://111.206.6.150:3306/platform?useUnicode=true&characterEncoding=utf8";
  27 + private static String csczUrl = "jdbc:mysql://118.193.124.187:3306/platform?useUnicode=true&characterEncoding=utf8";
28 28 private static String csczUser = "platform";
29 29 private static String csczPassword = "platform123";
30 30  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LivelihoodProjectsController.java View file @ 69a09d0
... ... @@ -123,5 +123,13 @@
123 123 @RequestParam(required = false) String endDate) {
124 124 return livelihoodProjectsFacade.getMsgcC401(startDate,endDate);
125 125 }
  126 +
  127 +
  128 + @RequestMapping(value = "/getDef", method = RequestMethod.GET)
  129 + @ResponseBody
  130 + public void getDef(HttpServletResponse httpServletResponse
  131 + ) {
  132 + livelihoodProjectsFacade.getDef(httpServletResponse);
  133 + }
126 134 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java View file @ 69a09d0
... ... @@ -111,7 +111,7 @@
111 111  
112 112 List<BasicConfig> mainBasicConfigList = new ArrayList<>();
113 113 try {
114   - Mongo mongo = new Mongo("111.206.6.150", 10001);
  114 + Mongo mongo = new Mongo("118.193.124.187", 10001);
115 115 UserCredentials credentials = new UserCredentials("platform", "platform123");
116 116 MongoTemplate mongoTemplate = new MongoTemplate(mongo, "sync-platform-data", credentials);
117 117  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LivelihoodProjectsFacade.java View file @ 69a09d0
... ... @@ -10,10 +10,7 @@
10 10 import com.lyms.platform.common.enums.CdGwPcountryEnums;
11 11 import com.lyms.platform.common.enums.YnEnums;
12 12 import com.lyms.platform.common.result.BaseObjectResponse;
13   -import com.lyms.platform.common.utils.DateUtil;
14   -import com.lyms.platform.common.utils.JsonUtil;
15   -import com.lyms.platform.common.utils.PropertiesUtils;
16   -import com.lyms.platform.common.utils.SystemConfig;
  13 +import com.lyms.platform.common.utils.*;
17 14 import com.lyms.platform.operate.web.result.BasicConfigResult;
18 15 import com.lyms.platform.operate.web.result.MsgcResult;
19 16 import com.lyms.platform.operate.web.utils.CollectionUtils;
... ... @@ -37,6 +34,8 @@
37 34 import org.springframework.data.mongodb.core.query.Query;
38 35 import org.springframework.stereotype.Component;
39 36  
  37 +import javax.servlet.http.HttpServletResponse;
  38 +import java.io.*;
40 39 import java.util.*;
41 40  
42 41 /**
43 42  
44 43  
... ... @@ -1235,13 +1234,18 @@
1235 1234 public Map<String, Object> getC201Patient(String id) {
1236 1235 Patients patients = patientsService.findOnePatientById(id);
1237 1236 try{
1238   - if ("4".equals(HIS_VERSION))
  1237 + if (patients.getDueStatus() == null || patients.getDueStatus() == 1)
  1238 + {
  1239 + return null;
  1240 + }
  1241 +
  1242 + if ("4".equals(HIS_VERSION))
  1243 + {
  1244 + if (!("2".equals(patients.getCityId()) || (patients.isSendCoupon() != null && patients.isSendCoupon())))
1239 1245 {
1240   - if (!("2".equals(patients.getCityId()) ))
1241   - {
1242   - return null;
1243   - }
  1246 + return null;
1244 1247 }
  1248 + }
1245 1249 Map<String, Object> map = new HashMap<>();
1246 1250 //id
1247 1251 map.put("id",StringUtils.isNotEmpty(patients.getId())?patients.getId():"/");
... ... @@ -1903,5 +1907,84 @@
1903 1907 return objectResponse;
1904 1908 }
1905 1909  
  1910 + public List<String> readTxt(String path) {
  1911 + List<String> CARDS = new ArrayList<>();
  1912 + File file = new File(path);
  1913 + String s = "";
  1914 + InputStreamReader in = null;
  1915 + BufferedReader br = null;
  1916 + try {
  1917 + in = new InputStreamReader(new FileInputStream(file),"UTF-8");
  1918 + br = new BufferedReader(in);
  1919 + while ((s=br.readLine()) != null){
  1920 + CARDS.add(s);
  1921 + }
  1922 + }
  1923 + catch (Exception e)
  1924 + {
  1925 + try {
  1926 + if(br != null)
  1927 + {
  1928 + br.close();
  1929 + }
  1930 + if(in != null)
  1931 + {
  1932 + in.close();
  1933 + }
  1934 + } catch (IOException e1) {
  1935 + e1.printStackTrace();
  1936 + }
  1937 + }
  1938 + return CARDS;
  1939 + }
  1940 +
  1941 + public void getDef(HttpServletResponse httpServletResponse) {
  1942 + List<String> list = readTxt("/data/card.txt");
  1943 + System.out.println(list.size());
  1944 + List<Map<String, Object>> datas = new ArrayList<>();
  1945 + for (String card : list){
  1946 + PatientsQuery patientsQuery = new PatientsQuery();
  1947 + patientsQuery.setYn(YnEnums.YES.getId());
  1948 + patientsQuery.setExtEnable(false);
  1949 + patientsQuery.setBuildTypeNot(1);
  1950 + patientsQuery.setCardNo(card);
  1951 + patientsQuery.setType(3);//产妇
  1952 + List<Patients> patientsList = patientsService.queryPatient(patientsQuery);
  1953 + if (CollectionUtils.isNotEmpty(patientsList)){
  1954 + Patients patients = patientsList.get(0);
  1955 + if(StringUtils.isNotEmpty(patients.getSource()))
  1956 + {
  1957 + patients = patientsService.findOnePatientById(patients.getSource());
  1958 + }
  1959 + if (patients != null){
  1960 + System.out.println(card);
  1961 + Map<String, Object> data = new HashMap<>();
  1962 + data.put("name",patients.getUsername());
  1963 + data.put("cardNo",patients.getCardNo());
  1964 + data.put("phone",patients.getPhone());
  1965 + data.put("isSend",(patients.isSendCoupon() != null && patients.isSendCoupon()) ? "已发放" : "未发放");
  1966 + data.put("residence",CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(),
  1967 + patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  1968 + datas.add(data);
  1969 + }
  1970 + }
  1971 + }
  1972 + try {
  1973 + OutputStream out = httpServletResponse.getOutputStream();
  1974 + Map <String, String> cnames = new LinkedHashMap <>();
  1975 + cnames.put("name", "姓名");
  1976 + cnames.put("phone", "手机号码");
  1977 + cnames.put("cardNo", "身份证号码");
  1978 + cnames.put("isSend", "是否发放优惠券");
  1979 + cnames.put("residence", "户籍地");
  1980 + httpServletResponse.setContentType("application/octet-stream");
  1981 + httpServletResponse.setCharacterEncoding("UTF-8");
  1982 + httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=" + "data.xls");
  1983 + ExcelUtil.toExcel(out, datas, cnames);
  1984 + } catch (IOException e) {
  1985 + e.printStackTrace();
  1986 + }
  1987 +
  1988 + }
1906 1989 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/JdbcUtil.java View file @ 69a09d0
... ... @@ -45,7 +45,7 @@
45 45 Connection con = null;
46 46 try {
47 47 Class.forName("com.mysql.jdbc.Driver");
48   - String url = "jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  48 + String url = "jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
49 49 String userName = "platform";
50 50 String pwd = "platform123";
51 51 con = DriverManager.getConnection(url, userName, pwd);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/LpJdbcUtil.java View file @ 69a09d0
... ... @@ -19,7 +19,7 @@
19 19 Connection con = null;
20 20 try {
21 21 Class.forName("com.mysql.jdbc.Driver");
22   - String url = "jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  22 + String url = "jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
23 23 String userName = "platform";
24 24 String pwd = "platform123";
25 25 con = DriverManager.getConnection(url, userName, pwd);
platform-operate-api/src/main/resources/database.properties View file @ 69a09d0
... ... @@ -19,7 +19,7 @@
19 19 server.startup=2
20 20  
21 21 mysql.slave.driver=com.mysql.jdbc.Driver
22   -mysql.slave.jdbcurl=jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
  22 +mysql.slave.jdbcurl=jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
23 23 mysql.slave.db.name=platform
24 24 mysql.slave.db.password=platform123
25 25  
platform-resource/resources/config-dev.properties View file @ 69a09d0
1   -mongo.db.host=111.206.6.150
  1 +mongo.db.host=118.193.124.187
2 2 mongo.db.port=10001
3 3 mongo.db.dbname=platform
4 4  
... ... @@ -17,7 +17,7 @@
17 17 mysql.db.name=platform
18 18 mysql.db.password=platform123
19 19 mysql.driver=com.mysql.jdbc.Driver
20   -mysql.jdbcurl=jdbc:mysql://111.206.6.150:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
  20 +mysql.jdbcurl=jdbc:mysql://118.193.124.187:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
21 21  
22 22 mysql.maxpoolsize=5
23 23 mysql.initialpoolsize=2