浏览代码

Merge branch 'master' of huangzhanpeng/esb_huangzhanpeng into master

esb 9 年之前
父节点
当前提交
631198581a
共有 100 个文件被更改,包括 0 次插入10147 次删除
  1. 0 233
      EHR-resource/EHR-Resource.iml
  2. 0 118
      EHR-resource/pom.xml
  3. 0 57
      EHR-resource/src/main/java/com/yihu/ehr/common/ApplicationStart.java
  4. 0 60
      EHR-resource/src/main/java/com/yihu/ehr/common/CommonPageController.java
  5. 0 119
      EHR-resource/src/main/java/com/yihu/ehr/common/Services.java
  6. 0 483
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/controller/DataCollectController.java
  7. 0 233
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/DatacollectDao.java
  8. 0 36
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/DatacollectLogDao.java
  9. 0 83
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/intf/IDatacollectDao.java
  10. 0 22
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/intf/IDatacollectLogDao.java
  11. 0 48
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoDatasetCol.java
  12. 0 48
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoDictCol.java
  13. 0 29
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoJobConfig.java
  14. 0 74
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoJobDataset.java
  15. 0 36
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoJobLog.java
  16. 0 129
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobConfig.java
  17. 0 117
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobDataset.java
  18. 0 87
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobLog.java
  19. 0 191
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobLogDetail.java
  20. 0 503
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/DatacollectManager.java
  21. 0 523
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/DatacollectService.java
  22. 0 93
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/intf/IDatacollectManager.java
  23. 0 24
      EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/intf/IDatacollectService.java
  24. 0 27
      EHR-resource/src/main/java/com/yihu/ehr/job/service/DatacollectJob.java
  25. 0 13
      EHR-resource/src/main/java/com/yihu/ehr/job/service/IBaseJob.java
  26. 0 25
      EHR-resource/src/main/java/com/yihu/ehr/job/service/TestJob.java
  27. 0 105
      EHR-resource/src/main/java/com/yihu/ehr/resource/TextResource.java
  28. 0 49
      EHR-resource/src/main/java/com/yihu/ehr/resource/XTextResource.java
  29. 0 115
      EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsCategoryController.java
  30. 0 276
      EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsDimensionController.java
  31. 0 737
      EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsResourceController.java
  32. 0 194
      EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsResourceRestController.java
  33. 0 21
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsAppResourceDao.java
  34. 0 17
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsAppResourceDetailDao.java
  35. 0 21
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsCategoryDao.java
  36. 0 17
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsDemensionCategoryDao.java
  37. 0 10
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsDimensionDao.java
  38. 0 13
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceCategoryDao.java
  39. 0 24
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceDao.java
  40. 0 9
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceDatasetDao.java
  41. 0 17
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceDimensionDao.java
  42. 0 28
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceMetadataDao.java
  43. 0 13
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceRestDao.java
  44. 0 20
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceRestDetailDao.java
  45. 0 41
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsAppResourceDaoImpl.java
  46. 0 25
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsAppResourceDetailDaoImpl.java
  47. 0 50
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsCategoryDaoImpl.java
  48. 0 34
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsDemensionCategoryDaoImpl.java
  49. 0 13
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsDimensionDaoImpl.java
  50. 0 19
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceCategoryDaoImpl.java
  51. 0 66
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceDaoImpl.java
  52. 0 12
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceDatasetDaoImpl.java
  53. 0 34
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceDimensionDaoImpl.java
  54. 0 63
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceMetadataDaoImpl.java
  55. 0 26
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceRestDaoImpl.java
  56. 0 51
      EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceRestDetailDaoImpl.java
  57. 0 56
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsAppResource.java
  58. 0 88
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsAppResourceDetail.java
  59. 0 87
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsDatasourceDataset.java
  60. 0 43
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsDemensionCategory.java
  61. 0 79
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsDimension.java
  62. 0 129
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResource.java
  63. 0 77
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceCategory.java
  64. 0 100
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceDataset.java
  65. 0 53
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceDimension.java
  66. 0 203
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceMetadata.java
  67. 0 81
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceRest.java
  68. 0 131
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceRestDetail.java
  69. 0 79
      EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsRoleDimension.java
  70. 0 22
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsCategoryService.java
  71. 0 37
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsDimensionService.java
  72. 0 35
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsResourceRestService.java
  73. 0 80
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsResourceService.java
  74. 0 57
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsCategoryServiceImpl.java
  75. 0 98
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsDimensionServiceImpl.java
  76. 0 111
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsResourceRestServiceImpl.java
  77. 0 570
      EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsResourceServiceImpl.java
  78. 0 25
      EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/ComboboxResult.java
  79. 0 130
      EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/DynamicDatagridResult.java
  80. 0 52
      EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/ResourceAuthorizeDGModel.java
  81. 0 70
      EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsCategoryDetailModel.java
  82. 0 97
      EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsResourceDeatilModel.java
  83. 0 61
      EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsResourceDimensionModel.java
  84. 0 154
      EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsResourceFieldDetailModel.java
  85. 0 193
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/AdapterController.java
  86. 0 81
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/AdapterPlanController.java
  87. 0 142
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/AdapterVersionController.java
  88. 0 113
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/IntegrationController.java
  89. 0 101
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/PublisherController.java
  90. 0 103
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeController.java
  91. 0 127
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeDatasetController.java
  92. 0 103
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeDictController.java
  93. 0 116
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeDictEntryController.java
  94. 0 115
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeMetadataController.java
  95. 0 104
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeVersionController.java
  96. 0 106
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StandardController.java
  97. 0 143
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StandardVersionController.java
  98. 0 132
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StdDatasetController.java
  99. 0 132
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StdDictController.java
  100. 0 0
      EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StdDictEntryController.java

+ 0 - 233
EHR-resource/EHR-Resource.iml

@ -1,233 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="web" name="Web">
      <configuration>
        <descriptors>
          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
        </descriptors>
        <webroots>
          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
        </webroots>
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/target/classes" />
    <output-test url="file://$MODULE_DIR$/target/test-classes" />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <excludeFolder url="file://$MODULE_DIR$/target" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-dbhelper:1.0.7" level="project" />
    <orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.1.0" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:1.6.0.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.1.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.1.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.1.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.1.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.12" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-core:4.1.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-solr:1.5.0.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.2.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.2.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient-cache:4.2.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.solr:solr-solrj:4.10.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.6" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:wstx-asl:3.2.7" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.12" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.11.0.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.1.7.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: redis.clients:jedis:2.7.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.3" level="project" />
    <orderEntry type="module" module-name="Hos-Framework" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.3" level="project" />
    <orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.3.11.Final" level="project" />
    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.3.GA" level="project" />
    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1" level="project" />
    <orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final" level="project" />
    <orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.5.Final" level="project" />
    <orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final" level="project" />
    <orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-aspects:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-orm:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc-portlet:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-websocket:4.1.8.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-acl:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-aspects:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-cas:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.jasig.cas.client:cas-client-core:3.3.3" level="project" />
    <orderEntry type="library" name="Maven: org.opensaml:opensaml:2.5.1-1" level="project" />
    <orderEntry type="library" name="Maven: org.opensaml:openws:1.4.2-1" level="project" />
    <orderEntry type="library" name="Maven: org.opensaml:xmltooling:1.3.2-1" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.6.1" level="project" />
    <orderEntry type="library" name="Maven: joda-time:joda-time:1.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15:1.45" level="project" />
    <orderEntry type="library" name="Maven: org.apache.santuario:xmlsec:1.4.4" level="project" />
    <orderEntry type="library" name="Maven: ca.juliusdavies:not-yet-commons-ssl:0.3.9" level="project" />
    <orderEntry type="library" name="Maven: velocity:velocity:1.5" level="project" />
    <orderEntry type="library" name="Maven: org.owasp.esapi:esapi:2.0GA" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:xalan:2.7.1" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: xalan:serializer:2.7.1" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-ldap:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.ldap:spring-ldap-core:2.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-openid:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: com.google.inject:guice:2.0" level="project" />
    <orderEntry type="library" name="Maven: org.openid4java:openid4java-nodeps:0.9.6" level="project" />
    <orderEntry type="library" name="Maven: net.jcip:jcip-annotations:1.0" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: net.sourceforge.nekohtml:nekohtml:1.9.20" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: xerces:xercesImpl:2.10.0" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-remoting:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-taglibs:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:4.0.2.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.1.2" level="project" />
    <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.0.0.Beta4" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.0" level="project" />
    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.0" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.1.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.1.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.1.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.1.2" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.1.2" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.2.0" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.hateoas:spring-hateoas:0.17.0.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.objenesis:objenesis:2.1" level="project" />
    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.1.2" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.4.6" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.4.6" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.4.6" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.9.13" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.9.13" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
    <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis:axis:1.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-adb:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.0.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-kernel:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.axiom:axiom-api:1.2.14" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-javamail_1.4_spec:1.7.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.james:apache-mime4j-core:0.7.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.axiom:axiom-compat:1.2.14" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.ws.commons.axiom:axiom-impl:1.2.14" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.1.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:1.1.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.3" level="project" />
    <orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.ws.commons.schema:XmlSchema:1.4.7" level="project" />
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-api:1.0M9" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-impl-dom:1.0M9" level="project" />
    <orderEntry type="library" name="Maven: org.apache.woden:woden-impl-commons:1.0M9" level="project" />
    <orderEntry type="library" name="Maven: javax.ws.rs:jsr311-api:1.1.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:org.apache.axis2.osgi:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-transport-http:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.axis2:axis2-transport-local:1.6.3" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-nop:1.7.13" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.4.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.4.1" level="project" />
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
    <orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.5.0" level="project" />
    <orderEntry type="library" name="Maven: com.google.guava:guava:16.0" level="project" />
    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.37" level="project" />
    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.0.1" level="project" />
    <orderEntry type="library" name="Maven: javax.transaction:jta:1.1" level="project" />
    <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" />
    <orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.8.7" level="project" />
    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.7" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-extras:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-core:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-api:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: commons-digester:commons-digester:2.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-request-servlet-wildcard:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-request-servlet:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-request-mustache:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-request-api:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: com.github.spullara.mustache.java:compiler:0.8.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-jsp:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-servlet:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-template:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-autotag-core-runtime:1.1.0" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-request-jsp:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-freemarker:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-request-freemarker:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.15" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-velocity:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.velocity:velocity-tools:2.0" level="project" />
    <orderEntry type="library" name="Maven: oro:oro:2.0.8" level="project" />
    <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.6.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-request-velocity:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-el:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-mvel:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: org.mvel:mvel2:2.0.11" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-ognl:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: ognl:ognl:2.7.3" level="project" />
    <orderEntry type="library" name="Maven: jboss:javassist:3.7.ga" level="project" />
    <orderEntry type="library" name="Maven: org.apache.tiles:tiles-compat:3.0.5" level="project" />
    <orderEntry type="library" name="Maven: net.sf.json-lib:json-lib:2.4" level="project" />
    <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" />
    <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.0" level="project" />
    <orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
    <orderEntry type="library" name="Maven: org.apache.commons:commons-dbcp2:2.1" level="project" />
    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
    <orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.10" level="project" />
    <orderEntry type="library" name="Maven: commons-dbutils:commons-dbutils:1.6" level="project" />
    <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.1" level="project" />
    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
    <orderEntry type="library" name="Maven: org.csource:fastdfs-client-java:1.0" level="project" />
    <orderEntry type="library" name="Maven: javax.mail:javax.mail-api:1.5.4" level="project" />
    <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
    <orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" />
    <orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
    <orderEntry type="library" name="Maven: asm:asm:3.1" level="project" />
    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
    <orderEntry type="library" name="Maven: org.json:json:20151123" level="project" />
    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
    <orderEntry type="library" name="Maven: javax.xml:jaxrpc-api:1.1" level="project" />
    <orderEntry type="library" name="Maven: org.antlr:antlr4:4.5" level="project" />
    <orderEntry type="library" name="Maven: org.antlr:antlr4-runtime:4.5" level="project" />
    <orderEntry type="library" name="Maven: org.abego.treelayout:org.abego.treelayout.core:1.0.1" level="project" />
    <orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.5.2" level="project" />
    <orderEntry type="library" name="Maven: org.antlr:ST4:4.0.8" level="project" />
    <orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
    <orderEntry type="library" name="Maven: org.jboss:jandex:1.1.0.Final" level="project" />
    <orderEntry type="library" name="Maven: org.javassist:javassist:3.18.1-GA" level="project" />
    <orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0.2" level="project" />
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
    <orderEntry type="library" name="Maven: jstl:jstl:1.2" level="project" />
    <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />
    <orderEntry type="library" name="Maven: taglibs:standard:1.1.2" level="project" />
    <orderEntry type="library" name="Maven: net.lingala.zip4j:zip4j:1.3.2" level="project" />
    <orderEntry type="library" name="Maven: org.apache.htrace:htrace-core:3.1.0-incubating" level="project" />
    <orderEntry type="library" name="Maven: io.netty:netty-all:4.0.32.Final" level="project" />
    <orderEntry type="library" name="Maven: org.noggit:noggit:0.6" level="project" />
    <orderEntry type="library" name="Maven: com.yihu.core:ehr-redishelper:1.0.0" level="project" />
    <orderEntry type="library" name="Maven: com.oracle:ojdbc14:10.2.0.3.0" level="project" />
  </component>
</module>

+ 0 - 118
EHR-resource/pom.xml

@ -1,118 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.yihu.ehr.resource</groupId>
    <artifactId>EHR-Resource</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <properties>
    </properties>
    <!--用于发布到服务器 对应setting的对应server表情里面的id -->
    <distributionManagement>
        <repository>
            <id>Releases</id>
            <name>Releases</name>
            <url>http://172.19.103.47:8081/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Snapshots</name>
            <url>http://172.19.103.47:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <dependencies>
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.0.7</version>
        </dependency>
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>1.6.0.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-solr</artifactId>
            <version>1.5.0.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <version>1.11.0.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.7.3</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.hos.resource</groupId>
            <artifactId>Hos-Framework</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <!--<dependency>-->
        <!--<groupId>com.yihu.ehr</groupId>-->
        <!--<artifactId>EHR</artifactId>-->
        <!--<version>0.99</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-redishelper</artifactId>
            <version>1.0.0</version>
        </dependency>
        <!--=============oracle驱动 start =============-->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc14</artifactId>
            <version>10.2.0.3.0</version>
        </dependency>
        <!--=============oracle驱动 end =============-->
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

+ 0 - 57
EHR-resource/src/main/java/com/yihu/ehr/common/ApplicationStart.java

@ -1,57 +0,0 @@
package com.yihu.ehr.common;
import com.yihu.ehr.framework.constrant.DateConvert;
import com.yihu.ehr.framework.util.log.LogService;
import com.yihu.ehr.framework.util.quartz.QuartzManager;
import org.apache.commons.beanutils.ConvertUtils;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.util.Date;
/**
 * 项目启动执行
 * add by hzp at 2016-01-25
 */
public class ApplicationStart implements ServletContextListener {
    private static int rebootCount = 0;
    @Override
    public void contextInitialized(ServletContextEvent context) {
        //使用自定义转化器转化时间格式
        ConvertUtils.register(new DateConvert(), Date.class);
        initQuartz();//启动任务
    }
    @Override
    public void contextDestroyed(ServletContextEvent context) {
        destroyedQuartz();
    }
    /**
     * 初始化任务
     * @return
     */
    public void initQuartz(){
        try {
            QuartzManager.startJobs();
        } catch(Exception e){
            LogService.getLogger().error(" Quartz job initing Exception " + e.getMessage());
        }
    }
    /**
     * 终止任务
     */
    public void destroyedQuartz(){
        try {
            QuartzManager.shutdownJobs();
        } catch(Exception e){
            LogService.getLogger().error(" Quartz job destroying Exception " + e.getMessage());
        }
    }
}

+ 0 - 60
EHR-resource/src/main/java/com/yihu/ehr/common/CommonPageController.java

@ -1,60 +0,0 @@
package com.yihu.ehr.common;
import com.yihu.ehr.datacollect.model.RsJobConfig;
import com.yihu.ehr.datacollect.service.intf.IDatacollectManager;
import com.yihu.ehr.datacollect.service.intf.IDatacollectService;
import com.yihu.ehr.framework.constrant.DateConvert;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.std.service.intf.IStdService;
import com.yihu.ehr.system.service.intf.IDatasourceManager;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Map;
/**
 * 数据采集配置页面
 * Created by hzp on 2015/8/12.
 */
@RequestMapping("/")
@Controller("commonPageController")
public class CommonPageController extends BaseController {
    /*
    登录页面
     */
    @RequestMapping("loginPage")
    public String login(Model model) {
        model.addAttribute("contentPage","/common/login");
        return "pageView";
    }
    /*
    首页页面
     */
    @RequestMapping("indexPage")
    public String index(Model model) {
        model.addAttribute("contentPage","/common/index");
        return "pageView";
    }
    /*
    系统主页
     */
    @RequestMapping("homePage")
    public String home(Model model) {
        model.addAttribute("contentPage","/common/home");
        return "partView";
    }
}

+ 0 - 119
EHR-resource/src/main/java/com/yihu/ehr/common/Services.java

@ -1,119 +0,0 @@
package com.yihu.ehr.common;
/**
 * 平台顶级服务列表.
 *
 */
public class Services {
    public final static String EnvironmentOption = "com.yihu.ha.EnvironmentOption";
    public final static String LogService = "com.yihu.ha.LogService";
    public final static String RedisClient = "com.yihu.ha.RedisClient";
    public final static String HBaseClient= "com.yihu.ha.HBaseClient";
    public final static String SolrClient = "com.yihu.ha.SolrClient";
    public final static String SQLGeneralDAO = "com.yihu.ha.SQLGeneralDAO";
    public final static String AddressManager = "com.yihu.ha.AddressManager";
    public final static String AppManager = "com.yihu.ha.AppManager";
    public final static String JsonPackageManager = "com.yihu.ha.JsonPackageManager";
    public final static String EhrArchiveManager = "com.yihu.ha.EhrArchiveManager";
    public final static String SNSPlatformManager = "com.yihu.ha.SNSPlatformManager";
    public final static String DemographicIndex = "com.yihu.ha.DemographicIndex";
    public final static String DemographicIndexStragety = "com.yihu.ha.DemographicIndexStragety";
    public final static String SystemDictManager = "com.yihu.ha.SystemDictManager";
    public final static String OrgManager = "com.yihu.ha.OrgManager";
    public final static String CardManager = "com.yihu.ha.CardManager";
    public final static String TextResource = "com.yihu.ha.TextResource";
    public final static String SecurityManager = "com.yihu.ha.SecurityManager";
    public final static String CDAVersionManager = "com.yihu.ha.CDAVersionManager";
    public final static String CDAManager="com.yihu.ha.CDADocumentManager";
    public final static String StandardSourceManager="com.yihu.ha.StandardSourceManager";
    public final static String DataSetManager = "com.yihu.ha.DataSetManager";
    public final static String MetaDataManager = "com.yihu.ha.MetaDataManager";
    public final static String DictEntryManager = "com.yihu.ha.DictEntryManager";
    public final static String DictManager = "com.yihu.ha.DictManager";
    public final static String StdDiffer = "com.yihu.ha.StdDiffer";
    public final static String StdDispatchManager = "com.yihu.ha.StdDispatchManager";
    public final static String StdVersionFileManager = "com.yihu.ha.StdVersionFileManager";
    public final static String SchemaManager = "com.yihu.ha.SchemaManager";
    public final static String UserManager = "com.yihu.ha.UserManager";
    public final static String TokenManager = "com.yihu.ha.TokenManager";
    public final static String ObjectMapper = "com.yihu.ha.ObjectMapper";
    public final static String ArchiveTemplateManager = "com.yihu.ha.ArchiveTemplateManager";
    public final static String DataSetRelationshipManager = "com.yihu.ha.CdaDatasetRelationshipManager";
    public final static String ConventionalDictEntry = "com.yihu.ha.ConventionalDictEntry";
    public final static String SolrIndexer = "com.yihu.ha.SolrIndexer";
    public final static String JobManager = "com.yihu.ha.JobManager";
    public final static String SchedulerFactory = "com.yihu.ha.SchedulerFactory";
    public final static String MonitorManager = "com.yihu.ha.MonitorManager";
    public final static String OrgDictManager = "com.yihu.ha.OrgDictManager";
    public final static String OrgDictItemManager = "com.yihu.ha.OrgDictItemManager";
    public final static String OrgDataSetManager = "com.yihu.ha.OrgDataSetManager";
    public final static String OrgMetaDataManager = "com.yihu.ha.OrgMetaDataManager";
    public final static String OrgAdapterPlanManager = "com.yihu.ha.OrgAdapterPlanManager";
    public final static String AdapterDataSetManager = "com.yihu.ha.AdapterDataSetManager";
    public final static String AdapterDictManager = "com.yihu.ha.AdapterDictManager";
    public final static String AdapterOrgManager = "com.yihu.ha.AdapterOrgManager";
    public final static String AdapterInfoSendManager = "com.yihu.ha.AdapterInfoSendManager";
    public final static String RsCategoryServiceImpl = "com.yihu.ha.resource.service.impl.RsCategoryServiceImpl";
    /******************************************************************************************/
    public final static String Organization = "com.yihu.ehr.system.service.OrganizationManager";
    public final static String Datacollect = "com.yihu.ehr.datacollect.service.DatacollectManager";
    public final static String DatacollectService = "com.yihu.ehr.datacollect.service.DatacollectService";
    public final static String Datasource = "com.yihu.ehr.system.service.DatasourceManager";
    public final static String BaseDict = "com.yihu.ehr.system.service.BaseDictManager";
    public final static String StdService = "com.yihu.ehr.system.service.StdService";
}

+ 0 - 483
EHR-resource/src/main/java/com/yihu/ehr/datacollect/controller/DataCollectController.java

@ -1,483 +0,0 @@
package com.yihu.ehr.datacollect.controller;
import com.yihu.ehr.common.Services;
import com.yihu.ehr.datacollect.model.RsJobConfig;
import com.yihu.ehr.datacollect.model.RsJobLog;
import com.yihu.ehr.datacollect.service.intf.IDatacollectManager;
import com.yihu.ehr.datacollect.service.intf.IDatacollectService;
import com.yihu.ehr.framework.constrant.DateConvert;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.std.service.intf.IStdService;
import com.yihu.ehr.system.service.intf.IDatasourceManager;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Map;
/**
 * 数据采集配置页面
 * Created by hzp on 2015/8/12.
 */
@RequestMapping("/datacollect")
@Controller("dataCollectController")
public class DataCollectController extends BaseController {
    @Resource(name = Services.Datacollect)
    IDatacollectManager datacollect;
    @Resource(name = Services.DatacollectService)
    IDatacollectService datacollectService;
    @Resource(name = Services.StdService)
    IStdService stdService;
    @Resource(name = Services.Datasource)
    IDatasourceManager datasource;
    /**************************** 任务管理 ************************************************/
    /*
    任务配置
     */
    @RequestMapping("configJob")
    public String configJob(Model model) {
        model.addAttribute("contentPage","/datacollect/configJob");
        return "partView";
    }
    /*
    任务新增/编辑
     */
    @RequestMapping("editorJob")
    public String editorJob(Model model,String jobId) {
        try {
            //是否编辑
            if (jobId != null && jobId.length() > 0) {
                //获取任务信息
                RsJobConfig job = datacollect.getJobById(jobId);
                model.addAttribute("model", job);
                String cron = datacollect.getCronByJobId(jobId);
                model.addAttribute("cronExpression", cron);
            }
            //获取方案列表
            String data = stdService.getSchemeVersion();
            model.addAttribute("schemeList", "{\"detailModelList\":"+(data.length()==0?"[]":data)+"}");
            model.addAttribute("contentPage", "/datacollect/editorJob");
            return "pageView";
        }
        catch (Exception ex)
        {
            model.addAttribute("contentPage", "/datacollect/editorJob");
            return "pageView";
        }
    }
    /*
    获取任务列表
    */
    @RequestMapping("getJob")
    @ResponseBody
    public Result getJob(String name,int page, int rows){
        try {
            Map<String, Object> map = new HashMap<>();
            map.put("name", name);
            return datacollect.getJobList(map, page, rows);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /**
     * 根据适配方案获取数据集列表
     */
    @RequestMapping("getSchemeDataset")
    @ResponseBody
    public Result getSchemeDataset(String schemeId,String schemeVersion,String jobId){
        try{
            return datacollect.getSchemeDataset(schemeId,schemeVersion, jobId);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /**
     * 根据适配方案+数据集获取字段列表
     */
    @RequestMapping("getSchemeDatasetCol")
    @ResponseBody
    public Result getSchemeDatasetCol(String schemeId,String schemeVersion,String datasetId){
        try{
            return datacollect.getSchemeDatasetCol(schemeId, schemeVersion, datasetId);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /*
       新增任务
    */
    @RequestMapping("addJob")
    @ResponseBody
    public Result addJob(HttpServletRequest request) {
        try {
            RsJobConfig obj = new RsJobConfig();
            BeanUtils.populate(obj, request.getParameterMap());
            obj.setValid("1");
            String cron = request.getParameter("cronExpression");
            String jobDataset = request.getParameter("jobDataset");
            return datacollect.addJob(obj,cron,jobDataset);
        }
        catch (Exception ex)
        {
            return Result.error("新增任务失败!");
        }
    }
    /*
       修改任务
    */
    @RequestMapping("updateJob")
    @ResponseBody
    public Result updateJob(HttpServletRequest request) {
        try {
            RsJobConfig obj = new RsJobConfig();
            BeanUtils.populate(obj, request.getParameterMap());
            String cron = request.getParameter("cronExpression");
            String jobDataset = request.getParameter("jobDataset");
            return datacollect.updateJob(obj, cron,jobDataset);
        }
        catch (Exception ex)
        {
            return Result.error("修改任务失败!");
        }
    }
    /*
      修改任务状态
   */
    @RequestMapping("validJob")
    @ResponseBody
    public Result validJob(String jobId,String valid) {
        try {
            return datacollect.validJob(jobId, valid);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /*
      删除任务
   */
    @RequestMapping("deleteJob")
    @ResponseBody
    public Result deleteJob(String jobId) {
        try {
            return datacollect.deleteJob(jobId);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /**
     * 获取任务信息
     * @return
     */
    @RequestMapping("getJobInfo")
    @ResponseBody
    public Result getJobInfo(String jobId)
    {
        try {
            RsJobConfig job = datacollect.getJobById(jobId);
            if(job!=null)
            {
                ActionResult re = new ActionResult(true,"");
                re.setData(job.getValid());
                return re;
            }
            else{
                return new ActionResult(false,"非法操作!");
            }
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /**
     * 根据任务Id获取相关数据集下拉数据
     * @return
     */
    @RequestMapping("getJobDatasetByJobId")
    @ResponseBody
    public Result getJobDatasetByJobId(String jobId)
    {
        try {
            return datacollect.getJobDatasetByJobId(jobId);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /************************* 数据集--数据源管理 ******************************************/
    /*
    数据集配置
     */
    @RequestMapping("configDataset")
    public String configDataset(Model model) {
        try {
            model.addAttribute("stdVersion", "569e19522e3d");
            //获取数据源数据
            model.addAttribute("datasourceList", datasource.getDatasourceByOrg("").toJson());
            model.addAttribute("contentPage", "/datacollect/configDataset");
            return "partView";
        }
        catch (Exception ex)
        {
            model.addAttribute("contentPage", "error");
            return "partView";
        }
    }
    /**
     * 数据集数据源管理列表(包含全部数据集)
     * @return
     */
    @RequestMapping("getDatasetSource")
    @ResponseBody
    public Result getDatasetSource(String stdVersion) {
        try {
            return datacollect.getDatasetSource(stdVersion);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /**
     * 更新数据集数据源
     * @return
     */
    @RequestMapping("saveDatasetSource")
    @ResponseBody
    public Result saveDatasetSource(String stdVersion,String json){
        try {
            return datacollect.saveDatasetSource(json);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /*************************** 任务执行 ************************************************/
    /**
     * 执行任务
     * @return
     */
    @RequestMapping("executeJob")
    @ResponseBody
    public Result executeJob(String jobId){
        try {
            datacollectService.executeJob(jobId);
            return Result.success("已交由后台处理!");
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
    }
    }
    /*
    任务补采界面
     */
    @RequestMapping("repeatDatacollect")
    public String repeatDatacollect(Model model,String jobId,String jobDatasetId,String jobStatus,String jobTimeFrom,String jobTimeTo) {
        try {
            model.addAttribute("jobId", jobId==null?"":jobId);
            model.addAttribute("jobDatasetId", jobDatasetId==null?"":jobDatasetId);
            model.addAttribute("jobStatus", jobStatus==null?"":jobStatus);
            if(jobTimeFrom!=null&&jobTimeFrom.length()>0)
            {
                Date timeFrom = DateConvert.toDate(jobTimeFrom);
                model.addAttribute("jobTimeFrom", DateConvert.toString(timeFrom));
            }
            else{
                GregorianCalendar gc=new GregorianCalendar();
                gc.setTime(new Date());
                gc.add(5, -7);
                model.addAttribute("jobTimeFrom", DateConvert.toString(gc.getTime()));
            }
            if(jobTimeTo!=null&&jobTimeTo.length()>0)
            {
                Date timeTo = DateConvert.toDate(jobTimeTo);
                model.addAttribute("jobTimeTo", DateConvert.toString(timeTo));
            }
            else{
                model.addAttribute("jobTimeTo", DateConvert.toString(new Date()));
            }
            model.addAttribute("contentPage", "/datacollect/repeatDatacollect");
            return "partView";
        }
        catch (Exception ex)
        {
            model.addAttribute("contentPage", "error");
            return "partView";
        }
    }
    /**
     * 任务详细日志列表
     * @return
     */
    @RequestMapping("getJobLogDetail")
    @ResponseBody
    public Result getJobLogDetail(String jobId,String jobDatasetId,String jobStatus,String jobTimeFrom,String jobTimeTo,int page, int rows){
        try {
            Map<String, Object> conditionMap = new HashMap<String, Object>();
            conditionMap.put("jobId",jobId);
            conditionMap.put("jobDatasetId",jobDatasetId);
            conditionMap.put("jobStatus",jobStatus);
            conditionMap.put("jobTimeFrom",jobTimeFrom);
            conditionMap.put("jobTimeTo", jobTimeTo);
            return datacollect.getJobLogDetail(conditionMap,page,rows);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /**
     * 补采数据
     * @return
     */
    @RequestMapping("repeat")
    @ResponseBody
    public Result repeat(String ids){
        try {
            if(ids.length()>0)
            {
                String[] logId = ids.split(",");
                if(logId.length==1)
                {
                    return datacollectService.repeatJob(ids);
                }
                else {
                    StringBuilder str = new StringBuilder();
                    for(String id:logId)
                    {
                        ActionResult re = datacollectService.repeatJob(id);
                        if(re.isSuccessFlg())
                        {
                            str.append(id+"补采成功!\n");
                        }
                        else{
                            str.append(id+"补采失败!\n");
                        }
                    }
                    return Result.success(str.toString());
                }
            }
            else{
                return Result.error("非法操作!");
            }
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /*************************** 任务跟踪 ***********************************/
    /**
     * 任务跟踪界面
     * @return
     */
    @RequestMapping("trackJob")
    public String trackJob(Model model,String jobId) {
        try{
            model.addAttribute("contentPage", "/datacollect/trackJob");
            return "pageView";
        }
        catch (Exception ex)
        {
            model.addAttribute("contentPage", "error");
            return "partView";
        }
    }
    /**
     * 任务日志列表
     * @return
     */
    @RequestMapping("getJobLog")
    @ResponseBody
    public Result getJobLog(String jobId,int page, int rows){
        try {
            Map<String, Object> conditionMap = new HashMap<String, Object>();
            conditionMap.put("jobId",jobId);
            return datacollect.getJobLog(conditionMap,page,rows);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
    /**
     * 任务详细根据数据集分组
     * @return
     */
    @RequestMapping("getJobLogDataset")
    @ResponseBody
    public Result getJobLogDataset(String logId){
        try {
            return datacollect.getJobLogDataset(logId);
        }
        catch (Exception ex)
        {
            return Result.error(ex.getMessage());
        }
    }
}

+ 0 - 233
EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/DatacollectDao.java

@ -1,233 +0,0 @@
package com.yihu.ehr.datacollect.dao;
import com.yihu.ehr.datacollect.dao.intf.IDatacollectDao;
import com.yihu.ehr.datacollect.model.DtoJobDataset;
import com.yihu.ehr.datacollect.model.RsJobDataset;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.constrant.DateConvert;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.SimpleChartItem;
import com.yihu.ehr.resource.model.RsDatasourceDataset;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Map;
/**
 * Created by hzp on 2016/1/11.
 */
@Repository("DatacollectDao")
public class DatacollectDao extends SQLGeneralDAO implements IDatacollectDao {
    /**
     * 根据JobId获取Cron表达式
     */
    @Override
    public String getCronByJobId(String jobId)
    {
        try{
            String sql = "select CRON_EXPRESSION from qrtz_cron_triggers where TRIGGER_NAME='"+jobId+"'";
            return super.scalarBySql(sql, String.class);
        }
        catch (Exception e)
        {
            return "";
        }
    }
    /**
     * 获取任务列表
     * @return
     */
    @Override
    public DataGridResult getJobList(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception
    {
        StringBuilder sb = new StringBuilder();
        sb.append("from RsJobConfig t where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("jobName")))
        {
            sb.append(" and t.jobName like '%" + conditionMap.get("jobName") + "%'");
        }
        return getDataGridResult(sb.toString(),page,pageSize);
    }
    /**
     * 获取任务数据集
     * @return
     * @throws Exception
     */
    @Override
    public List<RsJobDataset> getJobDataset(String jobId) throws Exception
    {
        String sql = "select * from rs_job_dataset where job_id='"+jobId+"'";
        return super.queryListBySql(sql, RsJobDataset.class);
    }
    /**
     * 修改任务状态
     */
    @Override
    public void validJob(String id,String valid) throws Exception
    {
        String sql = "update rs_job_config set valid='"+valid+"' where Id='"+id+"'";
        super.execute(sql);
    }
    /**
     * 删除任务关联数据集
     */
    public void deleteJobDatasetByJobId(String jobId) throws Exception
    {
        String sql = "delete from rs_job_dataset where job_id='"+jobId+"'";
        super.execute(sql);
    }
    /**
     * 通过版本获取配置的数据集--数据源
     * @throws Exception
     */
    public List<RsDatasourceDataset> getDatasourceDataset(String stdVersion) throws Exception
    {
        String sql = "select * from rs_datasource_dataset where std_version='"+stdVersion+"'";
        return super.queryListBySql(sql, RsDatasourceDataset.class);
    }
    /**
     * 删除数据集数据源关联
     */
    public void deleteDatasourceDatasetById(String id) throws Exception
    {
        String sql = "delete from rs_datasource_dataset where id='"+id+"'";
        super.execute(sql);
    }
    /**
     * 通过任务ID获取相关数据集
     */
    public List<DtoJobDataset> getDatacollectDataset(String jobId) throws Exception
    {
        String sql = "select d.*,\n" +
                "t.datasource_id,t.datasource_name,t.config,t.type,t.org_id\n" +
                "from rs_job_dataset d\n" +
                "LEFT JOIN (select s.dataset_id,s.datasource_id,ss.name as datasource_name,ss.config,ss.type,ss.org_id from rs_datasource_dataset s,system_datasource ss where s.datasource_id=ss.id) t \n" +
                "on d.job_dataset_id = t.dataset_id\n" +
                "where d.job_id='"+jobId+"'\n" +
                "order by d.sort";
        return super.queryListBySql(sql,DtoJobDataset.class);
    }
    /**
     * 获取任务详细日志列表
     */
    @Override
    public DataGridResult getJobLogDetail(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception
    {
        StringBuilder sb = new StringBuilder();
        sb.append("from RsJobLogDetail where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("jobId"))) {
            sb.append(" and job_id ='"+conditionMap.get("jobId")+"'");
        }
        if (!StringUtils.isEmpty(conditionMap.get("jobDatasetId"))) {
            sb.append(" and job_dataset_id ='"+conditionMap.get("jobDatasetId")+"'");
        }
        if (!StringUtils.isEmpty(conditionMap.get("jobStatus"))) {
            sb.append(" and jobStatus ='"+conditionMap.get("jobStatus")+"'");
        }
        if (!StringUtils.isEmpty(conditionMap.get("jobTimeFrom"))) {
            Date time = DateConvert.toDate(conditionMap.get("jobTimeFrom").toString());
            time.setHours(0);
            time.setMinutes(0);
            time.setSeconds(0);
            sb.append(" and startTime >= '"+DateConvert.toString(time)+"'");
        }
        if (!StringUtils.isEmpty(conditionMap.get("jobTimeTo"))) {
            Date time = DateConvert.toDate(conditionMap.get("jobTimeTo").toString());
            time.setHours(0);
            time.setMinutes(0);
            time.setSeconds(0);
            GregorianCalendar gc=new GregorianCalendar();
            gc.setTime(time);
            gc.add(5, 1);
            sb.append(" and startTime < '"+DateConvert.toString(gc.getTime())+"'");
        }
        sb.append("order by startTime desc");
        return getDataGridResult(sb.toString(),page,pageSize);
    }
    /**
     * 获取任务日志列表
     */
    @Override
    public DataGridResult getJobLog(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception
    {
        StringBuilder sb = new StringBuilder();
        sb.append("from RsJobLog where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("jobId"))) {
            sb.append(" and jobId ='"+conditionMap.get("jobId")+"'");
        }
        sb.append("order by jobStartTime desc");
        return getDataGridResult(sb.toString(),page,pageSize);
    }
    /**
     * 获取采集日志统计
     */
    public List<Map<String, Object>> getJobLogCount(String logId) throws Exception
    {
        String sql ="select d.job_log_id,sum(d.Job_dataset_rows) as count,\n" +
                "sum(case d.job_status\n" +
                "    when '1' THEN\n" +
                "         d.Job_dataset_rows\n" +
                "    ELSE\n" +
                "         0\n" +
                "    END) as success,\n" +
                "sum(case d.job_status\n" +
                "    when '3' THEN\n" +
                "         d.Job_dataset_rows\n" +
                "    ELSE\n" +
                "         0\n" +
                "    END) as repeat_num\n" +
                "from rs_job_log_detail d\n";
        if(logId!=null && logId.length()>0)
        {
            sql += "where d.job_log_id ='"+logId+"'\n";
        }
        sql+="group by d.job_log_id ";
        return super.queryListBySql(sql);
    }
    /**
     * 任务详细根据数据集分组
     */
    public List<SimpleChartItem> getJobLogDataset(String logId) throws Exception
    {
        String sql ="select d.job_dataset_name as x,sum(d.Job_dataset_rows) as y1,\n" +
                "                sum(case d.job_status\n" +
                "                    when '1' THEN\n" +
                "                         d.Job_dataset_rows\n" +
                "                    ELSE\n" +
                "                         0\n" +
                "                    END) as y2,\n" +
                "                sum(case d.job_status\n" +
                "                    when '3' THEN\n" +
                "                         d.Job_dataset_rows\n" +
                "                    ELSE\n" +
                "                         0\n" +
                "                    END) as y3\n" +
                "                from rs_job_log_detail d\n" +
                "where d.job_log_id = '"+logId+"'\n" +
                "GROUP BY d.Job_dataset_name";
        return super.queryListBySql(sql,SimpleChartItem.class);
    }
}

+ 0 - 36
EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/DatacollectLogDao.java

@ -1,36 +0,0 @@
package com.yihu.ehr.datacollect.dao;
import com.yihu.ehr.datacollect.dao.intf.IDatacollectDao;
import com.yihu.ehr.datacollect.dao.intf.IDatacollectLogDao;
import com.yihu.ehr.datacollect.model.DtoJobDataset;
import com.yihu.ehr.datacollect.model.RsJobDataset;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.resource.model.RsDatasourceDataset;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
 * Created by hzp on 2016/1/11.
 */
@Repository("DatacollectLogDao")
public class DatacollectLogDao extends SQLGeneralDAO implements IDatacollectLogDao {
    /**
     * 修改
     */
    @Override
    public void updateJobDatasetKeyvalue(String id,String jobDatasetKeyvalue) throws Exception
    {
        String sql = "update rs_job_dataset set job_dataset_keyvalue='"+jobDatasetKeyvalue+"' where id='"+id+"'";
        super.execute(sql);
    }
}

+ 0 - 83
EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/intf/IDatacollectDao.java

@ -1,83 +0,0 @@
package com.yihu.ehr.datacollect.dao.intf;
import com.yihu.ehr.datacollect.model.DtoJobDataset;
import com.yihu.ehr.datacollect.model.RsJobDataset;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.SimpleChartItem;
import com.yihu.ehr.resource.model.RsDatasourceDataset;
import java.util.List;
import java.util.Map;
/**
 * Created by hzp on 2016/1/11.
 */
public interface IDatacollectDao extends XSQLGeneralDAO {
    /**
     * 根据JobId获取Cron表达式
     */
    public String getCronByJobId(String jobId);
    /**
     * 获取任务列表
     * @return
     */
    public DataGridResult getJobList(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception;
    /**
     * 获取任务数据集
     * @return
     * @throws Exception
     */
    public List<RsJobDataset> getJobDataset(String jobId) throws Exception;
    /**
     * 修改任务状态
     */
    public void validJob(String id,String valid) throws Exception;
    /**
     * 删除任务关联数据集
     */
    public void deleteJobDatasetByJobId(String jobId) throws Exception;
    /**
     * 通过版本获取配置的数据集--数据源
     * @throws Exception
     */
    public List<RsDatasourceDataset> getDatasourceDataset(String stdVersion) throws Exception;
    /**
     * 删除数据集数据源关联
     */
    public void deleteDatasourceDatasetById(String id) throws Exception;
    /**
     * 通过任务ID获取相关数据集
     */
    public List<DtoJobDataset> getDatacollectDataset(String jobId) throws Exception;
    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLogDetail(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception;
    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLog(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception;
    /**
     * 获取采集日志统计
     */
    public List<Map<String, Object>> getJobLogCount(String logId) throws Exception;
    /**
     * 任务详细根据数据集分组
     */
    public List<SimpleChartItem> getJobLogDataset(String logId) throws Exception;
}

+ 0 - 22
EHR-resource/src/main/java/com/yihu/ehr/datacollect/dao/intf/IDatacollectLogDao.java

@ -1,22 +0,0 @@
package com.yihu.ehr.datacollect.dao.intf;
import com.yihu.ehr.datacollect.model.DtoJobDataset;
import com.yihu.ehr.datacollect.model.RsJobDataset;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.resource.model.RsDatasourceDataset;
import java.util.List;
import java.util.Map;
/**
 * 采集日志
 * Created by hzp on 2016/1/26.
 */
public interface IDatacollectLogDao extends XSQLGeneralDAO {
    /**
     * 修改
     */
    public void updateJobDatasetKeyvalue(String id,String jobDatasetKeyvalue) throws Exception;
}

+ 0 - 48
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoDatasetCol.java

@ -1,48 +0,0 @@
package com.yihu.ehr.datacollect.model;
import org.json.JSONArray;
/**
 * 数据集字段
 */
public class DtoDatasetCol implements java.io.Serializable {
	private String code;
	private String text;
	private String type;
	private String dict;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getDict() {
		return dict;
	}
	public void setDict(String dict) {
		this.dict = dict;
	}
}

+ 0 - 48
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoDictCol.java

@ -1,48 +0,0 @@
package com.yihu.ehr.datacollect.model;
import org.json.JSONArray;
/**
 * 数据源关联字典
 */
public class DtoDictCol implements java.io.Serializable {
	private String stdMetadataCode;
	private String adapterDataType;
	private String adapterDictId;
	private JSONArray dictList;
	public String getStdMetadataCode() {
		return stdMetadataCode;
	}
	public void setStdMetadataCode(String stdMetadataCode) {
		this.stdMetadataCode = stdMetadataCode;
	}
	public String getAdapterDataType() {
		return adapterDataType;
	}
	public void setAdapterDataType(String adapterDataType) {
		this.adapterDataType = adapterDataType;
	}
	public String getAdapterDictId() {
		return adapterDictId;
	}
	public void setAdapterDictId(String adapterDictId) {
		this.adapterDictId = adapterDictId;
	}
	public JSONArray getDictList() {
		return dictList;
	}
	public void setDictList(JSONArray dictList) {
		this.dictList = dictList;
	}
}

+ 0 - 29
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoJobConfig.java

@ -1,29 +0,0 @@
package com.yihu.ehr.datacollect.model;
import java.sql.Timestamp;
/**
 * RsJobConfig entity. @author MyEclipse Persistence Tools
 */
public class DtoJobConfig extends RsJobConfig implements java.io.Serializable {
	private String jobDataset;
	private String jobPlan;
	public String getJobDataset() {
		return jobDataset;
	}
	public void setJobDataset(String jobDataset) {
		this.jobDataset = jobDataset;
	}
	public String getJobPlan() {
		return jobPlan;
	}
	public void setJobPlan(String jobPlan) {
		this.jobPlan = jobPlan;
	}
}

+ 0 - 74
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoJobDataset.java

@ -1,74 +0,0 @@
package com.yihu.ehr.datacollect.model;
/**
 * RsJobDataset entity. @author MyEclipse Persistence Tools
 */
public class DtoJobDataset extends RsJobDataset implements java.io.Serializable {
	private String checked;
	private String jobDatasetCode;
	/** 数据源相关 **/
	private String orgId;
	private String datasourceId;
	private String datasourceName;
	private String config;
	private String type;
	public String getOrgId() {
		return orgId;
	}
	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}
	public String getChecked() {
		return checked;
	}
	public void setChecked(String checked) {
		this.checked = checked;
	}
	public String getJobDatasetCode() {
		return jobDatasetCode;
	}
	public void setJobDatasetCode(String jobDatasetCode) {
		this.jobDatasetCode = jobDatasetCode;
	}
	public String getDatasourceId() {
		return datasourceId;
	}
	public void setDatasourceId(String datasourceId) {
		this.datasourceId = datasourceId;
	}
	public String getDatasourceName() {
		return datasourceName;
	}
	public void setDatasourceName(String datasourceName) {
		this.datasourceName = datasourceName;
	}
	public String getConfig() {
		return config;
	}
	public void setConfig(String config) {
		this.config = config;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
}

+ 0 - 36
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/DtoJobLog.java

@ -1,36 +0,0 @@
package com.yihu.ehr.datacollect.model;
/**
 * add by hzp at 20160204
 */
public class DtoJobLog extends RsJobLog implements java.io.Serializable {
	private Integer count;
	private Integer success;
	private Integer repeatNum;
	public Integer getCount() {
		return count;
	}
	public void setCount(Integer count) {
		this.count = count;
	}
	public Integer getSuccess() {
		return success;
	}
	public void setSuccess(Integer success) {
		this.success = success;
	}
	public Integer getRepeatNum() {
		return repeatNum;
	}
	public void setRepeatNum(Integer repeatNum) {
		this.repeatNum = repeatNum;
	}
}

+ 0 - 129
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobConfig.java

@ -1,129 +0,0 @@
package com.yihu.ehr.datacollect.model;
import java.util.Date;
/**
 * RsJobConfig entity. @author MyEclipse Persistence Tools
 */
public class RsJobConfig implements java.io.Serializable {
	// Fields
	private String id;
	private String jobName;
	private String jobInfo;
	private String jobType;
	private String schemeId;
	private String schemeVersion;
	private Date jobNextTime;
	private String valid;
	private String jobContent;
	private String jobContentType;
	// Constructors
	/** default constructor */
	public RsJobConfig() {
	}
	public String getJobContent() {
		return jobContent;
	}
	public void setJobContent(String jobContent) {
		this.jobContent = jobContent;
	}
	public String getJobContentType() {
		return jobContentType;
	}
	public void setJobContentType(String jobContentType) {
		this.jobContentType = jobContentType;
	}
	/** minimal constructor */
	public RsJobConfig(String jobName, String valid) {
		this.jobName = jobName;
		this.valid = valid;
	}
	/** full constructor */
	public RsJobConfig(String jobName, String jobInfo, String jobType, String schemeId,String schemeVersion, String jobTimeInterval, Date jobNextTime, String valid) {
		this.jobName = jobName;
		this.jobInfo = jobInfo;
		this.jobType = jobType;
		this.schemeId = schemeId;
		this.schemeVersion = schemeVersion;
		this.jobNextTime = jobNextTime;
		this.valid = valid;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getJobName() {
		return this.jobName;
	}
	public void setJobName(String jobName) {
		this.jobName = jobName;
	}
	public String getJobInfo() {
		return this.jobInfo;
	}
	public void setJobInfo(String jobInfo) {
		this.jobInfo = jobInfo;
	}
	public String getJobType() {
		return this.jobType;
	}
	public void setJobType(String jobType) {
		this.jobType = jobType;
	}
	public String getSchemeId() {
		return schemeId;
	}
	public void setSchemeId(String schemeId) {
		this.schemeId = schemeId;
	}
	public String getSchemeVersion() {
		return schemeVersion;
	}
	public void setSchemeVersion(String schemeVersion) {
		this.schemeVersion = schemeVersion;
	}
	public Date getJobNextTime() {
		return this.jobNextTime;
	}
	public void setJobNextTime(Date jobNextTime) {
		this.jobNextTime = jobNextTime;
	}
	public String getValid() {
		return this.valid;
	}
	public void setValid(String valid) {
		this.valid = valid;
	}
}

+ 0 - 117
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobDataset.java

@ -1,117 +0,0 @@
package com.yihu.ehr.datacollect.model;
/**
 * RsJobDataset entity. @author MyEclipse Persistence Tools
 */
public class RsJobDataset implements java.io.Serializable {
	// Fields
	private String id;
	private String jobId;
	private String jobDatasetId;
	private String jobDatasetName;
	private String jobDatasetKey;
	private String jobDatasetKeytype;
	private String jobDatasetKeyvalue;
	private String jobDatasetCondition;
	private Integer sort;
	// Constructors
	/** default constructor */
	public RsJobDataset() {
	}
	public String getJobDatasetKey() {
		return jobDatasetKey;
	}
	public void setJobDatasetKey(String jobDatasetKey) {
		this.jobDatasetKey = jobDatasetKey;
	}
	public String getJobDatasetKeytype() {
		return jobDatasetKeytype;
	}
	public void setJobDatasetKeytype(String jobDatasetKeytype) {
		this.jobDatasetKeytype = jobDatasetKeytype;
	}
	/** minimal constructor */
	public RsJobDataset(String jobId, String jobDatasetId) {
		this.jobId = jobId;
		this.jobDatasetId = jobDatasetId;
	}
	/** full constructor */
	public RsJobDataset(String jobId, String jobDatasetId, String jobDatasetName, String jobDatasetKeyvalue, String jobDatasetCondition, Integer sort) {
		this.jobId = jobId;
		this.jobDatasetId = jobDatasetId;
		this.jobDatasetName = jobDatasetName;
		this.jobDatasetKeyvalue = jobDatasetKeyvalue;
		this.jobDatasetCondition = jobDatasetCondition;
		this.sort = sort;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getJobId() {
		return this.jobId;
	}
	public void setJobId(String jobId) {
		this.jobId = jobId;
	}
	public String getJobDatasetId() {
		return this.jobDatasetId;
	}
	public void setJobDatasetId(String jobDatasetId) {
		this.jobDatasetId = jobDatasetId;
	}
	public String getJobDatasetName() {
		return this.jobDatasetName;
	}
	public void setJobDatasetName(String jobDatasetName) {
		this.jobDatasetName = jobDatasetName;
	}
	public String getJobDatasetKeyvalue() {
		return this.jobDatasetKeyvalue;
	}
	public void setJobDatasetKeyvalue(String jobDatasetKeyvalue) {
		this.jobDatasetKeyvalue = jobDatasetKeyvalue;
	}
	public String getJobDatasetCondition() {
		return this.jobDatasetCondition;
	}
	public void setJobDatasetCondition(String jobDatasetCondition) {
		this.jobDatasetCondition = jobDatasetCondition;
	}
	public Integer getSort() {
		return this.sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
}

+ 0 - 87
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobLog.java

@ -1,87 +0,0 @@
package com.yihu.ehr.datacollect.model;
import java.sql.Timestamp;
import java.util.Date;
/**
 * RsJobLog entity. @author MyEclipse Persistence Tools
 */
public class RsJobLog implements java.io.Serializable {
	// Fields
	private String id;
	private Date jobStartTime;
	private Date jobEndTime;
	private String jobId;
	private String jobContent;
	private Integer jobDatasetCount;
	private Integer jobDatasetSuccess;
	// Constructors
	/** default constructor */
	public RsJobLog() {
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Date getJobStartTime() {
		return jobStartTime;
	}
	public void setJobStartTime(Date jobStartTime) {
		this.jobStartTime = jobStartTime;
	}
	public Date getJobEndTime() {
		return jobEndTime;
	}
	public void setJobEndTime(Date jobEndTime) {
		this.jobEndTime = jobEndTime;
	}
	public Integer getJobDatasetCount() {
		return jobDatasetCount;
	}
	public void setJobDatasetCount(Integer jobDatasetCount) {
		this.jobDatasetCount = jobDatasetCount;
	}
	public Integer getJobDatasetSuccess() {
		return jobDatasetSuccess;
	}
	public void setJobDatasetSuccess(Integer jobDatasetSuccess) {
		this.jobDatasetSuccess = jobDatasetSuccess;
	}
	public String getJobId() {
		return this.jobId;
	}
	public void setJobId(String jobId) {
		this.jobId = jobId;
	}
	public String getJobContent() {
		return this.jobContent;
	}
	public void setJobContent(String jobContent) {
		this.jobContent = jobContent;
	}
}

+ 0 - 191
EHR-resource/src/main/java/com/yihu/ehr/datacollect/model/RsJobLogDetail.java

@ -1,191 +0,0 @@
package com.yihu.ehr.datacollect.model;
import java.sql.Timestamp;
import java.util.Date;
/**
 * RsJobLogDetail entity. @author MyEclipse Persistence Tools
 */
public class RsJobLogDetail implements java.io.Serializable {
	// Fields
	private String id;
	private Date startTime;
	private Date endTime;
	private String jobLogId;
	private String jobStatus;
	private String jobContent;
	private String datasourceId;
	private String config;
	private String stdDatasetCode;
	private String jobDatasetId;
	private String jobId;
	private String jobDatasetName;
	private String jobSql;
	private Integer jobNum;
	private Date repeatStartTime;
	private Date repeatEndTime;
	private String repeatJobContent;
	private String schemeVersion;
	private Integer jobDatasetRows;
	// Constructors
	/** default constructor */
	public RsJobLogDetail() {
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Date getStartTime() {
		return this.startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getEndTime() {
		return this.endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public String getJobLogId() {
		return jobLogId;
	}
	public void setJobLogId(String jobLogId) {
		this.jobLogId = jobLogId;
	}
	public String getJobStatus() {
		return jobStatus;
	}
	public void setJobStatus(String jobStatus) {
		this.jobStatus = jobStatus;
	}
	public String getJobContent() {
		return this.jobContent;
	}
	public void setJobContent(String jobContent) {
		this.jobContent = jobContent;
	}
	public String getDatasourceId() {
		return datasourceId;
	}
	public void setDatasourceId(String datasourceId) {
		this.datasourceId = datasourceId;
	}
	public String getConfig() {
		return config;
	}
	public void setConfig(String config) {
		this.config = config;
	}
	public String getStdDatasetCode() {
		return stdDatasetCode;
	}
	public void setStdDatasetCode(String stdDatasetCode) {
		this.stdDatasetCode = stdDatasetCode;
	}
	public String getJobDatasetId() {
		return jobDatasetId;
	}
	public void setJobDatasetId(String jobDatasetId) {
		this.jobDatasetId = jobDatasetId;
	}
	public String getJobId() {
		return jobId;
	}
	public void setJobId(String jobId) {
		this.jobId = jobId;
	}
	public String getJobDatasetName() {
		return jobDatasetName;
	}
	public void setJobDatasetName(String jobDatasetName) {
		this.jobDatasetName = jobDatasetName;
	}
	public String getJobSql() {
		return jobSql;
	}
	public void setJobSql(String jobSql) {
		this.jobSql = jobSql;
	}
	public Integer getJobNum() {
		return jobNum;
	}
	public void setJobNum(Integer jobNum) {
		this.jobNum = jobNum;
	}
	public Date getRepeatStartTime() {
		return repeatStartTime;
	}
	public void setRepeatStartTime(Date repeatStartTime) {
		this.repeatStartTime = repeatStartTime;
	}
	public Date getRepeatEndTime() {
		return repeatEndTime;
	}
	public void setRepeatEndTime(Date repeatEndTime) {
		this.repeatEndTime = repeatEndTime;
	}
	public String getRepeatJobContent() {
		return repeatJobContent;
	}
	public void setRepeatJobContent(String repeatJobContent) {
		this.repeatJobContent = repeatJobContent;
	}
	public String getSchemeVersion() {
		return schemeVersion;
	}
	public void setSchemeVersion(String schemeVersion) {
		this.schemeVersion = schemeVersion;
	}
	public Integer getJobDatasetRows() {
		return jobDatasetRows;
	}
	public void setJobDatasetRows(Integer jobDatasetRows) {
		this.jobDatasetRows = jobDatasetRows;
	}
}

+ 0 - 503
EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/DatacollectManager.java

@ -1,503 +0,0 @@
package com.yihu.ehr.datacollect.service;
import com.yihu.ehr.datacollect.dao.intf.IDatacollectDao;
import com.yihu.ehr.datacollect.model.*;
import com.yihu.ehr.datacollect.service.intf.IDatacollectManager;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.common.Services;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.DictItem;
import com.yihu.ehr.framework.model.SimpleChartItem;
import com.yihu.ehr.framework.util.quartz.QuartzManager;
import com.yihu.ehr.resource.model.RsDatasourceDataset;
import com.yihu.ehr.std.service.intf.IStdService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service(Services.Datacollect)
public class DatacollectManager implements IDatacollectManager {
    @Resource(name = "DatacollectDao")
    private IDatacollectDao datacollectDao;
    @Resource(name = Services.StdService)
    private IStdService stdManager;
    /*********************** 任务管理 ****************************************/
    /**
     * 根据JobId获取Cron表达式
     */
    @Override
    public String getCronByJobId(String jobId) throws Exception
    {
        return datacollectDao.getCronByJobId(jobId);
    }
    /**
     * 根据ID获取任务详细
     * @return
     */
    @Override
    public RsJobConfig getJobById(String id) throws Exception
    {
        return datacollectDao.getEntity(RsJobConfig.class, id);
    }
    /**
     * 翻译Cron表达式
     * @return
     */
    private String translationCron(String cron){
        try {
            if (cron != null && cron.length() > 0) {
                String re = "";
                String[] items = cron.split(" ");
                if (!items[5].equals("?")) //周
                {
                    String[] weekDay = items[5].split(",");
                    for(String day :weekDay)
                    {
                        re+="星期" + day +",";
                    }
                    re = re.substring(0,re.length()-1);
                }
                else{
                    if (!items[3].equals("*"))
                    {
                        String v = items[3];
                        if(v.indexOf('/')>0) //天
                        {
                            String[] varry = v.split("/");
                            re = "每隔" + varry[1] + "天";
                        }
                        else{//月
                            if(v.equals("1"))
                            {
                                re = "每月第一天";
                            }
                            else if(v.equals("L")){
                                re = "每月最后一天";
                            }
                            else{
                                re = "每月第"+v+"天";
                            }
                        }
                    }
                    else{
                        String v1 = items[1];
                        String v2 = items[2];
                        if(v1.indexOf('/')>0) //分
                        {
                            String[] varry = v1.split("/");
                            re =  "每隔" + varry[1] + "分";
                        }
                        else{ //时
                            String[] varry = v2.split("/");
                            re =  "每隔" + varry[1] + "时";
                        }
                    }
                }
                return re+"执行";
            }
            return cron;
        }
        catch (Exception ex)
        {
            return cron;
        }
    }
    /**
     * 获取任务列表
     */
    @Override
    public DataGridResult getJobList(Map<String, Object> conditionMap,int page, int rows) throws Exception
    {
        DataGridResult re = datacollectDao.getJobList(conditionMap,page,rows);
        //获取任务列表
        List<RsJobConfig> list = re.getDetailModelList();
        if(list!=null && list.size()>0)
        {
            List<DtoJobConfig> dtoList = new ArrayList<>();
            for(RsJobConfig job :list)
            {
                DtoJobConfig dto = new DtoJobConfig();
                dto.setId(job.getId());
                dto.setJobContent(job.getJobContent());
                dto.setJobContentType(job.getJobContentType());
                dto.setJobInfo(job.getJobInfo());
                dto.setJobName(job.getJobName());
                dto.setJobNextTime(job.getJobNextTime());
                //dto.setJobTimeInterval(job.getJobTimeInterval());
                dto.setJobType(job.getJobType());
                dto.setSchemeId(job.getSchemeId());
                dto.setValid(job.getValid());
                //获取关联数据集
                List<RsJobDataset> datasetList = datacollectDao.getJobDataset(job.getId());
                if(datasetList!=null && datasetList.size()>0)
                {
                    String ds = "";
                    for(RsJobDataset dataset :datasetList)
                    {
                        ds += dataset.getJobDatasetName() + ",";
                    }
                    ds= ds.substring(0,ds.length()-1);
                    dto.setJobDataset(ds);
                }
                String cron = datacollectDao.getCronByJobId(job.getId());
                //执行计划翻译
                dto.setJobPlan(translationCron(cron));
                dtoList.add(dto);
            }
            re.setDetailModelList(dtoList);
        }
        return re;
    }
    /**
     * 根据适配方案获取数据集列表
     */
    @Override
    public DataGridResult getSchemeDataset(String schemeId,String schemeVersion,String jobId) throws Exception
    {
        //获取适配数据集总和
        String datasetString = stdManager.getDatasetByScheme(schemeVersion);
        JSONArray jsonArray =  JSONArray.fromObject(datasetString);
        //获取任务数据集
        List<RsJobDataset> jobDataset = datacollectDao.getJobDataset(jobId);
        DataGridResult re = new DataGridResult();
        List<DtoJobDataset> list = new ArrayList<>();
        for(Object item : jsonArray)
        {
            JSONObject jsonItem = JSONObject.fromObject(item);
            String datasetId= jsonItem.getString("adapterDatasetId");
            DtoJobDataset obj = new DtoJobDataset();
            obj.setJobDatasetName(jsonItem.getString("adapterDatasetName"));
            obj.setJobDatasetCode(jsonItem.getString("adapterDatasetCode"));
            obj.setJobDatasetId(datasetId);
            //是否关联任务
            if(jobDataset!=null&&jobDataset.size()>0)
            {
                for(RsJobDataset jd :jobDataset)
                {
                    if(jd.getJobDatasetId().equals(datasetId))
                    {
                        obj.setId(jd.getId());
                        obj.setJobId(jobId);
                        obj.setJobDatasetKeyvalue(jd.getJobDatasetKeyvalue());
                        obj.setJobDatasetKey(jd.getJobDatasetKey());
                        obj.setJobDatasetKeytype(jd.getJobDatasetKeytype());
                        obj.setChecked("1");
                        obj.setJobDatasetCondition(jd.getJobDatasetCondition());
                        break;
                    }
                }
            }
            list.add(obj);
        }
        re.setDetailModelList(list);
        return re;
    }
    /**
     * 根据适配方案获取字段列表
     */
    @Override
    public DataGridResult getSchemeDatasetCol(String schemeId,String schemeVersion,String datasetId) throws Exception
    {
        //获取适配字段
        String datacolString = stdManager.getDatacolByScheme(schemeVersion, datasetId);
        JSONArray datacolList = JSONArray.fromObject(datacolString);
        DataGridResult re = new DataGridResult();
        List<DtoDatasetCol> list = new ArrayList<>();
        for(Object item : datacolList)
        {
            JSONObject jsonItem = JSONObject.fromObject(item);
            DtoDatasetCol obj = new DtoDatasetCol();
            obj.setCode(jsonItem.getString("adapterMetadataCode"));
            obj.setText(jsonItem.getString("adapterMetadataName"));
            obj.setType(jsonItem.getString("adapterMetadataType"));
            obj.setDict(jsonItem.getString("adapterDictId"));
            list.add(obj);
        }
        re.setDetailModelList(list);
        return re;
    }
    /**
     * 根据任务Id获取相关数据集下拉数据
     */
    @Override
    public DataGridResult getJobDatasetByJobId(String jobId) throws Exception
    {
        //获取任务数据集
        List<RsJobDataset> jobDataset = datacollectDao.getJobDataset(jobId);
        DataGridResult re = new DataGridResult();
        List<DictItem> list = new ArrayList<>();
        for(RsJobDataset obj :jobDataset)
        {
            DictItem item = new DictItem();
            item.setValue(obj.getJobDatasetName());
            item.setCode(obj.getJobDatasetId());
            list.add(item);
        }
        re.setDetailModelList(list);
        return re;
    }
    /**
     * 保存任务关联数据集
     */
    private void saveJobDataset(String jobId,String jobDataset) throws Exception{
        //清空任务关联数据集
        datacollectDao.deleteJobDatasetByJobId(jobId);
        JSONArray array = JSONArray.fromObject(jobDataset);
        List<DtoJobDataset> list = JSONArray.toList(array, DtoJobDataset.class);
        if(list!=null && list.size()>0)
        {
            for (DtoJobDataset item : list) {
                RsJobDataset obj = new RsJobDataset();
                obj.setJobDatasetCondition(item.getJobDatasetCondition());
                obj.setJobDatasetId(item.getJobDatasetId());
                obj.setJobDatasetKey(item.getJobDatasetKey());
                obj.setJobDatasetKeytype(item.getJobDatasetKeytype());
                obj.setJobDatasetKeyvalue(item.getJobDatasetKeyvalue());
                obj.setJobDatasetName(item.getJobDatasetName());
                obj.setJobId(jobId);
                datacollectDao.saveEntity(obj);
            }
        }
    }
    /**
     * 新增任务
     */
    @Override
    @Transactional
    public ActionResult addJob(RsJobConfig obj,String cron,String jobDataset) throws Exception
    {
        datacollectDao.saveEntity(obj);
        saveJobDataset(obj.getId(),jobDataset);
        //quartz新增任务
        QuartzManager.addJob(obj.getId(),obj.getJobContentType(),obj.getJobContent(),obj.getJobNextTime(),cron);
        return new ActionResult(true,"新增成功!");
    }
    /**
     * 修改任务
     */
    @Override
    @Transactional
    public ActionResult updateJob(RsJobConfig obj,String cron,String jobDataset) throws Exception
    {
        datacollectDao.updateEntity(obj);
        saveJobDataset(obj.getId(),jobDataset);
        //quartz修改cron表达式
        QuartzManager.modifyJob(obj.getId(),obj.getJobContentType(),obj.getJobContent(),obj.getJobNextTime(),cron);
        return new ActionResult(true,"修改成功!");
    }
    /**
     * 修改任务状态
     */
    @Transactional
    public ActionResult validJob(String jobId,String valid) throws Exception
    {
        datacollectDao.validJob(jobId, valid);
        //暂停Quartz任务
        if(valid.equals("0"))
        {
            QuartzManager.pauseJob(jobId);
        }
        else{ //恢复Quartz任务
            QuartzManager.resumeJob(jobId);
        }
        return new ActionResult(true,"状态修改成功!");
    }
    /**
     * 删除任务
     */
    @Transactional
    public ActionResult deleteJob(String jobId) throws Exception {
        //清空任务关联数据集
        datacollectDao.deleteJobDatasetByJobId(jobId);
        datacollectDao.deleteEntity(RsJobConfig.class, jobId);
        //删除Quartz任务
        QuartzManager.removeJob(jobId);
        return new ActionResult(true, "删除成功!");
    }
    /************************* 数据集数据源管理 ***************************************************/
    /**
     * 数据集数据源管理列表(包含全部数据集)
     */
    @Override
    public DataGridResult getDatasetSource(String stdVersion) throws Exception
    {
        //获取版本下全部数据集
        String datasetString = stdManager.getDatasetByVersion(stdVersion);
        JSONArray datasetList = JSONArray.fromObject(datasetString);
        //获取已配数据集
        List<RsDatasourceDataset> jobDataset = datacollectDao.getDatasourceDataset(stdVersion);
        DataGridResult re = new DataGridResult();
        List<JSONObject> list = new ArrayList<>();
        for(Object item : datasetList)
        {
            JSONObject obj = JSONObject.fromObject(item);
            JSONObject dd = new JSONObject();
            dd.put("datasetId",obj.getString("id"));
            dd.put("datasetCode",obj.getString("code"));
            dd.put("datasetName", obj.getString("name"));
            dd.put("stdVersion", stdVersion);
            if(jobDataset!=null&&jobDataset.size()>0)
            {
                for(RsDatasourceDataset rdd:jobDataset)
                {
                    if(rdd.getDatasetId().equals(obj.getString("id"))) {
                        dd.put("orgId", rdd.getOrgId());
                        dd.put("datasourceId", rdd.getDatasourceId());
                        dd.put("id", rdd.getId());
                        break;
                    }
                }
            }
            list.add(dd);
        }
        re.setDetailModelList(list);
        return re;
    }
    /**
     * 保存数据集数据源配置
     */
    @Override
    @Transactional
    public ActionResult saveDatasetSource(String json) throws Exception
    {
        JSONArray jsonList = JSONArray.fromObject(json);
        for(Object item : jsonList)
        {
            JSONObject obj = JSONObject.fromObject(item);
            if(obj.containsKey("id") && obj.getString("id").length()>0)
            {
                String id = obj.getString("id");
                //修改
                if(obj.containsKey("datasourceId") && obj.getString("datasourceId").length()>0)
                {
                    RsDatasourceDataset dd = (RsDatasourceDataset)JSONObject.toBean(obj,RsDatasourceDataset.class);
                    datacollectDao.updateEntity(dd);
                }
                //删除
                else{
                    datacollectDao.deleteEntity(RsDatasourceDataset.class,id);
                }
            }
            else{
                //新增
                RsDatasourceDataset dd = (RsDatasourceDataset)JSONObject.toBean(obj,RsDatasourceDataset.class);
                datacollectDao.saveEntity(dd);
            }
        }
        return new ActionResult(true,"保存成功!");
    }
    /********************** 任务日志管理 *******************************************/
    /**
     * 获取任务详细日志列表
     */
    @Override
    public DataGridResult getJobLogDetail(Map<String, Object> conditionMap,int page, int rows) throws Exception
    {
        return datacollectDao.getJobLogDetail(conditionMap, page,rows);
    }
    /**
     * 获取任务日志列表
     */
    @Override
    public DataGridResult getJobLog(Map<String, Object> conditionMap,int page, int rows) throws Exception
    {
        DataGridResult re = datacollectDao.getJobLog(conditionMap, page, rows);
        List<RsJobLog> logList = re.getDetailModelList();
        List<DtoJobLog> list = new ArrayList<>();
        for(RsJobLog log:logList)
        {
            DtoJobLog dto = new DtoJobLog();
            BeanUtils.copyProperties(log,dto);
            List<Map<String,Object>> maps = datacollectDao.getJobLogCount(log.getId());
            if(maps!=null && maps.size()>0)
            {
                int count = Integer.parseInt(String.valueOf(maps.get(0).get("count")));
                int success =  Integer.parseInt(String.valueOf(maps.get(0).get("success")));
                int repeat_num =  Integer.parseInt(String.valueOf(maps.get(0).get("repeat_num")));
                dto.setCount(count);
                dto.setSuccess(success);
                dto.setRepeatNum(repeat_num);
            }
            else{
                dto.setCount(0);
                dto.setSuccess(0);
                dto.setRepeatNum(0);
            }
            list.add(dto);
        }
        re.setDetailModelList(list);
        return re;
    }
    /**
     * 任务详细根据数据集分组
     * @return
     */
    @Override
    public DataGridResult getJobLogDataset(String logId) throws Exception{
        DataGridResult re = new DataGridResult();
        List<SimpleChartItem> maps = datacollectDao.getJobLogDataset(logId);
        re.setDetailModelList(maps);
        return re;
    }
}

+ 0 - 523
EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/DatacollectService.java

@ -1,523 +0,0 @@
package com.yihu.ehr.datacollect.service;
import com.yihu.ehr.common.Services;
import com.yihu.ehr.datacollect.dao.intf.IDatacollectDao;
import com.yihu.ehr.datacollect.dao.intf.IDatacollectLogDao;
import com.yihu.ehr.datacollect.model.*;
import com.yihu.ehr.datacollect.service.intf.IDatacollectManager;
import com.yihu.ehr.datacollect.service.intf.IDatacollectService;
import com.yihu.ehr.dbhelper.common.DBQuery;
import com.yihu.ehr.dbhelper.common.enums.DBType;
import com.yihu.ehr.dbhelper.jdbc.DBHelper;
import com.yihu.ehr.dbhelper.mongodb.MongodbHelper;
import com.yihu.ehr.framework.constrant.DateConvert;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.std.service.intf.IStdService;
import org.json.JSONObject;
import org.json.JSONArray;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.zip.DataFormatException;
/**
 * 数据采集执行服务
 */
@Service(Services.DatacollectService)
public class DatacollectService implements IDatacollectService {
    @Resource(name = Services.Datacollect)
    private IDatacollectManager datacollect;
    @Resource(name = Services.StdService)
    private IStdService stdService;
    @Resource(name = "DatacollectDao")
    private IDatacollectDao datacollectDao;
    @Resource(name = "DatacollectLogDao")
    private IDatacollectLogDao datacollectLogDao;
    MongodbHelper mongo = new MongodbHelper();
    String dateFormat = "yyyy-MM-dd HH:mm:ss"; //默认时间字符串格式
    int maxNum = 1000; //查询条数限制
    /**
     * 根据连接字符串获取数据库类型
     */
    private static DBType getDbType(String uri) {
        return uri.startsWith("jdbc:mysql")?DBType.Mysql:(uri.startsWith("jdbc:oracle")?DBType.Oracle:(uri.startsWith("jdbc:hive2")?DBType.Hive:(uri.startsWith("jdbc:microsoft:sqlserver")?DBType.Sqlserver:DBType.Mysql)));
    }
    /**
     * 根据数据库类型获取时间sql
     * @return
     */
    private String getDateSqlByDBType(DBType dbType,Date date) throws Exception
    {
        String val = DateConvert.toString(date, dateFormat);
        if(dbType.equals(DBType.Mysql))
        {
            return "date_format(\'" + val + "\',\'" + dateFormat + "\')";
        }
        else if(dbType.equals(DBType.Oracle))
        {
            return "to_date(\'" + val + "\',\'" + dateFormat + "\')";
        }
        else
        {
            return val;
        }
    }
    /**
     * 根据数据库类型获取转换数值型sql
     */
    private String getToNumberSqlByDBType(DBType dbType,String key)  throws Exception
    {
        if(dbType.equals(DBType.Mysql))
        {
            return "cast("+key+" as signed integer)";
        }
        else if(dbType.equals(DBType.Oracle))
        {
            return "to_number(" + key + ")";
        }
        else
        {
            return key;
        }
    }
    /**
     * 根据数据库类型获取分页sql
     * @return
     */
    private String getPageSqlByDBType(DBType dbType,String sql,int start,int rows) throws Exception
    {
        if(dbType.equals(DBType.Mysql))
        {
            return sql + " LIMIT " + start + "," + rows;
        }
        else if(dbType.equals(DBType.Oracle))
        {
            return " select * from (select t.*,ROWNUM RSCOM_RN from (" + sql + ") t where ROWNUM<" + (start+rows+1) + ") where RSCOM_RN>= " + (start+1);
        }
        else
        {
            return sql;
        }
    }
    /**
     * 字典转换
     * @param list
     * @param colList
     * @return
     * @throws Exception
     */
    private List<JSONObject> translateDict(List<JSONObject> list,JSONArray colList,String schemeVersion) throws Exception
    {
        //获取字典列表
        List<DtoDictCol> dictColList = new ArrayList<>();
        for(int i=0; i< colList.length();i++)
        {
            JSONObject col = colList.getJSONObject(i);
            String dictId = col.optString("adapterDictId");
            if(dictId!=null && dictId.length()>0)
            {
                String dictType = col.optString("adapterDataType");
                String stdMetadataCode = col.optString("stdMetadataCode");
                DtoDictCol dictCol = new DtoDictCol();
                dictCol.setStdMetadataCode(stdMetadataCode);
                dictCol.setAdapterDictId(dictId);
                dictCol.setAdapterDataType(dictType.length()>0?dictType:"1");//默认通过code转换字典
                //获取字典数据
                String dictString = stdService.getDictByScheme(schemeVersion,dictId);
                JSONArray dictAdapterArray = new JSONArray(dictString);
                dictCol.setDictList(dictAdapterArray);
                dictColList.add(dictCol);
            }
        }
        //翻译列表
        for(JSONObject data :list)
        {
            //遍历字典字段
            for (DtoDictCol col : dictColList) {
                String colNmae = col.getStdMetadataCode();
                String oldValue = data.optString(colNmae);
                String newValue = translateDictValue(oldValue,col.getAdapterDataType(),col.getDictList());
                if(newValue!=null && newValue.length()>0)
                {
                    data.put(colNmae,newValue);
                }
            }
        }
        return list;
    }
    /**
     * 转译字典
     * @return
     */
    private String translateDictValue(String oldValue,String type,JSONArray dictAdapterList) throws Exception
    {
        //应用标准字段
        String colName = "adapterEntryCode";
        if(type!="1") //通过name转译
        {
            colName = "adapterEntryValue";
        }
        //遍历字典数据
        for(int i=0; i< dictAdapterList.length();i++)
        {
            JSONObject dictItem = dictAdapterList.getJSONObject(i);
            if(oldValue.equals(dictItem.getString(colName)))
            {
                String newValue = dictItem.getString("stdEntryCode");
                return newValue;
            }
        }
        return oldValue;
    }
    /**
     * 数据库表采集
     * @return
     */
    private String collectTable(DtoJobDataset ds,String schemeVersion,String logId)
    {
        try{
            String datasetId = ds.getJobDatasetId();
            String condition=ds.getJobDatasetCondition();
            String key=ds.getJobDatasetKey();
            String keytype=ds.getJobDatasetKeytype();
            String keyvalue=ds.getJobDatasetKeyvalue();
            String orgId = ds.getOrgId();
            String datasourceId = ds.getDatasourceId();
            String config = ds.getConfig(); //数据库连接
            DBHelper db = new DBHelper(datasourceId,config);
            DBType dbType = db.dbType;
            //获取数据集映射
            String datasetString = stdService.getDatasetByScheme(schemeVersion, datasetId);
            JSONArray datasetList = new JSONArray(datasetString);
            String stdTableName ="";
            String adapterTableName ="";
            if(datasetList!=null &&datasetList.length()>0)
            {
                stdTableName = datasetList.getJSONObject(0).optString("stdDatasetCode");
                adapterTableName = datasetList.getJSONObject(0).optString("adapterDatasetCode");
            }
            //获取数据集字段映射结构
            String colString = stdService.getDatacolByScheme(schemeVersion,datasetId);
            JSONArray colList = new JSONArray(colString);
            if(colList!=null && colList.length()>0)
            {
                //拼接查询sql
                String strSql = "Select '" + orgId +"' as RSCOM_ORG_ID";
                for(int i=0; i< colList.length();i++)
                {
                    JSONObject col = colList.getJSONObject(i);
                    strSql+= ","+col.optString("adapterMetadataCode") +" as " + col.optString("stdMetadataCode") ;
                }
                strSql += " from " +adapterTableName +" where 1=1 ";
                //采集范围
                if(condition!=null && condition.length()>0)
                {
                    strSql += " and "+ condition;
                }
                //增量采集
                String maxKey = "0";
                if(key!=null && key.length()>0)
                {
                    maxKey = key;
                    if(keytype.toUpperCase().equals("DATE")) //时间类型
                    {
                        Date keyDate = new Date();
                        if(keyvalue!=null && keyvalue.length()>0) {
                            //字符串转时间
                            keyDate = DateConvert.toDate(keyvalue);
                        }
                        //根据数据库类型获取时间sql
                        strSql += " and "+ key + ">'"+getDateSqlByDBType(dbType,keyDate)+"'";
                        strSql += " order by "+ key;
                    }
                    else if(keytype.toUpperCase().equals("VARCHAR")) //字符串类型
                    {
                        maxKey = getToNumberSqlByDBType(dbType,key);
                        if(keyvalue!=null && keyvalue.length()>0) {
                            strSql += " and "+ maxKey + ">'" + keyvalue + "'";
                        }
                        strSql += " order by "+ maxKey;
                    }
                    else{
                        if(keyvalue!=null && keyvalue.length()>0) {
                            strSql += " and "+ key + ">'" + keyvalue + "'";
                        }
                        strSql += " order by "+ key;
                    }
                }
                JSONObject obj = db.load("select count(1) as count,max(" + maxKey + ") as max_num from (" + strSql + ")");
                int count = obj.getInt("COUNT");
                if(count==0) //0条记录,无需采集
                {
                    return "";
                }
                String maxKeyvalue = String.valueOf(obj.get("MAX_NUM"));
                int countPage = 1;
                if(count > maxNum) //分页采集
                {
                    countPage = count/maxNum+1;
                }
                for(int i=0;i<countPage;i++)
                {
                    int rows = maxNum;
                    if(i+1==countPage){
                        rows = count-i*maxNum;
                    }
                    String sql = getPageSqlByDBType(dbType,strSql,i*maxNum,rows); //获取分页sql语句
                    RsJobLogDetail detail = new RsJobLogDetail();
                    detail.setStartTime(new Date());
                    detail.setJobLogId(logId);
                    detail.setDatasourceId(datasourceId);
                    detail.setConfig(config);
                    detail.setStdDatasetCode(stdTableName);
                    detail.setJobDatasetId(datasetId);
                    detail.setJobDatasetName(ds.getJobDatasetName());
                    detail.setJobId(ds.getJobId());
                    detail.setJobSql(sql);
                    detail.setJobNum(i+1);
                    detail.setJobDatasetRows(rows);
                    detail.setSchemeVersion(schemeVersion);
                    //最大值
                    if(i==countPage-1)
                    {
                        Object max = db.scalar("select max("+getToNumberSqlByDBType(dbType,key)+") from (" + sql + ")");
                        if(max!=null)
                            maxKeyvalue = String.valueOf(max);
                    }
                    List<JSONObject> list = db.query(sql);
                    String message = intoMongodb(list,schemeVersion,stdTableName,colList); //错误信息
                    if(message.length()>0)
                    {
                        //任务日志细表异常操作
                        detail.setJobStatus("0");
                        detail.setJobContent(message);
                    }
                    else{
                        detail.setJobStatus("1");
                        detail.setJobContent("采集成功!");
                    }
                    detail.setEndTime(new Date());
                    datacollectLogDao.saveEntity(detail);
                }
                //修改最大值
                if(maxKeyvalue!=null&& maxKeyvalue.length()>0)
                {
                    datacollectLogDao.updateJobDatasetKeyvalue(ds.getId(),maxKeyvalue);
                }
            }
            return "";
        }
        catch (Exception ex)
        {
            return ex.getMessage()+"\n";
        }
    }
    /**
     * 采集入库
     * @return
     */
    private String intoMongodb(List<JSONObject> list,String schemeVersion,String stdDatasetCode,JSONArray colList)
    {
        try{
            if(list!=null && list.size()>0)
            {
                //字典转换
                list = translateDict(list, colList,schemeVersion);
                //采集到mongodb
                boolean b = mongo.insert(stdDatasetCode,list);
                if(!b)
                {
                    if(mongo.errorMessage!=null && mongo.errorMessage.length()>0)
                    {
                        System.out.print(mongo.errorMessage);
                        return mongo.errorMessage;
                    }
                    else {
                        return "Mongodb保存失败!(表:"+stdDatasetCode+")";
                    }
                }
            }
        }
        catch (Exception e)
        {
            return e.getMessage();
        }
        return "";
    }
    /**
     * 执行任务
     */
    @Override
    public void executeJob(String jobId) {
        try {
            //获取任务详细信息
            RsJobConfig job = datacollect.getJobById(jobId);
            RsJobLog log = new RsJobLog();
            log.setJobId(jobId);
            log.setJobStartTime(new Date());
            datacollectLogDao.saveEntity(log);
            String logId = log.getId();
            StringBuilder logStr = new StringBuilder();
            int count = 0;
            int success = 0;
            try {
                String schemeVersion = job.getSchemeVersion();
                //获取任务相关数据集
                List<DtoJobDataset> list = datacollectDao.getDatacollectDataset(jobId);
                if (list != null && list.size() > 0) {
                    count = list.size();
                    logStr.append("/*********** 开始采集 *******************/\n");
                    //遍历数据集
                    for (DtoJobDataset ds : list) {
                        String type = ds.getType();
                        String message = "";
                        logStr.append(DateConvert.toString(new Date(), dateFormat) + " " + ds.getJobDatasetName());
                        if (type.equals("1")) //Web Service
                        {
                            logStr.append("Web Service采集。\n");
                        } else if (type.equals("2"))//文件系统
                        {
                            logStr.append("文件系统采集。\n");
                        } else { //数据库
                            logStr.append("数据库采集。\n");
                            message = collectTable(ds, schemeVersion,logId);
                        }
                        if(message.length()>0)
                        {
                            logStr.append(message);
                        }
                        else{
                            success++;
                        }
                    }
                    logStr.append("/*********** 结束采集 *******************/\n");
                }
            } catch (Exception ex) {
                logStr.append(ex.getMessage()+"\n");
                logStr.append("/*********** 出现异常,中断采集 *******************/\n");
            }
            //任务主日志成功
            log.setJobContent(logStr.toString());
            log.setJobEndTime(new Date());
            log.setJobDatasetCount(count);
            log.setJobDatasetSuccess(success);
            datacollectLogDao.updateEntity(log);
        }
        catch (Exception ex)
        {
            //文本日志
            System.out.println(ex.getMessage());
        }
    }
    /**
     * 根据日志详细补采数据
     */
    @Override
    public ActionResult repeatJob(String id) throws Exception
    {
        RsJobLogDetail log = datacollectLogDao.getEntity(RsJobLogDetail.class,id);
        if(log.getJobStatus().equals("2")) {
            return new ActionResult(false,"数据补采中!");
        }
        if(!log.getJobStatus().equals("0")){
            return new ActionResult(false,"数据无需补采!");
        }
        try {
            log.setRepeatStartTime(new Date());
            log.setJobStatus("2"); //设置采集中状态
            datacollectLogDao.beginTransaction();
            datacollectLogDao.updateEntity(log);
            datacollectLogDao.commitTransaction();
        }
        catch (Exception e){
            return new ActionResult(false,"补采失败!");
        }
        log.setJobStatus("0");
        datacollectLogDao.updateEntity(log);
        String stdDatasetCode = log.getStdDatasetCode();
        String sql = log.getJobSql();
        //数据库连接
        String datasourceId = log.getDatasourceId();
        String config = log.getConfig();
        DBHelper db = new DBHelper(datasourceId,config);
        //获取数据集字段映射结构
        String schemeVersion = log.getSchemeVersion();
        String datasetId = log.getJobDatasetId();
        String colString = stdService.getDatacolByScheme(schemeVersion,datasetId);
        JSONArray colList = new JSONArray(colString);
        List<JSONObject> list = db.query(sql);
        String message = intoMongodb(list,schemeVersion,stdDatasetCode,colList);
        if(message.length()>0 || db.errorMessage.length()>0)
        {
            log.setJobStatus("0");
            log.setRepeatEndTime(new Date());
            if(message.length()>0)
            {
                log.setRepeatJobContent(message);
            }
            else{
                db.errorMessage.length();
            }
            datacollectLogDao.updateEntity(log);
            return new ActionResult(false,"补采失败!");
        }
        else{
            log.setJobStatus("3");
            log.setRepeatEndTime(new Date());
            log.setRepeatJobContent("补采成功!");
            datacollectLogDao.updateEntity(log);
            return new ActionResult(true,"补采成功!");
        }
    }
}

+ 0 - 93
EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/intf/IDatacollectManager.java

@ -1,93 +0,0 @@
package com.yihu.ehr.datacollect.service.intf;
import com.yihu.ehr.datacollect.model.RsJobConfig;
import com.yihu.ehr.datacollect.model.RsJobLog;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.DataGridResult;
import java.util.Map;
/**
 * Created by hzp on 2015/12/25.
 */
public interface IDatacollectManager {
    /**
     * 根据JobId获取Cron表达式
     */
    public String getCronByJobId(String jobId) throws Exception;
    /**
     * 根据ID获取任务详细
     * @return
     */
    public RsJobConfig getJobById(String id) throws Exception;
    /**
     * 获取任务列表
     */
    public DataGridResult getJobList(Map<String, Object> conditionMap,int page, int rows) throws Exception;
    /**
     * 根据适配方案获取数据集列表
     */
    public DataGridResult getSchemeDataset(String schemeId,String schemeVersion,String jobId) throws Exception;
    /**
     * 根据适配方案获取字段列表
     */
    public DataGridResult getSchemeDatasetCol(String schemeId,String schemeVersion,String datasetId) throws Exception;
    /**
     * 根据任务Id获取相关数据集下拉数据
     */
    public DataGridResult getJobDatasetByJobId(String jobId) throws Exception;
    /**
     * 新增任务
     */
    public ActionResult addJob(RsJobConfig obj,String cron,String jobDataset) throws Exception;
    /**
     * 修改任务
     */
    public ActionResult updateJob(RsJobConfig obj,String cron,String jobDataset) throws Exception;
    /**
     * 删除任务
     */
    public ActionResult deleteJob(String id) throws Exception;
    /**
     * 修改任务状态
     */
    public ActionResult validJob(String jobId,String valid) throws Exception;
    /**
     * 数据集数据源管理列表(包含全部数据集)
     */
    public DataGridResult getDatasetSource(String stdVersion) throws Exception;
    /**
     * 保存数据集数据源配置
     */
    public ActionResult saveDatasetSource(String json) throws Exception;
    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLogDetail(Map<String, Object> conditionMap,int page, int rows) throws Exception;
    /**
     * 获取任务日志列表
     */
    public DataGridResult getJobLog(Map<String, Object> conditionMap,int page, int rows) throws Exception;
    /**
     * 任务详细根据数据集分组
     */
    public DataGridResult getJobLogDataset(String logId) throws Exception;
}

+ 0 - 24
EHR-resource/src/main/java/com/yihu/ehr/datacollect/service/intf/IDatacollectService.java

@ -1,24 +0,0 @@
package com.yihu.ehr.datacollect.service.intf;
import com.yihu.ehr.datacollect.model.RsJobConfig;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.DataGridResult;
import java.util.Map;
/**
 * Created by hzp on 2015/12/25.
 */
public interface IDatacollectService {
    /**
     * 执行任务
     */
    public void executeJob(String jobId) throws Exception;
    /**
     * 根据日志详细补采数据
     */
    public ActionResult repeatJob(String id) throws Exception;
}

+ 0 - 27
EHR-resource/src/main/java/com/yihu/ehr/job/service/DatacollectJob.java

@ -1,27 +0,0 @@
package com.yihu.ehr.job.service;
import com.yihu.ehr.common.Services;
import com.yihu.ehr.datacollect.service.intf.IDatacollectManager;
import com.yihu.ehr.datacollect.service.intf.IDatacollectService;
import com.yihu.ehr.framework.constrant.DateConvert;
import javax.annotation.Resource;
import java.util.Date;
/**
 * Created by hzp on 2016/2/2.
 */
public class DatacollectJob implements IBaseJob {
    @Resource(name = Services.DatacollectService)
    IDatacollectService service;
    @Override
    public void execute(String jobId) throws Exception{
        //service.executeJob(jobId);
        System.out.println(DateConvert.toString(new Date()) + jobId);
        return;
    }
}

+ 0 - 13
EHR-resource/src/main/java/com/yihu/ehr/job/service/IBaseJob.java

@ -1,13 +0,0 @@
package com.yihu.ehr.job.service;
/**
 * 任务类接口类
 * Created by hzp on 2016/2/2.
 */
public interface IBaseJob {
    /**
     * 类处理任务统一调用方法
     */
    void execute(String jobId) throws Exception;
}

+ 0 - 25
EHR-resource/src/main/java/com/yihu/ehr/job/service/TestJob.java

@ -1,25 +0,0 @@
package com.yihu.ehr.job.service;
import com.yihu.ehr.common.Services;
import com.yihu.ehr.datacollect.service.intf.IDatacollectService;
import com.yihu.ehr.framework.constrant.DateConvert;
import javax.annotation.Resource;
import java.util.Date;
/**
 * Created by hzp on 2016/2/2.
 */
public class TestJob implements IBaseJob {
    @Resource(name = Services.DatacollectService)
    IDatacollectService service;
    @Override
    public void execute(String jobId) throws Exception{
        System.out.println("测试quartz:"+DateConvert.toString(new Date()) + ":"+jobId);
        return;
    }
}

+ 0 - 105
EHR-resource/src/main/java/com/yihu/ehr/resource/TextResource.java

@ -1,105 +0,0 @@
package com.yihu.ehr.resource;
import com.yihu.ehr.framework.constrant.ErrorCode;
import com.yihu.ehr.framework.constrant.RedisNamespace;
import com.yihu.ehr.framework.util.PropertyLoader;
import com.yihu.ehr.framework.util.fastdfs.EnvironmentOptions;
import com.yihu.ehr.framework.util.fastdfs.XEnvironmentOption;
import com.yihu.ehr.framework.util.log.LogService;
import com.yihu.ehr.framework.util.springutil.SpringBeanUtil;
import com.yihu.ha.common.Services;
import com.yihu.ha.data.nosql.XRedisClient;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
/**
 * 资源包装类.
 *
 * @author Sand
 * @version 1.0
 * @created 2015.08.05 16:16
 */
@Service(Services.TextResource)
public class TextResource implements XTextResource {
    @Resource(name = Services.RedisClient)
    XRedisClient redisClient;
    static String makeKey(String subKey) {
        return RedisNamespace.TextResource + subKey;
    }
    @Override
    public String getErrorPhrase(final ErrorCode errorCode, final String... args) {
        String description = redisClient.get(makeKey(errorCode.getErrorCode()));
        return replaceArgs(description, args);
    }
    @Override
    public Map<String, String> getErrorMap(final ErrorCode errorCode, final String... args) {
        XRedisClient redisDAO = SpringBeanUtil.getService(Services.RedisClient);
        String description = redisDAO.get(makeKey(errorCode.getErrorCode()));
        Map<String, String> errorMap = new HashMap<>();
        errorMap.put("code", errorCode.getErrorCode());
        errorMap.put("message", replaceArgs(description, args));
        return errorMap;
    }
    private String replaceArgs(String description, final String... args) {
        if(description == null) {
            description = "";
            for (int i = 0; i < args.length; ++i) {
                description += args[i];
            }
        } else if(args != null && args.length > 0) {
            for (int i = 0; i < args.length; ++i) {
                description = description.replace("{" + i + "}", args[i]);
            }
        }
        return description;
    }
    public void registerTextResource(boolean overwrite) {
        try {
            // 向REDIS数据加加载预配置的数据及资源, 若已存在则忽略
            XEnvironmentOption environmentConfig = SpringBeanUtil.getService(Services.EnvironmentOption);
            String classPath = TextResource.class.getResource("/").getPath();
            String[] files = environmentConfig.getOption(EnvironmentOptions.TextResource).split(";");
            for (String file : files) {
                file = file.replace('\n', ' ');
                Properties properties = PropertyLoader.loadFile(classPath + file.trim());
                for (Object code : properties.keySet()) {
                    String key = makeKey((String) code);
                    if(redisClient.hasKey(key.toString()) && !overwrite) continue;
                    String value = (String) properties.get(code);
                    redisClient.set(key, value);
                }
            }
        } catch (Exception ex) {
            LogService.getLogger(TextResource.class).error("资源初始化: " + ex.getMessage());
        }
    }
    @Override
    public void clearTextResource() {
        Set<String> keys = redisClient.keys(makeKey("*"));
        keys.forEach(redisClient::delete);
    }
    @Override
    public int getResourceCount() {
        return redisClient.keys(makeKey("*")).size();
    }
}

+ 0 - 49
EHR-resource/src/main/java/com/yihu/ehr/resource/XTextResource.java

@ -1,49 +0,0 @@
package com.yihu.ehr.resource;
import com.yihu.ehr.framework.constrant.ErrorCode;
import java.util.Map;
/**
 * @author Sand
 * @version 1.0
 * @created 2015.08.05 16:18
 */
public interface XTextResource {
    /**
     * 获取错误描述.
     *
     * @param errorCode 错误代码
     * @param args 错误描述可以替换的参数
     * @return
     */
    public String getErrorPhrase(final ErrorCode errorCode, final String... args);
    /**
     * 获取错误描述, 以Map形式返回.Map结构为 {"code": "error_code", "message": "the description"}
     *
     * @param errorCode 错误代码
     * @param args 错误描述可以替换的参数
     * @return
     */
    public Map<String, String> getErrorMap(final ErrorCode errorCode, final String... args);
    /**
     * 向Redis服务器注册资源.
     */
    public void registerTextResource(boolean overwrite);
    /**
     * 清除Redis服务器中的资源.
     */
    public void clearTextResource();
    /**
     * 获取资源的数量.
     *
     * @return
     */
    public int getResourceCount();
}

+ 0 - 115
EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsCategoryController.java

@ -1,115 +0,0 @@
package com.yihu.ehr.resource.controller;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.resource.model.RsResourceCategory;
import com.yihu.ehr.resource.service.IRsCategoryService;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2015/12/15.
 */
@Controller
@RequestMapping("/resource/rsCategory")
public class RsCategoryController extends BaseController {
    @Resource(name = "categoryService")
    private IRsCategoryService rsCategoryService;
    //跳转到列表页
    @RequestMapping("initial")
    public String initial(Model model) {
        model.addAttribute("contentPage", "/resource/category/rsCategoryManage");
        return "partView";
    }
    @RequestMapping("/rsCategoryInfo")
    public String rsCategoryInfo(Model model, String id, String mode) {
        RsResourceCategory rrrd;
        try {
            if ("view".equals(mode)) {
                rrrd = rsCategoryService.getCategoryById(id);
            } else if ("modify".equals(mode)) {
                rrrd = rsCategoryService.getCategoryById(id);
            } else {
                rrrd = new RsResourceCategory();
            }
            model.addAttribute("resourceId", id);
            model.addAttribute("mode", mode);
            model.addAttribute("model", rrrd);
            model.addAttribute("contentPage", "resource/category/rsCategoryInfoDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    @RequestMapping("/searchRsCategory")
    @ResponseBody
    public Result getList(String searchNm, String parentid, String status, int page, int rows) {
        Map<String, Object> conditionMap = new HashMap<>();
        conditionMap.put("name", searchNm);
        conditionMap.put("page", page);
        conditionMap.put("rows", rows);
        Result result = null;
        try {
            result = rsCategoryService.getList(conditionMap);
        } catch (Exception e) {
            e.printStackTrace();
            result = Result.error(e.getMessage());
        }
        return result;
    }
    @RequestMapping("/createCategory")
    @ResponseBody
    public Result createCategory(HttpServletRequest request) {
        try {
            RsResourceCategory rrc = new RsResourceCategory();
            BeanUtils.populate(rrc, request.getParameterMap());
            return rsCategoryService.createCategory(rrc);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("新增失败");
        }
    }
    @RequestMapping("/updateCategory")
    @ResponseBody
    public Result updateCategory(HttpServletRequest request) {
        try {
            RsResourceCategory rrc = new RsResourceCategory();
            BeanUtils.populate(rrc, request.getParameterMap());
            return rsCategoryService.updateCategory(rrc);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("更新失败");
        }
    }
    @RequestMapping("/deleteCategory")
    @ResponseBody
    public Result deleteCategory(HttpServletRequest request) {
        try {
            String id=request.getParameter("id");
            return rsCategoryService.deleteCategory(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("更新失败");
        }
    }
}

+ 0 - 276
EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsDimensionController.java

@ -1,276 +0,0 @@
package com.yihu.ehr.resource.controller;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsDemensionCategory;
import com.yihu.ehr.resource.model.RsDimension;
import com.yihu.ehr.resource.service.IRsDimensionService;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/26.
 */
@Controller
@RequestMapping("/dimension")
public class RsDimensionController {
    @Resource(name = "rsDimensionService")
    private IRsDimensionService rsDimensionService;
    /**
     * @param model
     * @param mode
     * @return
     */
    @RequestMapping("/dimension")
    public String dimension(Model model, String mode) {
        model.addAttribute("mode", mode);
        model.addAttribute("contentPage", "dimension/dimension/dimension");
        return "partView";
    }
    /**
     * @param model
     * @param mode
     * @return
     */
    @RequestMapping("/dimensioncatetory")
    public String dimensioncatetory(Model model, String mode) {
        model.addAttribute("mode", mode);
        model.addAttribute("contentPage", "dimension/dimensioncatetory/dimensioncatetory");
        return "partView";
    }
    /**
     * 跳转到编辑页面
     *
     * @param model
     * @param id
     * @return
     */
    @RequestMapping("/editorDimension")
    public String editorDimension(Model model, String id) {
        if (!StringUtils.isEmpty(id)) {
            try {
                model.addAttribute("model", rsDimensionService.getDimensionById(id));
            } catch (Exception e) {
            }
        }
        model.addAttribute("contentPage", "dimension/dimension/editorDimension");
        return "pageView";
    }
    /**
     * 跳转到编辑页面
     *
     * @param model
     * @param id
     * @return
     */
    @RequestMapping("/editorDimensionCatetory")
    public String editorDimensionCatetory(Model model, String id) {
        if (!StringUtils.isEmpty(id)) {
            try {
                model.addAttribute("model", rsDimensionService.getDimensionCatetoryById(id));
            } catch (Exception e) {
            }
        }
        model.addAttribute("contentPage", "dimension/dimensioncatetory/editorDimensionCatetory");
        return "pageView";
    }
    /**
     * 维度类别列表
     *
     * @param request
     * @return
     */
    @RequestMapping("/getDimensionCategoryList")
    @ResponseBody
    public Result getDimensionCategoryList(HttpServletRequest request) {
        try {
            return rsDimensionService.getDimensionCategoryList();
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 维度列表
     *
     * @param request
     * @return
     */
    @RequestMapping("/getDimensionList")
    @ResponseBody
    public Result getDimensionList(HttpServletRequest request) {
        try {
            Map<String, Object> conditionMap = new HashMap<String, Object>();
            conditionMap.put("category", request.getParameter("dimensionCategoryId"));
            String page = (String) conditionMap.get("page");
            String rows = (String) conditionMap.get("rows");
            conditionMap.put("page", StringUtils.isEmpty(page) ? 1 : Integer.valueOf(page));
            conditionMap.put("rows", StringUtils.isEmpty(rows) ? 10 : Integer.valueOf(rows));
            return rsDimensionService.getDimensionList(conditionMap);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 维度类别列表
     *
     * @param request
     * @return
     */
    @RequestMapping("/getDimensionCatecoryList")
    @ResponseBody
    public Result getDimensionCatecoryList(HttpServletRequest request) {
        try {
            Map<String, Object> conditionMap = new HashMap<String, Object>();
            conditionMap.put("name", request.getParameter("name"));
            String page = (String) conditionMap.get("page");
            String rows = (String) conditionMap.get("rows");
            conditionMap.put("page", StringUtils.isEmpty(page) ? 1 : Integer.valueOf(page));
            conditionMap.put("rows", StringUtils.isEmpty(rows) ? 10 : Integer.valueOf(rows));
            return rsDimensionService.getDimensionCatecoryList(conditionMap);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 更新维度
     *
     * @param request
     * @return
     */
    @RequestMapping("/updateDimension")
    @ResponseBody
    public Result updateDimension(HttpServletRequest request) {
        try {
            RsDimension rsDimension = new RsDimension();
            BeanUtils.populate(rsDimension, request.getParameterMap());
            return rsDimensionService.updateDimension(rsDimension);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 新增维度
     *
     * @param request
     * @return
     */
    @RequestMapping("/addDimension")
    @ResponseBody
    public Result addDimension(HttpServletRequest request) {
        try {
            RsDimension rsDimension = new RsDimension();
            BeanUtils.populate(rsDimension, request.getParameterMap());
            return rsDimensionService.addDimension(rsDimension);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 删除维度
     *
     * @param request
     * @return
     */
    @RequestMapping("/deleteDimension")
    @ResponseBody
    public Result deleteDimension(HttpServletRequest request) {
        try {
            String id = request.getParameter("id");
            return rsDimensionService.deleteDimensionById(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 删除维度类别
     *
     * @param request
     * @return
     */
    @RequestMapping("/deleteDimensionCatetory")
    @ResponseBody
    public Result deleteDimensionCatetory(HttpServletRequest request) {
        try {
            String id = request.getParameter("id");
            return rsDimensionService.deleteDimensionCatetory(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 新增维度类别
     *
     * @param request
     * @return
     */
    @RequestMapping("/addDimensionCatetroy")
    @ResponseBody
    public Result addDimensionCatetroy(HttpServletRequest request) {
        try {
            RsDemensionCategory r = new RsDemensionCategory();
            BeanUtils.populate(r, request.getParameterMap());
            return rsDimensionService.addDimensionCatetroy(r);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 新增维度类别
     *
     * @param request
     * @return
     */
    @RequestMapping("/updateDimensionCatetroy")
    @ResponseBody
    public Result updateDimensionCatetroy(HttpServletRequest request) {
        try {
            RsDemensionCategory r = new RsDemensionCategory();
            BeanUtils.populate(r, request.getParameterMap());
            return rsDimensionService.updateDimensionCatetroy(r);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
}

+ 0 - 737
EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsResourceController.java

@ -1,737 +0,0 @@
package com.yihu.ehr.resource.controller;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.resource.model.*;
import com.yihu.ehr.resource.service.IRsResourceRestService;
import com.yihu.ehr.resource.service.IRsResourceService;
import com.yihu.ehr.resource.viewresult.RsResourceDeatilModel;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2015/12/15.
 */
@RequestMapping("/resource")
@Controller
public class RsResourceController extends BaseController {
    @Resource(name = "resourceService")
    private IRsResourceService resourceService;
    @Resource(name = "resourceRestService")
    private IRsResourceRestService resourceRestService;
    /**
     * 访问resourcebrowse/resource.jsp页面
     *
     * @param model
     * @param mode
     * @return
     */
    @RequestMapping("/resourcePage")
    public String resourcePage(Model model, String mode) {
        model.addAttribute("mode", mode);
        model.addAttribute("contentPage", "resource/resourcebrowse/resource");
        return "partView";
    }
    @RequestMapping("/resourceBrowse")
    public String resourceBrowse(Model model, String id) {
        try {
            model.addAttribute("resourceModel", resourceService.getRsResourceDeatilModel(id));
            model.addAttribute("contentPage", "resource/resourceregister/resourceBrowse");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "partView";
    }
    /**
     * 查找树List
     *
     * @return
     */
    @RequestMapping("/resourceTreeList")
    @ResponseBody
    public Result resourceTreeList() {
        try {
            ActionResult actionResult = new ActionResult();
            actionResult.setData(resourceService.getResourceTreeList());
            return actionResult;
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/resourceCategoryTreeList")
    @ResponseBody
    public Result resourceCategoryTreeList() {
        try {
            ActionResult actionResult = new ActionResult();
            actionResult.setData(resourceService.resourceCategoryTreeList());
            return actionResult;
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    //跳转到列表页
    @RequestMapping("/resource/initial")
    public String initial(Model model) {
        model.addAttribute("contentPage", "/resource/resourceregister/rsResourceManage");
        return "partView";
    }
    //跳转到资源配置页
    @RequestMapping("/resource/configInitial")
    public String resourceConfigInitial(String id, Model model) {
        try {
            model.addAttribute("resourceModel", resourceService.getRsResourceDeatilModel(id));
            model.addAttribute("model", model);
            model.addAttribute("contentPage", "/resource/resourceregister/rsResourceConfig");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "partView";
    }
    //跳转到资源授权页
    @RequestMapping("/resource/authorizeInitial")
    public String rsResourceAuthorizeInitial(String id, Model model) {
        try {
            model.addAttribute("resourceModel", resourceService.getRsResourceDeatilModel(id));
            model.addAttribute("contentPage", "/resource/resourceregister/rsResourceAuthorize");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "partView";
    }
    /**
     * 跳转到资源授权的dialog
     *
     * @param model
     * @param id
     * @param mode
     * @return
     */
    @RequestMapping("/resource/rsResourceAuthorize")
    public String rsResourceAuthorize(Model model, String id, String mode) {
        try {
            model.addAttribute("resourceId", id);
            model.addAttribute("mode", mode);
            model.addAttribute("contentPage", "/resource/resourceregister/rsResourceAuthorizeDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    /**
     * 跳转到导入数据集的界面
     *
     * @param model
     * @param mode
     * @return
     */
    @RequestMapping("/resource/rsResourceImportDataset")
    public String rsResourceImportDataset(Model model, String mode, String resourceId, String datasetId) {
        try {
            model.addAttribute("mode", mode);
            model.addAttribute("resourceId", resourceId);
            model.addAttribute("datasetId", datasetId);
            if (!StringUtils.isEmpty(datasetId)) {
                RsResourceDataset ds = resourceService.getLocalDataSetById(datasetId);
                model.addAttribute("datasetCode", ds.getCode());
            }
            model.addAttribute("contentPage", "/resource/resourceregister/rsResourceImportDatasetDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    /**
     * 打开新增或者编辑资源字段的界面
     *
     * @param model
     * @param id
     * @param mode
     * @return
     */
    @RequestMapping("/resource/rsResourceFieldInfo")
    public String rsResourceFieldInfo(Model model, String id, String mode, String datasetId, String resourceId) {
        try {
            RsResourceMetadata rsResourceMetadata = null;
            //mode定义:new modify view三种模式,新增,修改,查看
            if (mode.equals("view")) {
                rsResourceMetadata = resourceService.getRsResourceMetadata(id);
            } else if (mode.equals("modify")) {
                rsResourceMetadata = resourceService.getRsResourceMetadata(id);
            } else {
                rsResourceMetadata = new RsResourceMetadata();
            }
            model.addAttribute("entity", rsResourceMetadata);
            model.addAttribute("mode", mode);
            model.addAttribute("datasetId", datasetId);
            model.addAttribute("resourceId", resourceId);
            model.addAttribute("contentPage", "/resource/resourceregister/rsResourceFieldInfoDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    /**
     * 跳转到资源维度配置的dialog
     *
     * @param model
     * @param id
     * @param resourceId
     * @return
     */
    @RequestMapping("/resource/rsResourceDimension")
    public String rsResourceDimension(Model model, String id, String resourceId) {
        try {
            RsAppResourceDetail rard = resourceService.getAppResourceDetailId(id);
            model.addAttribute("appResourceDetail", rard);
            model.addAttribute("metadataName", resourceService.getRsResourceMetadata(rard.getMetadataId()));
            model.addAttribute("resultSelect", JSONArray.fromObject(resourceService.getDimensionByResourceId(resourceId)).toString());
            model.addAttribute("resourceId", resourceId);
            model.addAttribute("contentPage", "/resource/resourceregister/rsResourceDimensionDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    @RequestMapping("/resource/searchRsResource")
    @ResponseBody
    public Result getResourceList(HttpServletRequest request) {
        try {
            String page = request.getParameter("page");
            String rows = request.getParameter("rows");
            String categoryId = request.getParameter("categoryId");
            String resourceName = request.getParameter("resourceName");
            DataGridResult result = new DataGridResult(Integer.valueOf(page), Integer.valueOf(rows));
            Map<String, Object> conditionMap = new HashMap<>();
            conditionMap.put("categoryId", categoryId);
            conditionMap.put("resourceName", resourceName);
            result = resourceService.getResourceList(conditionMap, Integer.valueOf(page), Integer.valueOf(rows));
            return result;
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
    }
    /**
     * 资源浏览界面 查找datagrid
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/searchRomoteResourceList")
    @ResponseBody
    public Result searchRomoteResourceList(HttpServletRequest request, HttpServletResponse response) {
        DataGridResult result = new DataGridResult();
        try {
            String pageSize = StringUtils.isEmpty(request.getParameter("rows")) ? "10" : request.getParameter("rows");
            String currPage = StringUtils.isEmpty(request.getParameter("page")) ? "1" : request.getParameter("page");
            String id = request.getParameter("id");//资源ID
            String queryParams = request.getParameter("queryParams");
            //得到资源对象
            RsResourceDeatilModel resource = resourceService.getRsResourceDeatilModel(id);
            //设置参数
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("rows", Integer.valueOf(pageSize));
            params.put("page", Integer.valueOf(currPage));
            if (!StringUtils.isEmpty(resource.getDatasetCode())) {
                RsResourceRestDetail rrd = resourceRestService.getResourceRestDetailByCode(resource.getCode());
                if ("resource.getMongoDBData".equals(rrd.getNamespace())) {
                    //如果是访问mongo 则加入表的参数
                    String datasetId = resource.getDatasetCode();
                    if (!StringUtils.isEmpty(datasetId)) {
                        RsResourceDataset rd = resourceService.getLocalDataSetById(datasetId);
                        params.put("tableCode", rd.getCode());
                    } else {
                        return result;
                    }
                }
            }
            if (!StringUtils.isEmpty(queryParams)) {
                params.put("condition", queryParams);
            } else {
                params.put("condition", "{}");
            }
            //访问服务得到数据
            String response_params = resourceService.searchRomoteResourceList(resource.getCode(), params);
            if (response_params.startsWith("[")) {
                //如果是数组
                Integer count = JSONArray.fromObject(response_params).size();//得到总数
                //访问服务得到元数据
                //设置动态datagrid值
                result.setDetailModelList(JSONArray.fromObject(response_params));
                result.setTotalCount(count);
                result.setCurrPage(Integer.valueOf(currPage));
                result.setPageSize(count);
                result.setSuccessFlg(true);
            } else {
                Integer count = (Integer) JSONObject.fromObject(response_params).get("totalCount");//得到总数
                //访问服务得到元数据
                //设置动态datagrid值
                String s = JSONObject.fromObject(response_params).get("detailModelList").toString().replace(":null,", ":\"\",");
                result.setDetailModelList(JSONArray.fromObject(s));
                result.setTotalCount(count);
                result.setCurrPage(Integer.valueOf(currPage));
                result.setPageSize(Integer.valueOf(pageSize));
                result.setSuccessFlg(true);
            }
        } catch (Exception e) {
            e.printStackTrace();
            result.setSuccessFlg(false);
            result.setMessage("获取数据失败");
        }
        return result;
    }
    /**
     * 资源浏览界面 查找datagrid列
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/searchResourceDatagridColunm")
    @ResponseBody
    public String searchResourceDatagridColunm(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> mapParam = new HashMap<String, Object>();
        try {
            String id = request.getParameter("id");//资源ID
            //得到资源对象
            RsResourceDeatilModel resource = resourceService.getRsResourceDeatilModel(id);
            //得到列信息
            List<RsResourceMetadata> rsResourceMetadatas = resourceService.getResourceMetadataListColumn(resource.getId());
            List<String> colunmName = new ArrayList<String>();
            List<String> colunmCode = new ArrayList<String>();
            List<String> colunmType = new ArrayList<String>();
            List<String> colunmDict = new ArrayList<String>();
            for (RsResourceMetadata r : rsResourceMetadatas) {
                colunmName.add(r.getName());
                colunmCode.add(r.getCode());
                colunmType.add(r.getColumnType());
                colunmDict.add(r.getDictId() + "");
            }
            //设置动态datagrid值
            mapParam.put("colunmName", colunmName);
            mapParam.put("colunmCode", colunmCode);
            mapParam.put("colunmDict", colunmDict);
            mapParam.put("colunmType", colunmType);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.fromObject(mapParam).toString();
    }
    /**
     * 找出Field列表
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/searchResourceFieldList")
    @ResponseBody
    public Result searchResourceFieldList(HttpServletRequest request) {
        try {
            String resourceId = request.getParameter("resourceId");
            String page = request.getParameter("page");
            String rows = request.getParameter("rows");
            DataGridResult result = new DataGridResult(Integer.valueOf(page), Integer.valueOf(rows));
            Map<String, Object> conditionMap = new HashMap<>();
            conditionMap.put("resourceId", resourceId);
            result = resourceService.getResourceFiled(conditionMap, Integer.valueOf(page), Integer.valueOf(rows));
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 跳转到新增或者修改资源的界面
     *
     * @param model
     * @param id
     * @param mode
     * @return
     */
    @RequestMapping("/resource/rsResourceInfo")
    public String rsResourceInfoTemplate(Model model, String id, String mode) {
        try {
            RsResourceDeatilModel rsResource = null;
            //mode定义:new modify view三种模式,新增,修改,查看
            if (mode.equals("view")) {
                rsResource = resourceService.getRsResourceDeatilModel(id);
            } else if (mode.equals("modify")) {
                rsResource = resourceService.getRsResourceDeatilModel(id);
            } else {
                rsResource = new RsResourceDeatilModel();
            }
            model.addAttribute("entity", rsResource);
            model.addAttribute("mode", mode);
            model.addAttribute("contentPage", "/resource/resourceregister/rsResourceInfoDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    /**
     * 修改资源
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/updateRsResource")
    @ResponseBody
    public Result updateRsResource(HttpServletRequest request) {
        try {
            String category = request.getParameter("category");
            String rate = request.getParameter("rate");
            String code = request.getParameter("code");
            String name = request.getParameter("name");
            String supportType = request.getParameter("supportType");
            String type = request.getParameter("type");
            String id = request.getParameter("id");
            RsResource rs = new RsResource();
            rs.setId(id);
            rs.setCode(code);
            rs.setType(type);
            rs.setName(name);
            rs.setServiceRate(rate);
            rs.setCategory(category);
            rs.setDataSupportType(supportType);
            resourceService.updateRsResource(rs);
            return Result.success("修改成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("修改失败!");
        }
    }
    /**
     * 新增资源
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/createRsResource")
    @ResponseBody
    public Result createRsResource(HttpServletRequest request) {
        try {
            String category = request.getParameter("category");
            String rate = request.getParameter("rate");
            String code = request.getParameter("code");
            String name = request.getParameter("name");
            String supportType = request.getParameter("supportType");
            String type = request.getParameter("type");
            RsResource rs = new RsResource();
            rs.setCode(code);
            rs.setType(type);
            rs.setName(name);
            rs.setServiceRate(rate);
            rs.setCategory(category);
            rs.setDataSupportType(supportType);
            resourceService.createRsResource(rs);
            return Result.success("新增成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("新增失败!");
        }
    }
    @RequestMapping("/resource/deleteResource")
    @ResponseBody
    public Result deleteResource(HttpServletRequest request) {
        try {
            String id = request.getParameter("id");
            resourceService.deleteResource(id);
            return Result.success("删除成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("删除失败!");
        }
    }
    @RequestMapping("/resource/getDataSet")
    @ResponseBody
    public Result getDataSet(HttpServletRequest request) {
        try {
            Map<String, Object> params = new HashMap<String, Object>();
            String datasetId = request.getParameter("datasetId");
            params.put("datasetId", datasetId);
            return resourceService.getDataSet(params);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("删除失败!");
        }
    }
    @RequestMapping("/resource/getMetaData")
    @ResponseBody
    public Result getMetaData(HttpServletRequest request) {
        try {
            Map<String, Object> params = new HashMap<String, Object>();
            String id = request.getParameter("id");
            params.put("id", id);
            return resourceService.getMetaData(params);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("删除失败!");
        }
    }
    /**
     * 导入全部数据集
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/improtAllMetadata")
    @ResponseBody
    public Result improtAllMetadata(HttpServletRequest request) {
        try {
            String reourceId = request.getParameter("reourceId");//资源ID
            String datasetId = request.getParameter("datasetId");//资源ID
            System.out.println("datasetId" + datasetId);
            RsResourceDataset dataset = new RsResourceDataset();
            BeanUtils.populate(dataset, request.getParameterMap());
            return resourceService.improtAllMetadata(dataset, reourceId);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 导入全部数据集
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/improtSameMetadata")
    @ResponseBody
    public Result improtSameMetadata(HttpServletRequest request) {
        try {
            String dataset = request.getParameter("dataset");//数据集
            String metaData = request.getParameter("selecrMedatata");//选中的metaData
            String reourceId = request.getParameter("reourceId");//资源ID
            String datasetId = request.getParameter("datasetId");//数据集ID
            return resourceService.improtSameMetadata(reourceId, metaData, dataset, datasetId);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 导入数据集
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/deleteMetadata")
    @ResponseBody
    public Result deleteMetadata(HttpServletRequest request) {
        try {
            String id = request.getParameter("id");//资源ID
            return resourceService.deleteMetadata(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/resource/createMetaData")
    @ResponseBody
    public Result createMetaData(HttpServletRequest request) {
        try {
            RsResourceMetadata rmd = new RsResourceMetadata();
            BeanUtils.populate(rmd, request.getParameterMap());
            rmd.setCode(request.getParameter("columnCode"));
            return resourceService.createMetaData(rmd);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/resource/updateMetaData")
    @ResponseBody
    public Result updateMetaData(HttpServletRequest request) {
        try {
            RsResourceMetadata rmd = new RsResourceMetadata();
            BeanUtils.populate(rmd, request.getParameterMap());
            rmd.setCode(request.getParameter("columnCode"));
            return resourceService.updateMetaData(rmd);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/resource/getMetaDataByDatasetId")
    @ResponseBody
    public Result getMetaDataByDatasetId(HttpServletRequest request) {
        try {
            String datasetCode = request.getParameter("datasetCode");
            String datasetId = request.getParameter("datasetId");
            return resourceService.getMetaDataByDatasetId(datasetCode, datasetId);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/resource/getResourceAuthorize")
    @ResponseBody
    public Result getResourceAuthorize(HttpServletRequest request) {
        try {
            String resourceId = request.getParameter("resourceId");
            String appId = request.getParameter("appId");
            if (StringUtils.isEmpty(resourceId) || StringUtils.isEmpty(appId)) {
                return new DataGridResult();
            }
            return resourceService.getResourceAuthorize(resourceId, appId);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 资源授权页面 进入应用授权时 查询授权和未授权的应用
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/getResourceApp")
    @ResponseBody
    public Result getResourceApp(HttpServletRequest request) {
        try {
            String id = request.getParameter("id");
            return resourceService.getResourceApp(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 更新资源授权的应用
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/updateResourceApp")
    @ResponseBody
    public Result updateResourceApp(HttpServletRequest request) {
        try {
            String ids = request.getParameter("ids");
            String resourceId = request.getParameter("resourceId");
            return resourceService.updateResourceApp(ids, resourceId);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 更新资源授权的应用
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/getResourceAppList")
    @ResponseBody
    public Result getResourceAppList(HttpServletRequest request) {
        try {
            String resourceId = request.getParameter("resourceId");
            return resourceService.getResourceAppList(resourceId);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    /**
     * 全部禁止1 全部允许2 选中禁止3 选中允许4
     *
     * @param request
     * @return
     */
    @RequestMapping("/resource/changeAppResource")
    @ResponseBody
    public Result changeAppResource(HttpServletRequest request) {
        try {
            String resourceId = request.getParameter("resourceId");
            String appId = request.getParameter("appId");
            String ids = request.getParameter("ids");
            String flag = request.getParameter("flag");
            return resourceService.changeAppResource(flag, appId, ids, resourceId);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/resource/saveResourceDimension")
    @ResponseBody
    public Result saveResourceDimension(HttpServletRequest request) {
        try {
            String appResourceDeatilId = request.getParameter("appResourceDeatilId");
            String value = request.getParameter("value");
            String dimensionId = request.getParameter("dimensionId");
            RsAppResourceDetail appResourceDetail = new RsAppResourceDetail();
            appResourceDetail.setId(appResourceDeatilId);
            appResourceDetail.setDimensionValue(value);
            appResourceDetail.setDimensionId(dimensionId);
            return resourceService.saveResourceDimension(appResourceDetail);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
}

+ 0 - 194
EHR-resource/src/main/java/com/yihu/ehr/resource/controller/RsResourceRestController.java

@ -1,194 +0,0 @@
package com.yihu.ehr.resource.controller;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsResourceRest;
import com.yihu.ehr.resource.model.RsResourceRestDetail;
import com.yihu.ehr.resource.service.IRsResourceRestService;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/30.
 */
@RequestMapping("/resourceRest")
@Controller
public class RsResourceRestController {
    @Resource(name = "resourceRestService")
    private IRsResourceRestService resourceRestService;
    @RequestMapping("/initial")
    public String initial(Model model) {
        model.addAttribute("contentPage", "resource/resourcerest/resourceRest");
        return "partView";
    }
    @RequestMapping("/resourceRestDialog")
    public String resourceRestDialog(Model model, String id, String mode) {
        RsResourceRest rrr;
        try {
            if ("view".equals(mode)) {
                rrr = resourceRestService.getResourceRestById(id);
            } else if ("modify".equals(mode)) {
                rrr = resourceRestService.getResourceRestById(id);
            } else {
                rrr = new RsResourceRest();
            }
            model.addAttribute("resourceId", id);
            model.addAttribute("mode", mode);
            model.addAttribute("model", rrr);
            model.addAttribute("contentPage", "resource/resourcerest/resourceRestDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    @RequestMapping("/resourceRestDetailDialog")
    public String resourceRestDetailDialog(Model model, String id, String mode) {
        RsResourceRestDetail rrrd;
        try {
            if ("view".equals(mode)) {
                rrrd = resourceRestService.getResourceRestDetail(id);
            } else if ("modify".equals(mode)) {
                rrrd = resourceRestService.getResourceRestDetail(id);
            } else {
                rrrd= new RsResourceRestDetail();
            }
            model.addAttribute("resourceId", id);
            model.addAttribute("mode", mode);
            model.addAttribute("model", rrrd);
            model.addAttribute("contentPage", "resource/resourcerest/resourceRestDetailDialog");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "pageView";
    }
    @RequestMapping("/getResourceRestDetilList")
    @ResponseBody
    public Result getResourceRestDetilList(HttpServletRequest request) {
        try {
            String page = StringUtils.isEmpty(request.getParameter("page"))?"1":request.getParameter("page");
            String rows = StringUtils.isEmpty(request.getParameter("rows"))?"10":request.getParameter("rows");
            String resourceRestId = request.getParameter("resourceRestId");
            DataGridResult result = new DataGridResult(Integer.valueOf(page), Integer.valueOf(rows));
            Map<String, Object> conditionMap = new HashMap<>();
            conditionMap.put("resourceRestId",resourceRestId);
            result = resourceRestService.getResourceRestDetilList(conditionMap, Integer.valueOf(page), Integer.valueOf(rows));
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/getResourceRestList")
    @ResponseBody
    public Result getResourceRestList(HttpServletRequest request) {
        try {
            String page = request.getParameter("page");
            String rows = request.getParameter("rows");
            DataGridResult result = new DataGridResult(Integer.valueOf(page), Integer.valueOf(rows));
            Map<String, Object> conditionMap = new HashMap<>();
            result = resourceRestService.getResourceRestList(conditionMap, Integer.valueOf(page), Integer.valueOf(rows));
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
    @RequestMapping("/deleteResourceRest")
    @ResponseBody
    public Result deleteResourceRest(HttpServletRequest request) {
        try {
            String id = request.getParameter("id");
            return  resourceRestService.deleteResourceRestById(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("删除失败");
        }
    }
    @RequestMapping("/deleteResourceRestDetail")
    @ResponseBody
    public Result deleteResourceRestDetail(HttpServletRequest request) {
        try {
            String id = request.getParameter("id");
            return resourceRestService.deleteResourceRestDetail(id);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("删除失败");
        }
    }
    @RequestMapping("/addResourceRest")
    @ResponseBody
    public Result addResourceRest(HttpServletRequest request) {
        try {
            RsResourceRest rr=new RsResourceRest();
            BeanUtils.populate(rr, request.getParameterMap());
            return resourceRestService.addResourceRest(rr);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("新增失败");
        }
    }
    @RequestMapping("/updateResourceRest")
    @ResponseBody
    public Result updateResourceRest(HttpServletRequest request) {
        try {
            RsResourceRest rr=new RsResourceRest();
            BeanUtils.populate(rr, request.getParameterMap());
            return resourceRestService.updateResourceRest(rr);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("更新失败");
        }
    }
    @RequestMapping("/addResourceRestDetail")
    @ResponseBody
    public Result addResourceRestDetail(HttpServletRequest request) {
        try {
            RsResourceRestDetail rrd=new RsResourceRestDetail();
            BeanUtils.populate(rrd, request.getParameterMap());
            return resourceRestService.addResourceRestDetail(rrd);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("新增失败");
        }
    }
    @RequestMapping("/updateResourceRestDetail")
    @ResponseBody
    public Result updateResourceRestDetail(HttpServletRequest request) {
        try {
            RsResourceRestDetail rrd=new RsResourceRestDetail();
            BeanUtils.populate(rrd, request.getParameterMap());
            return resourceRestService.updateResourceRestDetail(rrd);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error("更新失败");
        }
    }
}

+ 0 - 21
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsAppResourceDao.java

@ -1,21 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.resource.model.RsAppResource;
import java.util.List;
/**
 * Created by chenweida on 2016/1/25.
 */
public interface IRsAppResourceDao extends XSQLGeneralDAO{
    List<RsAppResource> getAppResourceByResourceId(String resourceid) throws Exception;
    void deleteByResourceId(String resourceId)throws Exception;
    RsAppResource getAppResourceByResourceIdAndAppId(String resourceId, String appId)throws Exception;
    void deleteEntityList(List<RsAppResource> deleteList)throws Exception;
    void saveEntityList(List<RsAppResource> newList)throws Exception;
}

+ 0 - 17
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsAppResourceDetailDao.java

@ -1,17 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.resource.model.RsAppResourceDetail;
import java.util.List;
/**
 * Created by chenweida on 2016/1/25.
 */
public interface IRsAppResourceDetailDao extends XSQLGeneralDAO {
    List<RsAppResourceDetail> getAppResourceDetailByAppResouceId(String id) throws Exception;
    void deleteByAppResourceId(String id) throws Exception;
}

+ 0 - 21
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsCategoryDao.java

@ -1,21 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsDemensionCategory;
import com.yihu.ehr.resource.model.RsResourceCategory;
import java.util.Map;
/**
 * Created by chenweida on 2015/12/15.
 */
public interface IRsCategoryDao extends XSQLGeneralDAO {
    RsDemensionCategory[] getAllCategory() throws Exception;
    Result getList(Map<String, Object> conditionMap) throws Exception;
    RsResourceCategory getCategoryByNameAndPid(String name, String pid) throws Exception;
    RsResourceCategory getCategoryByNameAndPidWithOutThis(String name, String pid, String id)throws Exception;
}

+ 0 - 17
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsDemensionCategoryDao.java

@ -1,17 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsDemensionCategory;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/26.
 */
public interface IRsDemensionCategoryDao extends XSQLGeneralDAO {
    List<RsDemensionCategory> getDimensionCategoryList() throws Exception;
    Result getDimensionCatecoryList(Map<String, Object> conditionMap) throws Exception;
}

+ 0 - 10
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsDimensionDao.java

@ -1,10 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
/**
 * Created by chenweida on 2016/1/26.
 */
public interface IRsDimensionDao extends XSQLGeneralDAO {
}

+ 0 - 13
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceCategoryDao.java

@ -1,13 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.resource.model.RsResourceCategory;
import java.util.List;
/**
 * Created by chenweida on 2016/1/13.
 */
public interface IRsResourceCategoryDao extends XSQLGeneralDAO {
    List<RsResourceCategory> getAllRsResourceCategory() throws Exception;
}

+ 0 - 24
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceDao.java

@ -1,24 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.resource.model.RsResource;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/13.
 */
public interface IRsResourceDao extends XSQLGeneralDAO {
    DataGridResult getResourceList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    DataGridResult getResourceFiled(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    int getResourceListCount(Map<String, Object> conditionMap) throws Exception;
    List<RsResource> getAllRsResource() throws Exception;
    RsResource getResourceById(String id) throws Exception;
}

+ 0 - 9
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceDatasetDao.java

@ -1,9 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
/**
 * Created by chenweida on 2016/1/21.
 */
public interface IRsResourceDatasetDao extends XSQLGeneralDAO{
}

+ 0 - 17
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceDimensionDao.java

@ -1,17 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.viewresult.RsResourceDimensionModel;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/26.
 */
public interface IRsResourceDimensionDao extends XSQLGeneralDAO {
    List<RsResourceDimensionModel> getDimensionByResourceId(String resourceId) throws Exception;
    Result getDimensionList(Map<String,Object > conditionMap) throws Exception;
}

+ 0 - 28
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceMetadataDao.java

@ -1,28 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsResourceMetadata;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/21.
 */
public interface IRsResourceMetadataDao extends XSQLGeneralDAO {
    void deleteMetadatasByDataSetCode(String dataSetCode) throws Exception;
    void deleteLogicDataSupportMetaDataByLocalDataSetId(String datasetId) throws Exception;
    List<RsResourceMetadata> getMetadataByLocalDatssetId(String datasetId) throws Exception;
    Result getResourceAuthorize(Map<String, Object> params) throws Exception;
    List<RsResourceMetadata> getMetadataByResourceId(String code) throws Exception;
    RsResourceMetadata getMetadataByCodeAndResourceId(String code, String resourceId) throws Exception;
    RsResourceMetadata getMetadataByCodeAndResourceIdWithOutId(String code, String resourceId, String id) throws Exception;
}

+ 0 - 13
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceRestDao.java

@ -1,13 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/30.
 */
public interface IRsResourceRestDao extends XSQLGeneralDAO {
    DataGridResult getResourceRestList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
}

+ 0 - 20
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/IRsResourceRestDetailDao.java

@ -1,20 +0,0 @@
package com.yihu.ehr.resource.dao;
import com.yihu.ehr.framework.common.dao.XSQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.resource.model.RsResourceRestDetail;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/30.
 */
public interface IRsResourceRestDetailDao extends XSQLGeneralDAO {
    DataGridResult getResourceRestDetilList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    RsResourceRestDetail getResourceRestDetailByCode(String code) throws Exception;
    RsResourceRestDetail getResourceRestDetailByCodeAndResourceRestId(String code, String resourceRestId) throws Exception;
    RsResourceRestDetail getResourceRestDetailByCodeAndResourceRestIdWithOutId(String code, String resourceRestId, String id) throws Exception;
}

+ 0 - 41
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsAppResourceDaoImpl.java

@ -1,41 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.resource.dao.IRsAppResourceDao;
import com.yihu.ehr.resource.model.RsAppResource;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
 * Created by chenweida on 2016/1/25.
 */
@Repository("rsAppResourceDao")
public class RsAppResourceDaoImpl extends SQLGeneralDAO implements IRsAppResourceDao {
    @Override
    public List<RsAppResource> getAppResourceByResourceId(String resourceid) throws Exception {
        List<RsAppResource> rs = (List<RsAppResource>) super.hibernateTemplate.find("from RsAppResource r where r.resourceId=?", resourceid);
        return rs;
    }
    @Override
    public void deleteByResourceId(String resourceId) throws Exception {
        super.hibernateTemplate.deleteAll(super.hibernateTemplate.find("from RsAppResource r where r.resourceId=?", resourceId));
    }
    @Override
    public RsAppResource getAppResourceByResourceIdAndAppId(String resourceId, String appId) {
        return (RsAppResource) super.hibernateTemplate.find("from RsAppResource r where r.resourceId=? and r.appId=? ", resourceId, appId).get(0);
    }
    @Override
    public void deleteEntityList(List<RsAppResource> deleteList) throws Exception {
        super.hibernateTemplate.deleteAll(deleteList);
    }
    @Override
    public void saveEntityList(List<RsAppResource> newList) throws Exception {
        for (RsAppResource r : newList)
            super.hibernateTemplate.save(r);
    }
}

+ 0 - 25
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsAppResourceDetailDaoImpl.java

@ -1,25 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.resource.dao.IRsAppResourceDetailDao;
import com.yihu.ehr.resource.model.RsAppResourceDetail;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
 * Created by chenweida on 2016/1/25.
 */
@Repository("rsAppResourceDetailDao")
public class RsAppResourceDetailDaoImpl extends SQLGeneralDAO implements IRsAppResourceDetailDao {
    @Override
    public List<RsAppResourceDetail> getAppResourceDetailByAppResouceId(String id) throws Exception {
        return (List<RsAppResourceDetail>) super.hibernateTemplate.find("from RsAppResourceDetail r where r.appResouceId=? ", id);
    }
    @Override
    public void deleteByAppResourceId(String id) throws Exception {
        super.hibernateTemplate.deleteAll(super.hibernateTemplate.find("from RsAppResourceDetail r where r.appResouceId=? ", id));
    }
}

+ 0 - 50
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsCategoryDaoImpl.java

@ -1,50 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.dao.IRsCategoryDao;
import com.yihu.ehr.resource.model.RsDemensionCategory;
import com.yihu.ehr.resource.model.RsResourceCategory;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
@Repository("rsCategoryDao")
public class RsCategoryDaoImpl extends SQLGeneralDAO implements IRsCategoryDao {
    @Override
    public RsDemensionCategory[] getAllCategory() throws Exception {
        return (RsDemensionCategory[]) super.hibernateTemplate.find("from RsResourceCategory").toArray();
    }
    @Override
    public Result getList(Map<String, Object> conditionMap) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append(" from RsResourceCategory r ");
        sb.append(" where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("name"))) {
            sb.append(" and r.name like '%" + conditionMap.get("name") + "%'");
        }
        return super.getDataGridResult(sb.toString(), (Integer) conditionMap.get("page"), (Integer) conditionMap.get("rows"));
    }
    @Override
    public RsResourceCategory getCategoryByNameAndPid(String name, String pid) throws Exception {
        List<RsResourceCategory> r = (List<RsResourceCategory>) super.hibernateTemplate.find("from RsResourceCategory r where r.name=? and r.pid=?", name, pid);
        if (r != null && r.size() > 0)
            return r.get(0);
        else
            return null;
    }
    @Override
    public RsResourceCategory getCategoryByNameAndPidWithOutThis(String name, String pid, String id) throws Exception {
        List<RsResourceCategory> r = (List<RsResourceCategory>) super.hibernateTemplate.find("from RsResourceCategory r where r.name=? and r.pid = ? and r.id != ?", name, pid,id);
        if (r != null && r.size() > 0)
            return r.get(0);
        else
            return null;
    }
}

+ 0 - 34
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsDemensionCategoryDaoImpl.java

@ -1,34 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.dao.IRsDemensionCategoryDao;
import com.yihu.ehr.resource.model.RsDemensionCategory;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/26.
 */
@Repository("demensionCategoryDao")
public class RsDemensionCategoryDaoImpl extends SQLGeneralDAO implements IRsDemensionCategoryDao {
    @Override
    public List<RsDemensionCategory> getDimensionCategoryList() throws Exception {
        List<RsDemensionCategory> a = (List<RsDemensionCategory>) super.hibernateTemplate.find(" from RsDemensionCategory ");
        return (List<RsDemensionCategory>) super.hibernateTemplate.find(" from RsDemensionCategory ");
    }
    @Override
    public Result getDimensionCatecoryList(Map<String, Object> conditionMap) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append(" from RsDemensionCategory r ");
        sb.append(" where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("name"))) {
            sb.append(" and r.name = '" + conditionMap.get("name") + "'");
        }
        return super.getDataGridResult(sb.toString(),(Integer) conditionMap.get("page"), (Integer)conditionMap.get("rows"));
    }
}

+ 0 - 13
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsDimensionDaoImpl.java

@ -1,13 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.resource.dao.IRsDimensionDao;
import com.yihu.ehr.resource.dao.IRsResourceDimensionDao;
import org.springframework.stereotype.Repository;
/**
 * Created by chenweida on 2016/1/26.
 */
@Repository("dimensionDao")
public class RsDimensionDaoImpl extends SQLGeneralDAO implements IRsDimensionDao {
}

+ 0 - 19
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceCategoryDaoImpl.java

@ -1,19 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.resource.dao.IRsResourceCategoryDao;
import com.yihu.ehr.resource.model.RsResourceCategory;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
 * Created by chenweida on 2016/1/13.
 */
@Repository("rsResourceCategoryDao")
public class RsResourceCategoryDaoImpl extends SQLGeneralDAO implements IRsResourceCategoryDao {
    @Override
    public List<RsResourceCategory> getAllRsResourceCategory() throws Exception {
        return (List<RsResourceCategory>) super.hibernateTemplate.find(" from RsResourceCategory r ");
    }
}

+ 0 - 66
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceDaoImpl.java

@ -1,66 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.resource.dao.IRsResourceDao;
import com.yihu.ehr.resource.model.RsResource;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/13.
 */
@Repository("rsResourceDao")
public class RsResourceDaoImpl extends SQLGeneralDAO implements IRsResourceDao {
    public DataGridResult getResourceList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append(" from RsResource r ");
        sb.append(" where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("categoryId"))) {
            sb.append(" and r.category = '" + conditionMap.get("categoryId") + "'");
        }
        if (!StringUtils.isEmpty(conditionMap.get("resourceName"))) {
            sb.append(" and r.name like '%" + conditionMap.get("resourceName") + "%'  ");
        }
        return super.getDataGridResult(sb.toString(), page, rows);
    }
    @Override
    public DataGridResult getResourceFiled(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        StringBuffer sql = new StringBuffer(" from RsResourceMetadata smd where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("resourceId"))) {
            sql.append(" and smd.resourceId = '" + conditionMap.get("resourceId") + "'");
        }
        return super.getDataGridResult(sql.toString(), page, rows);
    }
    @Override
    public int getResourceListCount(Map<String, Object> conditionMap) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append("  from RsResource r");
        sb.append("  where 1=1  ");
        if (!StringUtils.isEmpty(conditionMap.get("categoryId"))) {
            sb.append(" and r.category = '" + conditionMap.get("categoryId") + "'");
        }
        if (!StringUtils.isEmpty(conditionMap.get("resourceName"))) {
            sb.append(" and r.name like '%" + conditionMap.get("resourceName") + "%'");
        }
        return super.hibernateTemplate.find(sb.toString()).size();
    }
    @Override
    public List<RsResource> getAllRsResource() throws Exception {
        return (List<RsResource>) super.hibernateTemplate.find(" from RsResource r ");
    }
    @Override
    public RsResource getResourceById(String id) throws Exception {
        return super.getEntity(RsResource.class, id);
    }
}

+ 0 - 12
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceDatasetDaoImpl.java

@ -1,12 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.resource.dao.IRsResourceDatasetDao;
import org.springframework.stereotype.Repository;
/**
 * Created by chenweida on 2016/1/21.
 */
@Repository("resourceDatasetDao")
public class RsResourceDatasetDaoImpl extends SQLGeneralDAO implements IRsResourceDatasetDao{
}

+ 0 - 34
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceDimensionDaoImpl.java

@ -1,34 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.dao.IRsResourceDimensionDao;
import com.yihu.ehr.resource.viewresult.RsResourceDimensionModel;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/26.
 */
@Repository("resourceDimensionDao")
public class RsResourceDimensionDaoImpl extends SQLGeneralDAO implements IRsResourceDimensionDao {
    @Override
    public List<RsResourceDimensionModel> getDimensionByResourceId(String resourceId) throws Exception {
        String sql = "select * from rs_dimension d,rs_resource_dimension rd where d.id=rd.dimension_id and rd.resource_id='" + resourceId + "'";
        return super.queryListBySql(sql, RsResourceDimensionModel.class);
    }
    @Override
    public Result getDimensionList(Map<String, Object> conditionMap) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append(" from RsDimension r ");
        sb.append(" where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("category"))) {
            sb.append(" and r.category= '" + conditionMap.get("category") + "'  ");
        }
        return super.getDataGridResult(sb.toString(), (Integer)conditionMap.get("page"), (Integer)conditionMap.get("rows"));
    }
}

+ 0 - 63
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceMetadataDaoImpl.java

@ -1,63 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.dao.IRsResourceMetadataDao;
import com.yihu.ehr.resource.model.RsResourceMetadata;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/21.
 */
@Repository("resourceMetadataDao")
public class RsResourceMetadataDaoImpl extends SQLGeneralDAO implements IRsResourceMetadataDao {
    @Override
    public void deleteMetadatasByDataSetCode(String dataSetCode) throws Exception {
        super.hibernateTemplate.deleteAll(super.hibernateTemplate.find("from RsResourceMetadata s where s.datasetId=?", dataSetCode));
    }
    @Override
    public void deleteLogicDataSupportMetaDataByLocalDataSetId(String datasetId) throws Exception {
        super.hibernateTemplate.deleteAll(super.hibernateTemplate.find("from RsResourceMetadata s where s.datasetId=? and s.dataSupportType=1", datasetId));
    }
    @Override
    public List<RsResourceMetadata> getMetadataByLocalDatssetId(String datasetId) {
        return (List<RsResourceMetadata>) super.hibernateTemplate.find("from RsResourceMetadata r where r.datasetId=?", datasetId);
    }
    @Override
    public Result getResourceAuthorize(Map<String, Object> params) throws Exception {
        StringBuilder sb = new StringBuilder("from RsResourceMetadata t where 1=1 ");
        return super.getDataGridResult(sb.toString(), Integer.valueOf(params.get("page").toString()), Integer.valueOf(params.get("rows").toString()));
    }
    @Override
    public List<RsResourceMetadata> getMetadataByResourceId(String code) throws Exception {
        return (List<RsResourceMetadata>) super.hibernateTemplate.find("from RsResourceMetadata r where r.resourceId=?", code);
    }
    @Override
    public RsResourceMetadata getMetadataByCodeAndResourceId(String code, String resourceId) throws Exception {
        List<RsResourceMetadata> rms = (List<RsResourceMetadata>) super.hibernateTemplate.find("from RsResourceMetadata r where r.code=? and r.resourceId=?", code, resourceId);
        if (rms != null && rms.size() > 0) {
            return rms.get(0);
        }
        return null;
    }
    @Override
    public RsResourceMetadata getMetadataByCodeAndResourceIdWithOutId(String code, String resourceId, String id) throws Exception {
        List<RsResourceMetadata> rms = (List<RsResourceMetadata>) super.hibernateTemplate.find("from RsResourceMetadata r where r.code=? and r.resourceId=? and r.id!=?", code, resourceId,id);
        if (rms != null && rms.size() > 0) {
            return rms.get(0);
        }
        return null;
    }
}

+ 0 - 26
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceRestDaoImpl.java

@ -1,26 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.resource.dao.IRsResourceRestDao;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/30.
 */
@Repository("resourceRestDao")
public class RsResourceRestDaoImpl extends SQLGeneralDAO implements IRsResourceRestDao {
    @Override
    public DataGridResult getResourceRestList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append(" from RsResourceRest r ");
        sb.append(" where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("categoryId"))) {
            sb.append(" and r.category = '" + conditionMap.get("categoryId") + "'");
        }
        return super.getDataGridResult(sb.toString(), page, rows);
    }
}

+ 0 - 51
EHR-resource/src/main/java/com/yihu/ehr/resource/dao/impl/RsResourceRestDetailDaoImpl.java

@ -1,51 +0,0 @@
package com.yihu.ehr.resource.dao.impl;
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.resource.dao.IRsResourceRestDetailDao;
import com.yihu.ehr.resource.model.RsResourceRestDetail;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/30.
 */
@Repository("resourceRestDetailDao")
public class RsResourceRestDetailDaoImpl extends SQLGeneralDAO implements IRsResourceRestDetailDao {
    @Override
    public DataGridResult getResourceRestDetilList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append(" from RsResourceRestDetail r ");
        sb.append(" where 1=1 ");
        if (!StringUtils.isEmpty(conditionMap.get("resourceRestId"))) {
            sb.append(" and r.resourceRestId = '" + conditionMap.get("resourceRestId") + "'");
        }
        return super.getDataGridResult(sb.toString(), page, rows);
    }
    @Override
    public RsResourceRestDetail getResourceRestDetailByCode(String code) throws Exception {
        return (RsResourceRestDetail) super.hibernateTemplate.find("from RsResourceRestDetail r where r.code=?", code).get(0);
    }
    @Override
    public RsResourceRestDetail getResourceRestDetailByCodeAndResourceRestId(String code, String resourceRestId) throws Exception {
        List<RsResourceRestDetail> rrrds = (List<RsResourceRestDetail>) super.hibernateTemplate.find("from RsResourceRestDetail r where r.code=? ", code);
        if (rrrds != null && rrrds.size() > 0) {
            return rrrds.get(0);
        }
        return null;
    }
    @Override
    public RsResourceRestDetail getResourceRestDetailByCodeAndResourceRestIdWithOutId(String code, String resourceRestId, String id) throws Exception {
        List<RsResourceRestDetail> rrrds = (List<RsResourceRestDetail>) super.hibernateTemplate.find("from RsResourceRestDetail r where r.code=? and r.id!=?", code, id);
        if (rrrds != null && rrrds.size() > 0) {
            return rrrds.get(0);
        }
        return null;
    }
}

+ 0 - 56
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsAppResource.java

@ -1,56 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * Created by chenweida on 2016/1/25.
 */
public class RsAppResource {
    private String id;
    private String appId;
    private String resourceId;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getAppId() {
        return appId;
    }
    public void setAppId(String appId) {
        this.appId = appId;
    }
    public String getResourceId() {
        return resourceId;
    }
    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RsAppResource that = (RsAppResource) o;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (appId != null ? !appId.equals(that.appId) : that.appId != null) return false;
        if (resourceId != null ? !resourceId.equals(that.resourceId) : that.resourceId != null) return false;
        return true;
    }
    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (appId != null ? appId.hashCode() : 0);
        result = 31 * result + (resourceId != null ? resourceId.hashCode() : 0);
        return result;
    }
}

+ 0 - 88
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsAppResourceDetail.java

@ -1,88 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * Created by chenweida on 2016/1/25.
 */
public class RsAppResourceDetail {
    private String id;
    private String appResouceId;
    private String metadataId;
    private String dimensionId;
    private String dimensionValue;
    private String valid;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getAppResouceId() {
        return appResouceId;
    }
    public void setAppResouceId(String appResouceId) {
        this.appResouceId = appResouceId;
    }
    public String getMetadataId() {
        return metadataId;
    }
    public void setMetadataId(String metadataId) {
        this.metadataId = metadataId;
    }
    public String getDimensionId() {
        return dimensionId;
    }
    public void setDimensionId(String dimensionId) {
        this.dimensionId = dimensionId;
    }
    public String getDimensionValue() {
        return dimensionValue;
    }
    public void setDimensionValue(String dimensionValue) {
        this.dimensionValue = dimensionValue;
    }
    public String getValid() {
        return valid;
    }
    public void setValid(String valid) {
        this.valid = valid;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RsAppResourceDetail that = (RsAppResourceDetail) o;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (metadataId != null ? !metadataId.equals(that.metadataId) : that.metadataId != null) return false;
        if (dimensionId != null ? !dimensionId.equals(that.dimensionId) : that.dimensionId != null) return false;
        if (dimensionValue != null ? !dimensionValue.equals(that.dimensionValue) : that.dimensionValue != null)
            return false;
        if (valid != null ? !valid.equals(that.valid) : that.valid != null) return false;
        return true;
    }
    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (metadataId != null ? metadataId.hashCode() : 0);
        result = 31 * result + (dimensionId != null ? dimensionId.hashCode() : 0);
        result = 31 * result + (dimensionValue != null ? dimensionValue.hashCode() : 0);
        result = 31 * result + (valid != null ? valid.hashCode() : 0);
        return result;
    }
}

+ 0 - 87
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsDatasourceDataset.java

@ -1,87 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsDatasourceDataset entity. @author MyEclipse Persistence Tools
 */
public class RsDatasourceDataset implements java.io.Serializable {
	// Fields
	private String id;
	private String datasetId;
	private String datasourceId;
	private String stdId;
	private String stdVersion;
	private String orgId;
	// Constructors
	/** default constructor */
	public RsDatasourceDataset() {
	}
	/** minimal constructor */
	public RsDatasourceDataset(String datasetId, String datasourceId) {
		this.datasetId = datasetId;
		this.datasourceId = datasourceId;
	}
	/** full constructor */
	public RsDatasourceDataset(String datasetId, String datasourceId, String stdId, String stdVersion) {
		this.datasetId = datasetId;
		this.datasourceId = datasourceId;
		this.stdId = stdId;
		this.stdVersion = stdVersion;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getDatasetId() {
		return this.datasetId;
	}
	public void setDatasetId(String datasetId) {
		this.datasetId = datasetId;
	}
	public String getDatasourceId() {
		return this.datasourceId;
	}
	public void setDatasourceId(String datasourceId) {
		this.datasourceId = datasourceId;
	}
	public String getStdId() {
		return stdId;
	}
	public void setStdId(String stdId) {
		this.stdId = stdId;
	}
	public String getStdVersion() {
		return stdVersion;
	}
	public void setStdVersion(String stdVersion) {
		this.stdVersion = stdVersion;
	}
	public String getOrgId() {
		return orgId;
	}
	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}
}

+ 0 - 43
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsDemensionCategory.java

@ -1,43 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsDemensionCategory entity. @author MyEclipse Persistence Tools
 */
public class RsDemensionCategory implements java.io.Serializable {
	// Fields
	private String id;
	private String name;
	// Constructors
	/** default constructor */
	public RsDemensionCategory() {
	}
	/** full constructor */
	public RsDemensionCategory(String name) {
		this.name = name;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
}

+ 0 - 79
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsDimension.java

@ -1,79 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsDimension entity. @author MyEclipse Persistence Tools
 */
public class RsDimension implements java.io.Serializable {
	// Fields
	private String id;
	private String name;
	private String category;
	private String type;
	private String dictCode;
	// Constructors
	/** default constructor */
	public RsDimension() {
	}
	/** minimal constructor */
	public RsDimension(String name, String category) {
		this.name = name;
		this.category = category;
	}
	/** full constructor */
	public RsDimension(String name, String category, String type, String dictCode) {
		this.name = name;
		this.category = category;
		this.type = type;
		this.dictCode = dictCode;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCategory() {
		return this.category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getType() {
		return this.type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getDictCode() {
		return this.dictCode;
	}
	public void setDictCode(String dictCode) {
		this.dictCode = dictCode;
	}
}

+ 0 - 129
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResource.java

@ -1,129 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsResource entity. @author MyEclipse Persistence Tools
 */
public class RsResource implements java.io.Serializable {
	// Fields
	private String id;
	private String name;
	private String code;
	private String type;
	private String serviceRate;
	private String dataSupportType;
	private String category;
	private String remark;
	private String valid;
	private String datasetCode;
	// Constructors
	/** default constructor */
	public RsResource() {
	}
	/** minimal constructor */
	public RsResource(String name, String code) {
		this.name = name;
		this.code = code;
	}
	/** full constructor */
	public RsResource(String name, String code, String type, String serviceRate, String dataSupportType, String category, String remark, String valid, String datasetCode) {
		this.name = name;
		this.code = code;
		this.type = type;
		this.serviceRate = serviceRate;
		this.dataSupportType = dataSupportType;
		this.category = category;
		this.remark = remark;
		this.valid = valid;
		this.datasetCode = datasetCode;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getType() {
		return this.type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getServiceRate() {
		return this.serviceRate;
	}
	public void setServiceRate(String serviceRate) {
		this.serviceRate = serviceRate;
	}
	public String getDataSupportType() {
		return this.dataSupportType;
	}
	public void setDataSupportType(String dataSupportType) {
		this.dataSupportType = dataSupportType;
	}
	public String getCategory() {
		return this.category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getValid() {
		return this.valid;
	}
	public void setValid(String valid) {
		this.valid = valid;
	}
	public String getDatasetCode() {
		return this.datasetCode;
	}
	public void setDatasetCode(String datasetCode) {
		this.datasetCode = datasetCode;
	}
}

+ 0 - 77
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceCategory.java

@ -1,77 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsResourceCategory entity. @author MyEclipse Persistence Tools
 */
public class RsResourceCategory implements java.io.Serializable {
	// Fields
	private String id;
	private String name;
	private String pid;
	private String status;
	private String remark;
	// Constructors
	/** default constructor */
	public RsResourceCategory() {
	}
	/** minimal constructor */
	public RsResourceCategory(String name, String pid) {
		this.name = name;
		this.pid = pid;
	}
	/** full constructor */
	public RsResourceCategory(String name, String pid, String status) {
		this.name = name;
		this.pid = pid;
		this.status = status;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPid() {
		return this.pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	public String getStatus() {
		return this.status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
}

+ 0 - 100
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceDataset.java

@ -1,100 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsResourceDataset entity. @author MyEclipse Persistence Tools
 */
public class RsResourceDataset implements java.io.Serializable {
	// Fields
	private String id;
	private String code;
	private String name;
	private String language;
	private Integer catalog;
	private String summary;
	private String classModel;
	// Constructors
	/** default constructor */
	public RsResourceDataset() {
	}
	/** minimal constructor */
	public RsResourceDataset(String code, String name) {
		this.code = code;
		this.name = name;
	}
	/** full constructor */
	public RsResourceDataset(String code, String name, String language, Integer catalog, String summary, String classModel) {
		this.code = code;
		this.name = name;
		this.language = language;
		this.catalog = catalog;
		this.summary = summary;
		this.classModel = classModel;
	}
	// Property accessors
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getLanguage() {
		return this.language;
	}
	public void setLanguage(String language) {
		this.language = language;
	}
	public Integer getCatalog() {
		return this.catalog;
	}
	public void setCatalog(Integer catalog) {
		this.catalog = catalog;
	}
	public String getSummary() {
		return this.summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getClassModel() {
		return this.classModel;
	}
	public void setClassModel(String classModel) {
		this.classModel = classModel;
	}
}

+ 0 - 53
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceDimension.java

@ -1,53 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsResourceDimension entity. @author MyEclipse Persistence Tools
 */
public class RsResourceDimension implements java.io.Serializable {
	// Fields
	private String id;
	private String resourceId;
	private String dimensionId;
	// Constructors
	/** default constructor */
	public RsResourceDimension() {
	}
	/** full constructor */
	public RsResourceDimension(String resourceId, String dimensionId) {
		this.resourceId = resourceId;
		this.dimensionId = dimensionId;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getResourceId() {
		return this.resourceId;
	}
	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}
	public String getDimensionId() {
		return this.dimensionId;
	}
	public void setDimensionId(String dimensionId) {
		this.dimensionId = dimensionId;
	}
}

+ 0 - 203
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceMetadata.java

@ -1,203 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsResourceMetadata entity. @author MyEclipse Persistence Tools
 */
public class RsResourceMetadata implements java.io.Serializable {
    // Fields
    private String id;
    private String datasetId;
    private String code;
    private String resourceId;
    private String deCode;
    private String name;
    private String type;
    private String format;
    private Integer dictId;
    private String definition;
    private Integer nullable;
    private String columnType;
    private String columnName;
    private String columnLength;
    private Integer primaryKey;
    private Integer dataSupportType;//1事实表 2逻辑表
    private String logicDataSource;
    // Constructors
    /**
     * default constructor
     */
    public RsResourceMetadata() {
    }
    /**
     * minimal constructor
     */
    public RsResourceMetadata(Integer datasetId, String code, String deCode, String name, String columnName) {
        this.code = code;
        this.deCode = deCode;
        this.name = name;
        this.columnName = columnName;
    }
    /**
     * full constructor
     */
    public RsResourceMetadata(Integer stdId, Integer datasetId, String code, String deCode, String name, String type, String format, Integer dictId, String definition, Integer nullable, String columnType, String columnName, String columnLength, Integer primaryKey) {
        this.code = code;
        this.deCode = deCode;
        this.name = name;
        this.type = type;
        this.format = format;
        this.dictId = dictId;
        this.definition = definition;
        this.nullable = nullable;
        this.columnType = columnType;
        this.columnName = columnName;
        this.columnLength = columnLength;
        this.primaryKey = primaryKey;
    }
    // Property accessors
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getDatasetId() {
        return datasetId;
    }
    public void setDatasetId(String datasetId) {
        this.datasetId = datasetId;
    }
    public String getCode() {
        return this.code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getDeCode() {
        return this.deCode;
    }
    public void setDeCode(String deCode) {
        this.deCode = deCode;
    }
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getType() {
        return this.type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getFormat() {
        return this.format;
    }
    public void setFormat(String format) {
        this.format = format;
    }
    public Integer getDictId() {
        return this.dictId;
    }
    public void setDictId(Integer dictId) {
        this.dictId = dictId;
    }
    public String getDefinition() {
        return this.definition;
    }
    public void setDefinition(String definition) {
        this.definition = definition;
    }
    public Integer getNullable() {
        return this.nullable;
    }
    public void setNullable(Integer nullable) {
        this.nullable = nullable;
    }
    public String getColumnType() {
        return this.columnType;
    }
    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }
    public String getColumnName() {
        return this.columnName;
    }
    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }
    public String getColumnLength() {
        return this.columnLength;
    }
    public void setColumnLength(String columnLength) {
        this.columnLength = columnLength;
    }
    public Integer getPrimaryKey() {
        return this.primaryKey;
    }
    public void setPrimaryKey(Integer primaryKey) {
        this.primaryKey = primaryKey;
    }
    public Integer getDataSupportType() {
        return dataSupportType;
    }
    public void setDataSupportType(Integer dataSupportType) {
        this.dataSupportType = dataSupportType;
    }
    public String getLogicDataSource() {
        return logicDataSource;
    }
    public void setLogicDataSource(String logicDataSource) {
        this.logicDataSource = logicDataSource;
    }
    public String getResourceId() {
        return resourceId;
    }
    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }
}

+ 0 - 81
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceRest.java

@ -1,81 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsResourceRest entity. @author MyEclipse Persistence Tools
 */
public class RsResourceRest implements java.io.Serializable {
	// Fields
	private String id;
	private String url;
	private String username;
	private String password;
	private String remark;
	private String name;
	// Constructors
	/** default constructor */
	public RsResourceRest() {
	}
	/** full constructor */
	public RsResourceRest(String url, String username, String password, String remark) {
		this.url = url;
		this.username = username;
		this.password = password;
		this.remark = remark;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getUrl() {
		return this.url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getUsername() {
		return this.username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return this.password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
}

+ 0 - 131
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsResourceRestDetail.java

@ -1,131 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsResourceRestDetail entity. @author MyEclipse Persistence Tools
 */
public class RsResourceRestDetail implements java.io.Serializable {
	// Fields
	private String id;
	private String code;
	private String resourceRestId;
	private String type;
	private String namespace;
	private String returnValue;
	private String returnType;
	private String param;
	private String paramType;
	private String signature;
	private String name;
	// Constructors
	/** default constructor */
	public RsResourceRestDetail() {
	}
	/** full constructor */
	public RsResourceRestDetail(String code, String resourceRestId, String type, String namespace, String returnValue, String returnType, String param, String paramType, String signature) {
		this.code = code;
		this.resourceRestId = resourceRestId;
		this.type = type;
		this.namespace = namespace;
		this.returnValue = returnValue;
		this.returnType = returnType;
		this.param = param;
		this.paramType = paramType;
		this.signature = signature;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getResourceRestId() {
		return this.resourceRestId;
	}
	public void setResourceRestId(String resourceRestId) {
		this.resourceRestId = resourceRestId;
	}
	public String getType() {
		return this.type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getNamespace() {
		return this.namespace;
	}
	public void setNamespace(String namespace) {
		this.namespace = namespace;
	}
	public String getReturnValue() {
		return this.returnValue;
	}
	public void setReturnValue(String returnValue) {
		this.returnValue = returnValue;
	}
	public String getReturnType() {
		return this.returnType;
	}
	public void setReturnType(String returnType) {
		this.returnType = returnType;
	}
	public String getParam() {
		return this.param;
	}
	public void setParam(String param) {
		this.param = param;
	}
	public String getParamType() {
		return this.paramType;
	}
	public void setParamType(String paramType) {
		this.paramType = paramType;
	}
	public String getSignature() {
		return this.signature;
	}
	public void setSignature(String signature) {
		this.signature = signature;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
}

+ 0 - 79
EHR-resource/src/main/java/com/yihu/ehr/resource/model/RsRoleDimension.java

@ -1,79 +0,0 @@
package com.yihu.ehr.resource.model;
/**
 * RsRoleDimension entity. @author MyEclipse Persistence Tools
 */
public class RsRoleDimension implements java.io.Serializable {
	// Fields
	private String id;
	private String appId;
	private String dimensionId;
	private String scope;
	private String valid;
	// Constructors
	/** default constructor */
	public RsRoleDimension() {
	}
	/** minimal constructor */
	public RsRoleDimension(String appId, String dimensionId) {
		this.appId = appId;
		this.dimensionId = dimensionId;
	}
	/** full constructor */
	public RsRoleDimension(String appId, String dimensionId, String scope, String valid) {
		this.appId = appId;
		this.dimensionId = dimensionId;
		this.scope = scope;
		this.valid = valid;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getAppId() {
		return this.appId;
	}
	public void setAppId(String appId) {
		this.appId = appId;
	}
	public String getDimensionId() {
		return this.dimensionId;
	}
	public void setDimensionId(String dimensionId) {
		this.dimensionId = dimensionId;
	}
	public String getScope() {
		return this.scope;
	}
	public void setScope(String scope) {
		this.scope = scope;
	}
	public String getValid() {
		return this.valid;
	}
	public void setValid(String valid) {
		this.valid = valid;
	}
}

+ 0 - 22
EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsCategoryService.java

@ -1,22 +0,0 @@
package com.yihu.ehr.resource.service;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsResourceCategory;
import java.util.Map;
/**
 * Created by chenweida on 2015/12/15.
 */
public interface IRsCategoryService {
    Result getList(Map<String, Object> conditionMap) throws Exception;
    RsResourceCategory getCategoryById(String id) throws Exception;
    Result createCategory(RsResourceCategory rrc) throws Exception;
    Result updateCategory(RsResourceCategory rrc) throws Exception;
    Result deleteCategory(String id) throws Exception;
}

+ 0 - 37
EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsDimensionService.java

@ -1,37 +0,0 @@
package com.yihu.ehr.resource.service;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsDemensionCategory;
import com.yihu.ehr.resource.model.RsDimension;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/26.
 */
public interface IRsDimensionService {
    Result getDimensionCategoryList() throws Exception;
    Result getDimensionList(Map<String, Object> conditionMap) throws Exception;
    RsDimension getDimensionById(String id) throws Exception;
    Result updateDimension(RsDimension rsDimension) throws Exception;
    Result addDimension(RsDimension rsDimension) throws Exception;
    Result deleteDimensionById(String id) throws Exception;
    Result getDimensionCatecoryList(Map<String, Object> conditionMap) throws Exception;
    Result deleteDimensionCatetory(String id) throws Exception;
    RsDemensionCategory getDimensionCatetoryById(String id) throws Exception;
    Result addDimensionCatetroy(RsDemensionCategory r)throws Exception;
    Result updateDimensionCatetroy(RsDemensionCategory r)throws Exception;
    ;
}

+ 0 - 35
EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsResourceRestService.java

@ -1,35 +0,0 @@
package com.yihu.ehr.resource.service;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.model.RsResourceRest;
import com.yihu.ehr.resource.model.RsResourceRestDetail;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/30.
 */
public interface IRsResourceRestService {
    DataGridResult getResourceRestDetilList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    DataGridResult getResourceRestList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    RsResourceRest getResourceRestById(String id) throws Exception;
    RsResourceRestDetail getResourceRestDetail(String id) throws Exception;
    Result deleteResourceRestById(String id) throws Exception;
    Result deleteResourceRestDetail(String id) throws Exception;
    Result addResourceRest(RsResourceRest rr)throws Exception;
    Result updateResourceRest(RsResourceRest rr)throws Exception;
    Result addResourceRestDetail(RsResourceRestDetail rrd)throws Exception;
    Result updateResourceRestDetail(RsResourceRestDetail rrd)throws Exception;
    RsResourceRestDetail getResourceRestDetailByCode(String code)throws Exception;
}

+ 0 - 80
EHR-resource/src/main/java/com/yihu/ehr/resource/service/IRsResourceService.java

@ -1,80 +0,0 @@
package com.yihu.ehr.resource.service;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.model.TreeResult;
import com.yihu.ehr.resource.model.RsAppResourceDetail;
import com.yihu.ehr.resource.model.RsResource;
import com.yihu.ehr.resource.model.RsResourceDataset;
import com.yihu.ehr.resource.model.RsResourceMetadata;
import com.yihu.ehr.resource.viewresult.RsResourceDeatilModel;
import com.yihu.ehr.resource.viewresult.RsResourceDimensionModel;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2015/12/15.
 */
public interface IRsResourceService {
    List<TreeResult> getResourceTreeList() throws Exception;
    DataGridResult getResourceList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    int getResourceListCount(Map<String, Object> conditionMap) throws Exception;
    RsResourceDeatilModel getRsResourceDeatilModel(String id) throws Exception;
    void updateRsResource(RsResource rs) throws Exception;
    void createRsResource(RsResource rs) throws Exception;
    void deleteResource(String id) throws Exception;
    DataGridResult getResourceFiled(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception;
    List<TreeResult> resourceCategoryTreeList() throws Exception;
    String searchRomoteResourceList(String url, Map<String, Object> params) throws Exception;
    Result getDataSet(Map<String, Object> params) throws Exception;
    Result improtAllMetadata(RsResourceDataset dataset, String reourceId) throws Exception;
    Result deleteMetadata(String id) throws Exception;
    RsResourceMetadata getRsResourceMetadata(String id) throws Exception;
    Result createMetaData(RsResourceMetadata rmd) throws Exception;
    Result updateMetaData(RsResourceMetadata rmd) throws Exception;
    Result getMetaDataByDatasetId(String code, String datasetId) throws Exception;
    Result improtSameMetadata(String reourceId, String metaData, String dataset, String datasetId) throws Exception;
    RsResourceDataset getLocalDataSetById(String datasetId) throws Exception;
    Result getMetadataByLocalDatssetId(String datasetId) throws Exception;
    Result getResourceAuthorize(String resourceId, String appID) throws Exception;
    Result getMetaData(Map<String, Object> params) throws Exception;
    Result getResourceApp(String id) throws Exception;
    Result updateResourceApp(String ids, String resourceId) throws Exception;
    Result getResourceAppList(String resourceId) throws Exception;
    Result changeAppResource(String flag, String appId, String ids, String resourceId) throws Exception;
    List<RsResourceDimensionModel> getDimensionByResourceId(String resourceId) throws Exception;
    RsAppResourceDetail getAppResourceDetailId(String id) throws Exception;
    Result saveResourceDimension(RsAppResourceDetail appResourceDetail) throws Exception;
    List<RsResourceMetadata>  getResourceMetadataListColumn(String code) throws Exception;
}

+ 0 - 57
EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsCategoryServiceImpl.java

@ -1,57 +0,0 @@
package com.yihu.ehr.resource.service.impl;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.dao.IRsCategoryDao;
import com.yihu.ehr.resource.model.RsResourceCategory;
import com.yihu.ehr.resource.service.IRsCategoryService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Map;
@Service("categoryService")
public class RsCategoryServiceImpl implements IRsCategoryService {
    @Resource(name = "rsCategoryDao")
    private IRsCategoryDao rsCategoryDao;
    @Override
    public Result getList(Map<String, Object> conditionMap) throws Exception {
        return rsCategoryDao.getList(conditionMap);
    }
    @Override
    public RsResourceCategory getCategoryById(String id) throws Exception {
        return rsCategoryDao.getEntity(RsResourceCategory.class, id);
    }
    @Transactional
    public Result createCategory(RsResourceCategory rrc) throws Exception {
        RsResourceCategory rrcTemp = rsCategoryDao.getCategoryByNameAndPid(rrc.getName(), rrc.getPid());
        if (rrcTemp == null)
            rsCategoryDao.saveEntity(rrc);
        else
            return Result.error("分类名称重复");
        return Result.success("保存成功");
    }
    @Transactional
    public Result updateCategory(RsResourceCategory rrc) throws Exception {
        RsResourceCategory rrcTemp = rsCategoryDao.getCategoryByNameAndPidWithOutThis(rrc.getName(), rrc.getPid(),rrc.getId());
        if (rrcTemp != null)
            return Result.error("分类名称重复");
        RsResourceCategory rc = rsCategoryDao.getEntity(RsResourceCategory.class, rrc.getId());
        rc.setName(rrc.getName());
        rc.setStatus(rrc.getStatus());
        rc.setPid(rrc.getPid());
        rc.setRemark(rrc.getRemark());
        return Result.success("更新成功");
    }
    @Transactional
    public Result deleteCategory(String id) throws Exception {
        RsResourceCategory rc = rsCategoryDao.getEntity(RsResourceCategory.class, id);
        rsCategoryDao.deleteEntity(rc);
        return Result.success("删除成功");
    }
}

+ 0 - 98
EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsDimensionServiceImpl.java

@ -1,98 +0,0 @@
package com.yihu.ehr.resource.service.impl;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.dao.IRsDemensionCategoryDao;
import com.yihu.ehr.resource.dao.IRsDimensionDao;
import com.yihu.ehr.resource.dao.IRsResourceDimensionDao;
import com.yihu.ehr.resource.model.RsDemensionCategory;
import com.yihu.ehr.resource.model.RsDimension;
import com.yihu.ehr.resource.service.IRsDimensionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/26.
 */
@Service("rsDimensionService")
public class RsDimensionServiceImpl implements IRsDimensionService {
    @Resource(name = "resourceDimensionDao")
    private IRsResourceDimensionDao resourceDimensionDao;
    @Resource(name = "demensionCategoryDao")
    private IRsDemensionCategoryDao demensionCategoryDao;
    @Resource(name = "dimensionDao")
    private IRsDimensionDao dimensionDao;
    @Override
    public Result getDimensionCategoryList() throws Exception {
        ActionResult actionResult = new ActionResult();
        actionResult.setData(demensionCategoryDao.getDimensionCategoryList());
        return actionResult;
    }
    @Override
    public Result getDimensionList(Map<String, Object> conditionMap) throws Exception {
        return resourceDimensionDao.getDimensionList(conditionMap);
    }
    @Override
    public RsDimension getDimensionById(String id) throws Exception {
        return dimensionDao.getEntity(RsDimension.class, id);
    }
    @Transactional
    public Result updateDimension(RsDimension rsDimension) throws Exception {
        RsDimension dimensionTemp = dimensionDao.getEntity(RsDimension.class, rsDimension.getId());
        dimensionTemp.setCategory(rsDimension.getCategory());
        dimensionTemp.setDictCode(rsDimension.getDictCode());
        dimensionTemp.setType(rsDimension.getType());
        dimensionTemp.setName(rsDimension.getName());
        return Result.success("修改成功");
    }
    @Transactional
    public Result addDimension(RsDimension rsDimension) throws Exception {
        dimensionDao.saveEntity(rsDimension);
        return Result.success("保存成功");
    }
    @Transactional
    public Result deleteDimensionById(String id) throws Exception {
        dimensionDao.deleteEntity(dimensionDao.getEntity(RsDimension.class, id));
        return Result.success("删除成功");
    }
    @Override
    public Result getDimensionCatecoryList(Map<String, Object> conditionMap) throws Exception {
        return demensionCategoryDao.getDimensionCatecoryList(conditionMap);
    }
    @Transactional
    public Result deleteDimensionCatetory(String id) throws Exception {
        demensionCategoryDao.deleteEntity(demensionCategoryDao.getEntity(RsDemensionCategory.class, id));
        return Result.success("删除成功");
    }
    @Override
    public RsDemensionCategory getDimensionCatetoryById(String id) throws Exception {
        return demensionCategoryDao.getEntity(RsDemensionCategory.class, id);
    }
    @Transactional
    public Result addDimensionCatetroy(RsDemensionCategory r) throws Exception {
        demensionCategoryDao.saveEntity(r);
        return Result.success("保存成功");
    }
    @Transactional
    public Result updateDimensionCatetroy(RsDemensionCategory r) throws Exception {
        RsDemensionCategory tsDemensionCategoryTemp = demensionCategoryDao.getEntity(RsDemensionCategory.class, r.getId());
        tsDemensionCategoryTemp.setName(r.getName());
        return Result.success("修改成功");
    }
}

+ 0 - 111
EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsResourceRestServiceImpl.java

@ -1,111 +0,0 @@
package com.yihu.ehr.resource.service.impl;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.resource.dao.IRsResourceRestDao;
import com.yihu.ehr.resource.dao.IRsResourceRestDetailDao;
import com.yihu.ehr.resource.model.RsResourceRest;
import com.yihu.ehr.resource.model.RsResourceRestDetail;
import com.yihu.ehr.resource.service.IRsResourceRestService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Map;
/**
 * Created by chenweida on 2016/1/30.
 */
@Service("resourceRestService")
public class RsResourceRestServiceImpl implements IRsResourceRestService {
    @Resource(name = "resourceRestDao")
    private IRsResourceRestDao resourceRestDao;
    @Resource(name = "resourceRestDetailDao")
    private IRsResourceRestDetailDao resourceRestDetailDao;
    @Override
    public DataGridResult getResourceRestDetilList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        return resourceRestDetailDao.getResourceRestDetilList(conditionMap, page, rows);
    }
    @Override
    public DataGridResult getResourceRestList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        return resourceRestDao.getResourceRestList(conditionMap, page, rows);
    }
    @Override
    public RsResourceRest getResourceRestById(String id) throws Exception {
        return resourceRestDao.getEntity(RsResourceRest.class, id);
    }
    @Override
    public RsResourceRestDetail getResourceRestDetail(String id) throws Exception {
        return resourceRestDetailDao.getEntity(RsResourceRestDetail.class, id);
    }
    @Transactional
    public Result deleteResourceRestById(String id) throws Exception {
        RsResourceRest r = resourceRestDao.getEntity(RsResourceRest.class, id);
        resourceRestDao.deleteEntity(r);
        return Result.success("删除成功");
    }
    @Transactional
    public Result deleteResourceRestDetail(String id) throws Exception {
        RsResourceRestDetail r = resourceRestDetailDao.getEntity(RsResourceRestDetail.class, id);
        resourceRestDetailDao.deleteEntity(r);
        return Result.success("删除成功");
    }
    @Transactional
    public Result addResourceRest(RsResourceRest rr) throws Exception {
        resourceRestDao.saveEntity(rr);
        return Result.success("新增成功");
    }
    @Transactional
    public Result updateResourceRest(RsResourceRest rr) throws Exception {
        RsResourceRest rrr = resourceRestDao.getEntity(RsResourceRest.class, rr.getId());
        rrr.setName(rr.getName());
        rrr.setRemark(rr.getRemark());
        rrr.setPassword(rr.getPassword());
        rrr.setUrl(rr.getUrl());
        rrr.setUsername(rr.getUsername());
        return Result.success("更新成功");
    }
    @Transactional
    public Result addResourceRestDetail(RsResourceRestDetail rrd) throws Exception {
        RsResourceRestDetail rrdTemp = resourceRestDetailDao.getResourceRestDetailByCodeAndResourceRestId(rrd.getCode(), rrd.getResourceRestId());
        if (rrdTemp != null) {
            return Result.error("业务资源项代码已经存在");
        }
        resourceRestDetailDao.saveEntity(rrd);
        return Result.success("新增成功");
    }
    @Transactional
    public Result updateResourceRestDetail(RsResourceRestDetail rrd) throws Exception {
        RsResourceRestDetail rrdTemp = resourceRestDetailDao.getResourceRestDetailByCodeAndResourceRestIdWithOutId(rrd.getCode(), rrd.getResourceRestId(),rrd.getId());
        if (rrdTemp != null) {
            return Result.error("业务资源项代码已经存在");
        }
        RsResourceRestDetail rrrd = resourceRestDetailDao.getEntity(RsResourceRestDetail.class, rrd.getId());
        rrrd.setName(rrd.getName());
        rrrd.setType(rrd.getType());
        rrrd.setCode(rrd.getCode());
        rrrd.setNamespace(rrd.getNamespace());
        rrrd.setParam(rrd.getParam());
        rrrd.setParamType(rrd.getParamType());
        rrrd.setResourceRestId(rrd.getResourceRestId());
        rrrd.setSignature(rrd.getSignature());
        rrrd.setReturnType(rrd.getReturnType());
        rrrd.setReturnValue(rrd.getReturnValue());
        return Result.success("更新成功");
    }
    @Override
    public RsResourceRestDetail getResourceRestDetailByCode(String code) throws Exception {
        return resourceRestDetailDao.getResourceRestDetailByCode(code);
    }
}

+ 0 - 570
EHR-resource/src/main/java/com/yihu/ehr/resource/service/impl/RsResourceServiceImpl.java

@ -1,570 +0,0 @@
package com.yihu.ehr.resource.service.impl;
import com.yihu.ehr.framework.model.ActionResult;
import com.yihu.ehr.framework.model.DataGridResult;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.model.TreeResult;
import com.yihu.ehr.framework.util.PKUtil;
import com.yihu.ehr.resource.dao.*;
import com.yihu.ehr.resource.model.*;
import com.yihu.ehr.resource.service.IRsResourceService;
import com.yihu.ehr.resource.viewresult.ResourceAuthorizeDGModel;
import com.yihu.ehr.resource.viewresult.RsResourceDeatilModel;
import com.yihu.ehr.resource.viewresult.RsResourceDimensionModel;
import com.yihu.ehr.std.service.BaseHttpService;
import com.yihu.ehr.std.service.intf.IStdService;
import com.yihu.ehr.system.dao.intf.IAppDao;
import com.yihu.ehr.system.model.SystemApp;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("resourceService")
public class RsResourceServiceImpl extends BaseHttpService implements IRsResourceService {
    @Resource(name = "rsResourceCategoryDao")
    private IRsResourceCategoryDao rsResourceCategoryDao;
    @Resource(name = "rsResourceDao")
    private IRsResourceDao rsResourceDao;
    @Resource(name = "resourceDatasetDao")
    private IRsResourceDatasetDao resourceDatasetDao;
    @Resource(name = "resourceMetadataDao")
    private IRsResourceMetadataDao resourceMetadataDao;
    @Resource(name = "appDao")
    private IAppDao appDao;
    @Resource(name = "rsAppResourceDao")
    private IRsAppResourceDao appResourceDao;
    @Resource(name = "rsAppResourceDetailDao")
    private IRsAppResourceDetailDao rsAppResourceDetailDao;
    @Resource(name = "resourceDimensionDao")
    private IRsResourceDimensionDao resourceDimensionDao;
    @Autowired
    private IStdService stdService;
    @Override
    public List<TreeResult> getResourceTreeList() throws Exception {
        List<TreeResult> treeVOs = new ArrayList<TreeResult>();
        List<RsResourceCategory> rsCategorya = rsResourceCategoryDao.getAllRsResourceCategory();
        for (RsResourceCategory r : rsCategorya) {
            TreeResult treeVO = new TreeResult();
            treeVO.setId(r.getId());
            treeVO.setPid(r.getPid());
            treeVO.setText(r.getName());
            treeVO.setType("1");
            treeVOs.add(treeVO);
        }
        return treeVOs;
    }
    @Override
    public List<TreeResult> resourceCategoryTreeList() throws Exception {
        List<TreeResult> treeVOs = new ArrayList<TreeResult>();
        List<RsResourceCategory> rsCategorya = rsResourceCategoryDao.getAllRsResourceCategory();
        for (RsResourceCategory r : rsCategorya) {
            TreeResult treeVO = new TreeResult();
            treeVO.setId(r.getId());
            treeVO.setPid(r.getPid());
            treeVO.setText(r.getName());
            treeVO.setType("1");
            treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/folder.gif");
            treeVOs.add(treeVO);
        }
        List<RsResource> rsResources = rsResourceDao.getAllRsResource();
        for (RsResource r : rsResources) {
            TreeResult treeVO = new TreeResult();
            treeVO.setId(r.getId());
            treeVO.setPid(r.getCategory());
            treeVO.setText(r.getName());
            treeVO.setType("2");
            treeVO.setIcon("../develop/lib/ligerui/skins/Aqua/images/tree/tree-leaf.gif");
            treeVOs.add(treeVO);
        }
        return treeVOs;
    }
    @Override
    public DataGridResult getResourceList(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        return rsResourceDao.getResourceList(conditionMap, page, rows);
    }
    @Override
    public int getResourceListCount(Map<String, Object> conditionMap) throws Exception {
        return rsResourceDao.getResourceListCount(conditionMap);
    }
    @Override
    public RsResourceDeatilModel getRsResourceDeatilModel(String id) throws Exception {
        RsResourceDeatilModel rsResourceDeatilModel = new RsResourceDeatilModel();
        RsResource rsResource = rsResourceDao.getResourceById(id);
        BeanUtils.copyProperties(rsResource, rsResourceDeatilModel);
        return rsResourceDeatilModel;
    }
    @Transactional
    public void updateRsResource(RsResource rs) throws Exception {
        RsResource rsResourceEntrty = rsResourceDao.getResourceById(rs.getId());
        rsResourceEntrty.setCategory(rs.getCategory());
        rsResourceEntrty.setServiceRate(rs.getServiceRate());
        rsResourceEntrty.setName(rs.getName());
        rsResourceEntrty.setCode(rs.getCode());
        rsResourceEntrty.setType(rs.getType());
        rsResourceEntrty.setDataSupportType(rs.getDataSupportType());
    }
    @Transactional
    public void createRsResource(RsResource rs) throws Exception {
        rsResourceDao.saveEntity(rs);
    }
    @Transactional
    public void deleteResource(String id) throws Exception {
        RsResource rs = rsResourceDao.getResourceById(id);
        String dataSetCode = rs.getDatasetCode();
        //删除资源
        rsResourceDao.deleteEntity(rs);
        //删除资源对应的数据集和数据源
        if (!StringUtils.isEmpty(dataSetCode)) {
            resourceDatasetDao.deleteEntity(resourceDatasetDao.getEntity(RsResourceDataset.class, dataSetCode));
            resourceMetadataDao.deleteMetadatasByDataSetCode(dataSetCode);
        }
    }
    @Override
    public DataGridResult getResourceFiled(Map<String, Object> conditionMap, Integer page, Integer rows) throws Exception {
        RsResource rs = rsResourceDao.getEntity(RsResource.class, (String) conditionMap.get("resourceId"));
        conditionMap.put("datasetId", rs.getDatasetCode());
        conditionMap.put("resourceId", rs.getId());
        return rsResourceDao.getResourceFiled(conditionMap, page, rows);
    }
    @Override
    public String searchRomoteResourceList(String url, Map<String, Object> params) throws Exception {
        String result = super.doGetByResourceCode(url, params);
        JSONObject jsonobject = JSONObject.fromObject(result);
        String response_params = (String) jsonobject.get("responseParams");
        return response_params;
    }
    @Override
    public Result getDataSet(Map<String, Object> params) throws Exception {
        DataGridResult re = new DataGridResult();
        if (StringUtils.isEmpty(params.get("datasetId"))) {
            re.setDetailModelList(net.sf.json.JSONArray.fromObject(stdService.datasetsAllVersionList()));
        } else {
            RsResourceDataset rd = resourceDatasetDao.getEntity(RsResourceDataset.class, (String) params.get("datasetId"));
            List list = new ArrayList();
            JSONObject jo = JSONObject.fromObject(rd);
            jo.put("checked", "true");
            list.add(jo);
            re.setDetailModelList(list);
        }
        return re;
    }
    @Transactional
    public Result improtAllMetadata(RsResourceDataset dataset, String reourceId) throws Exception {
        RsResource resource = rsResourceDao.getResourceById(reourceId);
        String dataSetId = null;
        if (StringUtils.isEmpty(resource.getDatasetCode())) {
            //第一次
            dataSetId = PKUtil.getUuid();
            //更新资源
            resource.setDatasetCode(dataSetId);
            dataset.setId(dataSetId);
            resourceDatasetDao.saveEntity(dataset);
        } else {
            dataSetId = resource.getDatasetCode();
            resourceMetadataDao.deleteLogicDataSupportMetaDataByLocalDataSetId(dataSetId);
        }
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("code", dataset.getCode());
        Map<String, Object> paramsTemp = new HashMap<String, Object>();
        paramsTemp.put("condition", JSONObject.fromObject(params).toString());
        String responseParasm = stdService.metadatasAllVersionList(paramsTemp);
        JSONArray array = JSONArray.fromObject(responseParasm);
        if (array.size() == 0) {
            throw new Exception("该数据集没有数据元");
        }
        //保存数据集
        //保存数据元
        for (int i = 0; i < array.size(); i++) {
            JSONObject jsonObject = array.getJSONObject(i);
            RsResourceMetadata rsResourceMetadata = new RsResourceMetadata();
            rsResourceMetadata.setDatasetId(dataSetId);
            rsResourceMetadata.setCode((String) jsonObject.get("code"));
            rsResourceMetadata.setDeCode((String) jsonObject.get("deCode"));
            rsResourceMetadata.setResourceId(reourceId);
            rsResourceMetadata.setName((String) jsonObject.get("name"));
            rsResourceMetadata.setType((String) jsonObject.get("type"));
            rsResourceMetadata.setFormat((String) jsonObject.get("format"));
            rsResourceMetadata.setDictId((Integer) jsonObject.get("dictId"));
            rsResourceMetadata.setDefinition((String) jsonObject.get("definition"));
            rsResourceMetadata.setNullable((Integer) jsonObject.get("nullable"));
            rsResourceMetadata.setColumnLength((String) jsonObject.get("columnLength"));
            rsResourceMetadata.setColumnType((String) jsonObject.get("columnType"));
            rsResourceMetadata.setColumnName((String) jsonObject.get("columnName"));
            rsResourceMetadata.setPrimaryKey((Integer) jsonObject.get("primaryKey"));
            rsResourceMetadata.setDataSupportType(1);
            resourceMetadataDao.saveEntity(rsResourceMetadata);
        }
        return Result.success("导入成功");
    }
    @Transactional
    public Result deleteMetadata(String id) throws Exception {
        resourceMetadataDao.deleteEntity(resourceMetadataDao.getEntity(RsResourceMetadata.class, id));
        return Result.success("删除成功");
    }
    @Override
    public RsResourceMetadata getRsResourceMetadata(String id) throws Exception {
        return resourceMetadataDao.getEntity(RsResourceMetadata.class, id);
    }
    @Transactional
    public Result createMetaData(RsResourceMetadata rmd) throws Exception {
        RsResourceMetadata rmdTemp = resourceMetadataDao.getMetadataByCodeAndResourceId(rmd.getCode(), rmd.getResourceId());
        if (rmdTemp != null) {
            return Result.error("字段代码已经存在");
        }
        resourceMetadataDao.saveEntity(rmd);
        return Result.success("保存成功");
    }
    @Transactional
    public Result updateMetaData(RsResourceMetadata rmd) throws Exception {
        RsResourceMetadata rmdTemp = resourceMetadataDao.getMetadataByCodeAndResourceIdWithOutId(rmd.getCode(), rmd.getResourceId(),rmd.getId());
        if (rmdTemp != null) {
            return Result.error("字段代码已经存在");
        }
        rmdTemp = resourceMetadataDao.getEntity(RsResourceMetadata.class, rmd.getId());
        rmdTemp.setColumnName(rmd.getColumnName());
        rmdTemp.setColumnType(rmd.getColumnType());
        rmdTemp.setColumnLength(rmd.getColumnLength());
        rmdTemp.setNullable(rmd.getNullable());
        rmdTemp.setCode(rmd.getCode());
        rmdTemp.setPrimaryKey(rmd.getPrimaryKey());
        rmdTemp.setDefinition(rmd.getDefinition());
        rmdTemp.setDataSupportType(rmd.getDataSupportType());
        rmdTemp.setLogicDataSource(rmd.getLogicDataSource());
        return Result.success("更新成功");
    }
    @Override
    public Result getMetaDataByDatasetId(String code, String datasetId) throws Exception {
        if (StringUtils.isEmpty(code)) {
            return new DataGridResult();
        }
        DataGridResult r = new DataGridResult();
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("code", code);
        Map<String, Object> paramsTemp = new HashMap<String, Object>();
        paramsTemp.put("condition", JSONObject.fromObject(params).toString());
        //得到所有的数据元
        String responseParasm = stdService.metadatasAllVersionList(paramsTemp);
        JSONArray jr = JSONArray.fromObject(responseParasm);
        if (!StringUtils.isEmpty(datasetId)) {
            List<RsResourceMetadata> md = resourceMetadataDao.getMetadataByLocalDatssetId(datasetId);
            for (int i = 0; i < JSONArray.fromObject(responseParasm).size(); i++) {
                for (int j = 0; j < md.size(); j++) {
                    if (JSONArray.fromObject(responseParasm).getJSONObject(i).get("code").equals(md.get(j).getCode())) {
                        jr.getJSONObject(i).put("checked", "true");
                    }
                }
            }
        }
        r.setDetailModelList(jr);
        return r;
    }
    @Transactional
    public Result improtSameMetadata(String reourceId, String metaData, String dataset, String datasetId) throws Exception {
        RsResource resource = rsResourceDao.getResourceById(reourceId);
        if (StringUtils.isEmpty(datasetId)) {
            //第一次导入
            String datasetID = PKUtil.getUuid();//得到ID
            RsResourceDataset rsResourceDataset = new RsResourceDataset();
            org.apache.commons.beanutils.BeanUtils.populate(rsResourceDataset, JSONObject.fromObject(dataset));
            rsResourceDataset.setId(datasetID);
            resourceDatasetDao.saveEntity(rsResourceDataset);
            JSONArray array = JSONArray.fromObject(metaData);
            if (array.size() == 0) {
                throw new Exception("该数据集没有数据元");
            }
            for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                RsResourceMetadata rsResourceMetadata = new RsResourceMetadata();
                org.apache.commons.beanutils.BeanUtils.populate(rsResourceMetadata, jsonObject);
                rsResourceMetadata.setDataSupportType(1);
                rsResourceMetadata.setDatasetId(datasetID);
                rsResourceMetadata.setResourceId(reourceId);
                resourceMetadataDao.saveEntity(rsResourceMetadata);
            }
            resource.setDatasetCode(datasetID);
        } else {
            //修改
            resourceMetadataDao.deleteLogicDataSupportMetaDataByLocalDataSetId(datasetId);
            JSONArray array = JSONArray.fromObject(metaData);
            for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                RsResourceMetadata rsResourceMetadata = new RsResourceMetadata();
                org.apache.commons.beanutils.BeanUtils.populate(rsResourceMetadata, jsonObject);
                rsResourceMetadata.setDataSupportType(1);
                rsResourceMetadata.setResourceId(reourceId);
                rsResourceMetadata.setDatasetId(resource.getDatasetCode());
                resourceMetadataDao.saveEntity(rsResourceMetadata);
            }
        }
        return Result.success("导入成功");
    }
    @Override
    public RsResourceDataset getLocalDataSetById(String datasetId) throws Exception {
        return resourceDatasetDao.getEntity(RsResourceDataset.class, datasetId);
    }
    @Override
    public Result getMetadataByLocalDatssetId(String datasetId) throws Exception {
        ActionResult ar = new ActionResult();
        ar.setData(resourceMetadataDao.getMetadataByLocalDatssetId(datasetId));
        return ar;
    }
    @Override
    public Result getResourceAuthorize(String resourceId, String appId) throws Exception {
        DataGridResult dr = new DataGridResult();
        //查找该资源所对应的数据元
        RsResource rsResource = rsResourceDao.getResourceById(resourceId);
        List<RsResourceMetadata> metadatas = resourceMetadataDao.getMetadataByResourceId(rsResource.getId());
        //得到所有的细表
        RsAppResource rsAppResource = appResourceDao.getAppResourceByResourceIdAndAppId(resourceId, appId);
        List<RsAppResourceDetail> rsAppResourceDetails = rsAppResourceDetailDao.getAppResourceDetailByAppResouceId(rsAppResource.getId());
        List<ResourceAuthorizeDGModel> rdg = new ArrayList<ResourceAuthorizeDGModel>();
        if (rsAppResourceDetails.size() == 0) {
            for (int i = 0; i < metadatas.size(); i++) {
                ResourceAuthorizeDGModel resourceAuthorizeDGModel = new ResourceAuthorizeDGModel();
                resourceAuthorizeDGModel.setMetaDataId(metadatas.get(i).getId());
                resourceAuthorizeDGModel.setMetaDataName(metadatas.get(i).getName());
                rdg.add(resourceAuthorizeDGModel);
            }
        } else {
            for (int i = 0; i < metadatas.size(); i++) {
                for (int j = 0; j < rsAppResourceDetails.size(); j++) {
                    if (metadatas.get(i).getId().equals(rsAppResourceDetails.get(j).getMetadataId())) {
                        //允许的
                        ResourceAuthorizeDGModel resourceAuthorizeDGModel = new ResourceAuthorizeDGModel();
                        resourceAuthorizeDGModel.setChecked("true");
                        resourceAuthorizeDGModel.setAppResourceDeatilId(rsAppResourceDetails.get(j).getId());
                        resourceAuthorizeDGModel.setMetaDataId(metadatas.get(i).getId());
                        resourceAuthorizeDGModel.setMetaDataName(metadatas.get(i).getName());
                        if (!StringUtils.isEmpty(rsAppResourceDetails.get(j).getDimensionId())) {
                            RsDimension rd = resourceDimensionDao.getEntity(RsDimension.class, rsAppResourceDetails.get(j).getDimensionId());
                            resourceAuthorizeDGModel.setDimensionMessage(rd.getName() + rsAppResourceDetails.get(j).getDimensionValue());
                        }
                        rdg.add(resourceAuthorizeDGModel);
                        break;
                    } else {
                        if (j == rsAppResourceDetails.size() - 1) {
                            ResourceAuthorizeDGModel resourceAuthorizeDGModel = new ResourceAuthorizeDGModel();
                            resourceAuthorizeDGModel.setMetaDataId(metadatas.get(i).getId());
                            resourceAuthorizeDGModel.setMetaDataName(metadatas.get(i).getName());
                            rdg.add(resourceAuthorizeDGModel);
                        }
                    }
                }
            }
        }
        dr.setDetailModelList(rdg);
        return dr;
    }
    @Override
    public Result getMetaData(Map<String, Object> params) throws Exception {
        DataGridResult re = new DataGridResult();
        RsResourceMetadata rd = resourceMetadataDao.getEntity(RsResourceMetadata.class, (String) params.get("id"));
        List rslist = new ArrayList();
        rslist.add(rd);
        re.setDetailModelList(rslist);
        return re;
    }
    @Override
    public Result getResourceApp(String resourceid) throws Exception {
        ActionResult returnData = new ActionResult();
        Map<String, Object> rsMap = new HashMap<String, Object>();
        List<SystemApp> selectApps = new ArrayList<SystemApp>();//已经选中
        List<SystemApp> noSelectApps = new ArrayList<SystemApp>();//未选中
        List<SystemApp> allApps = appDao.getAllApplist();
        List<RsAppResource> selectApp = appResourceDao.getAppResourceByResourceId(resourceid);
        if (selectApp != null && selectApp.size() != 0) {
            for (int i = 0; i < allApps.size(); i++) {
                for (int j = 0; j < selectApp.size(); j++) {
                    if (allApps.get(i).getId().equals(selectApp.get(j).getAppId())) {
                        selectApps.add(allApps.get(i));
                        break;
                    }
                    if (j == selectApp.size() - 1) {
                        noSelectApps.add(allApps.get(i));
                    }
                }
            }
            rsMap.put("noSelect", noSelectApps);
            rsMap.put("select", selectApps);
        } else {
            rsMap.put("noSelect", allApps);
            rsMap.put("select", null);
        }
        returnData.setData(rsMap);
        return returnData;
    }
    @Transactional
    public Result updateResourceApp(String ids, String resourceId) throws Exception {
        // appResourceDao.deleteByResourceId(resourceId);
        List<RsAppResource> rs = appResourceDao.getAppResourceByResourceId(resourceId);
        List<RsAppResource> deleteList = new ArrayList<RsAppResource>();
        List<RsAppResource> newList = new ArrayList<RsAppResource>();
        String[] appResourceIds = ids.split(",");
        //找出需要新增的
        for (String appResourceId : appResourceIds) {
            if (rs.size() != 0) {
                for (int i = 0; i < rs.size(); i++) {
                    if (rs.get(i).getAppId().equals(appResourceId)) {
                        break;
                    }
                    if (i == (rs.size() - 1)) {
                        //添加主表
                        RsAppResource rsAppResource = new RsAppResource();
                        rsAppResource.setAppId(appResourceId);
                        rsAppResource.setResourceId(resourceId);
                        newList.add(rsAppResource);
                    }
                }
            } else {
                //第一次直接新增
                RsAppResource rsAppResource = new RsAppResource();
                rsAppResource.setAppId(appResourceId);
                rsAppResource.setResourceId(resourceId);
                newList.add(rsAppResource);
            }
        }
        //找出需要删除的
        //遍历原有的
        for (int i = 0; i < rs.size(); i++) {
            //遍历现在的
            for (int j = 0; j < appResourceIds.length; j++) {
                if (rs.get(i).getAppId().equals(appResourceIds[j])) {
                    break;
                }
                if (appResourceIds.length - 1 == j) {
                    deleteList.add(rs.get(i));
                }
            }
        }
        appResourceDao.deleteEntityList(deleteList);
        appResourceDao.saveEntityList(newList);
        return Result.success("更新成功");
    }
    @Override
    public Result getResourceAppList(String resourceId) throws Exception {
        DataGridResult dgr = new DataGridResult();
        List<RsAppResource> rars = appResourceDao.getAppResourceByResourceId(resourceId);
        List modelList = new ArrayList();
        for (RsAppResource rar : rars) {
            modelList.add(appDao.getEntity(SystemApp.class, rar.getAppId()));
        }
        dgr.setDetailModelList(modelList);
        return dgr;
    }
    @Transactional
    public Result changeAppResource(String flag, String appId, String ids, String resourceId) throws Exception {
        RsAppResource rar = appResourceDao.getAppResourceByResourceIdAndAppId(resourceId, appId);
        switch (flag) {
            //全部禁止
            case "1": {
                rsAppResourceDetailDao.deleteByAppResourceId(rar.getId());
                break;
            }
            //全部允许
            case "2": {
                List<RsResourceMetadata> rrmd = resourceMetadataDao.getMetadataByResourceId(resourceId);
                rsAppResourceDetailDao.deleteByAppResourceId(rar.getId());
                for (RsResourceMetadata rRsResourceMetadata : rrmd) {
                    RsAppResourceDetail appResourceDetail = new RsAppResourceDetail();
                    appResourceDetail.setAppResouceId(rar.getId());
                    appResourceDetail.setMetadataId(rRsResourceMetadata.getId());
                    rsAppResourceDetailDao.saveEntity(appResourceDetail);
                }
                break;
            }
            //选中禁止
            case "3": {
                String[] idArray = ids.split(",");
                for (String id : idArray) {
                    rsAppResourceDetailDao.deleteEntity(rsAppResourceDetailDao.getEntity(RsAppResourceDetail.class, id));
                }
                break;
            }
            //选中允许
            case "4": {
                String[] idArray = ids.split(",");
                for (String id : idArray) {
                    RsResourceMetadata rrmd = resourceMetadataDao.getEntity(RsResourceMetadata.class, id);
                    RsAppResourceDetail appResourceDetail = new RsAppResourceDetail();
                    appResourceDetail.setAppResouceId(rar.getId());
                    appResourceDetail.setMetadataId(rrmd.getId());
                    rsAppResourceDetailDao.saveEntity(appResourceDetail);
                }
                break;
            }
        }
        return Result.success("修改成功");
    }
    @Override
    public List<RsResourceDimensionModel> getDimensionByResourceId(String resourceId) throws Exception {
        return resourceDimensionDao.getDimensionByResourceId(resourceId);
    }
    @Override
    public RsAppResourceDetail getAppResourceDetailId(String id) throws Exception {
        return rsAppResourceDetailDao.getEntity(RsAppResourceDetail.class, id);
    }
    @Transactional
    public Result saveResourceDimension(RsAppResourceDetail appResourceDetail) throws Exception {
        RsAppResourceDetail rsAppResourceDetail = rsAppResourceDetailDao.getEntity(RsAppResourceDetail.class, appResourceDetail.getId());
        rsAppResourceDetail.setDimensionValue(appResourceDetail.getDimensionValue());
        rsAppResourceDetail.setDimensionId(appResourceDetail.getDimensionId());
        return Result.success("保存成功");
    }
    @Override
    public List<RsResourceMetadata> getResourceMetadataListColumn(String code) throws Exception {
        return resourceMetadataDao.getMetadataByResourceId(code);
    }
}

+ 0 - 25
EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/ComboboxResult.java

@ -1,25 +0,0 @@
package com.yihu.ehr.resource.viewresult;
/**
 * Created by chenweida on 2016/1/14.
 */
public class ComboboxResult {
    private String text;
    private String id;
    public String getText() {
        return text;
    }
    public void setText(String text) {
        this.text = text;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
}

+ 0 - 130
EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/DynamicDatagridResult.java

@ -1,130 +0,0 @@
package com.yihu.ehr.resource.viewresult;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.framework.model.Result;
import com.yihu.ehr.framework.util.log.LogService;
import com.yihu.ehr.framework.util.springutil.SpringBeanUtil;
import com.yihu.ha.common.Services;
import java.util.List;
/**
 * Created by chenweida on 2016/1/4.
 * 动态datagrid对象
 */
public class DynamicDatagridResult extends Result {
    private static final long serialVersionUID = 2076324875575488461L;
    private int pageSize = 10;
    private int currPage;
    private int totalPage;
    private int totalCount;
    private List detailModelList;
    private List<String> colunmName;
    private List<String> colunmCode;
    public String toJson() {
        ObjectMapper objectMapper = SpringBeanUtil.getService(Services.ObjectMapper);
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            LogService.getLogger().error(e.getMessage());
            return "";
        }
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
    public int getCurrPage() {
        return currPage;
    }
    public void setCurrPage(int currPage) {
        this.currPage = currPage;
    }
    public int getTotalPage() {
        if (totalCount % pageSize == 0) {
            totalPage = totalCount / pageSize;
        } else {
            totalPage = totalCount / pageSize + 1;
        }
        return totalPage;
    }
    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }
    public int getStart() {
        if (currPage != 0) {
            return (currPage - 1) * pageSize;
        }
        return 0;
    }
    public int getEnd() {
        if (currPage != 0) {
            return currPage * pageSize;
        }
        return 0;
    }
    public int getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }
    public List getDetailModelList() {
        return detailModelList;
    }
    public void setDetailModelList(List detailModelList) {
        this.detailModelList = detailModelList;
    }
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("result=");
        sb.append("obj=");
        sb.append(detailModelList);
        return sb.toString();
    }
    public List<String> getColunmName() {
        return colunmName;
    }
    public void setColunmName(List<String> colunmName) {
        this.colunmName = colunmName;
    }
    public List<String> getColunmCode() {
        return colunmCode;
    }
    public void setColunmCode(List<String> colunmCode) {
        this.colunmCode = colunmCode;
    }
}

+ 0 - 52
EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/ResourceAuthorizeDGModel.java

@ -1,52 +0,0 @@
package com.yihu.ehr.resource.viewresult;
/**
 * Created by chenweida on 2016/1/25.
 */
public class ResourceAuthorizeDGModel {
    private String checked;
    private String metaDataName;
    private String metaDataId;
    private String appResourceDeatilId;
    private String dimensionMessage;
    public String getChecked() {
        return checked;
    }
    public void setChecked(String checked) {
        this.checked = checked;
    }
    public String getMetaDataName() {
        return metaDataName;
    }
    public void setMetaDataName(String metaDataName) {
        this.metaDataName = metaDataName;
    }
    public String getMetaDataId() {
        return metaDataId;
    }
    public void setMetaDataId(String metaDataId) {
        this.metaDataId = metaDataId;
    }
    public String getAppResourceDeatilId() {
        return appResourceDeatilId;
    }
    public void setAppResourceDeatilId(String appResourceDeatilId) {
        this.appResourceDeatilId = appResourceDeatilId;
    }
    public String getDimensionMessage() {
        return dimensionMessage;
    }
    public void setDimensionMessage(String dimensionMessage) {
        this.dimensionMessage = dimensionMessage;
    }
}

+ 0 - 70
EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsCategoryDetailModel.java

@ -1,70 +0,0 @@
package com.yihu.ehr.resource.viewresult;
import com.yihu.ehr.resource.model.RsResourceCategory;
import com.yihu.ha.dict.model.common.YesNo;
/**
 * RsCategory entity. @author MyEclipse Persistence Tools
 */
public class RsCategoryDetailModel implements java.io.Serializable {
	// Fields
	private String id;
	private RsResourceCategory parent;
	private String name;
	private YesNo status;
	// Constructors
	/**
	 * default constructor
	 */
	public RsCategoryDetailModel() {
	}
	/**
	 * full constructor
	 */
	public RsCategoryDetailModel(RsResourceCategory parent, String name, YesNo status) {
		this.parent = parent;
		this.name = name;
		this.status = status;
	}
	// Property accessors
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public RsResourceCategory getParent() {
		return this.parent;
	}
	public void setParent(RsResourceCategory parent) {
		this.parent = parent;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public YesNo getStatus() {
		return this.status;
	}
	public void setStatus(YesNo status) {
		this.status = status;
	}
}

+ 0 - 97
EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsResourceDeatilModel.java

@ -1,97 +0,0 @@
package com.yihu.ehr.resource.viewresult;
/**
 * Created by chenweida on 2015/12/21.
 */
public class RsResourceDeatilModel {
    private String id;
    private String name;
    private String code;
    private String type;//1 事实表/ 2统计表
    private String serviceRate;
    private String dataSupportType;//1 拉模式/ 2推模式
    private String category;
    private String valid;
    private String datasetCode;//数据集ID
    private String remark;
    public String getValid() {
        return valid;
    }
    public void setValid(String valid) {
        this.valid = valid;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getCategory() {
        return category;
    }
    public void setCategory(String category) {
        this.category = category;
    }
    public String getDatasetCode() {
        return datasetCode;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public void setDatasetCode(String datasetCode) {
        this.datasetCode = datasetCode;
    }
    public String getServiceRate() {
        return serviceRate;
    }
    public void setServiceRate(String serviceRate) {
        this.serviceRate = serviceRate;
    }
    public String getDataSupportType() {
        return dataSupportType;
    }
    public void setDataSupportType(String dataSupportType) {
        this.dataSupportType = dataSupportType;
    }
}

+ 0 - 61
EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsResourceDimensionModel.java

@ -1,61 +0,0 @@
package com.yihu.ehr.resource.viewresult;
/**
 * Created by chenweida on 2016/1/26.
 */
public class RsResourceDimensionModel {
    private String resourceId;
    private String dimensionId;
    private String name;
    private String category;
    private String type;
    private String dictCode;
    public String getResourceId() {
        return resourceId;
    }
    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }
    public String getDimensionId() {
        return dimensionId;
    }
    public void setDimensionId(String dimensionId) {
        this.dimensionId = dimensionId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCategory() {
        return category;
    }
    public void setCategory(String category) {
        this.category = category;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getDictCode() {
        return dictCode;
    }
    public void setDictCode(String dictCode) {
        this.dictCode = dictCode;
    }
}

+ 0 - 154
EHR-resource/src/main/java/com/yihu/ehr/resource/viewresult/RsResourceFieldDetailModel.java

@ -1,154 +0,0 @@
package com.yihu.ehr.resource.viewresult;
import org.apache.axis2.databinding.types.soapencoding.Integer;
/**
 * Created by chenweida on 2015/12/26.
 */
public class RsResourceFieldDetailModel {
    private Integer id;
    private Integer stdId;
    private Integer datasetId;
    private String code;
    private String deCode;
    private String name;
    private String type;
    private String format;
    private Integer dictId;
    private String definition;
    private Integer nullable;
    private String columnType;
    private String columnName;
    private String columnLength;
    private Integer primaryKey;
    private Integer dataSupportType;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Integer getStdId() {
        return stdId;
    }
    public void setStdId(Integer stdId) {
        this.stdId = stdId;
    }
    public Integer getDatasetId() {
        return datasetId;
    }
    public void setDatasetId(Integer datasetId) {
        this.datasetId = datasetId;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getDeCode() {
        return deCode;
    }
    public void setDeCode(String deCode) {
        this.deCode = deCode;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getFormat() {
        return format;
    }
    public void setFormat(String format) {
        this.format = format;
    }
    public Integer getDictId() {
        return dictId;
    }
    public void setDictId(Integer dictId) {
        this.dictId = dictId;
    }
    public String getDefinition() {
        return definition;
    }
    public void setDefinition(String definition) {
        this.definition = definition;
    }
    public Integer getNullable() {
        return nullable;
    }
    public void setNullable(Integer nullable) {
        this.nullable = nullable;
    }
    public String getColumnType() {
        return columnType;
    }
    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }
    public String getColumnName() {
        return columnName;
    }
    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }
    public String getColumnLength() {
        return columnLength;
    }
    public void setColumnLength(String columnLength) {
        this.columnLength = columnLength;
    }
    public Integer getPrimaryKey() {
        return primaryKey;
    }
    public void setPrimaryKey(Integer primaryKey) {
        this.primaryKey = primaryKey;
    }
    public Integer getDataSupportType() {
        return dataSupportType;
    }
    public void setDataSupportType(Integer dataSupportType) {
        this.dataSupportType = dataSupportType;
    }
}

+ 0 - 193
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/AdapterController.java

@ -1,193 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.model.DictItem;
import com.yihu.ehr.framework.model.DictionaryResult;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/16.
 */
@Controller
@RequestMapping("/adapter")
public class AdapterController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询适配方案首页信息(get)
     * @param condition
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchSchemesList")
    @ResponseBody
    public String searchSchemesList(String condition) throws Exception {
        String url = "/api/v1.0/adapter_center/schemes";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("condition", condition);
        String resutl = HttpClientUtil.doGet( host+url, params, username, password);
        return resutl;
    }
    /**
     * 根据适配ID获取适配方案信息(get)
     * @param schemeId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getForSchemeId")
    @ResponseBody
    public String getForStandardId(Integer schemeId) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("schemeId",schemeId);
        String resutl = HttpClientUtil.doGet( host+url,params,username,password);
        return resutl;
    }
    /**
     * 修改适配(PUT)
     * @param scheme
     * @return
     * @throws Exception
     */
    @RequestMapping("/updateScheme")
    @ResponseBody
    public String updateScheme(String scheme) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("scheme",scheme);
        String resutl = HttpClientUtil.doPut(host + url, params, username, password);
        return resutl;
    }
    /**
     * 新增适配(POST)
     * @param scheme
     * @return
     * @throws Exception
     */
    @RequestMapping("/addScheme")
    @ResponseBody
    public String addScheme(String scheme) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("scheme",scheme);
        String resutl = HttpClientUtil.doPost(host + url, params, username, password);
        return resutl;
    }
    /**
     * 删除适配(DELETE)
     * @param  schemeId
     * @return
     * @throws Exception
     */
    @RequestMapping("/deleteScheme")
    @ResponseBody
    public String deleteScheme(Integer schemeId) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("schemeId",schemeId);
        String resutl = HttpClientUtil.doDelete(host + url, params, username, password);
        return resutl;
    }
    /**
     * 获取平台标准名称/应用标准名称列表
     * @param condition
     * @return
     * @throws Exception
     */
    @RequestMapping("/getStandards")
    @ResponseBody
    public DictionaryResult getStandards(String condition) throws Exception {
        String url = "/api/v1.0/standard_center/standards";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("condition",condition);
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        JSONArray array = JSONArray.fromObject(result);
        DictionaryResult dictionaryResult = new DictionaryResult();
        List<DictItem> detailModelList = new ArrayList<DictItem>();
        for(int i = 0; i < array.size(); i++){
            JSONObject jsonObject = array.getJSONObject(i);
            DictItem items = new DictItem();
            Integer  id = (Integer) jsonObject.get("id");
            String name = (String)jsonObject.get("name");
            items.setCode(id.toString());
            items.setValue(name);
            detailModelList.add(items);
        }
        dictionaryResult.setDetailModelList(detailModelList);
        return dictionaryResult;
    }
    /**
     * 获取平台标准版本/应用标准版本列表
     * @param standardId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getVersions")
    @ResponseBody
    public DictionaryResult getVersions(Integer standardId) throws Exception {
        String url = "/api/v1.0/standard_center/versions";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("standardId",standardId);
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        JSONArray array = JSONArray.fromObject(result);
        DictionaryResult dictionaryResult = new DictionaryResult();
        List<DictItem> detailModelList = new ArrayList<DictItem>();
        for(int i = 0; i < array.size(); i++){
            JSONObject jsonObject = array.getJSONObject(i);
            DictItem items = new DictItem();
            String  id = (String) jsonObject.get("version");
            String name = (String)jsonObject.get("name");
            items.setCode(id.toString());
            items.setValue(name);
            detailModelList.add(items);
        }
        dictionaryResult.setDetailModelList(detailModelList);
        return dictionaryResult;
    }
    /**
     * 获取发布机构名称列表
     * @return
     * @throws Exception
     */
    @RequestMapping("/getPublishers")
    @ResponseBody
    public DictionaryResult getPublishers() throws Exception {
        String url = "/api/v1.0/standard_center/publishers";
        Map<String, Object> params = new HashMap<String, Object>();
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        JSONArray array = JSONArray.fromObject(result);
        DictionaryResult dictionaryResult = new DictionaryResult();
        List<DictItem> detailModelList = new ArrayList<DictItem>();
        for(int i = 0; i < array.size(); i++){
            JSONObject jsonObject = array.getJSONObject(i);
            DictItem items = new DictItem();
            String  id = (String) jsonObject.get("code");
            String name = (String)jsonObject.get("name");
            items.setCode(id.toString());
            items.setValue(name);
            detailModelList.add(items);
        }
        dictionaryResult.setDetailModelList(detailModelList);
        return dictionaryResult;
    }
}

+ 0 - 81
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/AdapterPlanController.java

@ -1,81 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.util.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/adapterPlan")
public class AdapterPlanController extends BaseController {
    @RequestMapping("initial")
    public String cdaTypeInitial(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/index");
        return "partView";
    }
    @RequestMapping("adapterUpdate")
    public String adapterUpdate(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/adapterDetail");
        return "pageView";
    }
    @RequestMapping("versionUpdate")
    public String versionUpdate(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/versionDetail");
        return "pageView";
    }
    @RequestMapping("adapterCustomize")
    public String adapterCustomize(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/adapterCustomize");
        return "pageView";
    }
    @RequestMapping("configuration")
    public String configuration(Model model,String version,String status,String schemeId,String stdVersion,String adapterStdVersion) {
        model.addAttribute("contentPage", "standard/adapterplan/configuration");
        model.addAttribute("version",version);
        model.addAttribute("schemeId", schemeId);
        model.addAttribute("status",status);
        model.addAttribute("stdVersion",stdVersion);
        model.addAttribute("adapterStdVersion",adapterStdVersion);
        return "partView";
    }
    @RequestMapping("updateDataset")
    public String updateDataset(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/dataset/updateDataset");
        return "pageView";
    }
    @RequestMapping("updateMetadata")
    public String updateMetadata(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/dataset/updateMetadata");
        return "pageView";
    }
    @RequestMapping("updateDict")
    public String updatedict(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/dict/updateDict");
        return "pageView";
    }
    @RequestMapping("updateDictItem")
    public String updatedictitem(Model model) {
        model.addAttribute("contentPage", "standard/adapterplan/dict/updateDictItem");
        return "pageView";
    }
}

+ 0 - 142
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/AdapterVersionController.java

@ -1,142 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.model.DictItem;
import com.yihu.ehr.framework.model.DictionaryResult;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/adapterversion")
public class AdapterVersionController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 根据版本id获取适配方案信息(get)
     * @param versionId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getForVersionId")
    @ResponseBody
    public String getForVersionId(Integer versionId) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId",versionId);
        String resutl = HttpClientUtil.doGet(host + url, params, username, password);
        return resutl;
    }
    /**
     * 新增版本(post)
     * @param version
     * @return
     * @throws Exception
     */
    @RequestMapping("/addVersion")
    @ResponseBody
    public String addVersion(String version) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("version",version);
        String resutl = HttpClientUtil.doPost(host + url, params, username, password);
        return resutl;
    }
    /**
     * 修改版本(put)
     * @param version
     * @return
     * @throws Exception
     */
    @RequestMapping("/updateVersion")
    @ResponseBody
    public String updateVersion(String version) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("version",version);
        String resutl = HttpClientUtil.doPut(host + url, params, username, password);
        return resutl;
    }
    /**
     * 发布版本(put)
     * @param version
     * @return
     * @throws Exception
     */
    @RequestMapping("/publishVersion")
    @ResponseBody
    public String publishVersion(String version) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("version",version);
        String resutl = HttpClientUtil.doPut(host + url, params, username, password);
        return resutl;
    }
    /**
     * 删除版本(put)
     * @param versionId
     * @return
     * @throws Exception
     */
    @RequestMapping("/deleteVersion")
    @ResponseBody
    public String deleteVersion(Integer versionId) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId",versionId);
        String resutl = HttpClientUtil.doDelete(host + url, params, username, password);
        return resutl;
    }
    /**
     * 获取基础版本列表
     * @param schemeId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getVersions")
    @ResponseBody
    public DictionaryResult getVersions(Integer schemeId) throws Exception {
        String url = "/api/v1.0/adapter_center/versions";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("schemeId",schemeId);
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        JSONArray array = JSONArray.fromObject(result);
        DictionaryResult dictionaryResult = new DictionaryResult();
        List<DictItem> detailModelList = new ArrayList<DictItem>();
        DictItem item = new DictItem();
        item.setCode("");
        item.setValue("-无-");
        detailModelList.add(item);
        for(int i = 0; i < array.size(); i++){
            JSONObject jsonObject = array.getJSONObject(i);
            DictItem items = new DictItem();
            String  id = (String) jsonObject.get("version");
            String name = (String)jsonObject.get("name");
            items.setCode(id.toString());
            items.setValue(name);
            detailModelList.add(items);
        }
        dictionaryResult.setDetailModelList(detailModelList);
        return dictionaryResult;
    }
}

+ 0 - 113
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/IntegrationController.java

@ -1,113 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.util.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/integration")
public class IntegrationController extends BaseController {
    @RequestMapping("initial/standard")
    public String standardInitial(Model model) {
        model.addAttribute("type", 0);
        model.addAttribute("contentPage", "standard/integration/index");
        return "partView";
    }
    @RequestMapping("initial/application")
    public String applicationInitial(Model model) {
        model.addAttribute("type", 1);
        model.addAttribute("contentPage", "standard/integration/appIndex");
        return "partView";
    }
    @RequestMapping("standardUpdate")
    public String standardUpdate(Model model) {
        model.addAttribute("contentPage", "standard/integration/standardDetail");
        return "pageView";
    }
    @RequestMapping("publisherUpdate")
    public String publisherUpdate(Model model) {
        model.addAttribute("contentPage", "standard/integration/publisher");
        return "pageView";
    }
    @RequestMapping("versionUpdate")
    public String versionUpdate(Model model) {
        model.addAttribute("contentPage", "standard/integration/versionDetail");
        return "pageView";
    }
    @RequestMapping("copyVersion")
    public String copyVersion(Model model) {
        model.addAttribute("contentPage", "standard/integration/copyVersion");
        return "pageView";
    }
    @RequestMapping("configuration")
    public String configuration(Model model, String version, String stdId, Integer type,String status) {
        model.addAttribute("version",version);
        stdId = stdId.replace("standard", "");
        if (type == 0) {
            model.addAttribute("backUrl", "/integration/initial/standard?treePid=5&treeId=21");
        } else if (type == 1) {
            model.addAttribute("backUrl", "/integration/initial/application?treePid=5&treeId=22");
        }
        model.addAttribute("stdId", Integer.parseInt(stdId));
        model.addAttribute("status",status);
        model.addAttribute("contentPage", "standard/integration/configuration");
        return "partView";
    }
    @RequestMapping("updateDataset")
    public String updateDataset(Model model, String type, String version, Integer id, Integer standardId) {
        model.addAttribute("type",type);
        model.addAttribute("stdVersion",version);
        model.addAttribute("datasetId", id);
        model.addAttribute("standardId", standardId);
        model.addAttribute("contentPage", "standard/integration/dataset/updateDataset");
        return "pageView";
    }
    @RequestMapping("updateMetadata")
    public String updateMetadata(Model model, String type, String version, Integer id, Integer pid, Integer standardId) {
        model.addAttribute("contentPage", "standard/integration/dataset/updateMetadata");
        model.addAttribute("type",type);
        model.addAttribute("stdVersion", version);
        model.addAttribute("standardId", standardId);
        model.addAttribute("datasetId", pid);
        model.addAttribute("metadataId", id);
        return "pageView";
    }
    @RequestMapping("updateDict")
    public String updateDict(Model model, String type, String version, Integer id, Integer standardId) {
        model.addAttribute("contentPage", "standard/integration/dict/updateDict");
        model.addAttribute("type",type);
        model.addAttribute("stdVersion",version);
        model.addAttribute("dictId", id);
        model.addAttribute("standardId", standardId);
        return "pageView";
    }
    @RequestMapping("updateDictEntry")
    public String updateDictEntry(Model model, String type, String version, Integer id, Integer pid, Integer standardId) {
        model.addAttribute("contentPage", "standard/integration/dict/updateDictEntry");
        model.addAttribute("type",type);
        model.addAttribute("stdVersion", version);
        model.addAttribute("standardId", standardId);
        model.addAttribute("dictId", pid);
        model.addAttribute("dictEntryId", id);
        return "pageView";
    }
}

+ 0 - 101
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/PublisherController.java

@ -1,101 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/standardCenter")
public class PublisherController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 根据标准ID获取发布机构(get)
     * @param publisherId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getForPublisherId")
    @ResponseBody
    public String getForStandardId(Integer publisherId) throws Exception {
        String url = "/api/v1.0/standard_center/publisher";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("publisherId", publisherId);
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    /**
     * 获取集成标准发布机构(get)
     * @return
     * @throws Exception
     */
    @RequestMapping("/getStandardPublisher")
    @ResponseBody
    public String getStandardPublisher() throws Exception {
        String url = "/api/v1.0/standard_center/publisher/standard";
        Map<String, Object> params = new HashMap<String, Object>();
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    /**
     * 修改发布机构(PUT)
     * @param publisher
     * @return
     * @throws Exception
     */
    @RequestMapping("/updatePublisher")
    @ResponseBody
    public String updateStandard(String publisher) throws Exception {
        String url = "/api/v1.0/standard_center/publisher";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("publisher", publisher);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    /**
     * 新增发布机构(POST)
     * @param publisher
     * @return
     * @throws Exception
     */
    @RequestMapping("/addPublisher")
    @ResponseBody
    public String addStandard(String publisher) throws Exception {
        String url = "/api/v1.0/standard_center/publisher";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("publisher", publisher);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    /**
     * 删除发布机构(DELETE)
     * @param  publisherId
     * @return
     * @throws Exception
     */
    @RequestMapping("/deletePublisher")
    @ResponseBody
    public String deleteStandard(Integer publisherId) throws Exception {
        String url = "/api/v1.0/standard_center/publisher";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("publisherId", publisherId);
        String result = HttpClientUtil.doDelete(host + url, params, username, password);
        return result;
    }
}

+ 0 - 103
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeController.java

@ -1,103 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by LLH on 2016/1/16.
 */
@Controller
@RequestMapping("/adapterCenter")
public class SchemeController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询适配方案首页信息(get)
     * @param condition
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchScheme")
    @ResponseBody
    public String searchSchemesList(String condition) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("condition", condition);
        String result = HttpClientUtil.doGet(host+url, params, username, password);
        return result;
    }
    /**
     * 根据适配ID获取适配方案信息(get)
     * @param schemeId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getForSchemeId")
    @ResponseBody
    public String getForStandardId(Integer schemeId) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("schemeId",schemeId);
        String result = HttpClientUtil.doGet( host+url,params,username,password);
        return result;
    }
    /**
     * 修改适配(PUT)
     * @param scheme
     * @return
     * @throws Exception
     */
    @RequestMapping("/updateScheme")
    @ResponseBody
    public String updateScheme(String scheme) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("scheme",scheme);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    /**
     * 新增适配(POST)
     * @param scheme
     * @return
     * @throws Exception
     */
    @RequestMapping("/addScheme")
    @ResponseBody
    public String addScheme(String scheme) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("scheme",scheme);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    /**
     * 删除适配(DELETE)
     * @param  schemeId
     * @return
     * @throws Exception
     */
    @RequestMapping("/deleteScheme")
    @ResponseBody
    public String deleteScheme(Integer schemeId) throws Exception {
        String url = "/api/v1.0/adapter_center/scheme";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("schemeId",schemeId);
        String result = HttpClientUtil.doDelete(host + url, params, username, password);
        return result;
    }
}

+ 0 - 127
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeDatasetController.java

@ -1,127 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.constrant.Result;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import com.yihu.ehr.standard.model.AdapterDatasetModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/adapterCenter")
public class SchemeDatasetController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询数据集列表信息(get)
     * @param adapterVersion
     * @param condition
     * @param order
     * @param rows
     * @param page
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchDatasetList")
    @ResponseBody
    public Result searchDatasetList(String adapterVersion,String condition,String order,Integer rows,Integer page) throws Exception {
        String url = "/api/v1.0/adapter_center/datasets/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("condition", condition);
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", page - 1);
        String resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        List<AdapterDatasetModel> dataSetModelList = jsonArrayToList(resultStr, AdapterDatasetModel.class);
        url = "/api/v1.0/adapter_center/datasets/totalCount";
        resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        Integer count = Integer.parseInt(resultStr);
        Result result = new Result();
        result.setDetailModelList(dataSetModelList);
        result.setTotalCount(count);
        return result;
    }
    @RequestMapping("/getForDatasetId")
    @ResponseBody
    public String getForDatasetId(String adapterVersion, Integer datasetId) throws Exception {
        String url = "/api/v1.0/adapter_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("datasetId", datasetId);
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/delDataset")
    @ResponseBody
    public String delDataset(String adapterVersion, Integer id) throws Exception {
        String url = "/api/v1.0/adapter_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("datasetId", id);
        String result = HttpClientUtil.doDelete(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/updateDataset")
    @ResponseBody
    public String updateDataset(String adapterVersion, String dataset) throws Exception {
        String url = "/api/v1.0/adapter_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dataset", dataset);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/addDataset")
    @ResponseBody
    public String addDataset(String adapterVersion, String dataset) throws Exception {
        String url = "/api/v1.0/adapter_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dataset", dataset);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/getAdapterDataset")
    @ResponseBody
    public String getAdapterDataset(String adapterVersion,String stdVersion) throws Exception {
        String url = "/api/v1.0/adapter_center/datasets/customization";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("stdVersion", stdVersion);
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        return result;
    }
    @RequestMapping(value = "/saveAdapterDataset",method = RequestMethod.POST)
    @ResponseBody
    public String saveAdapterDataset(Integer schemeId,String adapterVersion,String stdVersion,String customizeData) throws Exception {
        String url = "/api/v1.0/adapter_center/datasets/customization";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("schemeId", schemeId);
        params.put("adapterVersion", adapterVersion);
        params.put("stdVersion", stdVersion);
        params.put("customizeData", customizeData);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
}

+ 0 - 103
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeDictController.java

@ -1,103 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.constrant.Result;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import com.yihu.ehr.standard.model.AdapterDictModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/adapterCenter")
public class SchemeDictController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询字典列表信息(get)
     * @param adapterVersion
     * @param condition
     * @param order
     * @param rows
     * @param page
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchDictList")
    @ResponseBody
    public Result searchDictList(String adapterVersion,String condition,String order,Integer rows,Integer page) throws Exception {
        String url = "/api/v1.0/adapter_center/dicts/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("condition", condition);
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", page - 1);
        String resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        List<AdapterDictModel> dictModelList = jsonArrayToList(resultStr, AdapterDictModel.class);
        url = "/api/v1.0/adapter_center/dicts/totalCount";
        resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        Integer count = Integer.parseInt(resultStr);
        Result result = new Result();
        result.setDetailModelList(dictModelList);
        result.setTotalCount(count);
        return result;
    }
    @RequestMapping("/getForDictId")
    @ResponseBody
    public String getForDictId(String adapterVersion, Integer dictId) throws Exception {
        String url = "/api/v1.0/adapter_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dictId", dictId);
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/delDict")
    @ResponseBody
    public String delDict(String adapterVersion, Integer id) throws Exception {
        String url = "/api/v1.0/adapter_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dictId", id);
        String result = HttpClientUtil.doDelete(host+url,params,username,password);
        return result;
    }
    
    @RequestMapping("/updateDict")
    @ResponseBody
    public String updateDict(String adapterVersion, String dict) throws Exception {
        String url = "/api/v1.0/adapter_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dict", dict);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/addDict")
    @ResponseBody
    public String addDict(String adapterVersion, String dict) throws Exception {
        String url = "/api/v1.0/adapter_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dict", dict);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
}

+ 0 - 116
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeDictEntryController.java

@ -1,116 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.constrant.Result;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import com.yihu.ehr.standard.model.AdapterDictEntryResultDetailModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/adapterCenter")
public class SchemeDictEntryController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询字典项列表信息(get)
     * @param adapterVersion
     * @param condition
     * @param order
     * @param rows
     * @param page
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchDictEntryList")
    @ResponseBody
    public Result searchDictEntryList(String adapterVersion,String condition,String order,Integer rows,Integer page) throws Exception {
        String url = "/api/v1.0/adapter_center/dictEntrys/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("condition", condition);
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", page - 1);
        String resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        List<AdapterDictEntryResultDetailModel> detailModelList = jsonArrayToList(resultStr, AdapterDictEntryResultDetailModel.class);
        url = "/api/v1.0/adapter_center/dictEntrys/totalCount";
        resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        Integer count = Integer.parseInt(resultStr);
        Result result = new Result();
        result.setDetailModelList(detailModelList);
        result.setTotalCount(count);
        return result;
    }
    @RequestMapping("/getForDictEntryId")
    @ResponseBody
    public String getForDictEntryId(String adapterVersion, Integer dictId, Integer dictEntryId) throws Exception {
        String url = "/api/v1.0/adapter_center/dictEntry";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dictId", dictId);
        params.put("dictEntryId", dictEntryId);
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/updateDictEntry")
    @ResponseBody
    public String updateDictEntry(String adapterVersion, String dictEntry) throws Exception {
        String url = "/api/v1.0/adapter_center/dictEntry";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dictEntry", dictEntry);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/addDictEntry")
    @ResponseBody
    public String addDictEntry(String adapterVersion, String dictEntry) throws Exception {
        String url = "/api/v1.0/adapter_center/dictEntry";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dictEntry", dictEntry);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/updateDictEntrys")
    @ResponseBody
    public String updateDictEntrys(String adapterVersion, String list) throws Exception {
        String url = "/api/v1.0/adapter_center/dictEntrys";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("list", list);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/delDictEntry")
    @ResponseBody
    public boolean delDictEntry(String adapterVersion, Integer id, Integer stdId, Integer adapterId) throws Exception {
        String url = "/api/v1.0/adapter_center/dictEntry/multiple";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("dictEntryId", id);
        params.put("stdDictId", stdId);
        params.put("adapterDictId", adapterId);
        HttpClientUtil.doDelete(host+url,params,username,password);
        return true;
    }
}

+ 0 - 115
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeMetadataController.java

@ -1,115 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.constrant.Result;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import com.yihu.ehr.standard.model.ApiMetadataResultDetailModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/adapterCenter")
public class SchemeMetadataController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询数据元列表信息(get)
     * @param adapterVersion
     * @param condition
     * @param order
     * @param rows
     * @param page
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchMetadataList")
    @ResponseBody
    public Result searchMetadataList(String adapterVersion,String condition,String order,Integer rows,Integer page) throws Exception {
        String url = "/api/v1.0/adapter_center/metadatas/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("condition", condition);
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", page - 1);
        String resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        List<ApiMetadataResultDetailModel> metadataModelList = jsonArrayToList(resultStr, ApiMetadataResultDetailModel.class);
        url = "/api/v1.0/adapter_center/metadatas/totalCount";
        resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        Integer count = Integer.parseInt(resultStr);
        Result result = new Result();
        result.setDetailModelList(metadataModelList);
        result.setTotalCount(count);
        return result;
    }
    @RequestMapping("/getForMetadataId")
    @ResponseBody
    public String getForMetadataId(String adapterVersion, Integer datasetId, Integer metadataId) throws Exception {
        String url = "/api/v1.0/adapter_center/metadata";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("datasetId", datasetId);
        params.put("metadataId", metadataId);
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/updateMetadata")
    @ResponseBody
    public String updateMetadata(String adapterVersion, String metadata) throws Exception {
        String url = "/api/v1.0/adapter_center/metadata";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("metadata", metadata);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/addMetadata")
    @ResponseBody
    public String addMetadata(String adapterVersion, String metadata) throws Exception {
        String url = "/api/v1.0/adapter_center/metadata";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("metadata", metadata);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/updateMetadatas")
    @ResponseBody
    public String updateMetadatas(String adapterVersion, String list) throws Exception {
        String url = "/api/v1.0/adapter_center/metadatas";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("list", list);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/delMetadata")
    @ResponseBody
    public void delDictEntry(String adapterVersion, Integer id, Integer stdId, Integer adapterId) throws Exception {
        String url = "/api/v1.0/adapter_center/metadata/multiple";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("adapterVersion", adapterVersion);
        params.put("metadataId", id);
        params.put("stdDatasetId", stdId);
        params.put("adapterDatasetId", adapterId);
        HttpClientUtil.doDelete(host+url,params,username,password);
    }
}

+ 0 - 104
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/SchemeVersionController.java

@ -1,104 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/adapterCenter")
public class SchemeVersionController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 根据版本id获取适配方案信息(get)
     * @param versionId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getForVersionId")
    @ResponseBody
    public String getForVersionId(Integer versionId) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId",versionId);
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        return result;
    }
    /**
     * 新增版本(post)
     * @param version
     * @return
     * @throws Exception
     */
    @RequestMapping("/addVersion")
    @ResponseBody
    public String addVersion(String version) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("version",version);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    /**
     * 修改版本(put)
     * @param version
     * @return
     * @throws Exception
     */
    @RequestMapping("/updateVersion")
    @ResponseBody
    public String updateVersion(String version) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("version",version);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    /**
     * 发布版本(put)
     * @param versionId
     * @return
     * @throws Exception
     */
    @RequestMapping("/publishVersion")
    @ResponseBody
    public String publishVersion(Integer versionId, String publisher) throws Exception {
        String url = "/api/v1.0/adapter_center/version/publish";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId", versionId);
        params.put("publisher", publisher);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    /**
     * 删除版本(put)
     * @param versionId
     * @return
     * @throws Exception
     */
    @RequestMapping("/deleteVersion")
    @ResponseBody
    public String deleteVersion(Integer versionId) throws Exception {
        String url = "/api/v1.0/adapter_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId",versionId);
        String result = HttpClientUtil.doDelete(host + url, params, username, password);
        return result;
    }
}

+ 0 - 106
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StandardController.java

@ -1,106 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import com.yihu.ehr.standard.model.StandardResultDetailModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/standardCenter")
public class StandardController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询集成标准首页信息(get)
     * @param condition
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchStandard")
    @ResponseBody
    public String searchStandard(String condition) throws Exception {
        String url = "/api/v1.0/standard_center/standards/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("condition", condition);
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        List<StandardResultDetailModel> list = jsonArrayToList(result, StandardResultDetailModel.class);
        return result;
    }
    /**
     * 根据标准ID获取集成标准信息(get)
     * @param standardId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getForStandardId")
    @ResponseBody
    public String getForStandardId(Integer standardId) throws Exception {
        String url = "/api/v1.0/standard_center/standard";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("standardId",standardId);
        String result = HttpClientUtil.doGet( host+url,params,username,password);
        return result;
    }
    /**
     * 修改标准信息(PUT)
     * @param standard
     * @return
     * @throws Exception
     */
    @RequestMapping("/updateStandard")
    @ResponseBody
    public String updateStandard(String standard) throws Exception {
        String url = "/api/v1.0/standard_center/standard";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("standard",standard);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    /**
     * 新增标准信息(POST)
     * @param standard
     * @return
     * @throws Exception
     */
    @RequestMapping("/addStandard")
    @ResponseBody
    public String addStandard(String standard) throws Exception {
        String url = "/api/v1.0/standard_center/standard";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("standard",standard);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    /**
     * 删除标准信息(DELETE)
     * @param  standardId
     * @return
     * @throws Exception
     */
    @RequestMapping("/deleteStandard")
    @ResponseBody
    public String deleteStandard(Integer standardId) throws Exception {
        String url = "/api/v1.0/standard_center/standard";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("standardId",standardId);
        String result = HttpClientUtil.doDelete(host + url, params, username, password);
        return result;
    }
}

+ 0 - 143
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StandardVersionController.java

@ -1,143 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.model.DictItem;
import com.yihu.ehr.framework.model.DictionaryResult;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/standardCenter")
public class StandardVersionController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 根据版本id获取标准版本信息(get)
     * @param versionId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getForVersionId")
    @ResponseBody
    public String getForVersionId(String versionId) throws Exception {
        String url = "/api/v1.0/standard_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId",Integer.parseInt(versionId));
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        return result;
    }
    /**
     * 新增版本(post)
     * @param version
     * @return
     * @throws Exception
     */
    @RequestMapping("/addVersion")
    @ResponseBody
    public String addVersion(String version) throws Exception {
        String url = "/api/v1.0/standard_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("version",version);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    /**
     * 修改版本(put)
     * @param version
     * @return
     * @throws Exception
     */
    @RequestMapping("/updateVersion")
    @ResponseBody
    public String updateVersion(String version) throws Exception {
        String url = "/api/v1.0/standard_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("version",version);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    /**
     * 发布版本(post)
     * @param versionId
     * @param publisher
     * @return
     * @throws Exception
     */
    @RequestMapping("/publishVersion")
    @ResponseBody
    public String publishVersion(Integer versionId,String publisher) throws Exception {
        String url = "/api/v1.0/standard_center/version/publish";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId",versionId);
        params.put("publisher",publisher);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    /**
     * 删除版本(put)
     * @param versionId
     * @return
     * @throws Exception
     */
    @RequestMapping("/deleteVersion")
    @ResponseBody
    public String deleteVersion(String versionId) throws Exception {
        String url = "/api/v1.0/standard_center/version";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("versionId",versionId);
        String result = HttpClientUtil.doDelete(host + url, params, username, password);
        return result;
    }
    /**
     * 获取基础版本名称列表
     * @param standardId
     * @return
     * @throws Exception
     */
    @RequestMapping("/getVersions")
    @ResponseBody
    public DictionaryResult getVersions(Integer standardId) throws Exception {
        String url = "/api/v1.0/standard_center/versions";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("standardId",standardId);
        String result = HttpClientUtil.doGet(host + url, params, username, password);
        JSONArray array = JSONArray.fromObject(result);
        DictionaryResult dictionaryResult = new DictionaryResult();
        List<DictItem> detailModelList = new ArrayList<DictItem>();
        DictItem item = new DictItem();
        item.setCode("");
        item.setValue("-无-");
        detailModelList.add(item);
        for(int i = 0; i < array.size(); i++){
            JSONObject jsonObject = array.getJSONObject(i);
            DictItem items = new DictItem();
            String  id = (String) jsonObject.get("version");
            String name = (String)jsonObject.get("name");
            items.setCode(id.toString());
            items.setValue(name);
            detailModelList.add(items);
        }
        dictionaryResult.setDetailModelList(detailModelList);
        return dictionaryResult;
    }
}

+ 0 - 132
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StdDatasetController.java

@ -1,132 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.constrant.Result;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import com.yihu.ehr.framework.util.operator.StringUtil;
import com.yihu.ehr.standard.model.Select2;
import com.yihu.ehr.standard.model.StdDataSetModel;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/standardCenter")
public class StdDatasetController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询数据集列表信息(get)
     * @param stdVersion
     * @param condition
     * @param order
     * @param rows
     * @param page
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchDatasetList")
    @ResponseBody
    public Result searchDatasetList(String stdVersion,String condition,String order,Integer rows,Integer page) throws Exception {
        String url = "/api/v1.0/standard_center/datasets/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("condition", condition);
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", page - 1);
        String resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        List<StdDataSetModel> dataSetModelList = jsonArrayToList(resultStr, StdDataSetModel.class);
        url = "/api/v1.0/standard_center/datasets/totalCount";
        resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        Integer count = Integer.parseInt(resultStr);
        Result result = new Result();
        result.setDetailModelList(dataSetModelList);
        result.setTotalCount(count);
        return result;
    }
    @RequestMapping("/getForDatasetId")
    @ResponseBody
    public String getForDatasetId(String stdVersion, Integer datasetId) throws Exception {
        String url = "/api/v1.0/standard_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("datasetId", datasetId);
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/delDataset")
    @ResponseBody
    public String delDataset(String stdVersion, Integer id) throws Exception {
        String url = "/api/v1.0/standard_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("datasetId", id);
        String result = HttpClientUtil.doDelete(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/updateDataset")
    @ResponseBody
    public String updateDataset(String stdVersion, String dataset) throws Exception {
        String url = "/api/v1.0/standard_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("dataset", dataset);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/addDataset")
    @ResponseBody
    public String addDataset(String stdVersion, String dataset) throws Exception {
        String url = "/api/v1.0/standard_center/dataset";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("dataset", dataset);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    @RequestMapping(value="/getDatasetCodeValues")
    @ResponseBody
    public String getDatasetCodeValues(String stdVersion, String q, String initDatasetNm, String order, Integer rows) throws Exception {
        Map<String,String> condition = new HashMap<String,String>();
        if (StringUtil.isEmpty(initDatasetNm)) {
            initDatasetNm = "";
        }
        if(StringUtil.isEmpty(q)){
            condition.put("name", initDatasetNm);
        }else{
            condition.put("name", q);
        }
        JSONObject jsonpObject = JSONObject.fromObject(condition);
        String url = "/api/v1.0/standard_center/datasets/selectList";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("condition", jsonpObject.toString());
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", 0);
        String resultStr = HttpClientUtil.doGet(host+url,params,username,password);
        List<Select2> detailModelList = jsonArrayToList(resultStr, Select2.class);
        Result result = getResult(detailModelList, detailModelList.size(), 1, rows);
        return result.toJson();
    }
}

+ 0 - 132
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StdDictController.java

@ -1,132 +0,0 @@
package com.yihu.ehr.standard.controller;
import com.yihu.ehr.framework.constrant.Result;
import com.yihu.ehr.framework.util.ResourceProperties;
import com.yihu.ehr.framework.util.controller.BaseController;
import com.yihu.ehr.framework.util.httpclient.HttpClientUtil;
import com.yihu.ehr.framework.util.operator.StringUtil;
import com.yihu.ehr.standard.model.Select2;
import com.yihu.ehr.standard.model.StdDictionaryModel;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by LLH on 2016/1/6.
 */
@Controller
@RequestMapping("/standardCenter")
public class StdDictController extends BaseController {
    private static   String host = "http://"+ ResourceProperties.getProperty("serverip")+":"+ResourceProperties.getProperty("port");
    private static   String username = ResourceProperties.getProperty("username");
    private static   String password = ResourceProperties.getProperty("password");
    /**
     * 查询字典列表信息(get)
     * @param stdVersion
     * @param condition
     * @param order
     * @param rows
     * @param page
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchDictList")
    @ResponseBody
    public Result searchDictList(String stdVersion,String condition,String order,Integer rows,Integer page) throws Exception {
        String url = "/api/v1.0/standard_center/dicts/list";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("condition", condition);
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", page - 1);
        String resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        List<StdDictionaryModel> dictModelList = jsonArrayToList(resultStr, StdDictionaryModel.class);
        url = "/api/v1.0/standard_center/dicts/totalCount";
        resultStr = HttpClientUtil.doGet(host+url, params, username, password);
        Integer count = Integer.parseInt(resultStr);
        Result result = new Result();
        result.setDetailModelList(dictModelList);
        result.setTotalCount(count);
        return result;
    }
    @RequestMapping("/getForDictId")
    @ResponseBody
    public String getForDictId(String stdVersion, Integer dictId) throws Exception {
        String url = "/api/v1.0/standard_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("dictId", dictId);
        String result = HttpClientUtil.doGet(host+url,params,username,password);
        return result;
    }
    @RequestMapping("/delDict")
    @ResponseBody
    public String delDict(String stdVersion, Integer id) throws Exception {
        String url = "/api/v1.0/standard_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("dictId", id);
        String result = HttpClientUtil.doDelete(host+url,params,username,password);
        return result;
    }
    
    @RequestMapping("/updateDict")
    @ResponseBody
    public String updateDict(String stdVersion, String dict) throws Exception {
        String url = "/api/v1.0/standard_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("dict", dict);
        String result = HttpClientUtil.doPut(host + url, params, username, password);
        return result;
    }
    @RequestMapping("/addDict")
    @ResponseBody
    public String addDict(String stdVersion, String dict) throws Exception {
        String url = "/api/v1.0/standard_center/dict";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("dict", dict);
        String result = HttpClientUtil.doPost(host + url, params, username, password);
        return result;
    }
    @RequestMapping(value="/getDictCodeValues")
    @ResponseBody
    public String getDictCodeValues(String stdVersion, String q, String initDictNm, String order, Integer rows) throws Exception {
        Map<String,String> condition = new HashMap<String,String>();
        if (StringUtil.isEmpty(initDictNm)) {
            initDictNm = "";
        }
        if(StringUtil.isEmpty(q)){
            condition.put("name", initDictNm);
        }else{
            condition.put("name", q);
        }
        JSONObject jsonpObject = JSONObject.fromObject(condition);
        String url = "/api/v1.0/standard_center/dicts/selectList";
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("stdVersion", stdVersion);
        params.put("condition", jsonpObject.toString());
        params.put("order", order);
        params.put("limit", rows);
        params.put("offset", 0);
        String resultStr = HttpClientUtil.doGet(host+url,params,username,password);
        List<Select2> detailModelList = jsonArrayToList(resultStr, Select2.class);
        Result result = getResult(detailModelList, detailModelList.size(), 1, rows);
        return result.toJson();
    }
}

+ 0 - 0
EHR-resource/src/main/java/com/yihu/ehr/standard/controller/StdDictEntryController.java


部分文件因为文件数量过多而无法显示