├── .gitignore ├── PHDC ├── UOClient │ ├── .gitignore │ ├── .idea │ │ ├── caches │ │ │ └── build_file_checksums.ser │ │ ├── codeStyles │ │ │ └── Project.xml │ │ ├── compiler.xml │ │ ├── encodings.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ ├── runConfigurations.xml │ │ └── vcs.xml │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── libs │ │ │ └── fabric-sdk-java-1.3.0-SNAPSHOT.jar │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── mycat │ │ │ │ └── uoclient │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ │ ├── bootstrap-4.0.0-dist │ │ │ │ │ ├── css │ │ │ │ │ │ ├── bootstrap-grid.css │ │ │ │ │ │ ├── bootstrap-grid.css.map │ │ │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ │ │ ├── bootstrap-grid.min.css.map │ │ │ │ │ │ ├── bootstrap-reboot.css │ │ │ │ │ │ ├── bootstrap-reboot.css.map │ │ │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ │ │ │ ├── bootstrap.css │ │ │ │ │ │ ├── bootstrap.css.map │ │ │ │ │ │ ├── bootstrap.min.css │ │ │ │ │ │ └── bootstrap.min.css.map │ │ │ │ │ └── js │ │ │ │ │ │ ├── bootstrap.bundle.js │ │ │ │ │ │ ├── bootstrap.bundle.js.map │ │ │ │ │ │ ├── bootstrap.bundle.min.js │ │ │ │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ │ │ │ ├── bootstrap.js │ │ │ │ │ │ ├── bootstrap.js.map │ │ │ │ │ │ ├── bootstrap.min.js │ │ │ │ │ │ └── bootstrap.min.js.map │ │ │ │ ├── connection-profile-standard.yaml │ │ │ │ ├── js │ │ │ │ │ └── jquery-3.1.1.js │ │ │ │ ├── views │ │ │ │ └── web.html │ │ │ ├── java │ │ │ │ ├── io │ │ │ │ │ └── mycat │ │ │ │ │ │ └── uoclient │ │ │ │ │ │ └── MainActivity.java │ │ │ │ └── utils │ │ │ │ │ ├── ChaincodeExecutor.java │ │ │ │ │ ├── FabricUser.java │ │ │ │ │ ├── SampleOrg.java │ │ │ │ │ ├── SampleStore.java │ │ │ │ │ ├── SampleUser.java │ │ │ │ │ └── TestConfig.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── mycat │ │ │ └── uoclient │ │ │ └── ExampleUnitTest.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── chaincode │ ├── drcc │ │ ├── cmd │ │ │ └── main.go │ │ ├── drc.go │ │ └── drc_test.go │ ├── hdcc │ │ ├── cmd │ │ │ └── main.go │ │ ├── hdc.go │ │ └── hdc_test.go │ └── uicc │ │ ├── cmd │ │ └── main.go │ │ ├── uic.go │ │ └── uic_test.go ├── java │ ├── .idea │ │ ├── .name │ │ ├── compiler.xml │ │ ├── dictionaries │ │ │ └── Fanfan.xml │ │ ├── encodings.xml │ │ ├── inspectionProfiles │ │ │ └── Project_Default.xml │ │ ├── misc.xml │ │ └── workspace.xml │ ├── Readme.md │ ├── logs │ │ ├── console.2018-09-02.log │ │ ├── console.log │ │ ├── database.log │ │ └── system.log │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── mycat │ │ │ │ │ └── fabric │ │ │ │ │ └── phdc │ │ │ │ │ ├── PHDCApplication.java │ │ │ │ │ ├── bass │ │ │ │ │ ├── ChainCodeManager.java │ │ │ │ │ ├── ChaincodeExecutor.java │ │ │ │ │ ├── DRCChainCodeManager.java │ │ │ │ │ ├── FabricUser.java │ │ │ │ │ ├── HDCChainCodeManager.java │ │ │ │ │ └── dto │ │ │ │ │ │ ├── BaseResp.java │ │ │ │ │ │ └── InviteRespDto.java │ │ │ │ │ ├── business │ │ │ │ │ ├── ClientBusiness.java │ │ │ │ │ ├── InvitationBusiness.java │ │ │ │ │ └── ReserveBusiness.java │ │ │ │ │ ├── ctrl │ │ │ │ │ ├── ClientController.java │ │ │ │ │ ├── InstitutionController.java │ │ │ │ │ ├── MemberController.java │ │ │ │ │ └── config │ │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ │ ├── MyWebMvcConfig.java │ │ │ │ │ │ ├── ResponseCode.java │ │ │ │ │ │ ├── ResponseContent.java │ │ │ │ │ │ └── SpringContext.java │ │ │ │ │ ├── dao │ │ │ │ │ └── mapper │ │ │ │ │ │ ├── InstitutionDepartMapper.java │ │ │ │ │ │ ├── InstitutionDictionaryMapper.java │ │ │ │ │ │ ├── InstitutionMapper.java │ │ │ │ │ │ ├── MemberInvitationMapper.java │ │ │ │ │ │ ├── MemberMapper.java │ │ │ │ │ │ ├── ReportMapper.java │ │ │ │ │ │ ├── ReserveMapper.java │ │ │ │ │ │ └── ResultMapper.java │ │ │ │ │ ├── dto │ │ │ │ │ ├── MemberInstResultDto.java │ │ │ │ │ ├── MemberInvitationDetail.java │ │ │ │ │ ├── MemberInvitationDetailItem.java │ │ │ │ │ ├── MemberInvitationDto.java │ │ │ │ │ ├── MemberReserveDto.java │ │ │ │ │ ├── ReserveDetailDto.java │ │ │ │ │ └── ReserveExamResultDetail.java │ │ │ │ │ ├── entity │ │ │ │ │ ├── Institution.java │ │ │ │ │ ├── InstitutionDepart.java │ │ │ │ │ ├── InstitutionDictionary.java │ │ │ │ │ ├── Member.java │ │ │ │ │ ├── MemberInvitation.java │ │ │ │ │ ├── Report.java │ │ │ │ │ ├── Reserve.java │ │ │ │ │ └── Result.java │ │ │ │ │ ├── enums │ │ │ │ │ ├── InvitationStatus.java │ │ │ │ │ ├── ReserveStatus.java │ │ │ │ │ └── ResultStatus.java │ │ │ │ │ ├── exception │ │ │ │ │ └── BuzException.java │ │ │ │ │ ├── service │ │ │ │ │ ├── BaseService.java │ │ │ │ │ ├── InstitutionDepartService.java │ │ │ │ │ ├── InstitutionDictionaryService.java │ │ │ │ │ ├── InstitutionService.java │ │ │ │ │ ├── MemberInvitationService.java │ │ │ │ │ ├── MemberService.java │ │ │ │ │ ├── ReportService.java │ │ │ │ │ ├── ReserveService.java │ │ │ │ │ └── ResultService.java │ │ │ │ │ ├── util │ │ │ │ │ ├── DateStyle.java │ │ │ │ │ ├── DateUtil.java │ │ │ │ │ └── UserElementUtil.java │ │ │ │ │ └── vo │ │ │ │ │ └── InvitationDataVo.java │ │ │ └── resources │ │ │ │ ├── application.yml │ │ │ │ ├── config │ │ │ │ └── mapper │ │ │ │ │ ├── InstitutionDepartMapper.xml │ │ │ │ │ ├── InstitutionDictionaryMapper.xml │ │ │ │ │ ├── InstitutionMapper.xml │ │ │ │ │ ├── MemberInvitationMapper.xml │ │ │ │ │ ├── MemberMapper.xml │ │ │ │ │ ├── ReportMapper.xml │ │ │ │ │ ├── ReserveMapper.xml │ │ │ │ │ └── ResultMapper.xml │ │ │ │ ├── fabric-config │ │ │ │ ├── connection-profile-standard.yaml │ │ │ │ ├── duo-profile-standard.yaml │ │ │ │ └── houser-profile-standard.yaml │ │ │ │ └── logback.xml │ │ └── test │ │ │ ├── java │ │ │ └── io │ │ │ │ └── mycat │ │ │ │ └── fabric │ │ │ │ └── phdc │ │ │ │ └── test │ │ │ │ ├── bass │ │ │ │ └── ChainCodeManagerTest.java │ │ │ │ └── dao │ │ │ │ ├── MybatisGenerator.java │ │ │ │ └── ReserveManagerTest.java │ │ │ └── resources │ │ │ ├── generatorConfig.xml │ │ │ └── mybatis-generator.xml │ └── target │ │ ├── classes │ │ ├── application.yml │ │ ├── config │ │ │ └── mapper │ │ │ │ ├── InstitutionDepartMapper.xml │ │ │ │ ├── InstitutionDictionaryMapper.xml │ │ │ │ ├── InstitutionMapper.xml │ │ │ │ ├── MemberInvitationMapper.xml │ │ │ │ ├── MemberMapper.xml │ │ │ │ ├── ReportMapper.xml │ │ │ │ ├── ReserveMapper.xml │ │ │ │ └── ResultMapper.xml │ │ ├── fabric-config │ │ │ ├── connection-profile-standard.yaml │ │ │ ├── duo-profile-standard.yaml │ │ │ └── houser-profile-standard.yaml │ │ ├── io │ │ │ └── mycat │ │ │ │ └── fabric │ │ │ │ └── phdc │ │ │ │ ├── PHDCApplication.class │ │ │ │ ├── bass │ │ │ │ ├── ChainCodeManager.class │ │ │ │ ├── ChaincodeExecutor.class │ │ │ │ ├── DRCChainCodeManager.class │ │ │ │ ├── FabricUser.class │ │ │ │ ├── HDCChainCodeManager.class │ │ │ │ └── dto │ │ │ │ │ ├── BaseResp.class │ │ │ │ │ └── InviteRespDto.class │ │ │ │ ├── business │ │ │ │ ├── ClientBusiness.class │ │ │ │ ├── InvitationBusiness.class │ │ │ │ └── ReserveBusiness.class │ │ │ │ ├── ctrl │ │ │ │ ├── ClientController.class │ │ │ │ ├── InstitutionController.class │ │ │ │ ├── MemberController.class │ │ │ │ └── config │ │ │ │ │ ├── GlobalExceptionHandler.class │ │ │ │ │ ├── MyWebMvcConfig.class │ │ │ │ │ ├── ResponseCode.class │ │ │ │ │ ├── ResponseContent.class │ │ │ │ │ └── SpringContext.class │ │ │ │ ├── dao │ │ │ │ └── mapper │ │ │ │ │ ├── InstitutionDepartMapper.class │ │ │ │ │ ├── InstitutionDictionaryMapper.class │ │ │ │ │ ├── InstitutionMapper.class │ │ │ │ │ ├── MemberInvitationMapper.class │ │ │ │ │ ├── MemberMapper.class │ │ │ │ │ ├── ReportMapper.class │ │ │ │ │ ├── ReserveMapper.class │ │ │ │ │ └── ResultMapper.class │ │ │ │ ├── dto │ │ │ │ ├── MemberInstResultDto.class │ │ │ │ ├── MemberInvitationDetail.class │ │ │ │ ├── MemberInvitationDetailItem.class │ │ │ │ ├── MemberInvitationDto.class │ │ │ │ ├── MemberReserveDto.class │ │ │ │ ├── ReserveDetailDto.class │ │ │ │ └── ReserveExamResultDetail.class │ │ │ │ ├── entity │ │ │ │ ├── Institution.class │ │ │ │ ├── InstitutionDepart.class │ │ │ │ ├── InstitutionDictionary.class │ │ │ │ ├── Member.class │ │ │ │ ├── MemberInvitation.class │ │ │ │ ├── Report.class │ │ │ │ ├── Reserve.class │ │ │ │ └── Result.class │ │ │ │ ├── enums │ │ │ │ ├── InvitationStatus.class │ │ │ │ ├── ReserveStatus.class │ │ │ │ └── ResultStatus.class │ │ │ │ ├── exception │ │ │ │ └── BuzException.class │ │ │ │ ├── service │ │ │ │ ├── BaseService.class │ │ │ │ ├── InstitutionDepartService.class │ │ │ │ ├── InstitutionDictionaryService.class │ │ │ │ ├── InstitutionService.class │ │ │ │ ├── MemberInvitationService.class │ │ │ │ ├── MemberService.class │ │ │ │ ├── ReportService.class │ │ │ │ ├── ReserveService.class │ │ │ │ └── ResultService.class │ │ │ │ ├── util │ │ │ │ ├── DateStyle.class │ │ │ │ ├── DateUtil.class │ │ │ │ └── UserElementUtil.class │ │ │ │ └── vo │ │ │ │ └── InvitationDataVo.class │ │ └── logback.xml │ │ └── test-classes │ │ ├── generatorConfig.xml │ │ ├── io │ │ └── mycat │ │ │ └── fabric │ │ │ └── phdc │ │ │ └── test │ │ │ ├── bass │ │ │ └── ChainCodeManagerTest.class │ │ │ └── dao │ │ │ ├── MybatisGenerator$1.class │ │ │ ├── MybatisGenerator.class │ │ │ └── ReserveManagerTest.class │ │ └── mybatis-generator.xml ├── pages │ ├── bootstrap-4.0.0-dist │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ ├── js │ │ └── jquery-3.1.1.js │ └── views │ │ ├── duo │ │ ├── userDetail.html │ │ └── userList.html │ │ ├── ho │ │ ├── appointmentList.html │ │ ├── dataList.html │ │ ├── index.html │ │ ├── userItem.html │ │ └── userList.html │ │ └── uo │ │ ├── duoApplyList.html │ │ ├── hoList.html │ │ ├── index.html │ │ └── userDataList.html ├── phdc_20180904.sql ├── uoclient.apk ├── 应用操作文档-业务场景类-Mycat黄埔军团.docx ├── 阿里云天池区块链决赛演讲稿-Mycat黄埔军团.pdf └── 阿里云天池区块链决赛演讲稿-Mycat黄埔军团的En.pdf ├── README.md ├── docker ├── README.md ├── config │ ├── configtx.yaml │ └── crypto-config.yaml └── docker-host.txt └── supersync ├── config.properties ├── fabric.ks ├── org1-user ├── admincerts │ └── Admin@org1.example.com-cert.pem └── keystore │ └── key.pem ├── pom.xml ├── src └── main │ ├── java │ └── io │ │ └── bestcloud │ │ ├── ledger │ │ ├── LedgerClient.java │ │ ├── LedgerUtil.java │ │ ├── SampleOrg.java │ │ ├── SampleStore.java │ │ ├── SampleUser.java │ │ └── TestMyChainCode.java │ │ └── supersyn │ │ ├── DataSyLogRec.java │ │ ├── DataSynLogRecorder.java │ │ ├── DataSynProcess.java │ │ ├── DemoSynProcessor.java │ │ ├── SuperSynStarter.java │ │ └── SynDataOmitter.java │ └── resources │ ├── conf.properties │ └── log4j.properties └── txlogs └── txlog.data /.gitignore: -------------------------------------------------------------------------------- 1 | /java-project/.project 2 | /java-project/.settings 3 | /java-project/target 4 | /java-project/.classpath 5 | -------------------------------------------------------------------------------- /PHDC/UOClient/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /PHDC/UOClient/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | defaultConfig { 6 | applicationId "io.mycat.uoclient" 7 | minSdkVersion 26 8 | targetSdkVersion 26 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | multiDexEnabled true //important 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | compileOptions { 21 | sourceCompatibility JavaVersion.VERSION_1_8 22 | targetCompatibility JavaVersion.VERSION_1_8 23 | } 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | implementation 'com.android.support.constraint:constraint-layout:1.1.2' 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 31 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 32 | // implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.6.0' 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/libs/fabric-sdk-java-1.3.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/libs/fabric-sdk-java-1.3.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /PHDC/UOClient/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -dontwarn 23 | 24 | -keepattributes Signature 25 | -keepattributes SetJavaScriptEnabled 26 | -keepattributes JavascriptInterface 27 | -keepattributes InlinedApi 28 | -keepattributes SourceFile,LineNumberTable 29 | -keepattributes *Annotation* 30 | 31 | -keepclassmembers class * { 32 | @android.webkit.JavascriptInterface ; 33 | } 34 | -keepclassmembers class * { 35 | @android.webkit.JavascriptInterface ; 36 | } 37 | -keepclassmembers class **.*MainActivity { 38 | *; 39 | } 40 | -keepclassmembers class **.*$JavaScriptInterface { 41 | *; 42 | } 43 | 44 | -keep public class **.*MainActivity 45 | -keep public class **.*$JavaScriptInterface -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/androidTest/java/io/mycat/uoclient/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package io.mycat.uoclient; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("io.mycat.uoclient", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/assets/bootstrap-4.0.0-dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/assets/views: -------------------------------------------------------------------------------- 1 | /Users/Fanfan/workshop/Github/kaiz/PersonalHealthDataChain/pages/views -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/assets/web.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/assets/web.html -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/java/utils/FabricUser.java: -------------------------------------------------------------------------------- 1 | package utils; 2 | 3 | import org.hyperledger.fabric.sdk.Enrollment; 4 | import org.hyperledger.fabric.sdk.User; 5 | 6 | import java.util.Set; 7 | 8 | public class FabricUser implements User { 9 | 10 | private String name; 11 | private String organization; 12 | private String mspId; 13 | private String account; 14 | private Set roles; 15 | Enrollment enrollment; 16 | private String affiliation; 17 | 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | public String getOrganization() { 24 | return organization; 25 | } 26 | 27 | public void setOrganization(String organization) { 28 | this.organization = organization; 29 | } 30 | 31 | public void setMspId(String mspId) { 32 | this.mspId = mspId; 33 | } 34 | 35 | public void setEnrollment(Enrollment enrollment) { 36 | this.enrollment = enrollment; 37 | } 38 | 39 | public String getName() { 40 | return this.name; 41 | } 42 | 43 | public void setRoles(Set roles) { 44 | this.roles = roles; 45 | } 46 | 47 | public Set getRoles() { 48 | return this.roles; 49 | } 50 | 51 | public String getAccount() { 52 | return this.account; 53 | } 54 | 55 | public void setAccount(String account) { 56 | this.account = account; 57 | } 58 | 59 | public String getAffiliation() { 60 | return this.affiliation; 61 | } 62 | 63 | public Enrollment getEnrollment() { 64 | return this.enrollment; 65 | } 66 | 67 | public void setAffiliation(String affiliation) { 68 | this.affiliation = affiliation; 69 | } 70 | 71 | public String getMspId() { 72 | return this.mspId; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/java/utils/SampleOrg.java: -------------------------------------------------------------------------------- 1 | package utils; 2 | 3 | import org.hyperledger.fabric.sdk.User; 4 | 5 | import java.util.Collections; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.Properties; 9 | import java.util.Set; 10 | 11 | 12 | public class SampleOrg { 13 | 14 | final String name; 15 | final String mspid; 16 | private String domainName; 17 | private String caLocation; 18 | private String caName; 19 | private SampleUser admin; 20 | private SampleUser peerAdmin; 21 | 22 | Map userMap = new HashMap<>(); 23 | Map peerLocations = new HashMap<>(); 24 | Map ordererLocations = new HashMap<>(); 25 | Map eventHubLocations = new HashMap<>(); 26 | 27 | private Properties caProperties = null; 28 | 29 | public SampleOrg(String name, String mspid) { 30 | this.name = name; 31 | this.mspid = mspid; 32 | } 33 | 34 | public void addPeerLocation(String name, String location) { 35 | 36 | peerLocations.put(name, location); 37 | } 38 | 39 | public void setDomainName(String domainName) { 40 | this.domainName = domainName; 41 | } 42 | public String getDomainName() { 43 | return this.domainName; 44 | } 45 | public void addOrdererLocation(String name, String location) { 46 | 47 | ordererLocations.put(name, location); 48 | } 49 | 50 | public void addEventHubLocation(String name, String location) { 51 | 52 | eventHubLocations.put(name, location); 53 | } 54 | 55 | public void setCALocation(String caLocation) { 56 | this.caLocation = caLocation; 57 | } 58 | 59 | public void setCAName(String caName) { 60 | this.caName = caName; 61 | } 62 | 63 | public void setCAProperties(Properties caProperties) { 64 | this.caProperties = caProperties; 65 | } 66 | 67 | public String getCALocation() { 68 | return this.caLocation; 69 | } 70 | 71 | public Properties getCAProperties() { 72 | return this.caProperties; 73 | } 74 | public void addUser(SampleUser user) { 75 | this.userMap.put(user.getName(), user); 76 | } 77 | 78 | public User getUser(String name) { 79 | return this.userMap.get(name); 80 | } 81 | 82 | public SampleUser getAdmin() { 83 | return this.admin; 84 | } 85 | 86 | public void setAdmin(SampleUser admin) { 87 | this.admin = admin; 88 | } 89 | public String getMSPID() { 90 | return this.mspid; 91 | } 92 | 93 | public SampleUser getPeerAdmin() { 94 | System.out.println("Getting peer admin for "+this.mspid+ " with name: "+peerAdmin.getMspId()); 95 | return this.peerAdmin; 96 | } 97 | 98 | public void setPeerAdmin(SampleUser peerAdmin) { 99 | 100 | System.out.println("Setting peer admin for "+this.mspid+ " with name: "+peerAdmin.getMspId()); 101 | this.peerAdmin = peerAdmin; 102 | } 103 | 104 | public String getName() { 105 | return name; 106 | } 107 | 108 | public Set getOrdererNames() { 109 | 110 | return Collections.unmodifiableSet(ordererLocations.keySet()); 111 | } 112 | 113 | public String getOrdererLocation(String name) { 114 | return ordererLocations.get(name); 115 | 116 | } 117 | 118 | public Set getPeerNames() { 119 | 120 | return Collections.unmodifiableSet(peerLocations.keySet()); 121 | } 122 | public String getPeerLocation(String name) { 123 | return peerLocations.get(name); 124 | 125 | } 126 | 127 | } -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PHDC客户端 3 | 4 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /PHDC/UOClient/app/src/test/java/io/mycat/uoclient/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package io.mycat.uoclient; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /PHDC/UOClient/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.1.4' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /PHDC/UOClient/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | -------------------------------------------------------------------------------- /PHDC/UOClient/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/UOClient/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /PHDC/UOClient/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 22 11:32:51 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /PHDC/UOClient/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /PHDC/UOClient/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /PHDC/chaincode/drcc/cmd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "phdc/drcc" 6 | 7 | "github.com/hyperledger/fabric/core/chaincode/shim" 8 | ) 9 | 10 | func main() { 11 | err := shim.Start(new(drcc.DRCChaincode)) 12 | if err != nil { 13 | fmt.Printf("Error starting Simple chaincode: %s", err) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /PHDC/chaincode/hdcc/cmd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "phdc/hdcc" 6 | 7 | "github.com/hyperledger/fabric/core/chaincode/shim" 8 | ) 9 | 10 | func main() { 11 | err := shim.Start(new(hdcc.HDCChaincode)) 12 | if err != nil { 13 | fmt.Printf("Error starting Simple chaincode: %s", err) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /PHDC/chaincode/hdcc/hdc.go: -------------------------------------------------------------------------------- 1 | package hdcc 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "time" 7 | 8 | "github.com/hyperledger/fabric/core/chaincode/shim" 9 | pb "github.com/hyperledger/fabric/protos/peer" 10 | ) 11 | 12 | // HDCChaincode example simple Chaincode implementation 13 | type HDCChaincode struct { 14 | } 15 | 16 | // HealthData implementation 17 | type HealthData struct { 18 | UserID string 19 | DepartID string 20 | ItemID string 21 | Result string 22 | Doctor string 23 | } 24 | 25 | // InputArgs implementation 26 | type InputArgs struct { 27 | DepartID string 28 | ItemID string 29 | Date string 30 | } 31 | 32 | func (t *HDCChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { 33 | fmt.Println("ex02 Init") 34 | 35 | stub.PutState("departs_info", []byte("[{\"DepartName\":\"血糖\", \"DepartID\":\"2345\"}, {\"DepartName\":\"血脂\", \"DepartID\":\"2347\"}, {\"DepartName\":\"血压\", \"DepartID\":\"2349\"}]")) 36 | 37 | return shim.Success(nil) 38 | } 39 | 40 | func (t *HDCChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { 41 | fmt.Println("hdcc Invoke") 42 | function, args := stub.GetFunctionAndParameters() 43 | if function == "getDeparts" { 44 | return t.getDeparts(stub, args) 45 | } else if function == "putData" { 46 | return t.putData(stub, args) 47 | } else if function == "getData" { 48 | return t.getData(stub, args) 49 | } 50 | 51 | return shim.Error("Invalid invoke function name. Expecting \"getDeparts\" \"putData\" \"getData\"") 52 | } 53 | 54 | func (t *HDCChaincode) getDeparts(stub shim.ChaincodeStubInterface, args []string) pb.Response { 55 | var err error 56 | var ret string 57 | //{"sex":"1", "age":"30"} //性别1男2女 58 | 59 | Avalbytes, err := stub.GetState("departs_info") 60 | if err != nil { 61 | return shim.Error(err.Error()) 62 | } 63 | 64 | ret = "{\"Ret\":\"ok\", \"Data\":" + string(Avalbytes[:]) + "}" 65 | 66 | return shim.Success([]byte(ret)) 67 | } 68 | 69 | func (t *HDCChaincode) putData(stub shim.ChaincodeStubInterface, args []string) pb.Response { 70 | //{"userID":"4567", "departID":"1234", "itemID":"2345", "result":"3456", "doctor":"某某"} 71 | fmt.Println("put data : ", string(args[0])) 72 | var err error 73 | hd := &HealthData{} 74 | err = json.Unmarshal([]byte(args[0]), &hd) 75 | if err != nil { 76 | return shim.Error(err.Error()) 77 | } 78 | 79 | key, err := stub.CreateCompositeKey("hd", []string{hd.UserID, hd.ItemID, time.Now().Format("2006/01/02")}) 80 | if err != nil { 81 | return shim.Error(err.Error()) 82 | } 83 | 84 | val, err := json.Marshal(hd) 85 | if err != nil { 86 | return shim.Error(err.Error()) 87 | } 88 | err = stub.PutState(key, val) 89 | if err != nil { 90 | return shim.Error(err.Error()) 91 | } 92 | 93 | return shim.Success([]byte("{\"Ret\":\"ok\"}")) 94 | } 95 | 96 | func (t *HDCChaincode) getData(stub shim.ChaincodeStubInterface, args []string) pb.Response { 97 | //{"departID":"1234", "itemID":"2345", "date":"2018/08/31"} 98 | var err error 99 | input := &InputArgs{} 100 | err = json.Unmarshal([]byte(args[0]), &input) 101 | if err != nil { 102 | fmt.Println() 103 | return shim.Error("json.Unmarshal " + err.Error()) 104 | } 105 | 106 | //todo : get uid from abac 107 | uid := "4567" 108 | 109 | iter, err := stub.GetStateByPartialCompositeKey("hd", []string{uid, input.ItemID, input.Date}) 110 | if err != nil { 111 | return shim.Error("stub.GetStateByPartialCompositeKey " + err.Error()) 112 | } 113 | defer iter.Close() 114 | 115 | var result string 116 | for iter.HasNext() { 117 | val, err := iter.Next() 118 | if err != nil { 119 | return shim.Error("iter.Next " + err.Error()) 120 | } 121 | hd := &HealthData{} 122 | err = json.Unmarshal(val.GetValue(), &hd) 123 | if err != nil { 124 | return shim.Error("json.Unmarshal2 " + err.Error()) 125 | } 126 | result = hd.Result 127 | break 128 | } 129 | 130 | // if result == "" { 131 | // //return shim.Error("No valid value found!") 132 | // result = "" 133 | // } 134 | 135 | // result = strings.Replace(result, "\"", "\\\"", -1) 136 | 137 | return shim.Success([]byte("{\"Ret\":\"ok\", \"Result\":\"" + result + "\"}")) 138 | } 139 | -------------------------------------------------------------------------------- /PHDC/chaincode/hdcc/hdc_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | package hdcc 8 | 9 | import ( 10 | "encoding/json" 11 | "fmt" 12 | "testing" 13 | "time" 14 | 15 | "github.com/hyperledger/fabric/core/chaincode/shim" 16 | ) 17 | 18 | func checkInit(t *testing.T, stub *shim.MockStub, args [][]byte) { 19 | res := stub.MockInit("1", args) 20 | if res.Status != shim.OK { 21 | fmt.Println("Init failed", string(res.Message)) 22 | t.FailNow() 23 | } 24 | } 25 | 26 | func checkState(t *testing.T, stub *shim.MockStub, name string, value string) { 27 | bytes, err := stub.GetState(name) 28 | if err != nil { 29 | fmt.Println("State", err.Error()) 30 | t.FailNow() 31 | } 32 | if bytes == nil { 33 | fmt.Println("State", name, "failed to get value") 34 | t.FailNow() 35 | } 36 | if string(bytes) != value { 37 | fmt.Println("State value", name, "was not", value, "as expected") 38 | t.FailNow() 39 | } 40 | } 41 | 42 | func checkQuery(t *testing.T, stub *shim.MockStub, name string, value string) { 43 | res := stub.MockInvoke("1", [][]byte{[]byte("getData"), []byte(name)}) 44 | if res.Status != shim.OK { 45 | fmt.Println("Query", name, "failed", string(res.Message)) 46 | t.FailNow() 47 | } 48 | if res.Payload == nil { 49 | fmt.Println("Query", name, "failed to get value") 50 | t.FailNow() 51 | } 52 | if string(res.Payload) != value { 53 | fmt.Println("Query value", string(res.Payload), "was not", value, "as expected") 54 | t.FailNow() 55 | } 56 | } 57 | 58 | func checkInvoke(t *testing.T, stub *shim.MockStub, args [][]byte) { 59 | res := stub.MockInvoke("1", args) 60 | if res.Status != shim.OK { 61 | fmt.Println("Invoke", args, "failed", string(res.Message)) 62 | t.FailNow() 63 | } 64 | } 65 | 66 | func TestExample02_Invoke(t *testing.T) { 67 | scc := new(HDCChaincode) 68 | stub := shim.NewMockStub("ex02", scc) 69 | 70 | // Init A=567 B=678 71 | checkInit(t, stub, [][]byte{[]byte("init")}) 72 | 73 | testVal := HealthData{ 74 | UserID: "4567", 75 | DepartID: "2345", 76 | ItemID: "2345", 77 | Result: "3456", 78 | Doctor: "某某", 79 | } 80 | b, err := json.Marshal(testVal) 81 | if err != nil { 82 | fmt.Println("json.Marshal ", err.Error()) 83 | t.FailNow() 84 | } 85 | checkInvoke(t, stub, [][]byte{[]byte("putData"), b}) 86 | key, err := stub.CreateCompositeKey("hd", []string{testVal.UserID, testVal.ItemID, time.Now().Format("2006/01/02")}) 87 | if err != nil { 88 | fmt.Println("CreateCompositeKey ", err.Error()) 89 | t.FailNow() 90 | } 91 | checkState(t, stub, key, string(b)) 92 | 93 | date := time.Now().Format("2006/01/02") 94 | input := InputArgs{ 95 | DepartID: "1234", 96 | ItemID: "2345", 97 | Date: date, 98 | } 99 | b, err = json.Marshal(input) 100 | if err != nil { 101 | fmt.Println("json.Marshal ", err.Error()) 102 | t.FailNow() 103 | } 104 | fmt.Println(string(b)) 105 | checkQuery(t, stub, string(b), "{\"Ret\":\"ok\", \"Result\":\"3456\"}") 106 | } 107 | -------------------------------------------------------------------------------- /PHDC/chaincode/uicc/cmd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "phdc/uicc" 6 | 7 | "github.com/hyperledger/fabric/core/chaincode/shim" 8 | ) 9 | 10 | func main() { 11 | err := shim.Start(new(uicc.UICChaincode)) 12 | if err != nil { 13 | fmt.Printf("Error starting Simple chaincode: %s", err) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /PHDC/java/.idea/.name: -------------------------------------------------------------------------------- 1 | PHDC -------------------------------------------------------------------------------- /PHDC/java/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PHDC/java/.idea/dictionaries/Fanfan.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /PHDC/java/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PHDC/java/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /PHDC/java/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /PHDC/java/logs/database.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/logs/database.log -------------------------------------------------------------------------------- /PHDC/java/logs/system.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/logs/system.log -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/PHDCApplication.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | import tk.mybatis.spring.annotation.MapperScan; 7 | 8 | @SpringBootApplication 9 | @MapperScan("io.mycat.fabric.phdc") 10 | public class PHDCApplication { 11 | public static void main(String[] args) { 12 | SpringApplication.run(PHDCApplication.class, args); 13 | } 14 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/bass/ChainCodeManager.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.bass; 2 | 3 | import java.net.MalformedURLException; 4 | 5 | import org.hyperledger.fabric.sdk.Channel; 6 | import org.hyperledger.fabric.sdk.Enrollment; 7 | import org.hyperledger.fabric.sdk.HFClient; 8 | import org.hyperledger.fabric.sdk.NetworkConfig; 9 | import org.hyperledger.fabric_ca.sdk.HFCAClient; 10 | import org.hyperledger.fabric_ca.sdk.HFCAInfo; 11 | import org.hyperledger.fabric_ca.sdk.exception.EnrollmentException; 12 | import org.hyperledger.fabric_ca.sdk.exception.InfoException; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | 17 | public abstract class ChainCodeManager { 18 | 19 | protected Logger logger = LoggerFactory.getLogger("ChainCodeManager"); 20 | 21 | /*private static final long waitTime = 6000; 22 | private static String connectionProfilePath; 23 | 24 | private static String UICChannelName = "uic"; 25 | private static String HDCChannelName = "hdc"; 26 | private static String DRCChannelName = "drc"; 27 | private static String userName = "UOUser1"; 28 | private static String secret = "mycat2018"; 29 | private static String UICCName = "uicc"; 30 | private static String HDCCName = "hdcc"; 31 | private static String DRCCName = "drcc"; 32 | private static String chaincodeVersion = "1.0.1"; 33 | Channel uic; 34 | Channel hdc; 35 | Channel drc; 36 | HFClient client; 37 | ChaincodeExecutor uicExecutor; 38 | ChaincodeExecutor hdcExecutor; 39 | ChaincodeExecutor drcExecutor;*/ 40 | 41 | HFClient client; 42 | 43 | protected String channelName; 44 | 45 | protected String userName; 46 | 47 | protected String secret; 48 | 49 | protected String cCName; 50 | 51 | protected String chaincodeVersion = "1.0.1"; 52 | 53 | protected Channel channel; 54 | 55 | protected ChaincodeExecutor chaincodeExecutor; 56 | 57 | protected void lineBreak() { 58 | logger.info("============================================================="); 59 | } 60 | 61 | protected FabricUser getFabricUser(NetworkConfig.OrgInfo clientOrg, NetworkConfig.CAInfo caInfo) 62 | throws MalformedURLException, org.hyperledger.fabric_ca.sdk.exception.InvalidArgumentException, 63 | InfoException, EnrollmentException { 64 | HFCAClient hfcaClient = HFCAClient.createNewInstance(caInfo); 65 | HFCAInfo cainfo = hfcaClient.info(); 66 | lineBreak(); 67 | logger.info("CA name: " + cainfo.getCAName()); 68 | logger.info("CA version: " + cainfo.getVersion()); 69 | 70 | // Persistence is not part of SDK. 71 | 72 | logger.info("Going to enroll user: " + userName); 73 | Enrollment enrollment = hfcaClient.enroll(userName, secret); 74 | logger.info("Enroll user: " + userName + " successfully."); 75 | 76 | FabricUser user = new FabricUser(); 77 | user.setMspId(clientOrg.getMspId()); 78 | user.setName(userName); 79 | user.setOrganization(clientOrg.getName()); 80 | user.setEnrollment(enrollment); 81 | return user; 82 | } 83 | 84 | 85 | 86 | /* 87 | @Bean 88 | public HFClient hfClient() { 89 | File f = ResourceUtils.getFile("classpath:fabric-config/connection-profile-standard.yaml"); 90 | System.out.println(f.exists()); 91 | NetworkConfig networkConfig = NetworkConfig.fromYamlFile(f); 92 | NetworkConfig.OrgInfo clientOrg = networkConfig.getClientOrganization(); 93 | NetworkConfig.CAInfo caInfo = clientOrg.getCertificateAuthorities().get(0); 94 | 95 | FabricUser user = getFabricUser(clientOrg, caInfo); 96 | 97 | HFClient client = HFClient.createNewInstance(); 98 | client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); 99 | client.setUserContext(user); 100 | } 101 | */ 102 | } 103 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/bass/FabricUser.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.bass; 2 | 3 | import java.util.Set; 4 | 5 | import org.hyperledger.fabric.sdk.Enrollment; 6 | import org.hyperledger.fabric.sdk.User; 7 | 8 | public class FabricUser implements User { 9 | 10 | private String name; 11 | private String organization; 12 | private String mspId; 13 | private String account; 14 | private Set roles; 15 | Enrollment enrollment; 16 | private String affiliation; 17 | 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | public String getOrganization() { 24 | return organization; 25 | } 26 | 27 | public void setOrganization(String organization) { 28 | this.organization = organization; 29 | } 30 | 31 | public void setMspId(String mspId) { 32 | this.mspId = mspId; 33 | } 34 | 35 | public void setEnrollment(Enrollment enrollment) { 36 | this.enrollment = enrollment; 37 | } 38 | 39 | public String getName() { 40 | return this.name; 41 | } 42 | 43 | public void setRoles(Set roles) { 44 | this.roles = roles; 45 | } 46 | 47 | public Set getRoles() { 48 | return this.roles; 49 | } 50 | 51 | public String getAccount() { 52 | return this.account; 53 | } 54 | 55 | public void setAccount(String account) { 56 | this.account = account; 57 | } 58 | 59 | public String getAffiliation() { 60 | return this.affiliation; 61 | } 62 | 63 | public Enrollment getEnrollment() { 64 | return this.enrollment; 65 | } 66 | 67 | public void setAffiliation(String affiliation) { 68 | this.affiliation = affiliation; 69 | } 70 | 71 | public String getMspId() { 72 | return this.mspId; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/bass/HDCChainCodeManager.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.bass; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.UnsupportedEncodingException; 6 | import java.lang.reflect.InvocationTargetException; 7 | import java.util.concurrent.ExecutionException; 8 | import java.util.concurrent.TimeoutException; 9 | 10 | import org.hyperledger.fabric.sdk.HFClient; 11 | import org.hyperledger.fabric.sdk.NetworkConfig; 12 | import org.hyperledger.fabric.sdk.exception.CryptoException; 13 | import org.hyperledger.fabric.sdk.exception.NetworkConfigurationException; 14 | import org.hyperledger.fabric.sdk.exception.ProposalException; 15 | import org.hyperledger.fabric.sdk.exception.TransactionException; 16 | import org.hyperledger.fabric.sdk.security.CryptoSuite; 17 | import org.hyperledger.fabric_ca.sdk.exception.EnrollmentException; 18 | import org.hyperledger.fabric_ca.sdk.exception.InfoException; 19 | import org.hyperledger.fabric_ca.sdk.exception.InvalidArgumentException; 20 | import org.springframework.stereotype.Component; 21 | 22 | import com.alibaba.fastjson.JSON; 23 | 24 | import io.mycat.fabric.phdc.bass.dto.BaseResp; 25 | import io.mycat.fabric.phdc.exception.BuzException; 26 | 27 | /** 28 | * 操作HDC CHANNEL 类 29 | * @author xu 30 | */ 31 | @Component("hDCChainCodeManager") 32 | public class HDCChainCodeManager extends ChainCodeManager{ 33 | 34 | 35 | public HDCChainCodeManager() throws InvalidArgumentException, InfoException, EnrollmentException, org.hyperledger.fabric.sdk.exception.InvalidArgumentException, NetworkConfigurationException, IOException, CryptoException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, TransactionException { 36 | //URL url=ChainCodeManager.class.getClassLoader().getResource("houser-profile-standard.yaml"); 37 | InputStream configStream = ChainCodeManager.class.getClassLoader().getResourceAsStream("fabric-config/houser-profile-standard.yaml"); 38 | channelName = "hdc";//暂时写死 39 | userName = "HOUser1"; 40 | secret = "mycat2018"; 41 | cCName = "hdcc"; 42 | NetworkConfig networkConfig = NetworkConfig.fromYamlStream(configStream); 43 | NetworkConfig.OrgInfo clientOrg = networkConfig.getClientOrganization(); 44 | NetworkConfig.CAInfo caInfo = clientOrg.getCertificateAuthorities().get(0); 45 | 46 | FabricUser user = getFabricUser(clientOrg, caInfo); 47 | 48 | client = HFClient.createNewInstance(); 49 | client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); 50 | client.setUserContext(user); 51 | channel = client.loadChannelFromConfig(channelName, networkConfig); 52 | channel.initialize(); 53 | 54 | 55 | } 56 | 57 | /** 58 | * 存储数据 59 | * @return 60 | * @throws BuzException 61 | */ 62 | public BaseResp putData(String... args) throws BuzException { 63 | try { 64 | 65 | chaincodeExecutor = new ChaincodeExecutor(cCName, chaincodeVersion); 66 | String resp = chaincodeExecutor.executeTransaction(client, channel, true, "putData",args); 67 | return JSON.parseObject(resp, BaseResp.class); 68 | } catch (org.hyperledger.fabric.sdk.exception.InvalidArgumentException 69 | | ProposalException | UnsupportedEncodingException | InterruptedException | ExecutionException 70 | | TimeoutException e) { 71 | e.printStackTrace(); 72 | throw new BuzException("获取失败"); 73 | } 74 | } 75 | 76 | 77 | public String testGetHO() throws BuzException { 78 | String resp; 79 | try { 80 | chaincodeExecutor = new ChaincodeExecutor(cCName, chaincodeVersion); 81 | resp = chaincodeExecutor.executeTransaction(client, channel, false, "getDeparts"); 82 | return resp; 83 | } catch (org.hyperledger.fabric.sdk.exception.InvalidArgumentException 84 | | ProposalException | UnsupportedEncodingException | InterruptedException | ExecutionException 85 | | TimeoutException e) { 86 | e.printStackTrace(); 87 | throw new BuzException("获取失败"); 88 | } 89 | 90 | } 91 | 92 | public static void main(String[] args) throws InvalidArgumentException, InfoException, EnrollmentException, org.hyperledger.fabric.sdk.exception.InvalidArgumentException, NetworkConfigurationException, CryptoException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, TransactionException, IOException, ProposalException, InterruptedException, ExecutionException, TimeoutException, BuzException { 93 | HDCChainCodeManager manager =new HDCChainCodeManager(); 94 | System.out.println(manager.testGetHO()); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/bass/dto/BaseResp.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.bass.dto; 2 | 3 | /** 4 | * 操作chaincode响应的数据 5 | * @author xu 6 | * 7 | */ 8 | public class BaseResp { 9 | 10 | protected String Ret; 11 | 12 | public String getRet() { 13 | return Ret; 14 | } 15 | 16 | public void setRet(String ret) { 17 | Ret = ret; 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/bass/dto/InviteRespDto.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.bass.dto; 2 | 3 | /** 4 | * 邀请申请的响应 5 | * @author xusihan 6 | * @date 2018-08-31 7 | */ 8 | public class InviteRespDto extends BaseResp{ 9 | 10 | private String InviteId; 11 | 12 | 13 | public String getInviteId() { 14 | return InviteId; 15 | } 16 | 17 | public void setInviteId(String inviteId) { 18 | InviteId = inviteId; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/ClientController.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import io.mycat.fabric.phdc.business.ClientBusiness; 14 | import io.mycat.fabric.phdc.ctrl.config.ResponseContent; 15 | import io.mycat.fabric.phdc.dto.MemberInvitationDetail; 16 | import io.mycat.fabric.phdc.dto.MemberInvitationDto; 17 | import io.mycat.fabric.phdc.exception.BuzException; 18 | import io.mycat.fabric.phdc.vo.InvitationDataVo; 19 | 20 | 21 | @RestController 22 | @RequestMapping("client") 23 | public class ClientController { 24 | 25 | @Autowired 26 | ClientBusiness clientBusiness; 27 | 28 | @GetMapping("member/invitation/list") 29 | public ResponseContent memberInvitationList(@RequestParam(required=true) int memberId){ 30 | List result = clientBusiness.getMemberInvitationList(memberId); 31 | return ResponseContent.ok(result); 32 | } 33 | 34 | @GetMapping("member/invitation/detail") 35 | public ResponseContent getMemberInvitationDetail(@RequestParam(required=true) int invitationId) throws BuzException { 36 | MemberInvitationDetail detail = clientBusiness.getMemberInvitationDetail(invitationId); 37 | return ResponseContent.ok(detail); 38 | } 39 | 40 | @PostMapping("member/invitation/result/list") 41 | public ResponseContent saveResultList(@RequestParam(required=true)String invitationCode,@RequestBody(required=true)List invitationDataVo) throws BuzException { 42 | clientBusiness.saveInvitationResult(invitationCode, invitationDataVo); 43 | return ResponseContent.ok(null); 44 | } 45 | 46 | 47 | @PostMapping("member/invitation/access") 48 | public ResponseContent validateInvitation(@RequestParam(required=true) int memberId, 49 | @RequestParam(required=true) String name,@RequestParam(required=true) String mobile, 50 | @RequestParam(required=true) String invitationCode, 51 | @RequestParam(required=true) int patternId 52 | ) throws BuzException { 53 | clientBusiness.invitationAccess(memberId, name, mobile, invitationCode, patternId); 54 | return ResponseContent.ok(null); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/InstitutionController.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import io.mycat.fabric.phdc.business.InvitationBusiness; 13 | import io.mycat.fabric.phdc.business.ReserveBusiness; 14 | import io.mycat.fabric.phdc.ctrl.config.ResponseContent; 15 | import io.mycat.fabric.phdc.dto.MemberInstResultDto; 16 | import io.mycat.fabric.phdc.dto.MemberReserveDto; 17 | import io.mycat.fabric.phdc.dto.ReserveDetailDto; 18 | import io.mycat.fabric.phdc.dto.ReserveExamResultDetail; 19 | import io.mycat.fabric.phdc.exception.BuzException; 20 | 21 | /** 22 | * 23 | * @author xu 24 | * 25 | */ 26 | @RestController 27 | @RequestMapping("institution") 28 | public class InstitutionController { 29 | 30 | @Autowired 31 | ReserveBusiness reserveBusiness; 32 | 33 | @Autowired 34 | InvitationBusiness invitationBusiness; 35 | 36 | /** 37 | * 根据用户ID获取所有预约信息 38 | * @param memberId 39 | * @author xu 40 | * @return 41 | */ 42 | @GetMapping("member/reserve/list") 43 | public ResponseContent getMemberReserveList(@RequestParam(required=true) int institutionId) { 44 | List results = reserveBusiness.getReserveDetailList(institutionId); 45 | return ResponseContent.ok(results); 46 | } 47 | 48 | /** 49 | * 修改用户状态 是否到检 2)已到检 3)未到检', 50 | * @param reserveId 51 | * @param status 52 | * @author xu 53 | * @return 54 | */ 55 | @PostMapping("/member/reserve/status") 56 | public ResponseContent updateReserveStatus(@RequestParam(required=true) int reserveId,@RequestParam(required=true)byte status) { 57 | invitationBusiness.reserveStatus(reserveId, status); 58 | return ResponseContent.ok(null); 59 | } 60 | /** 61 | * 根据机构ID来获取所有该机构下的预约信息 62 | * @param institutionId 63 | * @author xu 64 | * @return 65 | * @throws BuzException 66 | */ 67 | @GetMapping("member/list") 68 | public ResponseContent memberList(@RequestParam(required=true)int institutionId) throws BuzException { 69 | List reserves = invitationBusiness.getInstitutionMemberReserveList(institutionId); 70 | return ResponseContent.ok(reserves); 71 | } 72 | 73 | /** 74 | * 获取该机构下 该用户的所有体检结果数据 75 | * @author xu 76 | * @param institutionId 77 | * @param memberId 78 | * @return 79 | */ 80 | @GetMapping("member/exam/result/list") 81 | public ResponseContent memberResuleList(@RequestParam(required=true)int institutionId, 82 | @RequestParam(required=true) int memberId) { 83 | List result = invitationBusiness.getMemberInstResult(institutionId, memberId); 84 | return ResponseContent.ok(result); 85 | } 86 | 87 | /** 88 | * 获取该机构下的所有体检数据 89 | * @param institutionId 90 | * @return 91 | * @throws BuzException 92 | */ 93 | @GetMapping("member/exam/list") 94 | public ResponseContent memberExamList(@RequestParam(required=true)int institutionId) throws BuzException { 95 | List resultDetails = invitationBusiness.reserveExamResultDetails(institutionId); 96 | return ResponseContent.ok(resultDetails); 97 | } 98 | 99 | /** 100 | * 填写用户数据结论 101 | * @param resultId 102 | * @param resuleSummary 103 | * @param departCheckDoctor 104 | * @return 105 | * @throws BuzException 106 | */ 107 | @PostMapping("member/exam/result") 108 | public ResponseContent memberExamStatus(@RequestParam(required=true) int resultId, 109 | @RequestParam(required=true) String result, 110 | @RequestParam(required=true) String checkDoctor) throws BuzException { 111 | reserveBusiness.memberExamResult(resultId, result,checkDoctor); 112 | return ResponseContent.ok(null); 113 | } 114 | 115 | @PostMapping("member/exam/summary") 116 | public ResponseContent memberExamSummary(@RequestParam(required=true) int resultId, 117 | @RequestParam(required=true) String summary, 118 | @RequestParam(required=true) String departDoctor) throws BuzException { 119 | reserveBusiness.memberExamSummary(resultId, summary,departDoctor); 120 | return ResponseContent.ok(null); 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/MemberController.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.format.annotation.DateTimeFormat; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import io.mycat.fabric.phdc.business.ReserveBusiness; 14 | import io.mycat.fabric.phdc.ctrl.config.ResponseContent; 15 | import io.mycat.fabric.phdc.dto.MemberInstResultDto; 16 | import io.mycat.fabric.phdc.exception.BuzException; 17 | 18 | @RestController 19 | @RequestMapping("member") 20 | public class MemberController { 21 | 22 | @Autowired 23 | ReserveBusiness reserveBusiness; 24 | 25 | /** 26 | * 用户预约 27 | * @param memberId 28 | * @param dictionaryId 29 | * @param institutionId 30 | * @param name 31 | * @param mobile 32 | * @param gender 33 | * @param reserveTime 34 | * @return 35 | */ 36 | @PostMapping("reserve") 37 | public ResponseContent saveMemberReserve( 38 | @RequestParam(required=true) int memberId, 39 | @RequestParam(required = true) int dictionaryId, 40 | @RequestParam(required=true) int institutionId, 41 | @RequestParam(required=true) String name, 42 | @RequestParam(required=true) String mobile, 43 | @RequestParam(required=true) byte gender, 44 | @RequestParam(required=true) @DateTimeFormat(pattern="yyyy/MM/dd") Date reserveTime) { 45 | // 46 | Integer reserveId = reserveBusiness.reserve(memberId, institutionId,dictionaryId, name, mobile, gender, reserveTime); 47 | return ResponseContent.ok(reserveId); 48 | } 49 | 50 | /** 51 | * 到检 52 | * @param reserveId 53 | * @return 54 | * @throws BuzException 55 | */ 56 | @PostMapping("reserve/sign") 57 | public ResponseContent reserveSign(@RequestParam(required=true) int reserveId) throws BuzException { 58 | reserveBusiness.signIn(reserveId); 59 | return ResponseContent.ok(null); 60 | } 61 | 62 | /** 63 | * 体检结果 64 | * @param id 65 | * @return 66 | */ 67 | @GetMapping("reserve/exam/result") 68 | public ResponseContent getReserveExamResultListByReserveId( 69 | @RequestParam(required=true) int id) { 70 | MemberInstResultDto dto = reserveBusiness.getMmeberResultById(id); 71 | return ResponseContent.ok(dto); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/config/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl.config; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.web.bind.annotation.ControllerAdvice; 8 | import org.springframework.web.bind.annotation.ExceptionHandler; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | import org.springframework.web.multipart.MultipartException; 11 | import org.springframework.web.util.NestedServletException; 12 | 13 | import io.mycat.fabric.phdc.exception.BuzException; 14 | 15 | 16 | @ControllerAdvice 17 | public class GlobalExceptionHandler { 18 | 19 | private Logger logger = LoggerFactory.getLogger(getClass()); 20 | 21 | /** 22 | * rest 业务错误处理 23 | * @param request 24 | * @param ex 25 | * @return 26 | */ 27 | @ExceptionHandler({Exception.class}) 28 | @ResponseBody 29 | public ResponseContent handleRestRespErrorException(HttpServletRequest request, Exception ex) { 30 | logger.error("GlobalExceptionHandler 处理错误 => [ex->{}]",ex.getMessage()); 31 | if (ex instanceof NestedServletException) { 32 | NestedServletException nestedServletException = (NestedServletException)ex; 33 | if (nestedServletException.getCause() instanceof OutOfMemoryError) { 34 | return new ResponseContent(ResponseCode.FAILED.getValue(), null,"服务器繁忙"); 35 | } 36 | } 37 | BuzException exception = null; 38 | if (ex instanceof BuzException) { 39 | exception = (BuzException) ex; 40 | return new ResponseContent(exception.getCode(),null,exception.getMessage()); 41 | } 42 | if (ex instanceof MultipartException) { 43 | return new ResponseContent(ResponseCode.FAILED,null); 44 | } 45 | return new ResponseContent(ResponseCode.FAILED, null); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/config/MyWebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 7 | import org.springframework.web.filter.CorsFilter; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 9 | 10 | @Configuration 11 | public class MyWebMvcConfig extends WebMvcConfigurerAdapter { 12 | 13 | private CorsConfiguration buildConfig() { 14 | System.out.println("WebConfig.buildConfig"); 15 | CorsConfiguration corsConfiguration = new CorsConfiguration(); 16 | corsConfiguration.addAllowedOrigin(CorsConfiguration.ALL); 17 | corsConfiguration.addAllowedHeader(CorsConfiguration.ALL); // 2允许所有请求头 18 | corsConfiguration.addAllowedMethod(CorsConfiguration.ALL); // 3 允许所有请求方法 19 | return corsConfiguration; 20 | } 21 | 22 | @Bean 23 | public CorsFilter corsFilter() { 24 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 25 | source.registerCorsConfiguration("/**", buildConfig()); // 4 26 | return new CorsFilter(source); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/config/ResponseCode.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl.config; 2 | 3 | public enum ResponseCode { 4 | OK(1000,"ok"), 5 | TEST(1,"test"), 6 | TOKEN_INVALID(1001,"访问令牌失效,请登录"), 7 | FAILED(500,"请求失败") 8 | ; 9 | 10 | private int value; 11 | 12 | private String msg; 13 | 14 | private ResponseCode(int value, String msg) { 15 | this.value = value; 16 | this.msg = msg; 17 | } 18 | 19 | public int getValue() { 20 | return value; 21 | } 22 | 23 | public void setValue(int value) { 24 | this.value = value; 25 | } 26 | 27 | public String getMsg() { 28 | return msg; 29 | } 30 | 31 | public void setMsg(String msg) { 32 | this.msg = msg; 33 | } 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/config/ResponseContent.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl.config; 2 | 3 | public class ResponseContent { 4 | 5 | /** 6 | * 响应码 7 | */ 8 | private int code; 9 | /** 10 | * 具体数据 11 | */ 12 | private Object data; 13 | /** 14 | * 响应信息 15 | */ 16 | private String message; 17 | 18 | 19 | 20 | public ResponseContent() { 21 | super(); 22 | // TODO Auto-generated constructor stub 23 | } 24 | 25 | public ResponseContent(int code, Object data, String message) { 26 | super(); 27 | this.code = code; 28 | this.data = data; 29 | this.message = message; 30 | } 31 | 32 | public ResponseContent(ResponseCode code, Object data) { 33 | super(); 34 | this.code = code.getValue(); 35 | this.data = data; 36 | this.message = code.getMsg(); 37 | } 38 | 39 | public static ResponseContent ok(Object data) { 40 | ResponseContent responseContent = new ResponseContent(ResponseCode.OK.getValue(), data, ResponseCode.OK.getMsg()); 41 | return responseContent; 42 | } 43 | 44 | public int getCode() { 45 | return code; 46 | } 47 | 48 | public void setCode(int code) { 49 | this.code = code; 50 | } 51 | 52 | public Object getData() { 53 | return data; 54 | } 55 | 56 | public void setData(Object data) { 57 | this.data = data; 58 | } 59 | 60 | public String getMessage() { 61 | return message; 62 | } 63 | 64 | public void setMessage(String message) { 65 | this.message = message; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/ctrl/config/SpringContext.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.ctrl.config; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.beans.factory.NoSuchBeanDefinitionException; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class SpringContext implements ApplicationContextAware { 11 | 12 | private static ApplicationContext applicationContext; 13 | 14 | @Override 15 | public void setApplicationContext(ApplicationContext appContext) 16 | throws BeansException { 17 | applicationContext = appContext; 18 | } 19 | 20 | public static ApplicationContext getApplicationContext() { 21 | return applicationContext; 22 | } 23 | 24 | public static Object getBean(String name) { 25 | return applicationContext.getBean(name); 26 | } 27 | 28 | public static T getBean(String name, Class requiredClass) { 29 | return applicationContext.getBean(name, requiredClass); 30 | } 31 | 32 | public static T getBean(Class requiredClass) { 33 | return applicationContext.getBean(requiredClass); 34 | } 35 | 36 | public static boolean containsBean(String name) { 37 | return applicationContext.containsBean(name); 38 | } 39 | 40 | public static boolean isSingleton(String name) 41 | throws NoSuchBeanDefinitionException { 42 | return applicationContext.isSingleton(name); 43 | } 44 | 45 | public static Class getType(String name) 46 | throws NoSuchBeanDefinitionException { 47 | return applicationContext.getType(name); 48 | } 49 | 50 | public static String[] getAliases(String name) 51 | throws NoSuchBeanDefinitionException { 52 | return applicationContext.getAliases(name); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/InstitutionDepartMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import io.mycat.fabric.phdc.entity.InstitutionDepart; 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | public interface InstitutionDepartMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/InstitutionDictionaryMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import io.mycat.fabric.phdc.entity.InstitutionDictionary; 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | public interface InstitutionDictionaryMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/InstitutionMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import io.mycat.fabric.phdc.entity.Institution; 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | public interface InstitutionMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/MemberInvitationMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import io.mycat.fabric.phdc.entity.MemberInvitation; 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | public interface MemberInvitationMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/MemberMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import io.mycat.fabric.phdc.entity.Member; 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | public interface MemberMapper extends Mapper { 7 | 8 | Integer getLastId(); 9 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/ReportMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import io.mycat.fabric.phdc.entity.Report; 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | public interface ReportMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/ReserveMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import io.mycat.fabric.phdc.entity.Report; 8 | import io.mycat.fabric.phdc.entity.Reserve; 9 | import tk.mybatis.mapper.common.Mapper; 10 | 11 | public interface ReserveMapper extends Mapper { 12 | 13 | void saveInvitationResult(@Param("reports")List reports); 14 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dao/mapper/ResultMapper.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dao.mapper; 2 | 3 | import io.mycat.fabric.phdc.entity.Result; 4 | import tk.mybatis.mapper.common.Mapper; 5 | 6 | public interface ResultMapper extends Mapper { 7 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dto/MemberInstResultDto.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dto; 2 | 3 | import java.util.Date; 4 | 5 | public class MemberInstResultDto { 6 | 7 | private Integer resultId; 8 | 9 | private String dictionaryName; 10 | 11 | private Date checkDate; 12 | 13 | private Integer dictionaryId; 14 | 15 | private Integer departId; 16 | 17 | private String result; 18 | 19 | private String summary; 20 | 21 | private String departName; 22 | 23 | private String departDoctor; 24 | 25 | private String checkDoctor; 26 | 27 | 28 | public Integer getDictionaryId() { 29 | return dictionaryId; 30 | } 31 | 32 | public void setDictionaryId(Integer dictionaryId) { 33 | this.dictionaryId = dictionaryId; 34 | } 35 | 36 | public Integer getDepartId() { 37 | return departId; 38 | } 39 | 40 | public void setDepartId(Integer departId) { 41 | this.departId = departId; 42 | } 43 | 44 | public Date getCheckDate() { 45 | return checkDate; 46 | } 47 | 48 | public void setCheckDate(Date checkDate) { 49 | this.checkDate = checkDate; 50 | } 51 | 52 | public String getDepartName() { 53 | return departName; 54 | } 55 | 56 | public void setDepartName(String departName) { 57 | this.departName = departName; 58 | } 59 | 60 | public Integer getResultId() { 61 | return resultId; 62 | } 63 | 64 | public void setResultId(Integer resultId) { 65 | this.resultId = resultId; 66 | } 67 | 68 | public String getDictionaryName() { 69 | return dictionaryName; 70 | } 71 | 72 | public void setDictionaryName(String dictionaryName) { 73 | this.dictionaryName = dictionaryName; 74 | } 75 | 76 | public String getResult() { 77 | return result; 78 | } 79 | 80 | public void setResult(String result) { 81 | this.result = result; 82 | } 83 | 84 | public String getSummary() { 85 | return summary; 86 | } 87 | 88 | public void setSummary(String summary) { 89 | this.summary = summary; 90 | } 91 | 92 | public String getDepartDoctor() { 93 | return departDoctor; 94 | } 95 | 96 | public void setDepartDoctor(String departDoctor) { 97 | this.departDoctor = departDoctor; 98 | } 99 | 100 | public String getCheckDoctor() { 101 | return checkDoctor; 102 | } 103 | 104 | public void setCheckDoctor(String checkDoctor) { 105 | this.checkDoctor = checkDoctor; 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dto/MemberInvitationDetail.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dto; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | public class MemberInvitationDetail { 7 | 8 | private String name; 9 | 10 | private String mobile; 11 | 12 | private Date invitationTime; 13 | 14 | private List items; 15 | 16 | public Date getInvitationTime() { 17 | return invitationTime; 18 | } 19 | 20 | public void setInvitationTime(Date invitationTime) { 21 | this.invitationTime = invitationTime; 22 | } 23 | 24 | public List getItems() { 25 | return items; 26 | } 27 | 28 | public void setItems(List items) { 29 | this.items = items; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | public String getMobile() { 41 | return mobile; 42 | } 43 | 44 | public void setMobile(String mobile) { 45 | this.mobile = mobile; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dto/MemberInvitationDetailItem.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dto; 2 | 3 | import java.util.Date; 4 | 5 | public class MemberInvitationDetailItem { 6 | 7 | private Integer reportId; 8 | 9 | private String dictionaryName; 10 | 11 | private String result; 12 | 13 | private Date checkDate; 14 | 15 | public Date getCheckDate() { 16 | return checkDate; 17 | } 18 | 19 | public void setCheckDate(Date checkDate) { 20 | this.checkDate = checkDate; 21 | } 22 | 23 | public Integer getReportId() { 24 | return reportId; 25 | } 26 | 27 | public void setReportId(Integer reportId) { 28 | this.reportId = reportId; 29 | } 30 | 31 | public String getDictionaryName() { 32 | return dictionaryName; 33 | } 34 | 35 | public void setDictionaryName(String dictionaryName) { 36 | this.dictionaryName = dictionaryName; 37 | } 38 | 39 | public String getResult() { 40 | return result; 41 | } 42 | 43 | public void setResult(String result) { 44 | this.result = result; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dto/MemberInvitationDto.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dto; 2 | 3 | import java.util.Date; 4 | 5 | public class MemberInvitationDto { 6 | 7 | private Integer invitationId; 8 | 9 | private Integer memberId; 10 | 11 | private Integer invitationMemberId; 12 | 13 | private String name; 14 | 15 | private byte status; 16 | 17 | private Date invitionDate; 18 | 19 | public Integer getInvitationId() { 20 | return invitationId; 21 | } 22 | 23 | public void setInvitationId(Integer invitationId) { 24 | this.invitationId = invitationId; 25 | } 26 | 27 | public Integer getMemberId() { 28 | return memberId; 29 | } 30 | 31 | public void setMemberId(Integer memberId) { 32 | this.memberId = memberId; 33 | } 34 | 35 | public Integer getInvitationMemberId() { 36 | return invitationMemberId; 37 | } 38 | 39 | public void setInvitationMemberId(Integer invitationMemberId) { 40 | this.invitationMemberId = invitationMemberId; 41 | } 42 | 43 | public String getName() { 44 | return name; 45 | } 46 | 47 | public void setName(String name) { 48 | this.name = name; 49 | } 50 | 51 | public byte getStatus() { 52 | return status; 53 | } 54 | 55 | public void setStatus(byte status) { 56 | this.status = status; 57 | } 58 | 59 | public Date getInvitionDate() { 60 | return invitionDate; 61 | } 62 | 63 | public void setInvitionDate(Date invitionDate) { 64 | this.invitionDate = invitionDate; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dto/MemberReserveDto.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dto; 2 | 3 | import java.util.Date; 4 | 5 | public class MemberReserveDto { 6 | 7 | private Integer memberId; 8 | 9 | private String name; 10 | 11 | private int age; 12 | 13 | private byte gender; 14 | 15 | private Date checkDate; 16 | 17 | private byte status; 18 | 19 | public Integer getMemberId() { 20 | return memberId; 21 | } 22 | 23 | public void setMemberId(Integer memberId) { 24 | this.memberId = memberId; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | public int getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(int age) { 40 | this.age = age; 41 | } 42 | 43 | public byte getGender() { 44 | return gender; 45 | } 46 | 47 | public void setGender(byte gender) { 48 | this.gender = gender; 49 | } 50 | 51 | public Date getCheckDate() { 52 | return checkDate; 53 | } 54 | 55 | public void setCheckDate(Date checkDate) { 56 | this.checkDate = checkDate; 57 | } 58 | 59 | public byte getStatus() { 60 | return status; 61 | } 62 | 63 | public void setStatus(byte status) { 64 | this.status = status; 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dto/ReserveDetailDto.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dto; 2 | 3 | import java.util.Date; 4 | 5 | public class ReserveDetailDto { 6 | 7 | private Integer reserveId; 8 | 9 | private String name; 10 | 11 | private int age; 12 | 13 | private byte gender; 14 | 15 | private Date reserveTime; 16 | 17 | private byte status; 18 | 19 | public Integer getReserveId() { 20 | return reserveId; 21 | } 22 | 23 | public void setReserveId(Integer reserveId) { 24 | this.reserveId = reserveId; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | public int getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(int age) { 40 | this.age = age; 41 | } 42 | 43 | public byte getGender() { 44 | return gender; 45 | } 46 | 47 | public void setGender(byte gender) { 48 | this.gender = gender; 49 | } 50 | 51 | public Date getReserveTime() { 52 | return reserveTime; 53 | } 54 | 55 | public void setReserveTime(Date reserveTime) { 56 | this.reserveTime = reserveTime; 57 | } 58 | 59 | public byte getStatus() { 60 | return status; 61 | } 62 | 63 | public void setStatus(byte status) { 64 | this.status = status; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/dto/ReserveExamResultDetail.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.dto; 2 | 3 | import java.util.Date; 4 | 5 | public class ReserveExamResultDetail { 6 | 7 | private Integer resultId; 8 | 9 | private Date checkDate; 10 | 11 | private byte gender; 12 | 13 | private int age; 14 | 15 | private String dictionaryName; 16 | 17 | private String result; 18 | 19 | private String checkDoctor; 20 | 21 | private String summary; 22 | 23 | private String departDoctor; 24 | 25 | private byte status; 26 | 27 | public Integer getAge() { 28 | return age; 29 | } 30 | 31 | public void setAge(Integer age) { 32 | this.age = age; 33 | } 34 | 35 | public byte getStatus() { 36 | return status; 37 | } 38 | 39 | public void setStatus(byte status) { 40 | this.status = status; 41 | } 42 | 43 | public int getResultId() { 44 | return resultId; 45 | } 46 | 47 | public void setResultId(int resultId) { 48 | this.resultId = resultId; 49 | } 50 | 51 | public Date getCheckDate() { 52 | return checkDate; 53 | } 54 | 55 | public void setCheckDate(Date checkDate) { 56 | this.checkDate = checkDate; 57 | } 58 | 59 | public byte getGender() { 60 | return gender; 61 | } 62 | 63 | public void setGender(byte gender) { 64 | this.gender = gender; 65 | } 66 | 67 | public String getDictionaryName() { 68 | return dictionaryName; 69 | } 70 | 71 | public void setDictionaryName(String dictionaryName) { 72 | this.dictionaryName = dictionaryName; 73 | } 74 | 75 | public String getResult() { 76 | return result; 77 | } 78 | 79 | public void setResult(String result) { 80 | this.result = result; 81 | } 82 | 83 | public String getCheckDoctor() { 84 | return checkDoctor; 85 | } 86 | 87 | public void setCheckDoctor(String checkDoctor) { 88 | this.checkDoctor = checkDoctor; 89 | } 90 | 91 | public String getSummary() { 92 | return summary; 93 | } 94 | 95 | public void setSummary(String summary) { 96 | this.summary = summary; 97 | } 98 | 99 | public String getDepartDoctor() { 100 | return departDoctor; 101 | } 102 | 103 | public void setDepartDoctor(String departDoctor) { 104 | this.departDoctor = departDoctor; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/entity/Institution.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.entity; 2 | 3 | import java.util.Date; 4 | import javax.persistence.*; 5 | 6 | @Table(name = "tb_institution") 7 | public class Institution { 8 | /** 9 | * ID 10 | */ 11 | @Id 12 | @GeneratedValue(strategy = GenerationType.IDENTITY) 13 | private Integer id; 14 | 15 | private String name; 16 | 17 | /** 18 | * 启用状态 1)启用 2)未启用 19 | */ 20 | private Byte status; 21 | 22 | /** 23 | * 创建时间 24 | */ 25 | @Column(name = "create_time") 26 | private Date createTime; 27 | 28 | /** 29 | * 获取ID 30 | * 31 | * @return id - ID 32 | */ 33 | public Integer getId() { 34 | return id; 35 | } 36 | 37 | /** 38 | * 设置ID 39 | * 40 | * @param id ID 41 | */ 42 | public void setId(Integer id) { 43 | this.id = id; 44 | } 45 | 46 | /** 47 | * @return name 48 | */ 49 | public String getName() { 50 | return name; 51 | } 52 | 53 | /** 54 | * @param name 55 | */ 56 | public void setName(String name) { 57 | this.name = name == null ? null : name.trim(); 58 | } 59 | 60 | /** 61 | * 获取启用状态 1)启用 2)未启用 62 | * 63 | * @return status - 启用状态 1)启用 2)未启用 64 | */ 65 | public Byte getStatus() { 66 | return status; 67 | } 68 | 69 | /** 70 | * 设置启用状态 1)启用 2)未启用 71 | * 72 | * @param status 启用状态 1)启用 2)未启用 73 | */ 74 | public void setStatus(Byte status) { 75 | this.status = status; 76 | } 77 | 78 | /** 79 | * 获取创建时间 80 | * 81 | * @return create_time - 创建时间 82 | */ 83 | public Date getCreateTime() { 84 | return createTime; 85 | } 86 | 87 | /** 88 | * 设置创建时间 89 | * 90 | * @param createTime 创建时间 91 | */ 92 | public void setCreateTime(Date createTime) { 93 | this.createTime = createTime; 94 | } 95 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/entity/InstitutionDepart.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.entity; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "tb_institution_depart") 6 | public class InstitutionDepart { 7 | /** 8 | * 科室ID 9 | */ 10 | @Id 11 | @GeneratedValue(strategy = GenerationType.IDENTITY) 12 | private Integer id; 13 | 14 | /** 15 | * 科室名称 16 | */ 17 | private String name; 18 | 19 | /** 20 | * 获取科室ID 21 | * 22 | * @return id - 科室ID 23 | */ 24 | public Integer getId() { 25 | return id; 26 | } 27 | 28 | /** 29 | * 设置科室ID 30 | * 31 | * @param id 科室ID 32 | */ 33 | public void setId(Integer id) { 34 | this.id = id; 35 | } 36 | 37 | /** 38 | * 获取科室名称 39 | * 40 | * @return name - 科室名称 41 | */ 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | /** 47 | * 设置科室名称 48 | * 49 | * @param name 科室名称 50 | */ 51 | public void setName(String name) { 52 | this.name = name == null ? null : name.trim(); 53 | } 54 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/entity/InstitutionDictionary.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.entity; 2 | 3 | import javax.persistence.*; 4 | 5 | @Table(name = "tb_institution_dictionary") 6 | public class InstitutionDictionary { 7 | /** 8 | * ID 9 | */ 10 | @Id 11 | @GeneratedValue(strategy = GenerationType.IDENTITY) 12 | private Integer id; 13 | 14 | /** 15 | * 科室ID 16 | */ 17 | @Column(name = "depart_id") 18 | private Integer departId; 19 | 20 | /** 21 | * 所属机构ID 22 | */ 23 | @Column(name = "inst_id") 24 | private Integer instId; 25 | 26 | /** 27 | * 项目名称 28 | */ 29 | private String name; 30 | 31 | /** 32 | * 获取ID 33 | * 34 | * @return id - ID 35 | */ 36 | public Integer getId() { 37 | return id; 38 | } 39 | 40 | /** 41 | * 设置ID 42 | * 43 | * @param id ID 44 | */ 45 | public void setId(Integer id) { 46 | this.id = id; 47 | } 48 | 49 | /** 50 | * 获取科室ID 51 | * 52 | * @return depart_id - 科室ID 53 | */ 54 | public Integer getDepartId() { 55 | return departId; 56 | } 57 | 58 | /** 59 | * 设置科室ID 60 | * 61 | * @param departId 科室ID 62 | */ 63 | public void setDepartId(Integer departId) { 64 | this.departId = departId; 65 | } 66 | 67 | /** 68 | * 获取所属机构ID 69 | * 70 | * @return inst_id - 所属机构ID 71 | */ 72 | public Integer getInstId() { 73 | return instId; 74 | } 75 | 76 | /** 77 | * 设置所属机构ID 78 | * 79 | * @param instId 所属机构ID 80 | */ 81 | public void setInstId(Integer instId) { 82 | this.instId = instId; 83 | } 84 | 85 | /** 86 | * 获取项目名称 87 | * 88 | * @return name - 项目名称 89 | */ 90 | public String getName() { 91 | return name; 92 | } 93 | 94 | /** 95 | * 设置项目名称 96 | * 97 | * @param name 项目名称 98 | */ 99 | public void setName(String name) { 100 | this.name = name == null ? null : name.trim(); 101 | } 102 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/entity/Member.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.entity; 2 | 3 | import java.util.Date; 4 | import javax.persistence.*; 5 | 6 | @Table(name = "tb_member") 7 | public class Member { 8 | /** 9 | * 用户表 10 | */ 11 | @Id 12 | @GeneratedValue(strategy = GenerationType.IDENTITY) 13 | private Integer id; 14 | 15 | /** 16 | * 姓名 17 | */ 18 | private String name; 19 | 20 | /** 21 | * 性别 0)未知 1)男 2)女 22 | */ 23 | private Byte gender; 24 | 25 | /** 26 | * 手机号码 27 | */ 28 | private String mobile; 29 | 30 | /** 31 | * 生日 32 | */ 33 | private Date birthday; 34 | 35 | /** 36 | * 创建时间 37 | */ 38 | @Column(name = "create_time") 39 | private Date createTime; 40 | 41 | /** 42 | * 获取用户表 43 | * 44 | * @return id - 用户表 45 | */ 46 | public Integer getId() { 47 | return id; 48 | } 49 | 50 | /** 51 | * 设置用户表 52 | * 53 | * @param id 用户表 54 | */ 55 | public void setId(Integer id) { 56 | this.id = id; 57 | } 58 | 59 | /** 60 | * 获取姓名 61 | * 62 | * @return name - 姓名 63 | */ 64 | public String getName() { 65 | return name; 66 | } 67 | 68 | /** 69 | * 设置姓名 70 | * 71 | * @param name 姓名 72 | */ 73 | public void setName(String name) { 74 | this.name = name == null ? null : name.trim(); 75 | } 76 | 77 | /** 78 | * 获取性别 0)未知 1)男 2)女 79 | * 80 | * @return gender - 性别 0)未知 1)男 2)女 81 | */ 82 | public Byte getGender() { 83 | return gender; 84 | } 85 | 86 | /** 87 | * 设置性别 0)未知 1)男 2)女 88 | * 89 | * @param gender 性别 0)未知 1)男 2)女 90 | */ 91 | public void setGender(Byte gender) { 92 | this.gender = gender; 93 | } 94 | 95 | /** 96 | * 获取手机号码 97 | * 98 | * @return mobile - 手机号码 99 | */ 100 | public String getMobile() { 101 | return mobile; 102 | } 103 | 104 | /** 105 | * 设置手机号码 106 | * 107 | * @param mobile 手机号码 108 | */ 109 | public void setMobile(String mobile) { 110 | this.mobile = mobile == null ? null : mobile.trim(); 111 | } 112 | 113 | /** 114 | * 获取生日 115 | * 116 | * @return birthday - 生日 117 | */ 118 | public Date getBirthday() { 119 | return birthday; 120 | } 121 | 122 | /** 123 | * 设置生日 124 | * 125 | * @param birthday 生日 126 | */ 127 | public void setBirthday(Date birthday) { 128 | this.birthday = birthday; 129 | } 130 | 131 | /** 132 | * 获取创建时间 133 | * 134 | * @return create_time - 创建时间 135 | */ 136 | public Date getCreateTime() { 137 | return createTime; 138 | } 139 | 140 | /** 141 | * 设置创建时间 142 | * 143 | * @param createTime 创建时间 144 | */ 145 | public void setCreateTime(Date createTime) { 146 | this.createTime = createTime; 147 | } 148 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/entity/Report.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.entity; 2 | 3 | import java.util.Date; 4 | import javax.persistence.*; 5 | 6 | @Table(name = "tb_report") 7 | public class Report { 8 | @Id 9 | @GeneratedValue(strategy = GenerationType.IDENTITY) 10 | private Integer id; 11 | 12 | /** 13 | * 报告ID 14 | */ 15 | @Column(name = "report_id") 16 | private String reportId; 17 | 18 | /** 19 | * 科室名称 20 | */ 21 | @Column(name = "depart_name") 22 | private String departName; 23 | 24 | /** 25 | * 体检时间 26 | */ 27 | @Column(name = "check_date") 28 | private Date checkDate; 29 | 30 | /** 31 | * 体检结果 32 | */ 33 | private String result; 34 | 35 | /** 36 | * @return id 37 | */ 38 | public Integer getId() { 39 | return id; 40 | } 41 | 42 | /** 43 | * @param id 44 | */ 45 | public void setId(Integer id) { 46 | this.id = id; 47 | } 48 | 49 | /** 50 | * 获取报告ID 51 | * 52 | * @return report_id - 报告ID 53 | */ 54 | public String getReportId() { 55 | return reportId; 56 | } 57 | 58 | /** 59 | * 设置报告ID 60 | * 61 | * @param reportId 报告ID 62 | */ 63 | public void setReportId(String reportId) { 64 | this.reportId = reportId == null ? null : reportId.trim(); 65 | } 66 | 67 | /** 68 | * 获取科室名称 69 | * 70 | * @return depart_name - 科室名称 71 | */ 72 | public String getDepartName() { 73 | return departName; 74 | } 75 | 76 | /** 77 | * 设置科室名称 78 | * 79 | * @param departName 科室名称 80 | */ 81 | public void setDepartName(String departName) { 82 | this.departName = departName == null ? null : departName.trim(); 83 | } 84 | 85 | /** 86 | * 获取体检时间 87 | * 88 | * @return check_date - 体检时间 89 | */ 90 | public Date getCheckDate() { 91 | return checkDate; 92 | } 93 | 94 | /** 95 | * 设置体检时间 96 | * 97 | * @param checkDate 体检时间 98 | */ 99 | public void setCheckDate(Date checkDate) { 100 | this.checkDate = checkDate; 101 | } 102 | 103 | /** 104 | * 获取体检结果 105 | * 106 | * @return result - 体检结果 107 | */ 108 | public String getResult() { 109 | return result; 110 | } 111 | 112 | /** 113 | * 设置体检结果 114 | * 115 | * @param result 体检结果 116 | */ 117 | public void setResult(String result) { 118 | this.result = result == null ? null : result.trim(); 119 | } 120 | } -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/enums/InvitationStatus.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.enums; 2 | 3 | public enum InvitationStatus { 4 | 5 | GENERATE((byte)1), 6 | 7 | APPLY((byte)2), 8 | 9 | APPLY_FALSE((byte)3), 10 | 11 | APPLY_AGGRE((byte)4), 12 | 13 | ORDERING((byte)5); 14 | 15 | private byte value; 16 | 17 | InvitationStatus(byte value) { 18 | this.value = value; 19 | } 20 | 21 | public byte value() { 22 | return this.value; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/enums/ReserveStatus.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.enums; 2 | 3 | public enum ReserveStatus { 4 | 5 | RESERVE((byte)1), 6 | 7 | ACCEPT_RESERVE((byte)2), 8 | 9 | CANCALE_RESERVE((byte)3); 10 | 11 | private byte value; 12 | 13 | ReserveStatus(byte value) { 14 | this.value = value; 15 | } 16 | 17 | public byte value() { 18 | return this.value; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/enums/ResultStatus.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.enums; 2 | 3 | public enum ResultStatus { 4 | 5 | NOT_RESULT((byte)1), 6 | 7 | HAS_RESULT((byte)2); 8 | 9 | private byte value; 10 | 11 | ResultStatus(byte value) { 12 | this.value = value; 13 | } 14 | 15 | public byte value() { 16 | return this.value; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/exception/BuzException.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.exception; 2 | 3 | import io.mycat.fabric.phdc.ctrl.config.ResponseCode; 4 | 5 | public class BuzException extends Exception { 6 | /** 7 | * 8 | */ 9 | private static final long serialVersionUID = 1L; 10 | protected int code; 11 | protected String description; 12 | 13 | public static final int SUCCESS_CODE_COMMON=1000; 14 | 15 | public static final int ERROR_CODE_COMMON=1001; 16 | 17 | public BuzException(int code, String description) { 18 | super(description); 19 | this.code = code; 20 | this.description = description; 21 | } 22 | 23 | public BuzException(ResponseCode code) { 24 | super(code.getMsg()); 25 | this.code = code.getValue(); 26 | this.description = code.getMsg(); 27 | } 28 | 29 | public BuzException() { 30 | super(); 31 | } 32 | 33 | public BuzException(String description) { 34 | super(description); 35 | this.description = description; 36 | } 37 | 38 | public int getCode() { 39 | return code; 40 | } 41 | 42 | public void setCode(int code) { 43 | this.code = code; 44 | } 45 | 46 | public String getDescription() { 47 | return description; 48 | } 49 | 50 | public void setDescription(String description) { 51 | this.description = description; 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/BaseService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | import com.github.pagehelper.PageHelper; 8 | import com.github.pagehelper.PageInfo; 9 | 10 | import tk.mybatis.mapper.common.Mapper; 11 | 12 | public abstract class BaseService{ 13 | 14 | @Autowired 15 | protected Mapper mapper; 16 | 17 | public Mapper getMapper() { 18 | return mapper; 19 | } 20 | 21 | public T selectByKey(Object key) { 22 | return mapper.selectByPrimaryKey(key); 23 | } 24 | public int save(T entity) { 25 | return mapper.insert(entity); 26 | } 27 | 28 | public int saveNotNull(T entity) { 29 | return mapper.insertSelective(entity); 30 | } 31 | 32 | public int delete(Object key) { 33 | return mapper.deleteByPrimaryKey(key); 34 | } 35 | 36 | public int deleteByExample(Object example) { 37 | 38 | return mapper.deleteByExample(example); 39 | 40 | } 41 | 42 | public int updateAll(T entity) { 43 | return mapper.updateByPrimaryKey(entity); 44 | } 45 | public int updateNotNull(T entity) { 46 | 47 | return mapper.updateByPrimaryKeySelective(entity); 48 | } 49 | 50 | public int updateByExample(T entity, Object example) { 51 | return mapper.updateByExample(entity,example); 52 | } 53 | public int updateByExampleNotNull(T entity, Object example) { 54 | 55 | return mapper.updateByExampleSelective(entity,example); 56 | } 57 | public int selectCountByEntity(T entity) { 58 | return mapper.selectCount(entity); 59 | } 60 | public int selectCountByExample(Object example) { 61 | return mapper.selectCountByExample(example); 62 | } 63 | public List selectAll() { 64 | return mapper.selectAll(); 65 | } 66 | public List selectByEntity(T entity) { 67 | return mapper.select(entity); 68 | } 69 | public List selectByExample(Object example) { 70 | return mapper.selectByExample(example); 71 | } 72 | @SuppressWarnings({ "rawtypes", "unchecked" }) 73 | public PageInfo selectByExample(Object example, int pageNum, int pageSize) { 74 | PageHelper.startPage(pageNum, pageSize); 75 | List list = 76 | mapper.selectByExample(example); 77 | return new PageInfo(list); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/InstitutionDepartService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import io.mycat.fabric.phdc.entity.Institution; 6 | import io.mycat.fabric.phdc.entity.InstitutionDepart; 7 | 8 | @Service 9 | public class InstitutionDepartService extends BaseService{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/InstitutionDictionaryService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import io.mycat.fabric.phdc.entity.InstitutionDictionary; 6 | 7 | @Service 8 | public class InstitutionDictionaryService extends BaseService{ 9 | 10 | } 11 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/InstitutionService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import io.mycat.fabric.phdc.entity.Institution; 6 | 7 | @Service 8 | public class InstitutionService extends BaseService{ 9 | 10 | } 11 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/MemberInvitationService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import io.mycat.fabric.phdc.entity.MemberInvitation; 6 | 7 | @Service 8 | public class MemberInvitationService extends BaseService{ 9 | 10 | } 11 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/MemberService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import io.mycat.fabric.phdc.dao.mapper.MemberMapper; 7 | import io.mycat.fabric.phdc.entity.Member; 8 | 9 | @Service 10 | public class MemberService extends BaseService{ 11 | 12 | @Autowired 13 | MemberMapper memberMapper; 14 | 15 | public Integer getLastId() { 16 | return memberMapper.getLastId(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/ReportService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import io.mycat.fabric.phdc.dao.mapper.ReserveMapper; 9 | import io.mycat.fabric.phdc.entity.Report; 10 | 11 | @Service 12 | public class ReportService extends BaseService{ 13 | 14 | @Autowired 15 | ReserveMapper reserveMapper; 16 | 17 | public void saveInvitationResult(List reports) { 18 | reserveMapper.saveInvitationResult(reports); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/ReserveService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import io.mycat.fabric.phdc.entity.Reserve; 6 | 7 | @Service 8 | public class ReserveService extends BaseService{ 9 | 10 | } 11 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/service/ResultService.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import io.mycat.fabric.phdc.entity.Result; 6 | 7 | @Service 8 | public class ResultService extends BaseService{ 9 | 10 | } 11 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/util/DateStyle.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.util; 2 | 3 | /** 4 | * 5 | * 日期格式 6 | * @author xusihan 7 | * 8 | */ 9 | public enum DateStyle { 10 | 11 | 12 | YYYY_MM_DD_HH_MM_SS("yyyy-MM-dd HH:mm:ss"), 13 | YYYY_MM_DD_HH_MM("yyyy-MM-dd HH:mm"), 14 | YYYY_MM_DD("yyyy-MM-dd"), 15 | YYYY_MM("yyyy-MM"), 16 | MM_DD_HH_MM_SS("MM-dd HH:mm:ss"), 17 | MM_DD_HH_MM("MM-dd HH:mm"), 18 | MM_DD("MM-dd"), 19 | HH_MM_SS("HH:mm:ss"), 20 | HH_MM("HH:mm"), 21 | 22 | YYYYMMDDHHMMSS("yyyyMMddHHmmss"), 23 | YYYYMMDDHH("yyyyMMddHH"), 24 | YYYYMMDD("yyyyMMdd"), 25 | 26 | DD_HH_MM("dd日 HH:mm"), 27 | 28 | YYYYMMdd_Sprit("yyyy/MM/dd"), 29 | 30 | YYYYMMdd_Cn("yyyy年MM月dd日"), 31 | 32 | YYYYMMdd_Comma("yyyy.MM.dd") 33 | 34 | 35 | ; 36 | 37 | private String value; 38 | 39 | DateStyle(String value) { 40 | this.value = value; 41 | } 42 | 43 | public String getValue() { 44 | return value; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/util/UserElementUtil.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.util; 2 | 3 | import java.util.Calendar; 4 | import java.util.Date; 5 | 6 | public class UserElementUtil { 7 | 8 | public static int getAgeByBirthday(Date birthday) { 9 | Calendar cal = Calendar.getInstance(); 10 | cal.setTime(new Date()); 11 | int yearNow = cal.get(Calendar.YEAR); 12 | int monthNow = cal.get(Calendar.MONTH); 13 | int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); 14 | cal.setTime(birthday); 15 | 16 | int yearBirth = cal.get(Calendar.YEAR); 17 | int monthBirth = cal.get(Calendar.MONTH); 18 | int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH); 19 | 20 | int age = yearNow - yearBirth; 21 | 22 | if (monthNow <= monthBirth) { 23 | if (monthNow == monthBirth) { 24 | if (dayOfMonthNow < dayOfMonthBirth) age--; 25 | }else{ 26 | age--; 27 | } 28 | } 29 | return age; 30 | } 31 | 32 | public static void main(String[] args) { 33 | Date birthday = DateUtil.StringToDate("1994-10-15"); 34 | System.out.println(birthday); 35 | System.out.println(getAgeByBirthday(birthday)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /PHDC/java/src/main/java/io/mycat/fabric/phdc/vo/InvitationDataVo.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.vo; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import com.fasterxml.jackson.annotation.JsonProperty; 8 | 9 | public class InvitationDataVo { 10 | 11 | @JsonProperty(value="Date") 12 | private String date; 13 | 14 | @JsonProperty(value="DepartName") 15 | private String departName; 16 | 17 | @JsonProperty(value="Result") 18 | private String result; 19 | 20 | public String getDate() { 21 | return date; 22 | } 23 | 24 | public void setDate(String date) { 25 | this.date = date; 26 | } 27 | 28 | public String getDepartName() { 29 | return departName; 30 | } 31 | 32 | public void setDepartName(String departName) { 33 | this.departName = departName; 34 | } 35 | 36 | public String getResult() { 37 | return result; 38 | } 39 | 40 | public void setResult(String result) { 41 | this.result = result; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8666 3 | 4 | spring: 5 | profiles: 6 | active: dev 7 | application: 8 | name: PHDCApplication 9 | datasource: 10 | driver-class-name: com.mysql.jdbc.Driver 11 | password: ****** 12 | url: "jdbc:mysql://39.104.99.78:3306/phdc?autoReconnect=true&initialTimeout=3&useUnicode=true&characterEncoding=utf-8&useSSL=false" 13 | username: root 14 | mapper: 15 | identity: MYSQL 16 | mappers: tk.mybatis.mapper.common.Mapper 17 | not-empty: false 18 | mybatis: 19 | configuration: 20 | default-statement-timeout: 300 21 | mapUnderscoreToCamelCase: true 22 | mapper-locations: "classpath*:config/mapper/*.xml" 23 | type-aliases-package: io.mycat.fabric.phdc.entity 24 | pagehelper: 25 | helperDialect: mysql 26 | params: count=countSql 27 | reasonable: true 28 | supportMethodsArguments: true 29 | logging: 30 | level: 31 | ROOT: INFO 32 | io.mycat.fabric: debug 33 | config: "classpath:logback.xml" -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/InstitutionDepartMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/InstitutionDictionaryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/InstitutionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/MemberInvitationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/MemberMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/ReportMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | INSERT INTO `tb_report`(`report_id`, `depart_name`, `check_date`, `result`) 17 | VALUES 18 | 19 | (#{report.reportId},#{report.departName},#{report.checkDate},#{report.result}) 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/ReserveMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/config/mapper/ResultMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /PHDC/java/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phdc 4 | 5 | 6 | 7 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | ./logs/system.log 14 | 15 | ./logs/system.%d{yyyy-MM-dd}.log 16 | 17 | 18 | 19 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 20 | 21 | 22 | 23 | 24 | 25 | ./logs/database.log 26 | 27 | ./logs/database.%d{yyyy-MM-dd}.log 28 | 29 | 30 | 31 | 32 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 33 | 34 | 35 | 36 | 37 | ./logs/console.log 38 | 39 | ./logs/console.%d{yyyy-MM-dd}.log 40 | 41 | 42 | 43 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /PHDC/java/src/test/java/io/mycat/fabric/phdc/test/dao/MybatisGenerator.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.test.dao; 2 | 3 | import org.mybatis.generator.api.MyBatisGenerator; 4 | import org.mybatis.generator.api.ProgressCallback; 5 | import org.mybatis.generator.config.Configuration; 6 | import org.mybatis.generator.config.xml.ConfigurationParser; 7 | import org.mybatis.generator.exception.InvalidConfigurationException; 8 | import org.mybatis.generator.exception.XMLParserException; 9 | import org.mybatis.generator.internal.DefaultShellCallback; 10 | 11 | import java.io.IOException; 12 | import java.sql.SQLException; 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | public class MybatisGenerator { 17 | 18 | public static void main(String args[]) { 19 | 20 | try { 21 | System.setProperty("file.encoding", "UTF-8"); 22 | List warnings = new ArrayList(); 23 | boolean overwrite = true; 24 | ConfigurationParser cp = new ConfigurationParser(warnings); 25 | Configuration config = cp.parseConfiguration( 26 | MybatisGenerator.class.getResourceAsStream("/mybatis-generator.xml")); 27 | DefaultShellCallback callback = new DefaultShellCallback(overwrite); 28 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); 29 | myBatisGenerator.generate(new ProgressCallback() { 30 | @Override 31 | public void introspectionStarted(int totalTasks) { 32 | 33 | } 34 | 35 | @Override 36 | public void generationStarted(int totalTasks) { 37 | 38 | } 39 | 40 | @Override 41 | public void saveStarted(int totalTasks) { 42 | 43 | } 44 | 45 | @Override 46 | public void startTask(String taskName) { 47 | System.out.println(taskName); 48 | } 49 | 50 | @Override 51 | public void done() { 52 | 53 | } 54 | 55 | @Override 56 | public void checkCancel() throws InterruptedException { 57 | 58 | } 59 | }); 60 | 61 | } catch (IOException e) { 62 | e.printStackTrace(); 63 | } catch (XMLParserException e) { 64 | e.printStackTrace(); 65 | } catch (InvalidConfigurationException e) { 66 | e.printStackTrace(); 67 | } catch (SQLException e) { 68 | e.printStackTrace(); 69 | } catch (InterruptedException e) { 70 | e.printStackTrace(); 71 | } 72 | 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /PHDC/java/src/test/java/io/mycat/fabric/phdc/test/dao/ReserveManagerTest.java: -------------------------------------------------------------------------------- 1 | package io.mycat.fabric.phdc.test.dao; 2 | 3 | import java.util.Date; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 10 | 11 | import io.mycat.fabric.phdc.PHDCApplication; 12 | import io.mycat.fabric.phdc.entity.Reserve; 13 | import io.mycat.fabric.phdc.service.ReserveService; 14 | 15 | @SpringBootTest(classes=PHDCApplication.class) 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | public class ReserveManagerTest { 18 | 19 | @Autowired 20 | ReserveService reserveService; 21 | 22 | @Test 23 | public void testADD() { 24 | Reserve reserve = new Reserve(); 25 | reserve.setCheckDate(new Date()); 26 | reserve.setDictionaryId(1); 27 | reserve.setCreateTime(new Date()); 28 | reserve.setGender((byte)1); 29 | reserve.setInstitutionId(1); 30 | reserve.setMemberId(1); 31 | reserve.setMobile("111111111"); 32 | reserve.setName("raindropsOxO"); 33 | reserve.setReserveTime(new Date()); 34 | reserve.setStatus((byte)1); 35 | reserveService.saveNotNull(reserve); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8666 3 | 4 | spring: 5 | profiles: 6 | active: dev 7 | application: 8 | name: PHDCApplication 9 | datasource: 10 | driver-class-name: com.mysql.jdbc.Driver 11 | password: ****** 12 | url: "jdbc:mysql://39.104.99.78:3306/phdc?autoReconnect=true&initialTimeout=3&useUnicode=true&characterEncoding=utf-8&useSSL=false" 13 | username: root 14 | mapper: 15 | identity: MYSQL 16 | mappers: tk.mybatis.mapper.common.Mapper 17 | not-empty: false 18 | mybatis: 19 | configuration: 20 | default-statement-timeout: 300 21 | mapUnderscoreToCamelCase: true 22 | mapper-locations: "classpath*:config/mapper/*.xml" 23 | type-aliases-package: io.mycat.fabric.phdc.entity 24 | pagehelper: 25 | helperDialect: mysql 26 | params: count=countSql 27 | reasonable: true 28 | supportMethodsArguments: true 29 | logging: 30 | level: 31 | ROOT: INFO 32 | io.mycat.fabric: debug 33 | config: "classpath:logback.xml" -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/InstitutionDepartMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/InstitutionDictionaryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/InstitutionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/MemberInvitationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/MemberMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/ReportMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | INSERT INTO `tb_report`(`report_id`, `depart_name`, `check_date`, `result`) 17 | VALUES 18 | 19 | (#{report.reportId},#{report.departName},#{report.checkDate},#{report.result}) 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/ReserveMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/config/mapper/ResultMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/PHDCApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/PHDCApplication.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/bass/ChainCodeManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/bass/ChainCodeManager.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/bass/ChaincodeExecutor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/bass/ChaincodeExecutor.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/bass/DRCChainCodeManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/bass/DRCChainCodeManager.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/bass/FabricUser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/bass/FabricUser.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/bass/HDCChainCodeManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/bass/HDCChainCodeManager.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/bass/dto/BaseResp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/bass/dto/BaseResp.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/bass/dto/InviteRespDto.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/bass/dto/InviteRespDto.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/business/ClientBusiness.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/business/ClientBusiness.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/business/InvitationBusiness.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/business/InvitationBusiness.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/business/ReserveBusiness.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/business/ReserveBusiness.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/ClientController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/ClientController.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/InstitutionController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/InstitutionController.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/MemberController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/MemberController.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/GlobalExceptionHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/GlobalExceptionHandler.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/MyWebMvcConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/MyWebMvcConfig.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/ResponseCode.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/ResponseCode.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/ResponseContent.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/ResponseContent.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/SpringContext.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/ctrl/config/SpringContext.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/InstitutionDepartMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/InstitutionDepartMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/InstitutionDictionaryMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/InstitutionDictionaryMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/InstitutionMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/InstitutionMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/MemberInvitationMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/MemberInvitationMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/MemberMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/MemberMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/ReportMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/ReportMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/ReserveMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/ReserveMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/ResultMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dao/mapper/ResultMapper.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInstResultDto.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInstResultDto.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInvitationDetail.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInvitationDetail.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInvitationDetailItem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInvitationDetailItem.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInvitationDto.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberInvitationDto.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberReserveDto.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dto/MemberReserveDto.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dto/ReserveDetailDto.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dto/ReserveDetailDto.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/dto/ReserveExamResultDetail.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/dto/ReserveExamResultDetail.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Institution.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Institution.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/InstitutionDepart.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/InstitutionDepart.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/InstitutionDictionary.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/InstitutionDictionary.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Member.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Member.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/MemberInvitation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/MemberInvitation.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Report.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Report.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Reserve.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Reserve.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Result.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/entity/Result.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/enums/InvitationStatus.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/enums/InvitationStatus.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/enums/ReserveStatus.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/enums/ReserveStatus.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/enums/ResultStatus.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/enums/ResultStatus.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/exception/BuzException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/exception/BuzException.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/BaseService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/BaseService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/InstitutionDepartService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/InstitutionDepartService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/InstitutionDictionaryService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/InstitutionDictionaryService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/InstitutionService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/InstitutionService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/MemberInvitationService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/MemberInvitationService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/MemberService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/MemberService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/ReportService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/ReportService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/ReserveService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/ReserveService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/service/ResultService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/service/ResultService.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/util/DateStyle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/util/DateStyle.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/util/DateUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/util/DateUtil.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/util/UserElementUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/util/UserElementUtil.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/io/mycat/fabric/phdc/vo/InvitationDataVo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/classes/io/mycat/fabric/phdc/vo/InvitationDataVo.class -------------------------------------------------------------------------------- /PHDC/java/target/classes/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phdc 4 | 5 | 6 | 7 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | ./logs/system.log 14 | 15 | ./logs/system.%d{yyyy-MM-dd}.log 16 | 17 | 18 | 19 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 20 | 21 | 22 | 23 | 24 | 25 | ./logs/database.log 26 | 27 | ./logs/database.%d{yyyy-MM-dd}.log 28 | 29 | 30 | 31 | 32 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 33 | 34 | 35 | 36 | 37 | ./logs/console.log 38 | 39 | ./logs/console.%d{yyyy-MM-dd}.log 40 | 41 | 42 | 43 | %date{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-4relative %-5level %logger[%L] - %msg%n 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/bass/ChainCodeManagerTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/bass/ChainCodeManagerTest.class -------------------------------------------------------------------------------- /PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/dao/MybatisGenerator$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/dao/MybatisGenerator$1.class -------------------------------------------------------------------------------- /PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/dao/MybatisGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/dao/MybatisGenerator.class -------------------------------------------------------------------------------- /PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/dao/ReserveManagerTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/java/target/test-classes/io/mycat/fabric/phdc/test/dao/ReserveManagerTest.class -------------------------------------------------------------------------------- /PHDC/pages/bootstrap-4.0.0-dist/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /PHDC/pages/views/duo/userDetail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 用户列表 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 40 | 41 |
检查日期检查项目结论
42 | 43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 118 | 119 | -------------------------------------------------------------------------------- /PHDC/pages/views/ho/appointmentList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 预约管理 9 | 10 | 11 | 12 | 13 |
14 |

预约管理

15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 47 | 48 |
姓名年龄性别预约日期状态
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 138 | 139 | -------------------------------------------------------------------------------- /PHDC/pages/views/ho/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | HO管理首页 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | -------------------------------------------------------------------------------- /PHDC/pages/views/ho/userItem.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 用户检查列表 9 | 10 | 11 | 12 | 13 |
14 |

用户检查列表

15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 47 | 48 |
检查日期检查项目结果结论检查医生
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 126 | 127 | -------------------------------------------------------------------------------- /PHDC/pages/views/ho/userList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 用户管理 9 | 10 | 11 | 12 | 13 |
14 |

用户管理

15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 46 | 47 |
姓名年龄性别最后检查时间操作
48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 111 | 112 | -------------------------------------------------------------------------------- /PHDC/pages/views/uo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 客户端首页 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | -------------------------------------------------------------------------------- /PHDC/pages/views/uo/userDataList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 查看数据 9 | 10 | 11 | 12 | 13 |
14 |
查看数据
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
检查机构检查项目结果结论检查日期
28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 117 | 118 | -------------------------------------------------------------------------------- /PHDC/uoclient.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/uoclient.apk -------------------------------------------------------------------------------- /PHDC/应用操作文档-业务场景类-Mycat黄埔军团.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/应用操作文档-业务场景类-Mycat黄埔军团.docx -------------------------------------------------------------------------------- /PHDC/阿里云天池区块链决赛演讲稿-Mycat黄埔军团.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/阿里云天池区块链决赛演讲稿-Mycat黄埔军团.pdf -------------------------------------------------------------------------------- /PHDC/阿里云天池区块链决赛演讲稿-Mycat黄埔军团的En.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/PHDC/阿里云天池区块链决赛演讲稿-Mycat黄埔军团的En.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # supersync 2 | 基于IBM Hyperledger区块链技术的通用数据同步框架,可用于多点数据库的同步,以及其他任何需要从零开始完整复制数据的分布式系统 3 | 以数据库为例,需要同步的节点从区块链上获取同步的数据,并执行同步过程,由于区块链保持了完整的同步数据前后关系,并且最终一致, 4 | 因此此方法可以用于局域网,广域网中的任意多台机器之间的数据同步,并且任意机器可以从头开始恢复完整的数据。 5 | 6 | # Fabric Demo 7 | 《区块链轻松上手》当中的虚拟机示例,具体内容以及操作方法请参见书本 8 | 链接:https://pan.baidu.com/s/1Udh-A5DrBGXdT3IXmIq1zg 密码:hvbx 9 | 10 | # 阿里云区块链大赛决赛作品 11 | 2018年9月份Mycat社区当中的赵锴、李艳军、许思涵、詹应达、黄飞组成了“Mycat黄埔军团”参加阿里云区块链大赛,进入决赛并获得了“创新奖”,PHDC目录下就是他们提交的作品——个人健康数据流转平台,关于项目的介绍请参考目录下的“应用操作文档”。注意:文档中的链接地址与用户名密码都已失效,如要运行请按照文档重新部署 12 | 13 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker化安装Hyperledger 2 | IBM Hyperledger区块链平台用Docker方式安装,目标是广域网里或者位于不同机房的多个机构组成一个区块链系统。 3 | 4 | -------------------------------------------------------------------------------- /docker/config/crypto-config.yaml: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------- 2 | # "OrdererOrgs" - Definition of organizations managing orderer nodes 3 | # --------------------------------------------------------------------------- 4 | OrdererOrgs: 5 | # --------------------------------------------------------------------------- 6 | # Orderer 7 | # --------------------------------------------------------------------------- 8 | - Name: Orderer 9 | Domain: example.com 10 | # --------------------------------------------------------------------------- 11 | # "Specs" - See PeerOrgs below for complete description 12 | # --------------------------------------------------------------------------- 13 | Specs: 14 | - Hostname: orderer 15 | # --------------------------------------------------------------------------- 16 | # "PeerOrgs" - Definition of organizations managing peer nodes 17 | # --------------------------------------------------------------------------- 18 | PeerOrgs: 19 | # --------------------------------------------------------------------------- 20 | # Org1 21 | # --------------------------------------------------------------------------- 22 | - Name: Org1 23 | Domain: org1.example.com 24 | # --------------------------------------------------------------------------- 25 | # "Specs" 26 | # --------------------------------------------------------------------------- 27 | # Uncomment this section to enable the explicit definition of hosts in your 28 | # configuration. Most users will want to use Template, below 29 | # 30 | # Specs is an array of Spec entries. Each Spec entry consists of two fields: 31 | # - Hostname: (Required) The desired hostname, sans the domain. 32 | # - CommonName: (Optional) Specifies the template or explicit override for 33 | # the CN. By default, this is the template: 34 | # 35 | # "{{.Hostname}}.{{.Domain}}" 36 | # 37 | # which obtains its values from the Spec.Hostname and 38 | # Org.Domain, respectively. 39 | # --------------------------------------------------------------------------- 40 | # Specs: 41 | # - Hostname: foo # implicitly "foo.org1.example.com" 42 | # CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above 43 | # - Hostname: bar 44 | # - Hostname: baz 45 | # --------------------------------------------------------------------------- 46 | # "Template" 47 | # --------------------------------------------------------------------------- 48 | # Allows for the definition of 1 or more hosts that are created sequentially 49 | # from a template. By default, this looks like "peer%d" from 0 to Count-1. 50 | # You may override the number of nodes (Count), the starting index (Start) 51 | # or the template used to construct the name (Hostname). 52 | # 53 | # Note: Template and Specs are not mutually exclusive. You may define both 54 | # sections and the aggregate nodes will be created for you. Take care with 55 | # name collisions 56 | # --------------------------------------------------------------------------- 57 | Template: 58 | Count: 2 59 | # Start: 5 60 | # Hostname: {{.Prefix}}{{.Index}} # default 61 | # --------------------------------------------------------------------------- 62 | # "Users" 63 | # --------------------------------------------------------------------------- 64 | # Count: The number of user accounts _in addition_ to Admin 65 | # --------------------------------------------------------------------------- 66 | Users: 67 | Count: 1 68 | # --------------------------------------------------------------------------- 69 | # Org2: See "Org1" for full specification 70 | # --------------------------------------------------------------------------- 71 | - Name: Org2 72 | Domain: org2.example.com 73 | Template: 74 | Count: 2 75 | Users: 76 | Count: 1 77 | -------------------------------------------------------------------------------- /docker/docker-host.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyCATApache/SuperLedger/44d928650314451967cb747b35ea171d26390e56/docker/docker-host.txt -------------------------------------------------------------------------------- /supersync/config.properties: -------------------------------------------------------------------------------- 1 | org.hyperledger.fabric.sdk.proposal.wait.time=40000 2 | org.hyperledger.fabric.sdk.orderer.ordererWaitTimeMilliSecs=10000 -------------------------------------------------------------------------------- /supersync/fabric.ks: -------------------------------------------------------------------------------- 1 | # 2 | #Tue Nov 28 18:28:37 CST 2017 3 | user.AdminOrg1=aced00057372001e696f2e62657374636c6f75642e6c65646765722e53616d706c65557365727017bcedd544da830200094c00076163636f756e747400124c6a6176612f6c616e672f537472696e673b4c000b616666696c696174696f6e71007e00014c000a656e726f6c6c6d656e747400274c6f72672f68797065726c65646765722f6661627269632f73646b2f456e726f6c6c6d656e743b4c0010656e726f6c6c6d656e7453656372657471007e00014c000f6b657956616c53746f72654e616d6571007e00014c00056d7370496471007e00014c00046e616d6571007e00014c000c6f7267616e697a6174696f6e71007e00014c0005726f6c657374000f4c6a6176612f7574696c2f5365743b7870707073720036696f2e62657374636c6f75642e6c65646765722e53616d706c6553746f72652453616d706c6553746f7265456e726f6c6c656d656e74d95a47210432a7b20200024c000b636572746966696361746571007e00014c000a707269766174654b657974001a4c6a6176612f73656375726974792f507269766174654b65793b78707403162d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949434754434341622b674177494241674951636e353679343466356477386456756d534c6432326a414b42676771686b6a4f50515144416a427a4d5173770a435159445651514745774a56557a45544d4245474131554543424d4b5132467361575a76636d3570595445574d4251474131554542784d4e5532467549455a790a5957356a61584e6a627a455a4d4263474131554543684d5162334a6e4d53356c654746746347786c4c6d4e76625445634d426f474131554541784d54593245750a62334a6e4d53356c654746746347786c4c6d4e7662544165467730784e7a45784d5451774e5449314e444e61467730794e7a45784d5449774e5449314e444e610a4d467378437a414a42674e5642415954416c56544d524d77455159445651514945777044595778705a6d3979626d6c684d5259774641594456515148457731540a59573467526e4a68626d4e7063324e764d523877485159445651514444425a425a473170626b4276636d63784c6d56345957317762475575593239744d466b770a457759484b6f5a497a6a3043415159494b6f5a497a6a30444151634451674145647575524f39584f4653784338302f4c506a4c374e784b4538364f424e4645550a72326e5464544d476a4b7837765a6235362f344e72595571786c4255587473705a6c4377476336426348774836322f2f7a31594e694b4e4e4d457377446759440a565230504151482f42415144416765414d41774741315564457745422f7751434d4141774b7759445652306a42435177496f41674266526968346a464e5037550a2b55447045536d31567334626d6e316e764665517a4a365175793274777a6b77436759494b6f5a497a6a3045417749445341417752514968414f776a6c4f76390a3276354132496741714a335a464d672f4d6532783656554f4c6d48645844334751766757416941564c52434f3036336f4d59626c437779384b6233654e5149610a6230636b4a50706a32766c335871317a41773d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a7372003d6f72672e626f756e6379636173746c652e6a63616a63652e70726f76696465722e6173796d6d65747269632e65632e42434543507269766174654b65790dcd5cdd2909ced40300025a000f77697468436f6d7072657373696f6e4c0009616c676f726974686d71007e00017870007400054543445341757200025b42acf317f8060854e0020000787000000096308193020100301306072a8648ce3d020106082a8648ce3d030107047930770201010420b3ed78d596b843c538861991ef681c0bbaebb2de99234ef34c302ce78612d587a00a06082a8648ce3d030107a1440342000476eb913bd5ce152c42f34fcb3e32fb371284f3a381345114af69d37533068cac7bbd96f9ebfe0dad852ac650545edb296650b019ce81707c07eb6fffcf560d88787074000e757365722e41646d696e4f7267317400074f7267314d535074000541646d696e7400044f72673170 4 | -------------------------------------------------------------------------------- /supersync/org1-user/admincerts/Admin@org1.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICGTCCAb+gAwIBAgIQcn56y44f5dw8dVumSLd22jAKBggqhkjOPQQDAjBzMQsw 3 | CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy 4 | YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu 5 | b3JnMS5leGFtcGxlLmNvbTAeFw0xNzExMTQwNTI1NDNaFw0yNzExMTIwNTI1NDNa 6 | MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T 7 | YW4gRnJhbmNpc2NvMR8wHQYDVQQDDBZBZG1pbkBvcmcxLmV4YW1wbGUuY29tMFkw 8 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEduuRO9XOFSxC80/LPjL7NxKE86OBNFEU 9 | r2nTdTMGjKx7vZb56/4NrYUqxlBUXtspZlCwGc6BcHwH62//z1YNiKNNMEswDgYD 10 | VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgBfRih4jFNP7U 11 | +UDpESm1Vs4bmn1nvFeQzJ6Quy2twzkwCgYIKoZIzj0EAwIDSAAwRQIhAOwjlOv9 12 | 2v5A2IgAqJ3ZFMg/Me2x6VUOLmHdXD3GQvgWAiAVLRCO063oMYblCwy8Kb3eNQIa 13 | b0ckJPpj2vl3Xq1zAw== 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /supersync/org1-user/keystore/key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgs+141Za4Q8U4hhmR 3 | 72gcC7rrst6ZI07zTDAs54YS1YehRANCAAR265E71c4VLELzT8s+Mvs3EoTzo4E0 4 | URSvadN1MwaMrHu9lvnr/g2thSrGUFRe2ylmULAZzoFwfAfrb//PVg2I 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /supersync/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | supersync 5 | supersync 6 | 0.0.1-SNAPSHOT 7 | 8 | 9 | org.hyperledger.fabric-sdk-java 10 | fabric-sdk-java 11 | 1.1.0-SNAPSHOT 12 | 13 | 14 | org.apache.httpcomponents 15 | httpclient 16 | 4.5.3 17 | 18 | 19 | junit 20 | junit 21 | 4.12 22 | 23 | 24 | org.apache.httpcomponents 25 | httpmime 26 | 4.5.3 27 | 28 | 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-compiler-plugin 34 | 2.3.2 35 | 36 | 1.8 37 | 1.8 38 | UTF-8 39 | 40 | 41 | 42 | 43 | 44 | 45 | allow-snapshots 46 | 47 | true 48 | 49 | 50 | 51 | snapshots-repo 52 | https://oss.sonatype.org/content/repositories/snapshots 53 | 54 | false 55 | 56 | 57 | true 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /supersync/src/main/java/io/bestcloud/ledger/LedgerClient.java: -------------------------------------------------------------------------------- 1 | package io.bestcloud.ledger; 2 | 3 | import java.io.File; 4 | import java.util.Properties; 5 | import java.util.concurrent.TimeUnit; 6 | 7 | import org.hyperledger.fabric.sdk.BlockEvent.TransactionEvent; 8 | import org.hyperledger.fabric.sdk.Channel; 9 | import org.hyperledger.fabric.sdk.EventHub; 10 | import org.hyperledger.fabric.sdk.HFClient; 11 | import org.hyperledger.fabric.sdk.Orderer; 12 | import org.hyperledger.fabric.sdk.Peer; 13 | import org.hyperledger.fabric.sdk.security.CryptoSuite; 14 | 15 | /** 16 | * Ledger client for simple use 17 | * 18 | * @author wuzhihui 19 | * 20 | */ 21 | public class LedgerClient { 22 | private final String channelName; 23 | private final Channel channel; 24 | private final HFClient client; 25 | private final Peer peer; 26 | private final Orderer orderer; 27 | 28 | private static Properties getProperties() { 29 | final Properties grpcProps = new Properties(); 30 | 31 | grpcProps.put("grpc.NettyChannelBuilderOption.maxMessageSize", new Integer(1024 * 1024 * 60)); 32 | grpcProps.put("grpc.NettyChannelBuilderOption.maxInboundMessageSize", new Integer(1024 * 1024 * 60)); 33 | grpcProps.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] { 5L, TimeUnit.MINUTES }); 34 | grpcProps.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] { 8L, TimeUnit.SECONDS }); 35 | return grpcProps; 36 | } 37 | 38 | public LedgerClient() throws Exception { 39 | String orgPrivateKeyFile = LedgerUtil.getProp("orgPrivateKeyFile"); 40 | String orgAdminCertificateFile = LedgerUtil.getProp("orgAdminCertificateFile"); 41 | 42 | String kstore = LedgerUtil.getProp("kstore"); 43 | final String domainName = LedgerUtil.getProp("domainName"); 44 | String orgName = LedgerUtil.getProp("orgName"); 45 | String orgMSP = LedgerUtil.getProp("orgMSP"); 46 | String orderAddr = LedgerUtil.getProp("orderAddr"); 47 | 48 | String peerName = LedgerUtil.getProp("peerName"); 49 | String peerAddr = LedgerUtil.getProp("peerAddr"); 50 | String peerEventAddr = LedgerUtil.getProp("peerEventAddr"); 51 | channelName = LedgerUtil.getProp("channelName"); 52 | 53 | SampleOrg org = new SampleOrg(orgName, orgMSP); 54 | org.setDomainName(domainName); 55 | SampleStore sampleStore = new SampleStore(new File(kstore)); 56 | SampleUser peerAdminUser = sampleStore.getMember("Admin", orgName, org.getMSPID(), new File(orgPrivateKeyFile), 57 | new File(orgAdminCertificateFile)); 58 | org.setPeerAdmin(peerAdminUser); 59 | // Create instance of client. 60 | client = HFClient.createNewInstance(); 61 | client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite()); 62 | client.setUserContext(org.getPeerAdmin()); 63 | 64 | peer = client.newPeer(peerName, peerAddr, getProperties()); 65 | orderer = client.newOrderer("blockchain-orderer", orderAddr, getProperties()); 66 | channel = client.newChannel(channelName); 67 | channel.addOrderer(orderer); 68 | channel.addPeer(peer); 69 | 70 | EventHub eventHub = client.newEventHub(peerName + "EvenHub", peerEventAddr, getProperties()); 71 | channel.addEventHub(eventHub); 72 | channel.initialize(); 73 | 74 | } 75 | 76 | public String getChannelName() { 77 | return channelName; 78 | } 79 | 80 | public Channel getChannel() { 81 | return channel; 82 | } 83 | 84 | public HFClient getHFClient() { 85 | return client; 86 | } 87 | 88 | public Peer getPeer() { 89 | return peer; 90 | } 91 | 92 | public Orderer getOrderer() { 93 | return orderer; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /supersync/src/main/java/io/bestcloud/supersyn/DataSyLogRec.java: -------------------------------------------------------------------------------- 1 | package io.bestcloud.supersyn; 2 | 3 | import java.util.LinkedList; 4 | 5 | /** 6 | * 数据同步日志记录 7 | * 8 | * @author wuzhihui 9 | * 10 | */ 11 | public class DataSyLogRec { 12 | public long blockID; 13 | public LinkedList txSeqs = new LinkedList<>(); 14 | 15 | public boolean containT(String txSeq) { 16 | return txSeqs.contains(txSeq); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /supersync/src/main/java/io/bestcloud/supersyn/DataSynLogRecorder.java: -------------------------------------------------------------------------------- 1 | package io.bestcloud.supersyn; 2 | 3 | import java.io.IOException; 4 | import java.nio.file.Files; 5 | import java.nio.file.Path; 6 | import java.nio.file.Paths; 7 | import java.nio.file.StandardOpenOption; 8 | 9 | public class DataSynLogRecorder { 10 | 11 | private DataSyLogRec lastSyLogRec; 12 | private Path logFile; 13 | 14 | public DataSynLogRecorder(String txLogFile) { 15 | this.logFile = Paths.get(txLogFile); 16 | } 17 | 18 | public void loadSynLog() throws IOException { 19 | lastSyLogRec = new DataSyLogRec(); 20 | lastSyLogRec.blockID = -1; 21 | 22 | if (!Files.exists(logFile)) { 23 | Files.createFile(logFile); 24 | } else { 25 | Files.lines(logFile).forEach(line -> { 26 | String[] txLogItems = line.split(","); 27 | long curBlockId = Long.valueOf(txLogItems[0]); 28 | if (curBlockId > lastSyLogRec.blockID) { 29 | lastSyLogRec.blockID = curBlockId; 30 | lastSyLogRec.txSeqs.clear(); 31 | } 32 | lastSyLogRec.txSeqs.add(txLogItems[1]); 33 | }); 34 | 35 | } 36 | } 37 | 38 | public void addTXSeq(long curBlockID, String txSeq) throws IOException { 39 | if (curBlockID != lastSyLogRec.blockID) { 40 | lastSyLogRec.blockID = curBlockID; 41 | lastSyLogRec.txSeqs.clear(); 42 | } 43 | lastSyLogRec.txSeqs.add(txSeq); 44 | byte[] line = (curBlockID + "," + txSeq + "," + System.currentTimeMillis()+"\r\n").getBytes("iso-8859-1"); 45 | Files.write(logFile, line, StandardOpenOption.APPEND); 46 | 47 | } 48 | 49 | public DataSyLogRec getLastDataSyLogRec() { 50 | 51 | return lastSyLogRec; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /supersync/src/main/java/io/bestcloud/supersyn/DataSynProcess.java: -------------------------------------------------------------------------------- 1 | package io.bestcloud.supersyn; 2 | 3 | public abstract class DataSynProcess { 4 | 5 | /** 6 | * 执行同步逻辑,如果成功或者已经成功同步这笔数据,返回TRUE,否则返回FALSE,未来继续同步 7 | * @param syncData 8 | * @return 9 | */ 10 | public abstract boolean processSynData(byte[] syncData); 11 | 12 | } 13 | 14 | -------------------------------------------------------------------------------- /supersync/src/main/java/io/bestcloud/supersyn/DemoSynProcessor.java: -------------------------------------------------------------------------------- 1 | package io.bestcloud.supersyn; 2 | 3 | public class DemoSynProcessor extends DataSynProcess{ 4 | 5 | @Override 6 | public boolean processSynData(byte[] syncData) { 7 | System.out.println("synchronize data ,length "+syncData); 8 | return true; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /supersync/src/main/java/io/bestcloud/supersyn/SynDataOmitter.java: -------------------------------------------------------------------------------- 1 | package io.bestcloud.supersyn; 2 | 3 | import org.hyperledger.fabric.sdk.ChaincodeID; 4 | import org.hyperledger.fabric.sdk.TransactionProposalRequest; 5 | 6 | import io.bestcloud.ledger.LedgerClient; 7 | import io.bestcloud.ledger.LedgerUtil; 8 | 9 | public class SynDataOmitter { 10 | private LedgerClient client; 11 | private ChaincodeID chaincodeID; 12 | 13 | public SynDataOmitter() { 14 | 15 | } 16 | 17 | public void start() throws Exception { 18 | client = new LedgerClient(); 19 | String mychaincodeName = LedgerUtil.getProp("chaincodeName"); 20 | String mychaincodeVersion = LedgerUtil.getProp("chaincodeVersion"); 21 | chaincodeID = ChaincodeID.newBuilder().setName(mychaincodeName).setVersion(mychaincodeVersion).build(); 22 | 23 | } 24 | 25 | public String commitSynDataTx(byte[] synData) throws Exception { 26 | TransactionProposalRequest txProposal = client.getHFClient().newTransactionProposalRequest(); 27 | txProposal.setArgBytes(new byte[][] { "dbsync".getBytes(), synData }); 28 | txProposal.setFcn("invoke"); 29 | txProposal.setChaincodeID(chaincodeID); 30 | return LedgerUtil.commitTransaction(txProposal, client.getChannel()); 31 | } 32 | 33 | public static void main(String[] args) throws Exception { 34 | SynDataOmitter omitter = new SynDataOmitter(); 35 | omitter.start(); 36 | byte[] data = ("insert into mytable values (" + System.currentTimeMillis() % 1000 + ")").getBytes(); 37 | String transactionId = omitter.commitSynDataTx(data); 38 | System.out.println("success commited syn data transaction " + transactionId); 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /supersync/src/main/resources/conf.properties: -------------------------------------------------------------------------------- 1 | orgPrivateKeyFile = org1-user/keystore/key.pem 2 | orgAdminCertificateFile = org1-user/admincerts/Admin@org1.example.com-cert.pem 3 | kstore = fabric.ks 4 | domainName=org1.example.com 5 | orgName =Org1 6 | orgMSP = Org1MSP 7 | orderAddr = grpc://192.168.18.134:31010 8 | peerName="Org1Peer1" 9 | peerAddr = grpc://192.168.18.134:30110 10 | peerEventAddr =grpc://192.168.18.134:30111 11 | channelName=channel1 12 | chaincodeName=mychaincode 13 | chaincodeVersion=v2 14 | dataSynProcessor=io.bestcloud.supersyn.DemoSynProcessor 15 | dataSynTxlogFile=txlogs/txlog.data 16 | 17 | -------------------------------------------------------------------------------- /supersync/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright IBM Corp. All Rights Reserved. 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | # Root logger option 7 | log4j.rootLogger=INFO, stdout 8 | 9 | 10 | 11 | # Direct log messages to stdout 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.Target=System.out 14 | log4j.appender.stdout.layout=org.apache.log4j.EnhancedPatternLayout 15 | #log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 16 | # log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 17 | log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601}{GMT} %t %-5p %c{1}:%L - %m%n 18 | log4j.category.org.hyperledger.fabric=DEBUG 19 | log4j.category.org.hyperledger.fabric_ca=DEBUG 20 | -------------------------------------------------------------------------------- /supersync/txlogs/txlog.data: -------------------------------------------------------------------------------- 1 | 5,0ef225b29cf72db78c999b70546a0097b6357f82e8a7dbba8ee265f03e35a21f_1,1511858045587 2 | 6,fb02b6e75cbaf7458210104302a6cf6411d682f3c74ef48ac1830d335526dba9_1,1511858283398 3 | 7,1796d91ff3f6617947e2dcced5535a551d91b6aecf3a37baf638cf36fbe79499_1,1511858712179 4 | --------------------------------------------------------------------------------