Commit 77bc44572a6813e0a57416407bd96e5e4467f7a9

Authored by liquanyu
1 parent 61751c5d91

code update

Showing 3 changed files with 54 additions and 9 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ 77bc445
... ... @@ -8,9 +8,11 @@
8 8 import com.lyms.platform.biz.service.GuidelinesService;
9 9 import com.lyms.platform.common.enums.YnEnums;
10 10 import com.lyms.platform.common.utils.JsonUtil;
  11 +import com.lyms.platform.common.utils.PingYinUtil;
11 12 import com.lyms.platform.common.utils.SystemConfig;
12 13 import com.lyms.platform.pojo.*;
13 14 import org.apache.commons.io.FileUtils;
  15 +import org.apache.struts.config.BaseConfig;
14 16 import org.springframework.context.ApplicationContext;
15 17 import org.springframework.context.support.ClassPathXmlApplicationContext;
16 18  
... ... @@ -24,7 +26,7 @@
24 26 public static void main(String[] args) throws Exception {
25 27 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
26 28 ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
27   - PuerperaService basicConfigService = (PuerperaService) applicationContext.getBean(PuerperaService.class);
  29 + // PuerperaService basicConfigService = (PuerperaService) applicationContext.getBean(PuerperaService.class);
28 30 /* PuerperaModel obj = new PuerperaModel();
29 31 obj.setAddress("成都市高新区天府2街");
30 32 obj.setAge(111);
31 33  
... ... @@ -48,14 +50,14 @@
48 50 obj1.setCardNo("50022319951267164466");
49 51 basicConfigService.addPuerpera(obj1);*/
50 52  
51   - PuerperaModelQuery puerperaQuery = new PuerperaModelQuery();
  53 + // PuerperaModelQuery puerperaQuery = new PuerperaModelQuery();
52 54  
53 55 ;
54 56 // puerperaQuery.setKeyword("小王");
55 57 // puerperaQuery.setDueDateStart(sdf.parse("2016-1-12"));
56 58 // puerperaQuery.setDueDateEnd(sdf.parse("2016-3-16"));
57   - puerperaQuery.setId("5719caf624fd57791341b7cb");
58   - System.out.println(basicConfigService.queryPuerpera(puerperaQuery));
  59 + // puerperaQuery.setId("5719caf624fd57791341b7cb");
  60 + // System.out.println(basicConfigService.queryPuerpera(puerperaQuery));
59 61 /*
60 62 * for(int i = 6;i<7;i++){ BasicConfig obj = new BasicConfig(); obj.setCode("xc123456"+i); obj.setName("哮喘123456"+i); obj.setYn(1);
61 63 * obj.setParentId("56ea134c24fdaafbabbb0025"); basicConfigService.addBasicConfig(obj); }
... ... @@ -78,7 +80,9 @@
78 80 // addVisit(applicationContext);
79 81 // addaw(applicationContext, "0-83月龄身长、高标准差数值表(男、女).csv", 1);
80 82 // addaw(applicationContext, "0-83月龄体重标准差数值表(男、女).csv", 0);
81   - addZhenduan(applicationContext);
  83 +// addZhenduan(applicationContext);
  84 +
  85 + addCountry(applicationContext);
82 86 }
83 87  
84 88 public static void addZhenduan(ApplicationContext applicationContext) {
... ... @@ -320,6 +324,34 @@
320 324 date.put("xxxxxx3",SimplePermission3);
321 325 DataPermissionsModel.setData(date);
322 326 mongoTemplate.save(DataPermissionsModel);
  327 + }
  328 +
  329 +
  330 + public static void addCountry(ApplicationContext applicationContext) {
  331 + MongoTemplate mongoTemplate
  332 + =(MongoTemplate)applicationContext.getBean("mongoTemplate");
  333 + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray());
  334 +
  335 + try {
  336 + List<String> list = FileUtils.readLines(new File("F:\\temp\\country.txt"),"gbk");
  337 + for (String line:list) {
  338 + if (line != null) {
  339 + BasicConfig config = new BasicConfig();
  340 + config.setYn(YnEnums.YES.getId());
  341 + config.setCode(PingYinUtil.getFirstSpell(line).toUpperCase());
  342 + config.setName(line);
  343 + config.setEnable(1);
  344 + Thread.sleep(1000);
  345 + config.setCreateDate(new Date().getTime());
  346 + config.setParentId("57dc45f7-b0ba-42f0-863b-de53966a6e65");
  347 + mongoTemplate.save(config);
  348 + System.out.println(line);
  349 + }
  350 + }
  351 +
  352 + } catch (Exception e) {
  353 + e.printStackTrace();
  354 + }
323 355 }
324 356  
325 357 public static void addVisit(ApplicationContext applicationContext){
platform-common/pom.xml View file @ 77bc445
... ... @@ -14,7 +14,11 @@
14 14 <groupId>commons-httpclient</groupId>
15 15 <artifactId>commons-httpclient</artifactId>
16 16 </dependency>
17   -
  17 + <dependency>
  18 + <groupId>com.belerweb</groupId>
  19 + <artifactId>pinyin4j</artifactId>
  20 + <version>2.5.0</version>
  21 + </dependency>
18 22 </dependencies>
19 23 <build>
20 24 <plugins>
platform-data-api/src/main/java/com/lyms/platform/data/service/impl/SmsServiceImpl.java View file @ 77bc445
... ... @@ -655,7 +655,7 @@
655 655  
656 656 if (!CollectionUtils.isNotEmpty(templates))
657 657 {
658   - return;
  658 + continue;
659 659 }
660 660  
661 661 //循环每一个模板,根据模板条件查询到用户 发送短信
... ... @@ -696,6 +696,8 @@
696 696  
697 697 PatientsQuery patientsQuery = new PatientsQuery();
698 698 patientsQuery.setYn(YnEnums.YES.getId());
  699 + patientsQuery.setHospitalId(hospitalId);
  700 +
699 701 //1孕妇
700 702 patientsQuery.setType(1);
701 703 // 0未终止妊娠 1终止妊娠
... ... @@ -1006,7 +1008,7 @@
1006 1008 {
1007 1009 BabyModelQuery babyModelQuery = new BabyModelQuery();
1008 1010 babyModelQuery.setYn(YnEnums.YES.getId());
1009   -
  1011 + babyModelQuery.setHospitalId(hospitalId);
1010 1012 babyModelQuery = getServiceBabyQuery( serviceType, serviceStatus, babyModelQuery);
1011 1013  
1012 1014 //发送短信集合
1013 1015  
... ... @@ -1332,8 +1334,10 @@
1332 1334 //产妇
1333 1335 else if (serviceObj == ServiceObjEnums.CHANOBJ.getId())
1334 1336 {
  1337 +
1335 1338 PatientsQuery patientsQuery = new PatientsQuery();
1336 1339 patientsQuery.setYn(YnEnums.YES.getId());
  1340 + patientsQuery.setHospitalId(hospitalId);
1337 1341 //1孕妇 3产妇
1338 1342 patientsQuery.setType(3);
1339 1343  
... ... @@ -1351,7 +1355,7 @@
1351 1355 Date actualSendDate = DateUtil.addDay(DateUtil.parseYMD(currentDate), sendTimeType);
1352 1356  
1353 1357 //查询出产妇预约
1354   - List<PostReviewModel> orderModels = postReviewService.queryPostOrder(actualSendDate,tempHid);
  1358 + List<PostReviewModel> orderModels = postReviewService.queryPostOrder(actualSendDate, tempHid);
1355 1359 if(CollectionUtils.isNotEmpty(orderModels))
1356 1360 {
1357 1361 for(PostReviewModel orderModel : orderModels)
... ... @@ -1364,6 +1368,7 @@
1364 1368 }
1365 1369 }
1366 1370 }
  1371 + //产后复查程序提醒
1367 1372 else if (smsType == SmsServiceEnums.CHFCCXTX.getId())
1368 1373 {
1369 1374 //发送频次
... ... @@ -1521,6 +1526,8 @@
1521 1526 {
1522 1527 PatientsQuery chanPatientsQuery = new PatientsQuery();
1523 1528 chanPatientsQuery.setYn(YnEnums.YES.getId());
  1529 + chanPatientsQuery.setHospitalId(hospitalId);
  1530 +
1524 1531 //3产妇
1525 1532 chanPatientsQuery.setType(3);
1526 1533 getServicePatientQuery(serviceType, serviceStatus, chanPatientsQuery);
... ... @@ -1528,6 +1535,7 @@
1528 1535  
1529 1536 PatientsQuery yunPatientsQuery = new PatientsQuery();
1530 1537 yunPatientsQuery.setYn(YnEnums.YES.getId());
  1538 + yunPatientsQuery.setHospitalId(hospitalId);
1531 1539 //1孕妇
1532 1540 yunPatientsQuery.setType(1);
1533 1541 getServicePatientQuery(serviceType, serviceStatus, yunPatientsQuery);
... ... @@ -1535,6 +1543,7 @@
1535 1543  
1536 1544 BabyModelQuery babyModelQuery = new BabyModelQuery();
1537 1545 babyModelQuery.setYn(YnEnums.YES.getId());
  1546 + babyModelQuery.setHospitalId(hospitalId);
1538 1547 babyModelQuery = getServiceBabyQuery(serviceType, serviceStatus, babyModelQuery);
1539 1548  
1540 1549 //发送短信集合