├── .externalToolBuilders └── org.eclipse.m2e.core.maven2Builder.launch ├── .project ├── .settings ├── org.eclipse.core.resources.prefs └── org.eclipse.m2e.core.prefs ├── README.MD ├── pom.xml ├── wallet-admin ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .jsdtscope │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.wst.jsdt.ui.superType.name │ └── org.eclipse.wst.validation.prefs └── pom.xml ├── wallet-base ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── .jsdtscope │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.wst.jsdt.ui.superType.name │ └── org.eclipse.wst.validation.prefs ├── WebContent │ ├── META-INF │ │ └── MANIFEST.MF │ ├── WEB-INF │ │ ├── lib │ │ │ └── com.springsource.com.mchange.v2.c3p0-0.9.1.2modifu.jar │ │ ├── rest-servlet.xml │ │ └── web.xml │ └── index.html ├── pom.xml └── src │ ├── gens │ └── java │ │ └── META-INF │ │ └── MANIFEST.MF │ └── main │ ├── java │ └── com │ │ └── fr │ │ └── chain │ │ ├── db │ │ ├── dao │ │ │ ├── CommonSqlMapper.java │ │ │ └── CommonSqlProvider.java │ │ ├── exception │ │ │ └── JPAException.java │ │ ├── iface │ │ │ ├── DynamicTableDaoSupport.java │ │ │ └── StaticTableDaoSupport.java │ │ └── service │ │ │ ├── DataService.java │ │ │ └── impl │ │ │ └── MysqlDataService.java │ │ ├── enums │ │ └── BaseStatusEnum.java │ │ ├── utils │ │ ├── BeanFactory.java │ │ ├── CharUtil.java │ │ ├── CheckUtil.java │ │ ├── CommonToolUtil.java │ │ ├── CommonUtil.java │ │ ├── CustomDateSerializer.java │ │ ├── DBBean.java │ │ ├── DataToJson.java │ │ ├── DateRangeUtil.java │ │ ├── DateStyle.java │ │ ├── DateTimeFM.java │ │ ├── DateUtil.java │ │ ├── DateUtils.java │ │ ├── DecryptUtil.java │ │ ├── Escape.java │ │ ├── FConfig.java │ │ ├── GzipUtil.java │ │ ├── IDGenerator.java │ │ ├── ISerializer.java │ │ ├── JoinSQLUtils.java │ │ ├── JsonSerializer.java │ │ ├── JsonUtil.java │ │ ├── MBUtil.java │ │ ├── NumberFormatUtil.java │ │ ├── NumberUtil.java │ │ ├── ObjectUtil.java │ │ ├── RC4.java │ │ ├── SerializerUtil.java │ │ ├── StringEscapeUtil.java │ │ ├── StringUtil.java │ │ ├── TimestampUtils.java │ │ ├── TransformDate.java │ │ └── TransformString.java │ │ └── web │ │ ├── action │ │ └── BasicCtrl.java │ │ ├── bean │ │ ├── Col.java │ │ ├── DbCondi.java │ │ ├── FieldsMapperBean.java │ │ ├── ListInfo.java │ │ ├── MenuInfo.java │ │ ├── PageInfo.java │ │ ├── QueryMapperBean.java │ │ ├── ReturnInfo.java │ │ ├── SqlMaker.java │ │ └── Tab.java │ │ ├── bind │ │ ├── Constans.java │ │ ├── FieldUtils.java │ │ ├── FieldsMapperResolver.java │ │ ├── KeyExplainHandler.java │ │ ├── MapWapper.java │ │ ├── QueryMapperResolver.java │ │ ├── RequestJsonParam.java │ │ ├── RequestJsonParamMethodArgumentResolver.java │ │ ├── RestObjectMapper.java │ │ └── UTF8StringHttpMessageConverter.java │ │ ├── filter │ │ └── SessionOutHandle.java │ │ ├── security │ │ └── MyFilterSecurityInterceptor.java │ │ └── start │ │ └── Starter.java │ └── resources │ ├── SpringContext-Common.xml │ ├── SpringContext-Mysql.xml │ └── sql-map-config.xml ├── wallet-gen-dao ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ └── org.eclipse.wst.validation.prefs ├── pom.xml └── src │ └── main │ └── java │ ├── SpringContext-daoConfig-chaintrade.xml │ ├── SpringContext-daoConfig-property.xml │ ├── SpringContext-daoConfig-trade.xml │ ├── SpringContext-daoConfig-wallet.xml │ └── com │ └── fr │ └── chain │ ├── chaintrade │ └── db │ │ ├── dao │ │ └── ChainTradeDao.java │ │ ├── entity │ │ ├── ChainTrade.java │ │ ├── ChainTradeExample.java │ │ └── ChainTradeKey.java │ │ └── mapper │ │ ├── ChainTradeMapper.java │ │ └── ChainTradeSqlProvider.java │ ├── ewallet │ └── db │ │ ├── dao │ │ └── WalletAdressDao.java │ │ ├── entity │ │ ├── WalletAdress.java │ │ ├── WalletAdressExample.java │ │ └── WalletAdressKey.java │ │ └── mapper │ │ ├── WalletAdressMapper.java │ │ └── WalletAdressSqlProvider.java │ ├── property │ └── db │ │ ├── dao │ │ ├── ProductDigitDao.java │ │ ├── ProductInfoDao.java │ │ └── PropertyDao.java │ │ ├── entity │ │ ├── ProductDigit.java │ │ ├── ProductDigitExample.java │ │ ├── ProductDigitKey.java │ │ ├── ProductInfo.java │ │ ├── ProductInfoExample.java │ │ ├── ProductInfoKey.java │ │ ├── Property.java │ │ ├── PropertyExample.java │ │ └── PropertyKey.java │ │ └── mapper │ │ ├── ProductDigitMapper.java │ │ ├── ProductDigitSqlProvider.java │ │ ├── ProductInfoMapper.java │ │ ├── ProductInfoSqlProvider.java │ │ ├── PropertyMapper.java │ │ └── PropertySqlProvider.java │ └── trade │ └── db │ ├── dao │ ├── TradeFlowDao.java │ └── TradeOrderDao.java │ ├── entity │ ├── TradeFlow.java │ ├── TradeFlowExample.java │ ├── TradeFlowKey.java │ ├── TradeOrder.java │ ├── TradeOrderExample.java │ └── TradeOrderKey.java │ └── mapper │ ├── TradeFlowMapper.java │ ├── TradeFlowSqlProvider.java │ ├── TradeOrderMapper.java │ └── TradeOrderSqlProvider.java ├── wallet-iface ├── .classpath ├── .externalToolBuilders │ ├── org.eclipse.m2e.core.maven2Builder (1).launch │ ├── org.eclipse.wst.common.project.facet.core.builder.launch │ ├── org.eclipse.wst.jsdt.core.javascriptValidator.launch │ └── org.eclipse.wst.validation.validationbuilder.launch ├── .gitignore ├── .project ├── .settings │ ├── .jsdtscope │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.wst.jsdt.ui.superType.name │ └── org.eclipse.wst.validation.prefs ├── WebContent │ ├── META-INF │ │ └── MANIFEST.MF │ ├── WEB-INF │ │ ├── rest-servlet.xml │ │ └── web.xml │ └── index.html ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── fr │ │ └── chain │ │ ├── common │ │ ├── HttpRequestHelper.java │ │ └── HttpRequestor.java │ │ ├── controller │ │ ├── property │ │ │ ├── ProcessPropertyMsg.java │ │ │ └── PropertyCtrl.java │ │ ├── trade │ │ │ ├── ProcessTradeMsg.java │ │ │ └── TradeOrderCtrl.java │ │ └── wallet │ │ │ ├── ProcessWalletAdressMsg.java │ │ │ └── WalletAdressCtrl.java │ │ ├── enums │ │ └── BaseStatusEnum.java │ │ ├── facadeservice │ │ ├── property │ │ │ ├── PropertyService.java │ │ │ └── impl │ │ │ │ └── PropertyServiceImpl.java │ │ ├── trade │ │ │ ├── TradeOrderService.java │ │ │ └── impl │ │ │ │ └── TradeOrderServiceImpl.java │ │ └── wallet │ │ │ ├── WalletService.java │ │ │ └── impl │ │ │ └── WalletServiceImpl.java │ │ ├── message │ │ ├── Message.java │ │ ├── MessageBuilder.java │ │ ├── MessageException.java │ │ ├── MsgBody.java │ │ └── ResponseMsg.java │ │ ├── schedule │ │ └── TradeOrderSchedule.java │ │ └── vo │ │ ├── property │ │ ├── CreatePropertyVo.java │ │ ├── ProductPublicInfoVo.java │ │ ├── QueryPropertyVo.java │ │ ├── Res_CreatePropertyVo.java │ │ └── Res_QueryPropertyVo.java │ │ ├── trade │ │ ├── ChangePropertyVo.java │ │ ├── GetPropertyVo.java │ │ ├── QueryTradeFlowVo.java │ │ ├── QueryTradeOrderVo.java │ │ ├── Res_QueryTradeFlowVo.java │ │ ├── Res_QueryTradeOrderVo.java │ │ ├── Res_SendPropertyVo.java │ │ ├── Res_TransDigitVo.java │ │ ├── SendPropertyVo.java │ │ └── TransDigitVo.java │ │ └── wallet │ │ ├── QueryWalletAdressVo.java │ │ └── Res_QueryWalletAdressVo.java │ └── resources │ ├── SpringContext-Common.xml │ ├── SpringContext-Mysql.xml │ ├── SpringContext-Schedule.xml │ ├── config.properties │ ├── log4j.properties │ └── sql-map-config.xml ├── wallet-service ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ └── org.eclipse.wst.validation.prefs ├── pom.xml └── src │ └── main │ └── java │ ├── com │ └── fr │ │ └── chain │ │ ├── enums │ │ ├── PropertyStatusEnum.java │ │ ├── PropertyTypeEnum.java │ │ ├── SystemOpenIdEnum.java │ │ ├── TradeStatusEnum.java │ │ └── TradeTypeEnum.java │ │ ├── property │ │ └── service │ │ │ ├── CreatePropertyService.java │ │ │ ├── DelPropertyService.java │ │ │ ├── QueryPropertyService.java │ │ │ ├── UpdatePropertyService.java │ │ │ └── impl │ │ │ ├── CreatePropertyServiceImpl.java │ │ │ ├── DelPropertyServiceImpl.java │ │ │ ├── QueryPropertyServiceImpl.java │ │ │ └── UpdatePropertyServiceImpl.java │ │ ├── trade │ │ └── service │ │ │ ├── CreateTradeOrderService.java │ │ │ ├── DelTradeOrderService.java │ │ │ ├── QueryTradeOrderService.java │ │ │ ├── UpdateTradeOrderService.java │ │ │ └── impl │ │ │ ├── CreateTradeOrderServiceImpl.java │ │ │ ├── DelTradeOrderServiceImpl.java │ │ │ ├── QueryTradeOrderServiceImpl.java │ │ │ └── UpdateTradeOrderServiceImpl.java │ │ └── wallet │ │ └── service │ │ ├── CreateWalletAdressService.java │ │ ├── DelWalletAdressService.java │ │ ├── QueryWalletAdressService.java │ │ ├── UpdateWalletAdressService.java │ │ └── impl │ │ ├── CreateWalletAdressImpl.java │ │ ├── DelWalletAdressServiceImpl.java │ │ ├── QueryWalletAdressServiceImpl.java │ │ └── UpdateWalletAdressServiceImpl.java │ └── conf │ ├── SpringContext-daoConfig-chaintrade.xml │ ├── SpringContext-daoConfig-property.xml │ ├── SpringContext-daoConfig-trade.xml │ └── SpringContext-daoConfig-wallet.xml └── wallet-web-rest ├── .classpath ├── .gitignore ├── .project ├── .settings ├── .jsdtscope ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.wst.jsdt.ui.superType.name └── org.eclipse.wst.validation.prefs └── pom.xml /.externalToolBuilders/org.eclipse.m2e.core.maven2Builder.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wallet 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.ui.externaltools.ExternalToolBuilder 10 | full,incremental, 11 | 12 | 13 | LaunchConfigHandle 14 | <project>/.externalToolBuilders/org.eclipse.m2e.core.maven2Builder.launch 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | 22 | 23 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | wallet group project 2 | -------------------------------------------------------------------------------- /wallet-admin/.classpath: -------------------------------------------------------------------------------- 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 | 37 | 38 | -------------------------------------------------------------------------------- /wallet-admin/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /wallet-admin/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wallet-admin 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.jem.workbench.JavaEMFNature 36 | org.eclipse.wst.common.modulecore.ModuleCoreNature 37 | org.eclipse.jdt.core.javanature 38 | org.eclipse.m2e.core.maven2Nature 39 | org.eclipse.wst.common.project.facet.core.nature 40 | org.eclipse.wst.jsdt.core.jsNature 41 | 42 | 43 | -------------------------------------------------------------------------------- /wallet-admin/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=utf-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.7 9 | -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | uses 9 | 10 | 11 | uses 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /wallet-admin/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /wallet-base/.classpath: -------------------------------------------------------------------------------- 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 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /wallet-base/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /wallet-base/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wallet-base 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.jem.workbench.JavaEMFNature 36 | org.eclipse.wst.common.modulecore.ModuleCoreNature 37 | org.eclipse.jdt.core.javanature 38 | org.eclipse.m2e.core.maven2Nature 39 | org.eclipse.wst.common.project.facet.core.nature 40 | org.eclipse.wst.jsdt.core.jsNature 41 | 42 | 43 | -------------------------------------------------------------------------------- /wallet-base/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/gens/java=UTF-8 3 | encoding//src/main/java=UTF-8 4 | encoding//src/main/resources=UTF-8 5 | encoding//src/test/java=utf-8 6 | encoding//src/test/resources=UTF-8 7 | encoding/=UTF-8 8 | -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.7 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 13 | org.eclipse.jdt.core.compiler.source=1.7 14 | -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /wallet-base/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /wallet-base/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /wallet-base/WebContent/WEB-INF/lib/com.springsource.com.mchange.v2.c3p0-0.9.1.2modifu.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CryptoWorldChain/ewallet/2c74c42fef82b750c24681755f18b1647edc8b62/wallet-base/WebContent/WEB-INF/lib/com.springsource.com.mchange.v2.c3p0-0.9.1.2modifu.jar -------------------------------------------------------------------------------- /wallet-base/WebContent/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | rest 8 | 9 | 10 | index.html 11 | 12 | 13 | 14 | contextConfigLocation 15 | classpath*:SpringContext-*.xml 16 | 17 | 18 | log4jConfigLocation 19 | classpath*:log4j.properties 20 | 21 | 22 | 23 | -1 24 | 25 | 26 | 27 | org.springframework.web.context.ContextLoaderListener 28 | 29 | 30 | 31 | Set Character Encoding 32 | org.springframework.web.filter.CharacterEncodingFilter 33 | 34 | encoding 35 | UTF-8 36 | 37 | 38 | 39 | 40 | Set Character Encoding 41 | /* 42 | 43 | 44 | SessionFilter 45 | com.fr.chain.web.filter.SessionOutHandle 46 | 47 | 48 | SessionFilter 49 | /* 50 | 51 | 52 | com.fr.chain.web.start.Starter 53 | 54 | 55 | 56 | rest 57 | org.springframework.web.servlet.DispatcherServlet 58 | 1 59 | 60 | 61 | 62 | rest 63 | / 64 | 65 | 66 | 67 | 68 | HiddenHttpMethodFilter 69 | org.springframework.web.filter.HiddenHttpMethodFilter 70 | 71 | 72 | 73 | HiddenHttpMethodFilter 74 | rest 75 | 76 | 77 | -------------------------------------------------------------------------------- /wallet-base/WebContent/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | hello here 6 | 7 | 8 | hello 9 | 10 | -------------------------------------------------------------------------------- /wallet-base/src/gens/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/db/dao/CommonSqlMapper.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.db.dao; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.SelectProvider; 7 | 8 | public interface CommonSqlMapper { 9 | 10 | @SelectProvider(type=CommonSqlProvider.class,method="executeSql") 11 | public List> executeSql(String sql); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/db/dao/CommonSqlProvider.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.db.dao; 2 | 3 | public class CommonSqlProvider { 4 | 5 | public String executeSql(String sql){ 6 | return sql; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/db/exception/JPAException.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.db.exception; 2 | 3 | public class JPAException extends Exception{ 4 | 5 | private static final long serialVersionUID = 3129124709055457388L; 6 | 7 | /** 8 | * Constructs a new exception with the specified detail message. 9 | * The cause is not initialized, and may subsequently be 10 | * initialized by a call to {@link #initCause}. 11 | * 12 | * @param message the detail message. The detail message is saved for 13 | * later retrieval by the {@link #getMessage()} method. 14 | */ 15 | public JPAException(String message) { 16 | super(message); 17 | } 18 | 19 | /** 20 | * Constructs a new exception with the specified detail message 21 | * and cause. 22 | * 23 | *

Note that the detail message associated with 24 | * {@code cause} is not automatically incorporated in 25 | * this exception's detail message. 26 | * 27 | * @param message the detail message (which is saved for later retrieval 28 | * by the {@link #getMessage()} method). 29 | * @param cause the cause (which is saved for later retrieval by the 30 | * {@link #getCause()} method). (A {@code null} value is 31 | * permitted, and indicates that the cause is nonexistent or 32 | * unknown.) 33 | */ 34 | public JPAException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | /** 39 | * Constructs a new exception with the specified cause and a detail 40 | * message of {@code (cause==null ? null : cause.toString())} (which 41 | * typically contains the class and detail message of {@code cause}). 42 | * 43 | * @param cause the cause (which is saved for later retrieval by the 44 | * {@link #getCause()} method). (A {@code null} value is 45 | * permitted, and indicates that the cause is nonexistent or 46 | * unknown.) 47 | */ 48 | public JPAException(Throwable cause) { 49 | super(cause); 50 | } 51 | 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/db/iface/DynamicTableDaoSupport.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.db.iface; 2 | 3 | import java.util.List; 4 | 5 | public interface DynamicTableDaoSupport { 6 | 7 | int countByExample(D example,String table); 8 | 9 | int deleteByExample(D example,String table); 10 | 11 | int deleteByPrimaryKey(K key,String table); 12 | 13 | int insert(T record,String table); 14 | 15 | int insertSelective(T record,String table); 16 | 17 | int batchInsert(List records,String table) ; 18 | 19 | int batchUpdate(List records,String table) ; 20 | 21 | int batchDelete(List records,String table) ; 22 | 23 | List selectByExample(D example,String table) ; 24 | 25 | T selectByPrimaryKey(K key,String table); 26 | 27 | List findAll(List records,String table) ; 28 | 29 | int updateByExampleSelective(T record, D example,String table); 30 | 31 | int updateByExample(T record, D example,String table); 32 | 33 | int updateByPrimaryKeySelective(T record,String table); 34 | 35 | int updateByPrimaryKey(T record,String table); 36 | 37 | int sumByExample(D example,String table); 38 | 39 | void deleteAll(String table); 40 | 41 | D getExample(T record); 42 | 43 | } -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/db/iface/StaticTableDaoSupport.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.db.iface; 2 | 3 | import java.util.List; 4 | 5 | public interface StaticTableDaoSupport { 6 | 7 | int countByExample(D example); 8 | 9 | int deleteByExample(D example); 10 | 11 | int deleteByPrimaryKey(K key); 12 | 13 | int insert(T record); 14 | 15 | int insertSelective(T record); 16 | 17 | int batchInsert(List records) ; 18 | 19 | int batchUpdate(List records) ; 20 | 21 | int batchDelete(List records) ; 22 | 23 | List selectByExample(D example) ; 24 | 25 | T selectByPrimaryKey(K key); 26 | 27 | List findAll(List records) ; 28 | 29 | int updateByExampleSelective(T record, D example); 30 | 31 | int updateByExample(T record, D example); 32 | 33 | int updateByPrimaryKeySelective(T record); 34 | 35 | int updateByPrimaryKey(T record); 36 | 37 | int sumByExample(D example); 38 | 39 | void deleteAll(); 40 | 41 | D getExample(T record); 42 | 43 | } -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/db/service/DataService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.db.service; 2 | 3 | 4 | 5 | public interface DataService { 6 | 7 | Object doBySQL(String sql) throws Exception; 8 | 9 | String doBySQL2jsonstr(String sql) throws Exception; 10 | 11 | public int getCount(String sql) throws Exception; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/BeanFactory.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | 5 | 6 | import org.springframework.beans.BeansException; 7 | import org.springframework.context.ApplicationContext; 8 | import org.springframework.context.ApplicationContextAware; 9 | 10 | 11 | 12 | /** 13 | * bean容器 14 | */ 15 | @Slf4j 16 | public class BeanFactory implements ApplicationContextAware { 17 | private static ApplicationContext ctx; 18 | 19 | public static Object getBean(String beanName) { 20 | return ctx.getBean(beanName); 21 | } 22 | 23 | @Override 24 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 25 | ctx = applicationContext; 26 | } 27 | 28 | public static ApplicationContext getCtx() { 29 | return ctx; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/CheckUtil.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.io.File; 4 | import java.util.regex.Pattern; 5 | 6 | /** 7 | * 数据验证工具类 8 | * @author fcpays 9 | * 10 | */ 11 | public class CheckUtil{ 12 | /** 13 | * 默认构造器 14 | */ 15 | private CheckUtil() { 16 | 17 | } 18 | 19 | /** 20 | * 检查是否为合法的Email(合法Email返回true,非法Email返回false) 21 | * @param mailStr 被检查字符串Email 22 | * @return boolean 合法返回true,非法返回false 23 | */ 24 | public static boolean isMailAddressTrue(String mailStr) { 25 | if (mailStr == null) { 26 | return false; 27 | } 28 | String mailstr = "[\\w|.]{3,16}@[\\w+\\.]+[\\w]{2,3}"; 29 | Pattern pn = Pattern.compile(mailstr); 30 | boolean b = pn.matcher(mailStr).matches(); 31 | System.out.println(b); 32 | return b; 33 | } 34 | 35 | /** 36 | * 判断文件是否存在(文件存在返回true,文件不存在返回false) 37 | * @param fileSrc 文件路径 38 | * @return boolean 文件存在返回true,文件不存在返回false. 39 | */ 40 | public static boolean isFileExist(String fileSrc) { 41 | File file = new File(fileSrc); 42 | return (file.exists()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/CommonToolUtil.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | /** 8 | * @date 2014.10.11 15:40 9 | * @author APaul 10 | * @desc Create some common utility methods class 11 | */ 12 | public class CommonToolUtil { 13 | 14 | public static Date strToDate(String str){ 15 | Date date = null; 16 | if(str!=null&&str!=""&&!"".equals(str)){ 17 | try { 18 | SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); 19 | date = s.parse(str); 20 | } catch (ParseException e) { 21 | // TODO Auto-generated catch block 22 | e.printStackTrace(); 23 | } 24 | } 25 | return date; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/CustomDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.io.IOException; 4 | import java.util.Date; 5 | 6 | import org.codehaus.jackson.JsonGenerator; 7 | import org.codehaus.jackson.JsonProcessingException; 8 | import org.codehaus.jackson.map.JsonSerializer; 9 | import org.codehaus.jackson.map.SerializerProvider; 10 | 11 | /** 12 | * 自定义返回JSON 数据格中日期格式化处理 13 | * 14 | * @author Michael Sun 15 | */ 16 | public class CustomDateSerializer extends JsonSerializer { 17 | @Override 18 | public void serialize(Date value, JsonGenerator jgen, 19 | SerializerProvider provider) throws IOException, 20 | JsonProcessingException { 21 | String formattedDate = DateUtil.format(value, DateStyle.YYYY_MM_DD_HH_MM_SS); 22 | jgen.writeString(formattedDate); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/DBBean.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import lombok.Getter; 7 | 8 | import org.apache.commons.lang3.StringUtils; 9 | 10 | import com.fr.chain.web.bean.Tab; 11 | 12 | 13 | 14 | public enum DBBean { 15 | adminoperator("T_ADMIN_OPERATOR",true), 16 | adminoperatorrole("T_ADMIN_OPERATOR_ROLE",true), 17 | adminpermission("T_ADMIN_PERMISSION",true), 18 | adminrole("T_ADMIN_ROLE",true), 19 | phdmedicalprocess("T_P_HD_MEDICAL_PROCESS",true), 20 | phdphysicalexam("T_P_HD_PHYSICAL_EXAM",true), 21 | phdmedicalhistory("T_P_HD_MEDICAL_HISTORY",true), 22 | adminrolepermission("T_ADMIN_ROLE_PERMISSION",true), 23 | patientoperation("T_P_PATIENT_OPERATION",true), 24 | 25 | tmpmedicineadvice("T_P_ADVICE_MEDICINE_TMP",true), 26 | oralmedicineadvice("T_P_ADVICE_MEDICINE_ORAL",true), 27 | examinemedicineadvice("T_P_ADVICE_EXAMINE",true), 28 | 29 | dialysisadvice("T_P_ADVICE_DIALYSIS",true), 30 | spritzemedicineadvice("T_P_ADVICE_MEDICINE_SPRITZE",true); 31 | 32 | 33 | @Getter 34 | private String table; 35 | @Getter 36 | private boolean staticTable; 37 | 38 | private DBBean(String table,boolean staticTable) { 39 | this.table = table; 40 | this.staticTable = staticTable; 41 | } 42 | private static Map classMap = new HashMap<>(); 43 | 44 | static{ 45 | for(DBBean info :DBBean.values()){ 46 | classMap.put(info.name(), info); 47 | } 48 | } 49 | 50 | public static String getTableName2Class(Class clazz){ 51 | //从注解里读取表名 52 | Tab classTabAnno = clazz.getAnnotation(Tab.class); 53 | if (classTabAnno != null) { 54 | return classTabAnno.name(); 55 | } else { 56 | return classMap.get(clazz.getSimpleName().toLowerCase()).getTable(); 57 | } 58 | } 59 | 60 | public static String getDomain2Class(Class clazz){ 61 | return clazz.getSimpleName().toLowerCase(); 62 | } 63 | 64 | public static String getTable2Name(String name){ 65 | name = name.toLowerCase(); 66 | if(StringUtils.contains(name, separator)){ 67 | String[] str = StringUtils.split(name, separator); 68 | String tableName = classMap.get(str[0]).getTable(); 69 | for(int i = 1 ;i Object serialize(T data); 15 | 16 | public Object serializeArray(List list); 17 | 18 | public T deserialize(Object bytes, Class clazz); 19 | 20 | public List deserializeArray(Object bytes, Class clazz); 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/JsonSerializer.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.io.IOException; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.codehaus.jackson.JsonNode; 8 | import org.codehaus.jackson.map.DeserializationConfig.Feature; 9 | import org.codehaus.jackson.map.ObjectMapper; 10 | import org.codehaus.jackson.node.ArrayNode; 11 | import org.codehaus.jackson.util.TokenBuffer; 12 | 13 | class JsonSerializer implements ISerializer { 14 | 15 | private final static JsonSerializer instance = new JsonSerializer(); 16 | 17 | private JsonSerializer() { 18 | } 19 | 20 | public static JsonSerializer getInstance() { 21 | return instance; 22 | } 23 | 24 | @Override 25 | public T deserialize(Object dataArray, Class clazz) { 26 | try { 27 | if (dataArray != null) { 28 | return mapper.readValue(new String((byte[])dataArray, DEFAULT_CHARSET), 29 | clazz); 30 | } 31 | return null; 32 | } catch (Exception e) { 33 | throw new RuntimeException(e); 34 | } 35 | } 36 | 37 | @Override 38 | public Object serialize(T data) { 39 | try { 40 | if (data == null) { 41 | return null; 42 | } 43 | TokenBuffer buffer = new TokenBuffer(mapper); 44 | mapper.writeValue(buffer, data); 45 | return mapper.readTree(buffer.asParser()).toString() 46 | .getBytes(DEFAULT_CHARSET); 47 | } catch (Exception e) { 48 | throw new RuntimeException(e); 49 | } 50 | } 51 | 52 | @Override 53 | public Object serializeArray(List list) { 54 | return this.serialize(list); 55 | } 56 | 57 | @Override 58 | public List deserializeArray(Object bytes, Class clazz) { 59 | try { 60 | List list = new ArrayList<>(); 61 | String jsontxt = new String((byte[])bytes, DEFAULT_CHARSET); 62 | ArrayNode nodes = mapper.readValue(jsontxt , ArrayNode.class); 63 | for(JsonNode node : nodes){ 64 | list.add(mapper.readValue(node, clazz)); 65 | } 66 | return list; 67 | } catch (IOException e) { 68 | throw new RuntimeException(e); 69 | } 70 | } 71 | 72 | static ObjectMapper mapper = new ObjectMapper(); 73 | static { 74 | mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/JsonUtil.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.codehaus.jackson.JsonNode; 7 | import org.codehaus.jackson.annotate.JsonAutoDetect; 8 | import org.codehaus.jackson.map.DeserializationConfig.Feature; 9 | import org.codehaus.jackson.map.ObjectMapper; 10 | import org.codehaus.jackson.node.ArrayNode; 11 | import org.codehaus.jackson.node.ObjectNode; 12 | import org.codehaus.jackson.util.TokenBuffer; 13 | 14 | public class JsonUtil { 15 | static ObjectMapper mapper = new ObjectMapper(); 16 | static 17 | { 18 | mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); 19 | mapper.setVisibilityChecker(mapper.getSerializationConfig().getDefaultVisibilityChecker() 20 | .withFieldVisibility(JsonAutoDetect.Visibility.ANY) 21 | .withGetterVisibility(JsonAutoDetect.Visibility.NONE) 22 | .withSetterVisibility(JsonAutoDetect.Visibility.NONE) 23 | .withCreatorVisibility(JsonAutoDetect.Visibility.NONE)); 24 | } 25 | 26 | public static T json2Bean(JsonNode node, Class clazz) { 27 | try { 28 | return mapper.readValue(node, clazz); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | throw new RuntimeException(e); 32 | } 33 | } 34 | 35 | 36 | public static T json2Bean(String jsonTxt, Class clazz) { 37 | try { 38 | return mapper.readValue(jsonTxt, clazz); 39 | } catch (Exception e) { 40 | e.printStackTrace(); 41 | throw new RuntimeException(e); 42 | } 43 | } 44 | public static List json2List(String jsontxt,Class clazz){ 45 | List list = new ArrayList<>(); 46 | ArrayNode nodes = toArrayNode(jsontxt); 47 | for(JsonNode node : nodes){ 48 | list.add(json2Bean(node, clazz)); 49 | } 50 | return list; 51 | } 52 | public static String list2Json(List list){ 53 | ArrayNode arrynode = newArrayNode(); 54 | for(T t: list){ 55 | arrynode.add(bean2Json(t)); 56 | } 57 | return arrynode.toString(); 58 | } 59 | 60 | public static JsonNode bean2Json(Object bean) { 61 | try { 62 | if(bean==null) 63 | { 64 | return null; 65 | } 66 | TokenBuffer buffer = new TokenBuffer(mapper); 67 | mapper.writeValue(buffer, bean); 68 | JsonNode node = mapper.readTree(buffer.asParser()); 69 | return node; 70 | } catch (Exception e) { 71 | e.printStackTrace(); 72 | throw new RuntimeException(e); 73 | } 74 | } 75 | 76 | public static ArrayNode newArrayNode() { 77 | return mapper.createArrayNode(); 78 | } 79 | 80 | public static ArrayNode toArrayNode(String jsontxt) { 81 | try { 82 | return mapper.readValue(jsontxt, ArrayNode.class); 83 | } catch (Exception e) { 84 | throw new RuntimeException(e); 85 | } 86 | } 87 | 88 | public static ObjectNode toObjectNode(String jsontxt) { 89 | try { 90 | return mapper.readValue(jsontxt, ObjectNode.class); 91 | } catch (Exception e) { 92 | throw new RuntimeException(e); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/MBUtil.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.math.BigDecimal; 4 | 5 | public class MBUtil { 6 | 7 | public static BigDecimal toBigDec(String v) { 8 | if (v != null) { 9 | try { 10 | Double db = Double.parseDouble(v); 11 | return BigDecimal.valueOf(db); 12 | } catch (NumberFormatException e) { 13 | } 14 | } 15 | return null; 16 | } 17 | 18 | public static Double toDbl(String v) { 19 | if (v != null) { 20 | try { 21 | return Double.parseDouble(v); 22 | } catch (NumberFormatException e) { 23 | } 24 | } 25 | return null; 26 | } 27 | public static Integer toInt(String v){ 28 | if(v!=null){ 29 | try { 30 | return Integer.parseInt(v); 31 | } catch (NumberFormatException e) { 32 | } 33 | } 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/ObjectUtil.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import org.apache.commons.lang3.ObjectUtils; 4 | 5 | /** 6 | * 对象处理工具类 7 | * @author fcpays 8 | * 这里面的方法引用apache.commons.lang-2.3里的ObjectUtils类 9 | */ 10 | public class ObjectUtil { 11 | 12 | /** 13 | * 构造函数 14 | * 15 | */ 16 | public ObjectUtil(){ 17 | 18 | } 19 | 20 | 21 | /** 22 | * 如果对象的值为null返回默认值,否则返回对象的值,引用apache.commons.lang包里ObjectUtils.defaultIfNull(Object object, Object defaultValue)方法。
23 | * @param object 检验的对象,可以为null。 24 | * @param defaultValue 返回的默认值,可能为null。 25 | * @return 对象的值或默认值 26 | */ 27 | public static Object defaultIfNull(Object object, Object defaultValue) { 28 | return ObjectUtils.defaultIfNull(object,defaultValue); 29 | } 30 | 31 | /** 32 | * 比较两个对象是否相等,两个对象都可能为空,引用apache.commons.lang包里ObjectUtils.equals(Object object1, Object object2)方法。
33 | * @param object1 对象1,可以为null。 34 | * @param object2 对象2,可以为null。 35 | * @return 两个对象相同返回true,否则返回false。 36 | */ 37 | public static boolean equals(Object object1, Object object2) { 38 | return ObjectUtils.equals(object1,object2); 39 | } 40 | 41 | /** 42 | * 获得对象的编码,如果对象不为null返回对象编码,否则返回0,引用apache.commons.lang包里ObjectUtils.hashCode(Object obj)方法。
43 | * @param obj 需要获得编码的对象,可以为null。 44 | * @return 如果对象不为null返回对象编码,否则返回0。 45 | */ 46 | public static int hashCode(Object obj) { 47 | return ObjectUtils.hashCode(obj); 48 | } 49 | 50 | /** 51 | * 把对象的转换成字符串或对象为null时转换成"",引用apache.commons.lang包里ObjectUtils.toString(Object obj)方法。
52 | * 例:
53 | * ObjectUtils.toString(null) = ""
54 | * ObjectUtils.toString("") = ""
55 | * ObjectUtils.toString("bat") = "bat"
56 | * @param obj 转换的对象,可以为null。 57 | * @return 如果对象为null返回"",否则返回obj.toString()。 58 | */ 59 | public static String toString(Object obj) { 60 | return ObjectUtils.toString(obj); 61 | } 62 | 63 | /** 64 | * 对象按给定的参数nullStr替换,引用apache.commons.lang包里ObjectUtils.toString(Object obj, String nullStr)方法。
65 | * 例:
66 | * ObjectUtils.toString(null, null) = null
67 | * ObjectUtils.toString(null, "null") = "null"
68 | * ObjectUtils.toString("", "null") = ""
69 | * ObjectUtils.toString("bat", "null") = "bat"
70 | * @param obj 转换的对象,可以为null。 71 | * @param nullStr 返回的字符串,可以为null。 72 | * @return 如果参数obj为null返回null,否则返回obj.toString()。 73 | */ 74 | public static String toString(Object obj, String nullStr) { 75 | return ObjectUtils.toString(obj,nullStr); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/RC4.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | 5 | import org.apache.commons.codec.binary.Base64; 6 | import org.bouncycastle.crypto.CipherParameters; 7 | import org.bouncycastle.crypto.engines.RC4Engine; 8 | import org.bouncycastle.crypto.params.KeyParameter; 9 | 10 | public class RC4{ 11 | public int[] box = new int[256]; 12 | 13 | public RC4(String key){ 14 | byte[] k = key.getBytes(); 15 | int i = 0, x = 0, t = 0, l = k.length; 16 | 17 | for(i=0; i<256; i++){ 18 | box[i] = i; 19 | } 20 | 21 | for(i=0; i<256; i++){ 22 | x = (x+box[i]+k[i%l]) % 256; 23 | 24 | t = box[x]; 25 | box[x] = box[i]; 26 | box[i] = t; 27 | } 28 | } 29 | 30 | public byte[] make(byte[] data){ 31 | int t, o, i=0, j = 0, l = data.length; 32 | byte[] out = new byte[l]; 33 | int[] ibox = new int[256]; 34 | System.arraycopy(box, 0, ibox, 0, 256); 35 | 36 | for(int c=0; c Object serialize(T data) { 16 | return json.serialize(data); 17 | } 18 | 19 | public static T deserialize(Object dataArray, Class clazz) { 20 | if(dataArray == null){ 21 | try { 22 | return clazz.newInstance(); 23 | } catch (InstantiationException e) { 24 | // TODO Auto-generated catch block 25 | e.printStackTrace(); 26 | } catch (IllegalAccessException e) { 27 | // TODO Auto-generated catch block 28 | e.printStackTrace(); 29 | } 30 | } 31 | return json.deserialize(dataArray, clazz); 32 | } 33 | 34 | public static Object serializeArray(List list) { 35 | if(list == null || list.size() == 0){ 36 | return new ArrayList<>(); 37 | } 38 | return json.serializeArray(list); 39 | } 40 | 41 | public static List deserializeArray(Object bytes, Class clazz) { 42 | if(bytes == null){ 43 | return new ArrayList<>(); 44 | } 45 | return json.deserializeArray(bytes, clazz); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/utils/TimestampUtils.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.utils; 2 | 3 | 4 | import java.sql.Timestamp; 5 | import java.util.Date; 6 | 7 | 8 | /** 9 | * Timestamp格式化工具类 10 | * @author fcpays 11 | * 12 | */ 13 | public class TimestampUtils { 14 | 15 | /** 16 | * 把Date日期类型转换成Timestamp日期类型 17 | * @param date 要转换的日期 18 | * @return Timestamp 转换后的Timestamp日期 19 | */ 20 | public static Timestamp parseForDate(Date date) { 21 | long longTime = date.getTime(); 22 | return new Timestamp(longTime); 23 | } 24 | 25 | /** 26 | * 把String日期类型转换成Timestamp类型,参数格式为10位的字符串,如:"yyyy-MM-dd" 27 | * @param strDate 原日期字符串 28 | * @return Timestamp 转换后的Timestamp类型日期 29 | * @throws IllegalArgumentException 如果给定的参数不是"yyyy-mm-dd hh:mm:ss"或长于"yyyy-mm-dd hh:mm:ss"的长度则抛出异常 30 | */ 31 | public static Timestamp parseTimestamp(String strDate) { 32 | if (strDate != null && !"".equals(strDate) && strDate.length() == 10) { 33 | strDate = strDate + " 00:00:00.0"; 34 | } 35 | return Timestamp.valueOf(strDate); 36 | } 37 | 38 | /** 39 | * 将timestamp日期
40 | * 转换为用于sql文的字符串(to_timestamp('2007-04-18 00:00:00.0' , 'yyyy-mm-dd hh24:mi:ssxff')) 41 | * @param timestamp 待转换的日期 42 | * @return String 返回如:to_timestamp('2007-04-18 00:00:00.0','yyyy-mm-dd hh24:mi:ssxff')的字符串 43 | */ 44 | public static String toTimeStamp(Timestamp timestamp) { 45 | String sql = "to_timestamp('" + timestamp.toString() + "' , 'yyyy-mm-dd hh24:mi:ssxff')"; 46 | return sql; 47 | } 48 | 49 | /** 50 | * 将格式如2007-04-18 00:00:00.0的日期字符串,
51 | * 转换为用于sql的字符串(to_timestamp('2007-04-18 00:00:00.0' , 'yyyy-mm-dd hh24:mi:ssxff')) 52 | * @param str 待转换的字符串 53 | * @return String 返回如:to_timestamp('2007-04-18 00:00:00.0' , 'yyyy-mm-dd hh24:mi:ssxff')的字符串 54 | */ 55 | public static String toTimeStamp(String str) { 56 | String sql = "to_timestamp('" + str + "' , 'yyyy-mm-dd hh24:mi:ssxff')"; 57 | return sql; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/action/BasicCtrl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.action; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.validation.ObjectError; 6 | import org.springframework.web.bind.MethodArgumentNotValidException; 7 | import org.springframework.web.bind.annotation.ExceptionHandler; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | 10 | import com.fr.chain.web.bean.ReturnInfo; 11 | 12 | public class BasicCtrl { 13 | 14 | @ExceptionHandler(MethodArgumentNotValidException.class) 15 | @ResponseBody 16 | public ReturnInfo handleMethodArgumentNotValidException( MethodArgumentNotValidException error ) { 17 | 18 | //return ReturnInfo.Faild; 19 | List errors = error.getBindingResult().getAllErrors(); 20 | 21 | StringBuffer errorStr = new StringBuffer(); 22 | int count = 0; 23 | for(ObjectError er: errors){ 24 | if(count != 0){ 25 | 26 | errorStr.append("∞"); 27 | } 28 | errorStr.append(er.getDefaultMessage()); 29 | count++; 30 | } 31 | return new ReturnInfo( (errorStr.toString()), 0, null,false); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/Col.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | @Target({ElementType.FIELD,ElementType.METHOD}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface Col { 11 | public String name() default ""; 12 | public String tableAlias() default ""; 13 | public boolean autoField() default true; 14 | } 15 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/DbCondi.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import java.util.Map; 4 | 5 | import lombok.Data; 6 | 7 | public @Data class DbCondi { 8 | 9 | private Class keyClass; 10 | private Class entityClass; 11 | private Class mapperClass; 12 | private FieldsMapperBean fmb; 13 | private PageInfo pageinfo; 14 | private QueryMapperBean qmb; 15 | private Map other; 16 | } 17 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/FieldsMapperBean.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import lombok.Data; 7 | 8 | public @Data class FieldsMapperBean { 9 | 10 | List fields = new ArrayList<>(); 11 | 12 | public @Data static class SearchField{ 13 | private String fieldName; 14 | private int show;//1:true 0:false 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/ListInfo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import lombok.Data; 7 | 8 | @Data 9 | public class ListInfo { 10 | 11 | int total_rows; 12 | List rows; 13 | int totalPages; 14 | int skip; 15 | int limit; 16 | // String identifier; 17 | // String secondid; 18 | // String label; 19 | 20 | public ListInfo(int total_rows, List rows, PageInfo para) { 21 | super(); 22 | // identifier = ""; 23 | init(total_rows, rows, para.getSkip(), para.getLimit()); 24 | } 25 | 26 | public ListInfo(int total_rows, List rows, int skip, int limit) { 27 | super(); 28 | // identifier = ""; 29 | init(total_rows, rows, skip, limit); 30 | } 31 | 32 | public ListInfo(String identifier, int total_rows, List rows, int skip, 33 | int limit) { 34 | super(); 35 | // this.identifier = identifier; 36 | // this.identifier = ""; 37 | init(total_rows, rows, skip, limit); 38 | } 39 | 40 | public void init(int total_rows, List rows, int skip, int limit) { 41 | this.total_rows = total_rows; 42 | this.rows = rows; 43 | if (rows!=null&&rows.size() > 0) { 44 | this.totalPages = total_rows / limit 45 | + (total_rows % limit == 0 ? 0 : 1); 46 | } else { 47 | this.totalPages = 0; 48 | } 49 | this.skip = skip; 50 | this.limit = limit; 51 | } 52 | 53 | public ListInfo() { 54 | super(); 55 | rows=new ArrayList(); 56 | } 57 | 58 | public T getItem(int index) 59 | { 60 | if(index>=0&&index0) 73 | { 74 | return rows.get(0); 75 | } 76 | return null; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/MenuInfo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import lombok.Data; 7 | 8 | /** 9 | * 主菜单信息 10 | * 11 | */ 12 | public @Data class MenuInfo { 13 | private String name; 14 | private String icon; 15 | private String url; 16 | private List children = new ArrayList<>(); 17 | } 18 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/PageInfo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | public class PageInfo { 7 | 8 | private @Setter boolean page; 9 | private @Setter Integer skip; 10 | private @Setter Integer limit; 11 | private @Setter @Getter boolean sortModed; 12 | private @Setter String sort; 13 | public Integer getSkip() { 14 | return skip==null?0:skip; 15 | } 16 | public Integer getLimit() { 17 | return limit==null?Integer.MAX_VALUE:limit; 18 | } 19 | public String getSort() { 20 | return sort; 21 | } 22 | public boolean isPage() { 23 | return page; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/QueryMapperBean.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import lombok.Data; 4 | 5 | import org.codehaus.jackson.JsonNode; 6 | 7 | @Data 8 | public class QueryMapperBean { 9 | private JsonNode node=null; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/ReturnInfo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ReturnInfo { 7 | private String description; 8 | private int retcode; 9 | private Object retObj; 10 | private boolean success; 11 | public final static ReturnInfo Success = new ReturnInfo("success", 0, null,true); 12 | public final static ReturnInfo Faild = new ReturnInfo("failed", 0, null,false); 13 | 14 | 15 | public ReturnInfo(String description, int retcode, Object retObj,boolean success) { 16 | super(); 17 | this.description = description; 18 | this.retcode = retcode; 19 | this.retObj = retObj; 20 | this.success = success; 21 | } 22 | 23 | public ReturnInfo(String description,boolean success) { 24 | super(); 25 | this.description = description; 26 | this.retcode = 0; 27 | this.retObj = null; 28 | this.success = success; 29 | } 30 | 31 | public ReturnInfo(boolean success) { 32 | super(); 33 | this.description = ""; 34 | this.retcode = 0; 35 | this.retObj = null; 36 | this.success = success; 37 | } 38 | 39 | public ReturnInfo() { 40 | super(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bean/Tab.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bean; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.Target; 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | @Target(ElementType.TYPE) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface Tab { 11 | public String name() default ""; 12 | public String tableAlias() default ""; 13 | } 14 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bind/Constans.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bind; 2 | 3 | public class Constans { 4 | //用户 状态 5 | public static final int VALID = 1; //有效 6 | public static final int INVALID = 0;//无效 7 | } 8 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bind/FieldUtils.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bind; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.InvocationTargetException; 5 | import java.lang.reflect.Method; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import org.springframework.util.ReflectionUtils; 10 | import org.springframework.util.StringUtils; 11 | 12 | public class FieldUtils { 13 | 14 | public static List allDeclaredField(Class clazz) { 15 | List fieldList = new ArrayList<>(); 16 | Class targetClass = clazz; 17 | do { 18 | Field[] fields = targetClass.getDeclaredFields(); 19 | for (Field field : fields) { 20 | fieldList.add(field); 21 | } 22 | targetClass = targetClass.getSuperclass(); 23 | } while (targetClass != null && targetClass != Object.class); 24 | return fieldList; 25 | } 26 | 27 | public static Object getObjectValue(Object pojo,String fieldName) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ 28 | String methodName = "get" + StringUtils.capitalize(fieldName); 29 | Method method = ReflectionUtils.findMethod(pojo.getClass(), methodName); 30 | Object obj = method.invoke(pojo); 31 | return obj; 32 | } 33 | 34 | public static void setObjectValue(Object pojo,Field field,Object value) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ 35 | String methodName = "set" + StringUtils.capitalize(field.getName()); 36 | Method method = ReflectionUtils.findMethod(pojo.getClass(), methodName,field.getType()); 37 | method.invoke(pojo,value); 38 | } 39 | 40 | public static String field2SqlColomn(String field) { 41 | StringBuffer buff = new StringBuffer(); 42 | for (int i = 0; i < field.length(); i++) { 43 | char ch = field.charAt(i); 44 | if (ch >= 'A' && ch <= 'Z') { 45 | buff.append("_").append(ch); 46 | } else { 47 | buff.append(ch); 48 | } 49 | } 50 | return buff.toString().toUpperCase(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bind/FieldsMapperResolver.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bind; 2 | 3 | import java.util.Iterator; 4 | import java.util.Map; 5 | import java.util.Map.Entry; 6 | 7 | import org.codehaus.jackson.JsonNode; 8 | import org.codehaus.jackson.node.ObjectNode; 9 | 10 | import com.fr.chain.utils.JsonUtil; 11 | import com.fr.chain.web.bean.FieldsMapperBean; 12 | import com.fr.chain.web.bean.FieldsMapperBean.SearchField; 13 | 14 | public class FieldsMapperResolver { 15 | 16 | public static FieldsMapperBean genQueryMapper(String json) { 17 | FieldsMapperBean fmb = new FieldsMapperBean(); 18 | ObjectNode node = JsonUtil.toObjectNode(json); 19 | Iterator> iter = node.getFields(); 20 | while (iter.hasNext()) { 21 | Entry entry = iter.next(); 22 | String key = entry.getKey(); 23 | JsonNode value = entry.getValue(); 24 | SearchField sf = new SearchField(); 25 | sf.setFieldName(key); 26 | sf.setShow(value.asInt()); 27 | fmb.getFields().add(sf); 28 | } 29 | return fmb; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bind/KeyExplainHandler.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bind; 2 | 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.InvocationTargetException; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | import org.apache.commons.lang3.ObjectUtils; 9 | import org.apache.commons.lang3.StringUtils; 10 | import org.codehaus.jackson.map.ObjectMapper; 11 | 12 | public class KeyExplainHandler { 13 | 14 | private static ObjectMapper mapper = new ObjectMapper(); 15 | public final static String ID_KEY = "_id"; 16 | 17 | // field-value_field-value_ 18 | @SuppressWarnings("rawtypes") 19 | public static String genKey(HashMap map, Class clazz) { 20 | StringBuffer key = new StringBuffer(); 21 | for (Field field : FieldUtils.allDeclaredField(clazz)) { 22 | key.append(field.getName()).append("-") 23 | .append(map.get(field.getName())).append("_"); 24 | } 25 | return key.toString(); 26 | } 27 | 28 | public static String genPojoKey(T pojo,Class keyClazz) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ 29 | StringBuffer key = new StringBuffer(); 30 | for(Field field : FieldUtils.allDeclaredField(keyClazz)){ 31 | key.append(field.getName()).append("-") 32 | .append(ObjectUtils.toString(FieldUtils.getObjectValue(pojo, field.getName()))).append("_"); 33 | } 34 | return key.toString(); 35 | } 36 | 37 | 38 | /** 39 | * 40 | * @param key 41 | * @param pojo example::ParaDbproperties 42 | * @param keyClass example::ParaDbpropertiesKey 43 | * @return 44 | * @throws IllegalAccessException 45 | * @throws IllegalArgumentException 46 | * @throws InvocationTargetException 47 | */ 48 | @SuppressWarnings("unchecked") 49 | public static T explainKey(String key, T pojo) throws IllegalAccessException, 50 | IllegalArgumentException, InvocationTargetException { 51 | Map fvMap = new HashMap<>(); 52 | String[] strs = StringUtils.split(key, "_"); 53 | for (String s : strs) { 54 | String[] fvs = StringUtils.split(s, "-"); 55 | if(fvs.length > 1 && !"null".equals(fvs[1]) && !"".equals(fvs[1])){ 56 | fvMap.put(fvs[0], fvs[1]); 57 | } 58 | // else{ 59 | // System.out.println("#######"+s); 60 | // } 61 | } 62 | //get Key 63 | // for (Field field : FieldUtils.allDeclaredField(pojo.getClass())) { 64 | //// if(fvMap.get(field.getName())!=null){ 65 | //// FieldUtils.setObjectValue(pojo, field,fvMap.get(field.getName())); 66 | //// } 67 | // Object value = FieldUtils.getObjectValue(pojo, field.getName()); 68 | // if(value!=null){ 69 | // fvMap.put(field.getName(), value); 70 | // } 71 | // } 72 | T source = (T) converType(fvMap, pojo.getClass()); 73 | for (Field field : FieldUtils.allDeclaredField(source.getClass())) { 74 | Object value = FieldUtils.getObjectValue(source, field.getName()); 75 | if(value!=null){ 76 | FieldUtils.setObjectValue(pojo, field, value); 77 | } 78 | } 79 | fvMap.clear(); 80 | return pojo; 81 | } 82 | 83 | private static T converType(Object source,Class clazz){ 84 | return mapper.convertValue(source, clazz); 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bind/MapWapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.fr.chain.web.bind; 18 | 19 | import java.util.Collection; 20 | import java.util.HashMap; 21 | import java.util.Map; 22 | import java.util.Set; 23 | 24 | /** 25 | *绑定JSON/自定义 数据到 Map 26 | * 27 | * @author 28 | * 29 | * @param 30 | * @param 31 | */ 32 | public class MapWapper { 33 | 34 | private Map innerMap = new HashMap(); 35 | 36 | public void setInnerMap(Map innerMap) { 37 | this.innerMap = innerMap; 38 | } 39 | 40 | public Map getInnerMap() { 41 | return innerMap; 42 | } 43 | 44 | public void clear() { 45 | innerMap.clear(); 46 | } 47 | 48 | public boolean containsKey(Object key) { 49 | return innerMap.containsKey(key); 50 | } 51 | 52 | public boolean containsValue(Object value) { 53 | return innerMap.containsValue(value); 54 | } 55 | 56 | public Set> entrySet() { 57 | return innerMap.entrySet(); 58 | } 59 | 60 | public boolean equals(Object o) { 61 | return innerMap.equals(o); 62 | } 63 | 64 | public V get(Object key) { 65 | return innerMap.get(key); 66 | } 67 | 68 | public int hashCode() { 69 | return innerMap.hashCode(); 70 | } 71 | 72 | public boolean isEmpty() { 73 | return innerMap.isEmpty(); 74 | } 75 | 76 | public Set keySet() { 77 | return innerMap.keySet(); 78 | } 79 | 80 | public V put(K key, V value) { 81 | return innerMap.put(key, value); 82 | } 83 | 84 | public void putAll(Map m) { 85 | innerMap.putAll(m); 86 | } 87 | 88 | public V remove(Object key) { 89 | return innerMap.remove(key); 90 | } 91 | 92 | public int size() { 93 | return innerMap.size(); 94 | } 95 | 96 | public Collection values() { 97 | return innerMap.values(); 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | return innerMap.toString(); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bind/RequestJsonParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.fr.chain.web.bind; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * 27 | * 该注解用于绑定请求参数(JSON字符串) 28 | * 29 | */ 30 | @Target(ElementType.PARAMETER) 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Documented 33 | public @interface RequestJsonParam { 34 | 35 | /** 36 | * 用于绑定的请求参数名字 37 | */ 38 | String value() default ""; 39 | 40 | /** 41 | * 是否必须,默认是 42 | */ 43 | boolean required() default true; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/bind/UTF8StringHttpMessageConverter.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.bind; 2 | 3 | import java.nio.charset.Charset; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeansException; 8 | import org.springframework.beans.factory.config.BeanPostProcessor; 9 | import org.springframework.http.MediaType; 10 | import org.springframework.http.converter.StringHttpMessageConverter; 11 | 12 | public class UTF8StringHttpMessageConverter implements BeanPostProcessor { 13 | @Override 14 | public Object postProcessAfterInitialization(Object bean, String beanName) 15 | throws BeansException { 16 | if (bean instanceof StringHttpMessageConverter) { 17 | MediaType mediaType = new MediaType("text", "plain", 18 | Charset.forName("UTF-8")); 19 | List types = new ArrayList(); 20 | types.add(mediaType); 21 | ((StringHttpMessageConverter) bean).setSupportedMediaTypes(types); 22 | } 23 | return bean; 24 | } 25 | 26 | @Override 27 | public Object postProcessBeforeInitialization(Object bean, String beanName) 28 | throws BeansException { 29 | return bean; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/filter/SessionOutHandle.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.filter; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.Filter; 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.FilterConfig; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.ServletRequest; 10 | import javax.servlet.ServletResponse; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import javax.servlet.http.HttpSession; 14 | 15 | import org.apache.commons.lang3.StringUtils; 16 | 17 | public class SessionOutHandle implements Filter { 18 | 19 | @Override 20 | public void init(FilterConfig filterConfig) throws ServletException { 21 | // TODO Auto-generated method stub 22 | } 23 | 24 | @Override 25 | public void doFilter(ServletRequest request, ServletResponse response, 26 | FilterChain chain) throws IOException, ServletException { 27 | 28 | String loginUrl = "/login"; 29 | String usernameKey = "username"; 30 | 31 | String path = ((HttpServletRequest) request).getServletPath(); 32 | boolean login = false; 33 | if (StringUtils.contains(path, loginUrl)) { 34 | login = true; 35 | } 36 | HttpSession session = ((HttpServletRequest) request).getSession(); 37 | String name = (String) session.getAttribute(usernameKey); 38 | if (name == null&&!login) { 39 | if (((HttpServletRequest) request).getHeader("x-requested-with") != null 40 | && ((HttpServletRequest) request).getHeader( 41 | "x-requested-with").equalsIgnoreCase( // ajax超时处理 42 | "XMLHttpRequest")) { 43 | ((HttpServletResponse) response).addHeader("sessionstatus", 44 | "timeout"); 45 | } else {// http超时的处理 46 | ((HttpServletRequest) request).getRequestDispatcher( 47 | "/login.html").forward(request, response); 48 | } 49 | } else { 50 | chain.doFilter(request, response); 51 | } 52 | } 53 | 54 | @Override 55 | public void destroy() { 56 | 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/security/MyFilterSecurityInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.security; 2 | 3 | import java.io.IOException; 4 | 5 | 6 | import javax.servlet.Filter; 7 | import javax.servlet.FilterChain; 8 | import javax.servlet.FilterConfig; 9 | import javax.servlet.ServletException; 10 | import javax.servlet.ServletRequest; 11 | import javax.servlet.ServletResponse; 12 | 13 | //import org.springframework.security.access.ConfigAttribute; 14 | import org.springframework.security.access.SecurityMetadataSource; 15 | import org.springframework.security.access.intercept.AbstractSecurityInterceptor; 16 | import org.springframework.security.access.intercept.InterceptorStatusToken; 17 | //import org.springframework.security.core.Authentication; 18 | //import org.springframework.security.core.context.SecurityContextHolder; 19 | import org.springframework.security.web.FilterInvocation; 20 | import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; 21 | 22 | public class MyFilterSecurityInterceptor extends AbstractSecurityInterceptor 23 | implements Filter { 24 | 25 | private FilterInvocationSecurityMetadataSource securityMetadataSource; 26 | 27 | @Override 28 | public void init(FilterConfig filterConfig) throws ServletException { 29 | } 30 | 31 | @Override 32 | public void doFilter(ServletRequest request, ServletResponse response, 33 | FilterChain chain) throws IOException, ServletException { 34 | FilterInvocation fi = new FilterInvocation(request, response, chain); 35 | invoke(fi); 36 | } 37 | 38 | @Override 39 | public void destroy() { 40 | } 41 | 42 | @Override 43 | public Class getSecureObjectClass() { 44 | return FilterInvocation.class; 45 | } 46 | 47 | @Override 48 | public SecurityMetadataSource obtainSecurityMetadataSource() { 49 | return this.securityMetadataSource; 50 | } 51 | 52 | public FilterInvocationSecurityMetadataSource getSecurityMetadataSource() { 53 | return this.securityMetadataSource; 54 | } 55 | 56 | 57 | public void invoke(FilterInvocation fi) throws IOException, 58 | ServletException { 59 | InterceptorStatusToken token = super.beforeInvocation(fi); 60 | try { 61 | fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); 62 | } finally { 63 | super.afterInvocation(token, null); 64 | } 65 | } 66 | 67 | public void setSecurityMetadataSource( 68 | FilterInvocationSecurityMetadataSource securityMetadataSource) { 69 | this.securityMetadataSource = securityMetadataSource; 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /wallet-base/src/main/java/com/fr/chain/web/start/Starter.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.web.start; 2 | 3 | import javax.servlet.ServletContextEvent; 4 | import javax.servlet.ServletContextListener; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | /** 10 | * 启动器 11 | * 12 | */ 13 | public class Starter implements ServletContextListener { 14 | 15 | private Logger log = LoggerFactory.getLogger(Starter.class); 16 | 17 | @Override 18 | public void contextInitialized(ServletContextEvent sce) { 19 | log.warn("WEB启动成功"); 20 | } 21 | 22 | @Override 23 | public void contextDestroyed(ServletContextEvent sce) { 24 | log.warn("WEB关闭成功"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /wallet-base/src/main/resources/SpringContext-Common.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /wallet-base/src/main/resources/sql-map-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /wallet-gen-dao/.classpath: -------------------------------------------------------------------------------- 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 | 37 | 38 | -------------------------------------------------------------------------------- /wallet-gen-dao/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /wallet-gen-dao/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wallet-gen-dao 4 | 5 | 6 | wallet-base 7 | 8 | 9 | 10 | org.eclipse.wst.common.project.facet.core.builder 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javabuilder 16 | 17 | 18 | 19 | 20 | org.eclipse.wst.validation.validationbuilder 21 | 22 | 23 | 24 | 25 | org.eclipse.m2e.core.maven2Builder 26 | 27 | 28 | 29 | 30 | 31 | org.eclipse.jem.workbench.JavaEMFNature 32 | org.eclipse.wst.common.modulecore.ModuleCoreNature 33 | org.eclipse.jdt.core.javanature 34 | org.eclipse.m2e.core.maven2Nature 35 | org.eclipse.wst.common.project.facet.core.nature 36 | 37 | 38 | -------------------------------------------------------------------------------- /wallet-gen-dao/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=utf-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /wallet-gen-dao/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.7 9 | -------------------------------------------------------------------------------- /wallet-gen-dao/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /wallet-gen-dao/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | uses 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /wallet-gen-dao/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /wallet-gen-dao/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /wallet-gen-dao/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.fr.chain 5 | wallet 6 | 0.0.1-SNAPSHOT 7 | 8 | wallet-gen-dao 9 | 10 | 11 | 12 | 13 | 14 | src/main/java 15 | 16 | **/*.xml 17 | 18 | 19 | 20 | src/main/resources 21 | 22 | **/*.xmls 23 | 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-javadoc-plugin 31 | 2.10.1 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-surefire-plugin 38 | 2.4.3 39 | 40 | true 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-compiler-plugin 46 | 3.1 47 | 48 | 1.7 49 | 1.7 50 | utf-8 51 | 52 | src/gens/java 53 | src/main/java 54 | 55 | 56 | 57 | 58 | org.codehaus.mojo 59 | build-helper-maven-plugin 60 | 1.5 61 | 62 | 63 | generate-sources 64 | 65 | add-source 66 | 67 | 68 | 69 | src/main/java 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | com.fr.chain 82 | wallet-base 83 | 0.0.1-SNAPSHOT 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/SpringContext-daoConfig-chaintrade.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/SpringContext-daoConfig-property.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/SpringContext-daoConfig-trade.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/SpringContext-daoConfig-wallet.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/com/fr/chain/chaintrade/db/entity/ChainTradeKey.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.chaintrade.db.entity; 2 | 3 | public class ChainTradeKey { 4 | /** 5 | * This field was generated by MyBatis Generator. 6 | * This field corresponds to the database column CHAIN_TRADE.CHAIN_TRADE_ID 7 | * 8 | * @mbggenerated Fri Feb 24 10:10:34 CST 2017 9 | */ 10 | private String chainTradeId; 11 | 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method returns the value of the database column CHAIN_TRADE.CHAIN_TRADE_ID 15 | * 16 | * @return the value of CHAIN_TRADE.CHAIN_TRADE_ID 17 | * 18 | * @mbggenerated Fri Feb 24 10:10:34 CST 2017 19 | */ 20 | public String getChainTradeId() { 21 | return chainTradeId; 22 | } 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method sets the value of the database column CHAIN_TRADE.CHAIN_TRADE_ID 27 | * 28 | * @param chainTradeId the value for CHAIN_TRADE.CHAIN_TRADE_ID 29 | * 30 | * @mbggenerated Fri Feb 24 10:10:34 CST 2017 31 | */ 32 | public void setChainTradeId(String chainTradeId) { 33 | this.chainTradeId = chainTradeId; 34 | } 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table CHAIN_TRADE 39 | * 40 | * @mbggenerated Fri Feb 24 10:10:34 CST 2017 41 | */ 42 | @Override 43 | public boolean equals(Object that) { 44 | if (this == that) { 45 | return true; 46 | } 47 | if (that == null) { 48 | return false; 49 | } 50 | if (getClass() != that.getClass()) { 51 | return false; 52 | } 53 | ChainTradeKey other = (ChainTradeKey) that; 54 | return (this.getChainTradeId() == null ? other.getChainTradeId() == null : this.getChainTradeId().equals(other.getChainTradeId())); 55 | } 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table CHAIN_TRADE 60 | * 61 | * @mbggenerated Fri Feb 24 10:10:34 CST 2017 62 | */ 63 | @Override 64 | public int hashCode() { 65 | final int prime = 31; 66 | int result = 1; 67 | result = prime * result + ((getChainTradeId() == null) ? 0 : getChainTradeId().hashCode()); 68 | return result; 69 | } 70 | 71 | /** 72 | * This method was generated by MyBatis Generator. 73 | * This method corresponds to the database table CHAIN_TRADE 74 | * 75 | * @mbggenerated Fri Feb 24 10:10:34 CST 2017 76 | */ 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", chainTradeId=").append(chainTradeId); 84 | sb.append("]"); 85 | return sb.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/com/fr/chain/ewallet/db/entity/WalletAdressKey.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.ewallet.db.entity; 2 | 3 | public class WalletAdressKey { 4 | /** 5 | * This field was generated by MyBatis Generator. 6 | * This field corresponds to the database column WALLET_ADDRESS.WALLET_ID 7 | * 8 | * @mbggenerated Fri Feb 24 10:10:32 CST 2017 9 | */ 10 | private String walletId; 11 | 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method returns the value of the database column WALLET_ADDRESS.WALLET_ID 15 | * 16 | * @return the value of WALLET_ADDRESS.WALLET_ID 17 | * 18 | * @mbggenerated Fri Feb 24 10:10:32 CST 2017 19 | */ 20 | public String getWalletId() { 21 | return walletId; 22 | } 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method sets the value of the database column WALLET_ADDRESS.WALLET_ID 27 | * 28 | * @param walletId the value for WALLET_ADDRESS.WALLET_ID 29 | * 30 | * @mbggenerated Fri Feb 24 10:10:32 CST 2017 31 | */ 32 | public void setWalletId(String walletId) { 33 | this.walletId = walletId; 34 | } 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table WALLET_ADDRESS 39 | * 40 | * @mbggenerated Fri Feb 24 10:10:32 CST 2017 41 | */ 42 | @Override 43 | public boolean equals(Object that) { 44 | if (this == that) { 45 | return true; 46 | } 47 | if (that == null) { 48 | return false; 49 | } 50 | if (getClass() != that.getClass()) { 51 | return false; 52 | } 53 | WalletAdressKey other = (WalletAdressKey) that; 54 | return (this.getWalletId() == null ? other.getWalletId() == null : this.getWalletId().equals(other.getWalletId())); 55 | } 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table WALLET_ADDRESS 60 | * 61 | * @mbggenerated Fri Feb 24 10:10:32 CST 2017 62 | */ 63 | @Override 64 | public int hashCode() { 65 | final int prime = 31; 66 | int result = 1; 67 | result = prime * result + ((getWalletId() == null) ? 0 : getWalletId().hashCode()); 68 | return result; 69 | } 70 | 71 | /** 72 | * This method was generated by MyBatis Generator. 73 | * This method corresponds to the database table WALLET_ADDRESS 74 | * 75 | * @mbggenerated Fri Feb 24 10:10:32 CST 2017 76 | */ 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", walletId=").append(walletId); 84 | sb.append("]"); 85 | return sb.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/com/fr/chain/property/db/entity/ProductDigitKey.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.db.entity; 2 | 3 | public class ProductDigitKey { 4 | /** 5 | * This field was generated by MyBatis Generator. 6 | * This field corresponds to the database column PRODUCT_DIGIT.PRODUCT_ID 7 | * 8 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 9 | */ 10 | private String productId; 11 | 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method returns the value of the database column PRODUCT_DIGIT.PRODUCT_ID 15 | * 16 | * @return the value of PRODUCT_DIGIT.PRODUCT_ID 17 | * 18 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 19 | */ 20 | public String getProductId() { 21 | return productId; 22 | } 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method sets the value of the database column PRODUCT_DIGIT.PRODUCT_ID 27 | * 28 | * @param productId the value for PRODUCT_DIGIT.PRODUCT_ID 29 | * 30 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 31 | */ 32 | public void setProductId(String productId) { 33 | this.productId = productId; 34 | } 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table PRODUCT_DIGIT 39 | * 40 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 41 | */ 42 | @Override 43 | public boolean equals(Object that) { 44 | if (this == that) { 45 | return true; 46 | } 47 | if (that == null) { 48 | return false; 49 | } 50 | if (getClass() != that.getClass()) { 51 | return false; 52 | } 53 | ProductDigitKey other = (ProductDigitKey) that; 54 | return (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())); 55 | } 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table PRODUCT_DIGIT 60 | * 61 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 62 | */ 63 | @Override 64 | public int hashCode() { 65 | final int prime = 31; 66 | int result = 1; 67 | result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); 68 | return result; 69 | } 70 | 71 | /** 72 | * This method was generated by MyBatis Generator. 73 | * This method corresponds to the database table PRODUCT_DIGIT 74 | * 75 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 76 | */ 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", productId=").append(productId); 84 | sb.append("]"); 85 | return sb.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/com/fr/chain/property/db/entity/ProductInfoKey.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.db.entity; 2 | 3 | public class ProductInfoKey { 4 | /** 5 | * This field was generated by MyBatis Generator. 6 | * This field corresponds to the database column PRODUCT_INFO.PRODUCT_ID 7 | * 8 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 9 | */ 10 | private String productId; 11 | 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method returns the value of the database column PRODUCT_INFO.PRODUCT_ID 15 | * 16 | * @return the value of PRODUCT_INFO.PRODUCT_ID 17 | * 18 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 19 | */ 20 | public String getProductId() { 21 | return productId; 22 | } 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method sets the value of the database column PRODUCT_INFO.PRODUCT_ID 27 | * 28 | * @param productId the value for PRODUCT_INFO.PRODUCT_ID 29 | * 30 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 31 | */ 32 | public void setProductId(String productId) { 33 | this.productId = productId; 34 | } 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table PRODUCT_INFO 39 | * 40 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 41 | */ 42 | @Override 43 | public boolean equals(Object that) { 44 | if (this == that) { 45 | return true; 46 | } 47 | if (that == null) { 48 | return false; 49 | } 50 | if (getClass() != that.getClass()) { 51 | return false; 52 | } 53 | ProductInfoKey other = (ProductInfoKey) that; 54 | return (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())); 55 | } 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table PRODUCT_INFO 60 | * 61 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 62 | */ 63 | @Override 64 | public int hashCode() { 65 | final int prime = 31; 66 | int result = 1; 67 | result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); 68 | return result; 69 | } 70 | 71 | /** 72 | * This method was generated by MyBatis Generator. 73 | * This method corresponds to the database table PRODUCT_INFO 74 | * 75 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 76 | */ 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", productId=").append(productId); 84 | sb.append("]"); 85 | return sb.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/com/fr/chain/property/db/entity/PropertyKey.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.db.entity; 2 | 3 | public class PropertyKey { 4 | /** 5 | * This field was generated by MyBatis Generator. 6 | * This field corresponds to the database column PROPERTY.PROPERTY_ID 7 | * 8 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 9 | */ 10 | private String propertyId; 11 | 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method returns the value of the database column PROPERTY.PROPERTY_ID 15 | * 16 | * @return the value of PROPERTY.PROPERTY_ID 17 | * 18 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 19 | */ 20 | public String getPropertyId() { 21 | return propertyId; 22 | } 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method sets the value of the database column PROPERTY.PROPERTY_ID 27 | * 28 | * @param propertyId the value for PROPERTY.PROPERTY_ID 29 | * 30 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 31 | */ 32 | public void setPropertyId(String propertyId) { 33 | this.propertyId = propertyId; 34 | } 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table PROPERTY 39 | * 40 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 41 | */ 42 | @Override 43 | public boolean equals(Object that) { 44 | if (this == that) { 45 | return true; 46 | } 47 | if (that == null) { 48 | return false; 49 | } 50 | if (getClass() != that.getClass()) { 51 | return false; 52 | } 53 | PropertyKey other = (PropertyKey) that; 54 | return (this.getPropertyId() == null ? other.getPropertyId() == null : this.getPropertyId().equals(other.getPropertyId())); 55 | } 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table PROPERTY 60 | * 61 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 62 | */ 63 | @Override 64 | public int hashCode() { 65 | final int prime = 31; 66 | int result = 1; 67 | result = prime * result + ((getPropertyId() == null) ? 0 : getPropertyId().hashCode()); 68 | return result; 69 | } 70 | 71 | /** 72 | * This method was generated by MyBatis Generator. 73 | * This method corresponds to the database table PROPERTY 74 | * 75 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 76 | */ 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", propertyId=").append(propertyId); 84 | sb.append("]"); 85 | return sb.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/com/fr/chain/trade/db/entity/TradeFlowKey.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.db.entity; 2 | 3 | public class TradeFlowKey { 4 | /** 5 | * This field was generated by MyBatis Generator. 6 | * This field corresponds to the database column TRADE_FLOW.FLOW_ID 7 | * 8 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 9 | */ 10 | private String flowId; 11 | 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method returns the value of the database column TRADE_FLOW.FLOW_ID 15 | * 16 | * @return the value of TRADE_FLOW.FLOW_ID 17 | * 18 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 19 | */ 20 | public String getFlowId() { 21 | return flowId; 22 | } 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method sets the value of the database column TRADE_FLOW.FLOW_ID 27 | * 28 | * @param flowId the value for TRADE_FLOW.FLOW_ID 29 | * 30 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 31 | */ 32 | public void setFlowId(String flowId) { 33 | this.flowId = flowId; 34 | } 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table TRADE_FLOW 39 | * 40 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 41 | */ 42 | @Override 43 | public boolean equals(Object that) { 44 | if (this == that) { 45 | return true; 46 | } 47 | if (that == null) { 48 | return false; 49 | } 50 | if (getClass() != that.getClass()) { 51 | return false; 52 | } 53 | TradeFlowKey other = (TradeFlowKey) that; 54 | return (this.getFlowId() == null ? other.getFlowId() == null : this.getFlowId().equals(other.getFlowId())); 55 | } 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table TRADE_FLOW 60 | * 61 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 62 | */ 63 | @Override 64 | public int hashCode() { 65 | final int prime = 31; 66 | int result = 1; 67 | result = prime * result + ((getFlowId() == null) ? 0 : getFlowId().hashCode()); 68 | return result; 69 | } 70 | 71 | /** 72 | * This method was generated by MyBatis Generator. 73 | * This method corresponds to the database table TRADE_FLOW 74 | * 75 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 76 | */ 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", flowId=").append(flowId); 84 | sb.append("]"); 85 | return sb.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /wallet-gen-dao/src/main/java/com/fr/chain/trade/db/entity/TradeOrderKey.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.db.entity; 2 | 3 | public class TradeOrderKey { 4 | /** 5 | * This field was generated by MyBatis Generator. 6 | * This field corresponds to the database column TRADE_ORDER.ORDER_ID 7 | * 8 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 9 | */ 10 | private String orderId; 11 | 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method returns the value of the database column TRADE_ORDER.ORDER_ID 15 | * 16 | * @return the value of TRADE_ORDER.ORDER_ID 17 | * 18 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 19 | */ 20 | public String getOrderId() { 21 | return orderId; 22 | } 23 | 24 | /** 25 | * This method was generated by MyBatis Generator. 26 | * This method sets the value of the database column TRADE_ORDER.ORDER_ID 27 | * 28 | * @param orderId the value for TRADE_ORDER.ORDER_ID 29 | * 30 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 31 | */ 32 | public void setOrderId(String orderId) { 33 | this.orderId = orderId; 34 | } 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table TRADE_ORDER 39 | * 40 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 41 | */ 42 | @Override 43 | public boolean equals(Object that) { 44 | if (this == that) { 45 | return true; 46 | } 47 | if (that == null) { 48 | return false; 49 | } 50 | if (getClass() != that.getClass()) { 51 | return false; 52 | } 53 | TradeOrderKey other = (TradeOrderKey) that; 54 | return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())); 55 | } 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table TRADE_ORDER 60 | * 61 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 62 | */ 63 | @Override 64 | public int hashCode() { 65 | final int prime = 31; 66 | int result = 1; 67 | result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); 68 | return result; 69 | } 70 | 71 | /** 72 | * This method was generated by MyBatis Generator. 73 | * This method corresponds to the database table TRADE_ORDER 74 | * 75 | * @mbggenerated Fri Feb 24 10:10:33 CST 2017 76 | */ 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", orderId=").append(orderId); 84 | sb.append("]"); 85 | return sb.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /wallet-iface/.classpath: -------------------------------------------------------------------------------- 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 | 37 | 38 | -------------------------------------------------------------------------------- /wallet-iface/.externalToolBuilders/org.eclipse.m2e.core.maven2Builder (1).launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-iface/.externalToolBuilders/org.eclipse.wst.common.project.facet.core.builder.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-iface/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-iface/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-iface/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /wallet-iface/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wallet-iface 4 | 5 | 6 | wallet-base 7 | 8 | 9 | 10 | org.eclipse.ui.externaltools.ExternalToolBuilder 11 | full,incremental, 12 | 13 | 14 | LaunchConfigHandle 15 | <project>/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javabuilder 21 | 22 | 23 | 24 | 25 | org.eclipse.ui.externaltools.ExternalToolBuilder 26 | full,incremental, 27 | 28 | 29 | LaunchConfigHandle 30 | <project>/.externalToolBuilders/org.eclipse.wst.common.project.facet.core.builder.launch 31 | 32 | 33 | 34 | 35 | org.eclipse.ui.externaltools.ExternalToolBuilder 36 | full,incremental, 37 | 38 | 39 | LaunchConfigHandle 40 | <project>/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch 41 | 42 | 43 | 44 | 45 | org.eclipse.ui.externaltools.ExternalToolBuilder 46 | full,incremental, 47 | 48 | 49 | LaunchConfigHandle 50 | <project>/.externalToolBuilders/org.eclipse.m2e.core.maven2Builder (1).launch 51 | 52 | 53 | 54 | 55 | org.eclipse.m2e.core.maven2Builder 56 | 57 | 58 | 59 | 60 | 61 | org.eclipse.jem.workbench.JavaEMFNature 62 | org.eclipse.wst.common.modulecore.ModuleCoreNature 63 | org.eclipse.jdt.core.javanature 64 | org.eclipse.m2e.core.maven2Nature 65 | org.eclipse.wst.common.project.facet.core.nature 66 | org.eclipse.wst.jsdt.core.jsNature 67 | 68 | 69 | -------------------------------------------------------------------------------- /wallet-iface/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=utf-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.7 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 13 | org.eclipse.jdt.core.compiler.source=1.7 14 | -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | uses 9 | 10 | 11 | uses 12 | 13 | 14 | uses 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /wallet-iface/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /wallet-iface/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /wallet-iface/WebContent/WEB-INF/rest-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 11 | 12 | 13 | 14 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | /WEB-INF/view/ 30 | 31 | 32 | .jsp 33 | 34 | 35 | 36 | 37 | 38 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 59 | 60 | -------------------------------------------------------------------------------- /wallet-iface/WebContent/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | cerest 4 | 5 | index.html 6 | 7 | 8 | contextConfigLocation 9 | classpath*:SpringContext-*.xml, classpath*:conf/SpringContext-*.xml 10 | 11 | 12 | log4jConfigLocation 13 | classpath*:log4j.properties 14 | 15 | 16 | 30 17 | 18 | 19 | org.springframework.web.context.ContextLoaderListener 20 | 21 | 22 | 23 | com.fr.chain.web.start.Starter 24 | 25 | 26 | 27 | Set Character Encoding 28 | org.springframework.web.filter.CharacterEncodingFilter 29 | 30 | encoding 31 | UTF-8 32 | 33 | 34 | 35 | Set Character Encoding 36 | /* 37 | 38 | 39 | 40 | rest 41 | org.springframework.web.servlet.DispatcherServlet 42 | 1 43 | 44 | 45 | rest 46 | / 47 | 48 | 49 | HiddenHttpMethodFilter 50 | org.springframework.web.filter.HiddenHttpMethodFilter 51 | 52 | 53 | HiddenHttpMethodFilter 54 | rest 55 | 56 | -------------------------------------------------------------------------------- /wallet-iface/WebContent/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | hello wallet 6 | 7 | 8 | hello wallet_iface 9 | 10 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/common/HttpRequestHelper.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.common; 2 | 3 | import java.io.IOException; 4 | import java.io.UnsupportedEncodingException; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | import lombok.extern.slf4j.Slf4j; 9 | 10 | import org.springframework.stereotype.Component; 11 | 12 | import com.fr.chain.message.MessageBuilder; 13 | 14 | @Component("httpRequestHelper") 15 | @Slf4j 16 | public class HttpRequestHelper { 17 | public String getJsonTxt(HttpServletRequest req) { 18 | String jsontxt = null; 19 | try { 20 | req.setCharacterEncoding("utf-8"); 21 | } catch (UnsupportedEncodingException e1) { 22 | e1.printStackTrace(); 23 | } 24 | 25 | try { 26 | jsontxt = MessageBuilder.getRequestContent(req); 27 | } catch (IOException e) { 28 | jsontxt = "Body is Null"; 29 | } 30 | log.debug("[RECV]:" + jsontxt); 31 | return jsontxt; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/facadeservice/property/PropertyService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.facadeservice.property; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.message.Message; 6 | import com.fr.chain.property.db.entity.ProductInfo; 7 | import com.fr.chain.property.db.entity.Property; 8 | import com.fr.chain.property.db.entity.PropertyExample; 9 | import com.fr.chain.property.db.entity.PropertyKey; 10 | import com.fr.chain.vo.property.CreatePropertyVo; 11 | import com.fr.chain.vo.property.QueryPropertyVo; 12 | import com.fr.chain.vo.property.Res_CreatePropertyVo; 13 | import com.fr.chain.vo.property.Res_QueryPropertyVo; 14 | 15 | /** 16 | * 注意事务用AOP配置的,参见配置文件 17 | * @title 18 | * @author Dylan 19 | * @date 2017年2月8日 20 | * 21 | */ 22 | public interface PropertyService { 23 | 24 | public int insert(Property info); 25 | 26 | public int batchInsert(List records); 27 | 28 | 29 | public int deleteByPrimaryKey (PropertyKey key); 30 | 31 | public List selectByExample(Property info); 32 | public List selectByExample(PropertyExample info); 33 | 34 | public int updateByExampleSelective (Property record, PropertyExample example); 35 | 36 | public int updateByPrimaryKeySelective (Property record); 37 | 38 | 39 | 40 | public void createProperty(Message msg, CreatePropertyVo msgVo, Res_CreatePropertyVo res_CreatePropertyVo,ProductInfo productInfo); 41 | public void queryProperty(Message msg, QueryPropertyVo msgVo, Res_QueryPropertyVo res_QueryPropertyVo); 42 | 43 | /** 44 | * 查找个性资产基本信息,如果没有查到,则新添加该资产的基础信息 45 | * @param msg 46 | * @param msgVo 47 | * @return 48 | */ 49 | public ProductInfo selectProduct4CreateProperty(Message msg, CreatePropertyVo msgVo); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/facadeservice/trade/TradeOrderService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.facadeservice.trade; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.message.Message; 6 | import com.fr.chain.message.ResponseMsg; 7 | import com.fr.chain.trade.db.entity.TradeOrder; 8 | import com.fr.chain.trade.db.entity.TradeOrderExample; 9 | import com.fr.chain.trade.db.entity.TradeOrderKey; 10 | import com.fr.chain.vo.trade.ChangePropertyVo; 11 | import com.fr.chain.vo.trade.GetPropertyVo; 12 | import com.fr.chain.vo.trade.QueryTradeFlowVo; 13 | import com.fr.chain.vo.trade.QueryTradeOrderVo; 14 | import com.fr.chain.vo.trade.Res_QueryTradeFlowVo; 15 | import com.fr.chain.vo.trade.Res_QueryTradeOrderVo; 16 | import com.fr.chain.vo.trade.Res_SendPropertyVo; 17 | import com.fr.chain.vo.trade.Res_TransDigitVo; 18 | import com.fr.chain.vo.trade.SendPropertyVo; 19 | import com.fr.chain.vo.trade.TransDigitVo; 20 | 21 | /** 22 | * 注意事务用AOP配置的,参见配置文件 23 | * @title 24 | * @author Dylan 25 | * @date 2017年2月8日 26 | * 27 | */ 28 | public interface TradeOrderService { 29 | 30 | public int insert(TradeOrder info); 31 | 32 | public int batchInsert(List records); 33 | 34 | public int deleteByPrimaryKey (TradeOrderKey key); 35 | 36 | public List selectByExample(TradeOrder info); 37 | public List selectByExample(TradeOrderExample info); 38 | 39 | public int updateByExampleSelective (TradeOrder record, TradeOrderExample example); 40 | 41 | /** 42 | *数字资产转账 43 | * @param msg 44 | * @param msgVo 45 | * @param res_TradeOrderVo 46 | */ 47 | public void createTransDigit(Message msg,TransDigitVo msgVo,Res_TransDigitVo res_TransDigitVo); 48 | 49 | /** 50 | * 查询订单 51 | * @param msg 52 | * @param msgVo 53 | * @param res_QueryTradeOrderVo 54 | */ 55 | public void queryTradeOrder(Message msg, QueryTradeOrderVo msgVo, Res_QueryTradeOrderVo res_QueryTradeOrderVo ); 56 | 57 | /** 58 | * 查询流水 59 | * @param msg 60 | * @param msgVo 61 | * @param res_QueryTradeFlowVo 62 | */ 63 | public void queryTradeFlow(Message msg, QueryTradeFlowVo msgVo, Res_QueryTradeFlowVo res_QueryTradeFlowVo ); 64 | 65 | /** 66 | * 发送资产 67 | * @param msg 68 | * @param msgVo 69 | * @param res_SendPropertyVo 70 | */ 71 | public void sendAndCreateProperty(Message msg, SendPropertyVo msgVo, Res_SendPropertyVo res_SendPropertyVo ); 72 | 73 | /** 74 | * 领取资产 75 | * @param msg 76 | * @param msgVo 77 | * @param responseMsg 78 | */ 79 | public void getAndCreateProperty(Message msg, GetPropertyVo msgVo, ResponseMsg responseMsg ); 80 | 81 | /** 82 | * 资产变更 83 | * @param msg 84 | * @param msgVo 85 | * @param responseMsg 86 | */ 87 | public void changeAndDeleteProperty(Message msg, ChangePropertyVo msgVo, ResponseMsg responseMsg); 88 | 89 | /** 90 | * 发送资产之后,24小时未领取,资产退回 91 | */ 92 | public void refundAndDeleteProperty(TradeOrder tradeOrder); 93 | 94 | } 95 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/facadeservice/wallet/WalletService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.facadeservice.wallet; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.message.Message; 6 | import com.fr.chain.message.MsgBody; 7 | import com.fr.chain.ewallet.db.entity.WalletAdress; 8 | import com.fr.chain.ewallet.db.entity.WalletAdressExample; 9 | import com.fr.chain.ewallet.db.entity.WalletAdressKey; 10 | import com.fr.chain.vo.wallet.QueryWalletAdressVo; 11 | import com.fr.chain.vo.wallet.Res_QueryWalletAdressVo; 12 | 13 | public interface WalletService { 14 | 15 | public List getWalletAdress(String walletCode, String OpenId); 16 | 17 | public String getNewWalletAdress(String walletCode, String OpenId ); 18 | 19 | public void getAndCreateWallet(Message msg, QueryWalletAdressVo msgVo, Res_QueryWalletAdressVo res_QueryWalletAdressVo); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/message/MessageException.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.message; 2 | 3 | public class MessageException extends RuntimeException{ 4 | 5 | public MessageException() { 6 | super(); 7 | // TODO Auto-generated constructor stub 8 | } 9 | 10 | public MessageException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 11 | super(message, cause, enableSuppression, writableStackTrace); 12 | // TODO Auto-generated constructor stub 13 | } 14 | 15 | public MessageException(String message, Throwable cause) { 16 | super(message, cause); 17 | // TODO Auto-generated constructor stub 18 | } 19 | 20 | public MessageException(String message) { 21 | super(message); 22 | // TODO Auto-generated constructor stub 23 | } 24 | 25 | public MessageException(Throwable cause) { 26 | super(cause); 27 | // TODO Auto-generated constructor stub 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/message/MsgBody.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.message; 2 | 3 | import lombok.Data; 4 | 5 | 6 | /* 7 | * body基类 8 | * 9 | */ 10 | 11 | @Data 12 | public class MsgBody { 13 | protected String datano;// 流水号 14 | } 15 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/message/ResponseMsg.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.message; 2 | 3 | import lombok.Data; 4 | 5 | /* 6 | * 消息返回 7 | */ 8 | @Data 9 | public class ResponseMsg extends MsgBody { 10 | 11 | protected String status = "1";// 返回接收状态,1是成功,0为失败 12 | protected String retcode = "1";// 返回代码 13 | protected String retmessage = "successful";// 返回描述编码 14 | 15 | /** 16 | * error 17 | * 18 | * @param retCode 19 | * @param retMessage 20 | */ 21 | public ResponseMsg(String datano, String retCode, String retMessage) { 22 | super(); 23 | this.datano = datano; 24 | this.status = "0"; 25 | this.retcode = retCode; 26 | this.retmessage = retMessage; 27 | } 28 | 29 | public ResponseMsg(String datano) { 30 | this.datano = datano; 31 | } 32 | 33 | public ResponseMsg() { 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/schedule/TradeOrderSchedule.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.schedule; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import lombok.extern.slf4j.Slf4j; 8 | 9 | import org.springframework.scheduling.annotation.Scheduled; 10 | import org.springframework.stereotype.Component; 11 | 12 | import com.fr.chain.enums.SystemOpenIdEnum; 13 | import com.fr.chain.enums.TradeStatusEnum; 14 | import com.fr.chain.enums.TradeTypeEnum; 15 | import com.fr.chain.facadeservice.trade.TradeOrderService; 16 | import com.fr.chain.trade.db.entity.TradeOrder; 17 | import com.fr.chain.trade.db.entity.TradeOrderExample; 18 | import com.fr.chain.utils.FConfig; 19 | import com.fr.chain.utils.NumberUtil; 20 | 21 | @Slf4j 22 | @Component 23 | public class TradeOrderSchedule { 24 | @Resource 25 | TradeOrderService tradeOrderService; 26 | 27 | private static final long refundPropertyRate= 1*60*1000; //1分钟执行一次 28 | 29 | //当前时间与订单创建时间相差超过24小时,退回资产 30 | private static final long refundPropertyTime = 24*60*60*1000; //24小时=86400000; //NumberUtil.toLong(FConfig.getProValue("refundPropertyTime")); // 时间 31 | 32 | /** 33 | * 发送出去的资产,24小时不领取,将退回给发送者 34 | */ 35 | @Scheduled(fixedDelay = refundPropertyRate) 36 | public void refundPropertyTradeOrder(){ 37 | log.info("refundProperty -----begin------"); 38 | TradeOrderExample tradeOrderExample = new TradeOrderExample(); 39 | tradeOrderExample.setOrderByClause("CREATE_TIME DESC"); 40 | TradeOrderExample.Criteria criteria = tradeOrderExample.createCriteria(); 41 | //ToOpenId = 系统默认账户,status=发送成功,createTime时间超过24小时 42 | criteria.andToOpenIdEqualTo(SystemOpenIdEnum.系统默认账户.getName()); 43 | criteria.andTradeTypeEqualTo(TradeTypeEnum.发送资产.getValue()); 44 | criteria.andStatusEqualTo(TradeStatusEnum.成功.getValue()); 45 | List tradeOrderList = tradeOrderService.selectByExample(tradeOrderExample); 46 | if(tradeOrderList == null || tradeOrderList.size() == 0){ 47 | return; 48 | } 49 | //退回逻辑处理 50 | for(TradeOrder tmpTradeOrder:tradeOrderList){ 51 | //当前时间与订单创建时间相差超过24小时,退回资产 52 | long diffTime = System.currentTimeMillis() - tmpTradeOrder.getCreateTime().getTime(); 53 | if(diffTime < refundPropertyTime){ 54 | continue; //时间不够24小时,轮询下一条 55 | } 56 | tradeOrderService.refundAndDeleteProperty(tmpTradeOrder); 57 | } 58 | log.info("refundProperty -----end------"); 59 | } 60 | } -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/property/CreatePropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.property; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class CreatePropertyVo extends MsgBody{ 9 | private String productid; 10 | private String productdesc; 11 | private String signtype; 12 | private String propertyname; 13 | private String unit; 14 | private String mincount; 15 | private String count; 16 | private String url; 17 | //private String description; 18 | } 19 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/property/ProductPublicInfoVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.property; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ProductPublicInfoVo{ 7 | 8 | private String productId; 9 | private String merchantId; 10 | private String appId; 11 | private String productdesc; 12 | private String isdigit; 13 | private String chainType; 14 | private String signtype; 15 | private String originOpenid; 16 | private String propertyname; 17 | private String unit; 18 | private String mincount; 19 | private String count; 20 | private String url; 21 | private String description; 22 | } 23 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/property/QueryPropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.property; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class QueryPropertyVo extends MsgBody{ 9 | private String propertytype; 10 | private String productid; 11 | private String status; 12 | } 13 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/property/Res_CreatePropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.property; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class Res_CreatePropertyVo extends MsgBody{ 9 | private String productid; 10 | 11 | public Res_CreatePropertyVo(){ 12 | } 13 | 14 | public Res_CreatePropertyVo(String datano){ 15 | this.datano = datano; 16 | } 17 | 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/property/Res_QueryPropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.property; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.fr.chain.message.MsgBody; 7 | 8 | import lombok.Data; 9 | 10 | @Data 11 | public class Res_QueryPropertyVo extends MsgBody{ 12 | 13 | //资产详情 14 | private List propertyinfolist; //查询多条 15 | 16 | @Data 17 | public static class PropertyInfo{ 18 | private String propertytype; //资产类型 19 | private String productid; 20 | private String productdesc; 21 | private String signtype; 22 | private String propertyname; 23 | private String unit; 24 | private String mincount; 25 | private String count; 26 | private String url; 27 | private String description; 28 | private String status; 29 | } 30 | 31 | public Res_QueryPropertyVo(){ 32 | propertyinfolist = new ArrayList (); 33 | } 34 | 35 | public Res_QueryPropertyVo(String datano){ 36 | this.datano = datano; 37 | propertyinfolist = new ArrayList (); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/ChangePropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class ChangePropertyVo extends MsgBody{ 9 | private String productid; 10 | private String tradetype; 11 | } 12 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/GetPropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.message.MsgBody; 6 | import com.fr.chain.vo.trade.SendPropertyVo.PackageData; 7 | 8 | import lombok.Data; 9 | 10 | @Data 11 | public class GetPropertyVo extends MsgBody{ 12 | private List data; 13 | @Data 14 | public static class PackageData { 15 | // private String productid; 16 | private String orderid; 17 | public PackageData(){ 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/QueryTradeFlowVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class QueryTradeFlowVo extends MsgBody{ 9 | private String propertytype; 10 | private String productid; 11 | } 12 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/QueryTradeOrderVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class QueryTradeOrderVo extends MsgBody{ 9 | private String propertytype; 10 | private String productid; 11 | } 12 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/Res_QueryTradeFlowVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.fr.chain.message.MsgBody; 7 | import com.fr.chain.vo.trade.Res_SendPropertyVo.PackageData; 8 | 9 | import lombok.Data; 10 | 11 | @Data 12 | public class Res_QueryTradeFlowVo extends MsgBody{ 13 | private List data; 14 | 15 | @Data 16 | public static class TradeOrderData { 17 | private String propertytype; 18 | private String propertyname; 19 | private String productid; 20 | private String signtype; 21 | private String tradetype; 22 | private String unit; 23 | private String count; 24 | private String tradetime; 25 | public TradeOrderData(){ 26 | } 27 | } 28 | 29 | public Res_QueryTradeFlowVo(String datano) { 30 | this.datano = datano; 31 | this.data = new ArrayList(); 32 | } 33 | 34 | public Res_QueryTradeFlowVo(){ 35 | this.data = new ArrayList(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/Res_QueryTradeOrderVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.fr.chain.message.MsgBody; 7 | import com.fr.chain.vo.trade.Res_SendPropertyVo.PackageData; 8 | 9 | import lombok.Data; 10 | 11 | @Data 12 | public class Res_QueryTradeOrderVo extends MsgBody{ 13 | private List data; 14 | 15 | @Data 16 | public static class TradeOrderData { 17 | private String propertytype; 18 | private String isselfsupport; 19 | private String productid; 20 | private String isdigit; 21 | private String signtype; 22 | private String propertyname; 23 | private String unit; 24 | private String count; 25 | private String address; 26 | private int tradetype; 27 | public TradeOrderData(){ 28 | } 29 | } 30 | 31 | public Res_QueryTradeOrderVo(String datano) { 32 | this.datano = datano; 33 | this.data = new ArrayList(); 34 | } 35 | 36 | public Res_QueryTradeOrderVo(){ 37 | this.data = new ArrayList(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/Res_SendPropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.fr.chain.message.MsgBody; 7 | 8 | import lombok.Data; 9 | 10 | @Data 11 | public class Res_SendPropertyVo extends MsgBody{ 12 | private String packageid; 13 | 14 | private List data; 15 | 16 | @Data 17 | public static class PackageData { 18 | 19 | private String productid; 20 | 21 | private String count; 22 | 23 | private String orderid; 24 | 25 | public PackageData(){ 26 | 27 | } 28 | } 29 | 30 | public Res_SendPropertyVo(String datano) { 31 | this.datano = datano; 32 | this.data = new ArrayList(); 33 | } 34 | 35 | public Res_SendPropertyVo(){ 36 | this.data = new ArrayList(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/Res_TransDigitVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | 4 | import com.fr.chain.message.MsgBody; 5 | 6 | import lombok.Data; 7 | 8 | @Data 9 | public class Res_TransDigitVo extends MsgBody{ 10 | private String openid; 11 | private String toopenid; 12 | private String productid; 13 | private String count; 14 | private String tradeid; 15 | 16 | public Res_TransDigitVo(String datano) { 17 | this.datano = datano; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/SendPropertyVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.message.MsgBody; 6 | 7 | import lombok.Data; 8 | 9 | @Data 10 | public class SendPropertyVo extends MsgBody{ 11 | 12 | private String packageid; 13 | private String propertytype; 14 | 15 | private List data; 16 | 17 | @Data 18 | public static class PackageData { 19 | 20 | private String productid; 21 | 22 | private String count; 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/trade/TransDigitVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.trade; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class TransDigitVo extends MsgBody{ 9 | private String productid; 10 | private String toopenid; 11 | private String count; 12 | } 13 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/wallet/QueryWalletAdressVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.wallet; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class QueryWalletAdressVo extends MsgBody{ 9 | private String walletcode; 10 | } 11 | -------------------------------------------------------------------------------- /wallet-iface/src/main/java/com/fr/chain/vo/wallet/Res_QueryWalletAdressVo.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.vo.wallet; 2 | 3 | import com.fr.chain.message.MsgBody; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class Res_QueryWalletAdressVo extends MsgBody{ 9 | private String walletcode; 10 | private String walletaddress; 11 | 12 | public Res_QueryWalletAdressVo(){ 13 | } 14 | 15 | public Res_QueryWalletAdressVo(String datano){ 16 | this.datano = datano; 17 | } 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /wallet-iface/src/main/resources/SpringContext-Common.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /wallet-iface/src/main/resources/SpringContext-Schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /wallet-iface/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | #退回资产时间间隔 24小时:24*60*60*1000 = 86400000 测试 3*60*1000 = 180000 2 | #refundPropertyTime = 86400000 3 | refundPropertyTime = 60000 -------------------------------------------------------------------------------- /wallet-iface/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Logger.getLogger("") 2 | log4j.rootLogger=DEBUG,stdout, iface_info,iface_error 3 | 4 | #Spring config 5 | log4j.logger.org.mybatis.spring = DEBUG 6 | 7 | #Mybatis config 8 | log4j.logger.org.apache = DEBUG 9 | 10 | log4j.logger.org.springframework.jdbc = DEBUG 11 | 12 | #JDBC config 13 | log4j.logger.java.sql.Connection = DEBUG 14 | log4j.logger.java.sql.Statement = DEBUG 15 | log4j.logger.java.sql.PreparedStatement = DEBUG 16 | log4j.logger.java.sql.ResultSet = DEBUG 17 | 18 | #apply to CONSOLE 19 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 20 | log4j.appender.stdout.Target=System.out 21 | log4j.appender.stdout.Encoding=utf-8 22 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.stdout.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss,SSS}] [%5p ] %c{48}:%L -- %m%n 24 | 25 | log4j.appender.iface_info =org.apache.log4j.RollingFileAppender 26 | log4j.appender.iface_info.Threshold=DEBUG 27 | log4j.appender.iface_info.encoding=utf-8 28 | log4j.appender.iface_info.File=${catalina.base}/logs/iface_info.log 29 | log4j.appender.iface_info.MaxFileSize = 100MB 30 | log4j.appender.iface_info.MaxBackupIndex = 200 31 | log4j.appender.iface_info.layout=org.apache.log4j.PatternLayout 32 | log4j.appender.iface_info.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss,SSS}] [%5p ] %c{48}:%L -- %m%n 33 | 34 | 35 | log4j.appender.iface_error =org.apache.log4j.RollingFileAppender 36 | log4j.appender.iface_error.Threshold=ERROR 37 | log4j.appender.iface_error.encoding=utf-8 38 | log4j.appender.iface_error.File=${catalina.base}/logs/iface_error.log 39 | log4j.appender.iface_error.MaxFileSize = 50MB 40 | log4j.appender.iface_error.layout=org.apache.log4j.PatternLayout 41 | log4j.appender.iface_error.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss,SSS}] [%5p ] %c{48}:%L -- %m%n -------------------------------------------------------------------------------- /wallet-iface/src/main/resources/sql-map-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /wallet-service/.classpath: -------------------------------------------------------------------------------- 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 | 37 | 38 | -------------------------------------------------------------------------------- /wallet-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /wallet-service/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wallet-service 4 | 5 | 6 | wallet-gen-dao 7 | wallet-base 8 | 9 | 10 | 11 | org.eclipse.wst.common.project.facet.core.builder 12 | 13 | 14 | 15 | 16 | org.eclipse.jdt.core.javabuilder 17 | 18 | 19 | 20 | 21 | org.eclipse.wst.validation.validationbuilder 22 | 23 | 24 | 25 | 26 | org.eclipse.m2e.core.maven2Builder 27 | 28 | 29 | 30 | 31 | 32 | org.eclipse.jem.workbench.JavaEMFNature 33 | org.eclipse.wst.common.modulecore.ModuleCoreNature 34 | org.eclipse.jdt.core.javanature 35 | org.eclipse.m2e.core.maven2Nature 36 | org.eclipse.wst.common.project.facet.core.nature 37 | 38 | 39 | -------------------------------------------------------------------------------- /wallet-service/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=utf-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /wallet-service/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.7 9 | -------------------------------------------------------------------------------- /wallet-service/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /wallet-service/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | uses 7 | 8 | 9 | uses 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /wallet-service/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /wallet-service/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /wallet-service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.fr.chain 5 | wallet 6 | 0.0.1-SNAPSHOT 7 | 8 | wallet-service 9 | jar 10 | 11 | 12 | 13 | 14 | src/main/java 15 | 16 | **/*.xml 17 | 18 | 19 | 20 | src/main/resources 21 | 22 | **/*.xmls 23 | 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-javadoc-plugin 31 | 2.10.1 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-surefire-plugin 38 | 2.4.3 39 | 40 | true 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-compiler-plugin 46 | 3.1 47 | 48 | 1.7 49 | 1.7 50 | utf-8 51 | 52 | src/gens/java 53 | src/main/java 54 | 55 | 56 | 57 | 58 | org.codehaus.mojo 59 | build-helper-maven-plugin 60 | 1.5 61 | 62 | 63 | generate-sources 64 | 65 | add-source 66 | 67 | 68 | 69 | src/main/java 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | com.fr.chain 81 | wallet-base 82 | 0.0.1-SNAPSHOT 83 | 84 | 85 | 86 | com.fr.chain 87 | wallet-gen-dao 88 | 0.0.1-SNAPSHOT 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/enums/PropertyStatusEnum.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.enums; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 资产状态枚举类 8 | * @author dylan 9 | * 10 | */ 11 | public enum PropertyStatusEnum { 12 | 不可用(0, "不可用"), 13 | 可用(1, "可用"), 14 | 锁定(2, "锁定"); 15 | 16 | 17 | public static String getNameByValue(int value) { 18 | PropertyStatusEnum status = valueMap.get(value); 19 | if (status != null) { 20 | return status.getName(); 21 | } 22 | return "未知状态"; 23 | } 24 | 25 | public static Integer getValueByName(String name) { 26 | PropertyStatusEnum status = nameMap.get(name); 27 | if (status != null) { 28 | return status.getValue(); 29 | } 30 | return null; 31 | } 32 | 33 | private static Map valueMap; 34 | 35 | private static Map nameMap; 36 | static { 37 | valueMap = new HashMap(); 38 | nameMap = new HashMap(); 39 | for (PropertyStatusEnum status : PropertyStatusEnum.values()) { 40 | valueMap.put(status.getValue(), status); 41 | nameMap.put(status.getName(), status); 42 | } 43 | } 44 | 45 | private int value; 46 | private String name; 47 | 48 | private PropertyStatusEnum(int value, String name) { 49 | this.value = value; 50 | this.name = name; 51 | } 52 | 53 | public int getValue() { 54 | return value; 55 | } 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public String toString() { 62 | return this.getValue() + "-" + this.getName(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/enums/PropertyTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.enums; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 资产类型枚举类 8 | * @author dylan 9 | * 10 | */ 11 | public enum PropertyTypeEnum { 12 | 数字资产(1, "数字资产"), 13 | 个性资产(2, "个性资产"); 14 | 15 | 16 | public static String getNameByValue(int value) { 17 | PropertyTypeEnum status = valueMap.get(value); 18 | if (status != null) { 19 | return status.getName(); 20 | } 21 | return "未知状态"; 22 | } 23 | 24 | public static Integer getValueByName(String name) { 25 | PropertyTypeEnum status = nameMap.get(name); 26 | if (status != null) { 27 | return status.getValue(); 28 | } 29 | return null; 30 | } 31 | 32 | private static Map valueMap; 33 | 34 | private static Map nameMap; 35 | static { 36 | valueMap = new HashMap(); 37 | nameMap = new HashMap(); 38 | for (PropertyTypeEnum status : PropertyTypeEnum.values()) { 39 | valueMap.put(status.getValue(), status); 40 | nameMap.put(status.getName(), status); 41 | } 42 | } 43 | 44 | private int value; 45 | private String name; 46 | 47 | private PropertyTypeEnum(int value, String name) { 48 | this.value = value; 49 | this.name = name; 50 | } 51 | 52 | public int getValue() { 53 | return value; 54 | } 55 | 56 | public String getName() { 57 | return name; 58 | } 59 | 60 | public String toString() { 61 | return this.getValue() + "-" + this.getName(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/enums/SystemOpenIdEnum.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.enums; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 交易类型枚举类 8 | * @author dylan 9 | * 10 | */ 11 | public enum SystemOpenIdEnum { 12 | 系统默认账户(10000000, "OpenId_Sys"); 13 | 14 | public static String getNameByValue(int value) { 15 | SystemOpenIdEnum status = valueMap.get(value); 16 | if (status != null) { 17 | return status.getName(); 18 | } 19 | return "未知状态"; 20 | } 21 | 22 | public static Integer getValueByName(String name) { 23 | SystemOpenIdEnum status = nameMap.get(name); 24 | if (status != null) { 25 | return status.getValue(); 26 | } 27 | return null; 28 | } 29 | 30 | private static Map valueMap; 31 | 32 | private static Map nameMap; 33 | static { 34 | valueMap = new HashMap(); 35 | nameMap = new HashMap(); 36 | for (SystemOpenIdEnum status : SystemOpenIdEnum.values()) { 37 | valueMap.put(status.getValue(), status); 38 | nameMap.put(status.getName(), status); 39 | } 40 | } 41 | 42 | private int value; 43 | private String name; 44 | 45 | private SystemOpenIdEnum(int value, String name) { 46 | this.value = value; 47 | this.name = name; 48 | } 49 | 50 | public int getValue() { 51 | return value; 52 | } 53 | 54 | public String getName() { 55 | return name; 56 | } 57 | 58 | public String toString() { 59 | return this.getValue() + "-" + this.getName(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/enums/TradeStatusEnum.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.enums; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 订单状态枚举类 8 | * @author dylan 9 | * 10 | */ 11 | public enum TradeStatusEnum { 12 | 失败(0, "失败"), 13 | 处理中(1, "处理中"), 14 | 成功(2, "成功"); 15 | 16 | 17 | public static String getNameByValue(int value) { 18 | TradeStatusEnum status = valueMap.get(value); 19 | if (status != null) { 20 | return status.getName(); 21 | } 22 | return "未知状态"; 23 | } 24 | 25 | public static Integer getValueByName(String name) { 26 | TradeStatusEnum status = nameMap.get(name); 27 | if (status != null) { 28 | return status.getValue(); 29 | } 30 | return null; 31 | } 32 | 33 | private static Map valueMap; 34 | 35 | private static Map nameMap; 36 | static { 37 | valueMap = new HashMap(); 38 | nameMap = new HashMap(); 39 | for (TradeStatusEnum status : TradeStatusEnum.values()) { 40 | valueMap.put(status.getValue(), status); 41 | nameMap.put(status.getName(), status); 42 | } 43 | } 44 | 45 | private int value; 46 | private String name; 47 | 48 | private TradeStatusEnum(int value, String name) { 49 | this.value = value; 50 | this.name = name; 51 | } 52 | 53 | public int getValue() { 54 | return value; 55 | } 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public String toString() { 62 | return this.getValue() + "-" + this.getName(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/enums/TradeTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.enums; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 交易类型枚举类 8 | * @author dylan 9 | * 10 | */ 11 | public enum TradeTypeEnum { 12 | 创建资产(1, "创建资产"), 13 | 发送资产(2, "发送资产"), 14 | 领取资产(3, "领取资产"), 15 | 退回资产(4, "退回资产"), 16 | 丢弃资产(5, "丢弃资产"), 17 | 消费资产(6, "消费资产"), 18 | 资产转移(7, "资产转移"); 19 | 20 | 21 | public static String getNameByValue(int value) { 22 | TradeTypeEnum status = valueMap.get(value); 23 | if (status != null) { 24 | return status.getName(); 25 | } 26 | return "未知状态"; 27 | } 28 | 29 | public static Integer getValueByName(String name) { 30 | TradeTypeEnum status = nameMap.get(name); 31 | if (status != null) { 32 | return status.getValue(); 33 | } 34 | return null; 35 | } 36 | 37 | private static Map valueMap; 38 | 39 | private static Map nameMap; 40 | static { 41 | valueMap = new HashMap(); 42 | nameMap = new HashMap(); 43 | for (TradeTypeEnum status : TradeTypeEnum.values()) { 44 | valueMap.put(status.getValue(), status); 45 | nameMap.put(status.getName(), status); 46 | } 47 | } 48 | 49 | private int value; 50 | private String name; 51 | 52 | private TradeTypeEnum(int value, String name) { 53 | this.value = value; 54 | this.name = name; 55 | } 56 | 57 | public int getValue() { 58 | return value; 59 | } 60 | 61 | public String getName() { 62 | return name; 63 | } 64 | 65 | public String toString() { 66 | return this.getValue() + "-" + this.getName(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/property/service/CreatePropertyService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.service; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.property.db.entity.ProductInfo; 6 | import com.fr.chain.property.db.entity.Property; 7 | import com.fr.chain.trade.db.entity.TradeOrder; 8 | 9 | public interface CreatePropertyService { 10 | public int insert(Property info); 11 | 12 | public int batchInsert(List records); 13 | 14 | //通过订单插入资产 15 | public int inserPropertyByOrder(TradeOrder orderRecord); 16 | 17 | //通过订单插入资产,资产发送接口,资产待激活(等chain返回结果) 18 | public boolean inserPropertyFreezen(TradeOrder orderRecord,int srcCount,String srcAddress,int receCount,String receAddress); 19 | 20 | public boolean inserProperty4Trans(TradeOrder orderRecord,String srcCount,String srcAddress,String receCount,String receAddress); 21 | 22 | public int insertProductInfo(ProductInfo info); 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/property/service/DelPropertyService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.service; 2 | 3 | import com.fr.chain.property.db.entity.PropertyKey; 4 | 5 | public interface DelPropertyService { 6 | public int deleteByPrimaryKey (PropertyKey key); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/property/service/QueryPropertyService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.service; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.property.db.entity.ProductDigit; 6 | import com.fr.chain.property.db.entity.ProductInfo; 7 | import com.fr.chain.property.db.entity.Property; 8 | import com.fr.chain.property.db.entity.PropertyExample; 9 | 10 | public interface QueryPropertyService { 11 | public List selectByExample(Property info); 12 | public Property selectOneByExample(Property info); 13 | public List selectByExample(PropertyExample info); 14 | public ProductInfo selectProductInfoByKey(String key); 15 | public ProductDigit selectProductDigitByKey(String key); 16 | } 17 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/property/service/UpdatePropertyService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.service; 2 | 3 | import com.fr.chain.property.db.entity.Property; 4 | import com.fr.chain.property.db.entity.PropertyExample; 5 | import com.fr.chain.trade.db.entity.TradeOrder; 6 | 7 | public interface UpdatePropertyService { 8 | public int updateByExampleSelective (Property record, PropertyExample example); 9 | public int updateByPrimaryKey(Property record); 10 | public int updateByPrimaryKeySelective(Property record); 11 | } 12 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/property/service/impl/DelPropertyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.service.impl; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.fr.chain.property.service.DelPropertyService; 8 | import com.fr.chain.property.db.dao.PropertyDao; 9 | import com.fr.chain.property.db.entity.PropertyKey; 10 | 11 | @Service("delPropertyService") 12 | public class DelPropertyServiceImpl implements DelPropertyService { 13 | 14 | @Resource 15 | PropertyDao propertyDao; 16 | 17 | 18 | @Override 19 | public int deleteByPrimaryKey (PropertyKey key){ 20 | return propertyDao.deleteByPrimaryKey(key); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/property/service/impl/QueryPropertyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.fr.chain.property.service.QueryPropertyService; 10 | import com.fr.chain.property.db.dao.ProductDigitDao; 11 | import com.fr.chain.property.db.dao.ProductInfoDao; 12 | import com.fr.chain.property.db.dao.PropertyDao; 13 | import com.fr.chain.property.db.entity.ProductDigit; 14 | import com.fr.chain.property.db.entity.ProductDigitKey; 15 | import com.fr.chain.property.db.entity.ProductInfo; 16 | import com.fr.chain.property.db.entity.ProductInfoKey; 17 | import com.fr.chain.property.db.entity.Property; 18 | import com.fr.chain.property.db.entity.PropertyExample; 19 | 20 | @Service("queryPropertyService") 21 | public class QueryPropertyServiceImpl implements QueryPropertyService { 22 | 23 | @Resource 24 | PropertyDao propertyDao; 25 | @Resource 26 | ProductInfoDao productInfoDao; 27 | @Resource 28 | ProductDigitDao productDigitDao; 29 | @Override 30 | public List selectByExample(Property property) { 31 | return propertyDao.selectByExample(propertyDao.getExample(property)); 32 | } 33 | 34 | public Property selectOneByExample(Property property){ 35 | List propertyList = propertyDao.selectByExample(propertyDao.getExample(property)); 36 | if(propertyList != null && propertyList.size() > 0){ 37 | return propertyList.get(0); 38 | } 39 | return null; 40 | } 41 | 42 | @Override 43 | public List selectByExample(PropertyExample info){ 44 | return propertyDao.selectByExample(info); 45 | } 46 | @Override 47 | public ProductInfo selectProductInfoByKey(String key){ 48 | ProductInfoKey infoKey = new ProductInfoKey(); 49 | infoKey.setProductId(key); 50 | return productInfoDao.selectByPrimaryKey(infoKey); 51 | } 52 | @Override 53 | public ProductDigit selectProductDigitByKey(String key){ 54 | ProductDigitKey infoKey = new ProductDigitKey(); 55 | infoKey.setProductId(key); 56 | return productDigitDao.selectByPrimaryKey(infoKey); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/property/service/impl/UpdatePropertyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.property.service.impl; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.fr.chain.property.db.dao.PropertyDao; 8 | import com.fr.chain.property.db.entity.Property; 9 | import com.fr.chain.property.db.entity.PropertyExample; 10 | import com.fr.chain.property.service.UpdatePropertyService; 11 | 12 | @Service("updatePropertyService") 13 | public class UpdatePropertyServiceImpl implements UpdatePropertyService { 14 | 15 | @Resource 16 | PropertyDao propertyDao; 17 | 18 | 19 | @Override 20 | public int updateByExampleSelective(Property record, PropertyExample example){ 21 | return propertyDao.updateByExampleSelective(record, example); 22 | } 23 | 24 | @Override 25 | public int updateByPrimaryKey(Property record) { 26 | return propertyDao.updateByPrimaryKey(record); 27 | } 28 | 29 | 30 | @Override 31 | public int updateByPrimaryKeySelective(Property record) { 32 | return propertyDao.updateByPrimaryKeySelective(record); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/trade/service/CreateTradeOrderService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.service; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.property.db.entity.Property; 6 | import com.fr.chain.trade.db.entity.TradeFlow; 7 | import com.fr.chain.trade.db.entity.TradeOrder; 8 | 9 | public interface CreateTradeOrderService { 10 | public int insert(TradeOrder info); 11 | public int insertSelective(TradeOrder record); 12 | 13 | public int batchInsert(List records); 14 | 15 | public int insertTradeByProperty(Property property, int tradeType); 16 | 17 | /** 18 | * TradeFlow 19 | * @param info 20 | * @return 21 | */ 22 | public int insertFlow(TradeFlow info); 23 | public int insertFlowSelective(TradeFlow record); 24 | 25 | public int batchInsertFlow(List records); 26 | 27 | //创建资产流水创建 28 | public int insertTradeFlowByOrder(TradeOrder orderRecord); 29 | 30 | //发送资产流水创建 31 | public boolean insertFlow4Sent(TradeOrder orderRecord); 32 | //获取资产流水创建 33 | public boolean insertFlow4Get(TradeOrder orderRecord); 34 | 35 | //丢弃资产流水创建 36 | public boolean insertFlow4Drop(TradeOrder orderRecord); 37 | //资产交易流水创建 38 | public boolean insertFolw4Trans(TradeOrder orderRecord); 39 | 40 | //退回资产流水创建 41 | public boolean insertFlow4Refund(TradeOrder orderRecord); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/trade/service/DelTradeOrderService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.service; 2 | 3 | import com.fr.chain.trade.db.entity.TradeOrderKey; 4 | 5 | public interface DelTradeOrderService { 6 | public int deleteByPrimaryKey (TradeOrderKey key); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/trade/service/QueryTradeOrderService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.service; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.trade.db.entity.TradeFlow; 6 | import com.fr.chain.trade.db.entity.TradeFlowExample; 7 | import com.fr.chain.trade.db.entity.TradeOrder; 8 | import com.fr.chain.trade.db.entity.TradeOrderExample; 9 | 10 | public interface QueryTradeOrderService { 11 | public List selectByExample(TradeOrder info); 12 | public List selectByExample(TradeOrderExample info); 13 | public TradeOrder selectOrderByKey(String orderId); 14 | public List selectByExample(TradeFlow info); 15 | public List selectByExample(TradeFlowExample info); 16 | } 17 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/trade/service/UpdateTradeOrderService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.service; 2 | 3 | import com.fr.chain.trade.db.entity.TradeOrder; 4 | import com.fr.chain.trade.db.entity.TradeOrderExample; 5 | 6 | public interface UpdateTradeOrderService { 7 | public int updateByExampleSelective (TradeOrder record, TradeOrderExample example); 8 | public int updateTradeOrder(TradeOrder record); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/trade/service/impl/DelTradeOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.service.impl; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.fr.chain.trade.db.dao.TradeOrderDao; 8 | import com.fr.chain.trade.db.entity.TradeOrderKey; 9 | import com.fr.chain.trade.service.DelTradeOrderService; 10 | 11 | @Service("delTradeOrderService") 12 | public class DelTradeOrderServiceImpl implements DelTradeOrderService { 13 | 14 | @Resource 15 | TradeOrderDao tradeOrderDao; 16 | 17 | 18 | @Override 19 | public int deleteByPrimaryKey (TradeOrderKey key){ 20 | return tradeOrderDao.deleteByPrimaryKey(key); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/trade/service/impl/QueryTradeOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.fr.chain.trade.db.dao.TradeFlowDao; 10 | import com.fr.chain.trade.db.dao.TradeOrderDao; 11 | import com.fr.chain.trade.db.entity.TradeFlow; 12 | import com.fr.chain.trade.db.entity.TradeFlowExample; 13 | import com.fr.chain.trade.db.entity.TradeOrder; 14 | import com.fr.chain.trade.db.entity.TradeOrderExample; 15 | import com.fr.chain.trade.db.entity.TradeOrderKey; 16 | import com.fr.chain.trade.service.QueryTradeOrderService; 17 | 18 | @Service("queryTradeOrderService") 19 | public class QueryTradeOrderServiceImpl implements QueryTradeOrderService { 20 | 21 | @Resource 22 | TradeOrderDao tradeOrderDao; 23 | @Resource 24 | TradeFlowDao tradeFlowDao; 25 | 26 | @Override 27 | public List selectByExample(TradeOrder property) { 28 | return tradeOrderDao.selectByExample(tradeOrderDao.getExample(property)); 29 | } 30 | 31 | @Override 32 | public List selectByExample(TradeOrderExample info){ 33 | return tradeOrderDao.selectByExample(info); 34 | } 35 | @Override 36 | public TradeOrder selectOrderByKey(String orderId){ 37 | TradeOrderKey key = new TradeOrderKey(); 38 | key.setOrderId(orderId); 39 | return tradeOrderDao.selectByPrimaryKey(key); 40 | } 41 | @Override 42 | public List selectByExample(TradeFlow info){ 43 | return tradeFlowDao.selectByExample(tradeFlowDao.getExample(info)); 44 | } 45 | 46 | @Override 47 | public List selectByExample(TradeFlowExample info){ 48 | return tradeFlowDao.selectByExample(info); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/trade/service/impl/UpdateTradeOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.trade.service.impl; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.fr.chain.trade.db.dao.TradeOrderDao; 8 | import com.fr.chain.trade.db.entity.TradeOrder; 9 | import com.fr.chain.trade.db.entity.TradeOrderExample; 10 | import com.fr.chain.trade.service.UpdateTradeOrderService; 11 | 12 | @Service("updateTradeOrderService") 13 | public class UpdateTradeOrderServiceImpl implements UpdateTradeOrderService { 14 | 15 | @Resource 16 | TradeOrderDao tradeOrderDao; 17 | 18 | 19 | @Override 20 | public int updateByExampleSelective(TradeOrder record, TradeOrderExample example){ 21 | return tradeOrderDao.updateByExampleSelective(record, example); 22 | } 23 | 24 | @Override 25 | public int updateTradeOrder(TradeOrder record){ 26 | return tradeOrderDao.updateByPrimaryKey(record); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/CreateWalletAdressService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.ewallet.db.entity.WalletAdress; 6 | 7 | public interface CreateWalletAdressService { 8 | public int insert(WalletAdress info); 9 | public int insertSelective(WalletAdress record); 10 | public int batchInsert(List records); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/DelWalletAdressService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service; 2 | 3 | import com.fr.chain.ewallet.db.entity.WalletAdressKey; 4 | 5 | public interface DelWalletAdressService { 6 | public int deleteByPrimaryKey (WalletAdressKey key); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/QueryWalletAdressService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service; 2 | 3 | import java.util.List; 4 | 5 | import com.fr.chain.ewallet.db.entity.WalletAdress; 6 | import com.fr.chain.ewallet.db.entity.WalletAdressExample; 7 | 8 | public interface QueryWalletAdressService { 9 | public List selectByExample(WalletAdress info); 10 | public WalletAdress selectOneByExample(WalletAdress info); 11 | public List selectByExample(WalletAdressExample info); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/UpdateWalletAdressService.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service; 2 | 3 | import com.fr.chain.ewallet.db.entity.WalletAdress; 4 | import com.fr.chain.ewallet.db.entity.WalletAdressExample; 5 | 6 | public interface UpdateWalletAdressService { 7 | public int updateByExampleSelective (WalletAdress record, WalletAdressExample example); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/impl/CreateWalletAdressImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.fr.chain.ewallet.db.dao.WalletAdressDao; 10 | import com.fr.chain.ewallet.db.entity.WalletAdress; 11 | import com.fr.chain.wallet.service.CreateWalletAdressService; 12 | 13 | @Service("createWalletAdressService") 14 | public class CreateWalletAdressImpl implements CreateWalletAdressService { 15 | 16 | @Resource 17 | WalletAdressDao walletAdressDao; 18 | 19 | 20 | @Override 21 | public int insert(WalletAdress info){ 22 | return walletAdressDao.insert(info); 23 | } 24 | 25 | @Override 26 | public int insertSelective(WalletAdress record){ 27 | return walletAdressDao.insertSelective(record); 28 | } 29 | 30 | @Override 31 | public int batchInsert(List records){ 32 | return walletAdressDao.batchInsert(records); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/impl/DelWalletAdressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service.impl; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.fr.chain.ewallet.db.dao.WalletAdressDao; 8 | import com.fr.chain.ewallet.db.entity.WalletAdressKey; 9 | import com.fr.chain.wallet.service.DelWalletAdressService; 10 | 11 | @Service("delWalletAdressService") 12 | public class DelWalletAdressServiceImpl implements DelWalletAdressService { 13 | 14 | @Resource 15 | WalletAdressDao walletAdressDao; 16 | 17 | 18 | @Override 19 | public int deleteByPrimaryKey (WalletAdressKey key){ 20 | return walletAdressDao.deleteByPrimaryKey(key); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/impl/QueryWalletAdressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.fr.chain.ewallet.db.dao.WalletAdressDao; 10 | import com.fr.chain.ewallet.db.entity.WalletAdress; 11 | import com.fr.chain.ewallet.db.entity.WalletAdressExample; 12 | import com.fr.chain.property.service.QueryPropertyService; 13 | import com.fr.chain.property.db.dao.PropertyDao; 14 | import com.fr.chain.property.db.entity.Property; 15 | import com.fr.chain.property.db.entity.PropertyExample; 16 | import com.fr.chain.wallet.service.QueryWalletAdressService; 17 | 18 | @Service("queryWalletAdressService") 19 | public class QueryWalletAdressServiceImpl implements QueryWalletAdressService { 20 | 21 | @Resource 22 | WalletAdressDao walletAdressDao; 23 | 24 | 25 | @Override 26 | public List selectByExample(WalletAdress info){ 27 | return walletAdressDao.selectByExample(walletAdressDao.getExample(info)); 28 | } 29 | 30 | @Override 31 | public List selectByExample(WalletAdressExample info){ 32 | return walletAdressDao.selectByExample(info); 33 | } 34 | 35 | @Override 36 | public WalletAdress selectOneByExample(WalletAdress info){ 37 | List walletAdressList = walletAdressDao.selectByExample(walletAdressDao.getExample(info)); 38 | if(walletAdressList != null && walletAdressList.size() > 0){ 39 | return walletAdressList.get(0); 40 | } 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/com/fr/chain/wallet/service/impl/UpdateWalletAdressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fr.chain.wallet.service.impl; 2 | 3 | import javax.annotation.Resource; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.fr.chain.ewallet.db.dao.WalletAdressDao; 8 | import com.fr.chain.ewallet.db.entity.WalletAdress; 9 | import com.fr.chain.ewallet.db.entity.WalletAdressExample; 10 | import com.fr.chain.wallet.service.UpdateWalletAdressService; 11 | 12 | @Service("updateWalletAdressService") 13 | public class UpdateWalletAdressServiceImpl implements UpdateWalletAdressService { 14 | 15 | @Resource 16 | WalletAdressDao walletAdressDao; 17 | 18 | 19 | @Override 20 | public int updateByExampleSelective (WalletAdress record, WalletAdressExample example){ 21 | return walletAdressDao.updateByExampleSelective(record, example); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/conf/SpringContext-daoConfig-chaintrade.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/conf/SpringContext-daoConfig-property.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/conf/SpringContext-daoConfig-trade.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /wallet-service/src/main/java/conf/SpringContext-daoConfig-wallet.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wallet-web-rest/.classpath: -------------------------------------------------------------------------------- 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 | 37 | 38 | -------------------------------------------------------------------------------- /wallet-web-rest/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /wallet-web-rest/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wallet-web-rest 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.jem.workbench.JavaEMFNature 36 | org.eclipse.wst.common.modulecore.ModuleCoreNature 37 | org.eclipse.jdt.core.javanature 38 | org.eclipse.m2e.core.maven2Nature 39 | org.eclipse.wst.common.project.facet.core.nature 40 | org.eclipse.wst.jsdt.core.jsNature 41 | 42 | 43 | -------------------------------------------------------------------------------- /wallet-web-rest/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=utf-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.7 9 | -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | uses 9 | 10 | 11 | uses 12 | 13 | 14 | uses 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /wallet-web-rest/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /wallet-web-rest/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.fr.chain 5 | wallet 6 | 0.0.1-SNAPSHOT 7 | 8 | wallet-web-rest 9 | war 10 | 11 | 12 | 13 | src/main/java 14 | 15 | **/*.xml 16 | 17 | 18 | 19 | src/main/resources 20 | 21 | **/*.xmls 22 | 23 | 24 | 25 | 26 | 27 | 28 | org.apache.maven.plugins 29 | maven-javadoc-plugin 30 | 2.10.1 31 | 32 | 33 | 34 | 35 | maven-war-plugin 36 | 2.3 37 | 38 | WebContent 39 | false 40 | 41 | 42 | 43 | org.apache.maven.plugins 44 | maven-surefire-plugin 45 | 2.4.3 46 | 47 | true 48 | 49 | 50 | 51 | org.apache.maven.plugins 52 | maven-compiler-plugin 53 | 3.1 54 | 55 | 1.7 56 | 1.7 57 | utf-8 58 | 59 | src/gens/java 60 | src/main/java 61 | 62 | 63 | 64 | 65 | org.codehaus.mojo 66 | build-helper-maven-plugin 67 | 1.5 68 | 69 | 70 | generate-sources 71 | 72 | add-source 73 | 74 | 75 | 76 | src/main/java 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | com.fr.chain 88 | wallet-service 89 | 0.0.1-SNAPSHOT 90 | 91 | 92 | --------------------------------------------------------------------------------