Commit b67d187061d742c4e48380f41ca89000f97c479a
1 parent
5d07f1c3ac
Exists in
master
and in
6 other branches
秦皇岛建档
Showing 5 changed files with 137 additions and 2 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-dal/src/main/java/com/lyms/platform/pojo/AreaAddressModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
b67d187
| ... | ... | @@ -7481,8 +7481,51 @@ | 
| 7481 | 7481 | } | 
| 7482 | 7482 | } | 
| 7483 | 7483 | |
| 7484 | + | |
| 7485 | + public static void saveAreaOrg(String fileName) { | |
| 7486 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
| 7487 | + MongoTemplate mongoTemplate | |
| 7488 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
| 7489 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
| 7490 | + File file = new File(fileName); | |
| 7491 | + Workbook wb = null; | |
| 7492 | + try { | |
| 7493 | + wb = Workbook.getWorkbook(file); | |
| 7494 | + | |
| 7495 | + Sheet s = wb.getSheet(0); | |
| 7496 | + System.out.println(s.getName() + " : "); | |
| 7497 | + int rows = s.getRows(); | |
| 7498 | + if (rows > 0) { | |
| 7499 | + //遍历每行 | |
| 7500 | + for (int i = 1; i < rows; i++) { | |
| 7501 | + System.out.println("rows=" + i); | |
| 7502 | + AreaAddressModel model = new AreaAddressModel(); | |
| 7503 | + Cell[] cells = s.getRow(i); | |
| 7504 | + if (cells.length > 0) { | |
| 7505 | + for (int j = 0; j < cells.length; j++) { | |
| 7506 | + | |
| 7507 | + String str = cells[j].getContents().trim(); | |
| 7508 | + switch (j) { | |
| 7509 | + case 0: | |
| 7510 | + model.setAddress(str); | |
| 7511 | + continue; | |
| 7512 | + case 1: | |
| 7513 | + model.setOrgName(str); | |
| 7514 | + continue; | |
| 7515 | + } | |
| 7516 | + } | |
| 7517 | + } | |
| 7518 | + mongoTemplate.save(model); | |
| 7519 | + } | |
| 7520 | + } | |
| 7521 | + } catch (Exception e) { | |
| 7522 | + e.printStackTrace(); | |
| 7523 | + } | |
| 7524 | + } | |
| 7525 | + | |
| 7484 | 7526 | public static void main(String[] args) { | 
| 7485 | - saveInout("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\预约.xls"); | |
| 7527 | + saveAreaOrg("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\org.xls"); | |
| 7528 | + //saveInout("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\预约.xls"); | |
| 7486 | 7529 | // compareYqys("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\联网.xls","C:\\Users\\liquanyu\\Desktop\\doc\\temp\\单机.xls"); | 
| 7487 | 7530 | //saveGw("C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\承德工位机构表.xls","C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\龙源承德机构表.xls"); | 
| 7488 | 7531 | //savePreeugenicsAddr("C:\\Users\\liquanyu\\Desktop\\doc\\孕前优生上传省平台\\隆化妇幼保健院孕前上传正式\\承德区划对照表.xls"); | 
platform-dal/src/main/java/com/lyms/platform/pojo/AreaAddressModel.java
View file @
b67d187
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.result.BaseModel; | |
| 4 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 5 | + | |
| 6 | + | |
| 7 | +/** | |
| 8 | + */ | |
| 9 | +@Document(collection = "lyms_area_address") | |
| 10 | +public class AreaAddressModel extends BaseModel { | |
| 11 | + | |
| 12 | + /*基础信息*/ | |
| 13 | + private String id; | |
| 14 | + private String address; | |
| 15 | + private String orgName; | |
| 16 | + | |
| 17 | + public String getId() { | |
| 18 | + return id; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public void setId(String id) { | |
| 22 | + this.id = id; | |
| 23 | + } | |
| 24 | + | |
| 25 | + public String getAddress() { | |
| 26 | + return address; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setAddress(String address) { | |
| 30 | + this.address = address; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public String getOrgName() { | |
| 34 | + return orgName; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public void setOrgName(String orgName) { | |
| 38 | + this.orgName = orgName; | |
| 39 | + } | |
| 40 | +} | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
b67d187
| ... | ... | @@ -8,6 +8,7 @@ | 
| 8 | 8 | import com.lyms.platform.common.base.PageInfo; | 
| 9 | 9 | import com.lyms.platform.common.constants.ErrorCodeConstants; | 
| 10 | 10 | import com.lyms.platform.common.enums.*; | 
| 11 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 11 | 12 | import com.lyms.platform.common.utils.ResultUtils; | 
| 12 | 13 | import com.lyms.platform.common.utils.SystemConfig; | 
| 13 | 14 | import com.lyms.platform.operate.web.facade.AccessPermissionFacade; | 
| ... | ... | @@ -538,6 +539,38 @@ | 
| 538 | 539 | public String getAreaCode(@RequestParam(value = "areaName", required = true) String areaName) { | 
| 539 | 540 | String areaCode = organizationService.getAreaCode(areaName); | 
| 540 | 541 | return areaCode; | 
| 542 | + } | |
| 543 | + | |
| 544 | + @RequestMapping(value = "/queryUserByOrgName", method = RequestMethod.GET) | |
| 545 | + @ResponseBody | |
| 546 | + public BaseObjectResponse queryUserByOrgName(@RequestParam(value = "orgName", required = true) String orgName) { | |
| 547 | + List<Map> datas = new ArrayList<>(); | |
| 548 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 549 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 550 | + organizationQuery.setName(orgName); | |
| 551 | + List<Organization> organizations = organizationService.queryOrganization(organizationQuery); | |
| 552 | + if (CollectionUtils.isNotEmpty(organizations)) | |
| 553 | + { | |
| 554 | + UsersQuery usersQuery = new UsersQuery(); | |
| 555 | + usersQuery.setOrgId(organizations.get(0).getId()); | |
| 556 | + List<Users> users = usersService.queryUsers(usersQuery); | |
| 557 | + if (CollectionUtils.isNotEmpty(users)) | |
| 558 | + { | |
| 559 | + for(Users user : users) | |
| 560 | + { | |
| 561 | + Map data = new HashMap(); | |
| 562 | + data.put("id",user.getId()); | |
| 563 | + data.put("name",user.getName()); | |
| 564 | + datas.add(data); | |
| 565 | + } | |
| 566 | + } | |
| 567 | + } | |
| 568 | + | |
| 569 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 570 | + objectResponse.setData(datas); | |
| 571 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 572 | + objectResponse.setErrormsg("成功"); | |
| 573 | + return objectResponse; | |
| 541 | 574 | } | 
| 542 | 575 | } | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
View file @
b67d187
| ... | ... | @@ -31,7 +31,6 @@ | 
| 31 | 31 | |
| 32 | 32 | /* | 
| 33 | 33 | *孕妇建档 | 
| 34 | - * lqy | |
| 35 | 34 | * 2016-06-15 | 
| 36 | 35 | */ | 
| 37 | 36 | @Controller | 
| ... | ... | @@ -749,6 +748,15 @@ | 
| 749 | 748 | public BaseObjectResponse queryRecommendInfo(RecommendQuery recommendQuery, HttpServletRequest request) { | 
| 750 | 749 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | 
| 751 | 750 | BaseObjectResponse objectResponse = bookbuildingFacade.queryRecommendInfo(recommendQuery,loginState.getId()); | 
| 751 | + return objectResponse; | |
| 752 | + } | |
| 753 | + | |
| 754 | + @RequestMapping(value = "/queryAreaOrgs", method = RequestMethod.GET) | |
| 755 | + @ResponseBody | |
| 756 | + @TokenRequired | |
| 757 | + public BaseObjectResponse queryAreaOrgs(HttpServletRequest request) { | |
| 758 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 759 | + BaseObjectResponse objectResponse = bookbuildingFacade.queryAreaOrgs(loginState.getId()); | |
| 752 | 760 | return objectResponse; | 
| 753 | 761 | } | 
| 754 | 762 | } | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
b67d187
| ... | ... | @@ -3545,5 +3545,16 @@ | 
| 3545 | 3545 | objectResponse.setErrormsg("成功"); | 
| 3546 | 3546 | return objectResponse; | 
| 3547 | 3547 | } | 
| 3548 | + | |
| 3549 | + public BaseObjectResponse queryAreaOrgs( Integer userId) { | |
| 3550 | + Query query=new Query(); | |
| 3551 | + query.addCriteria(Criteria.where("id").exists(true)); | |
| 3552 | + List<AreaAddressModel> models = mongoTemplate.find(query, AreaAddressModel.class); | |
| 3553 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 3554 | + objectResponse.setData(models); | |
| 3555 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 3556 | + objectResponse.setErrormsg("成功"); | |
| 3557 | + return objectResponse; | |
| 3558 | + } | |
| 3548 | 3559 | } |