├── 彩种图标大全.png ├── 实施输出 ├── 截图 │ ├── 下级开户.png │ ├── 充值.png │ ├── 投注.png │ ├── 投注记录.png │ ├── 提现.png │ ├── 撤单.png │ ├── 购彩大厅.png │ ├── 追号.png │ ├── 追号记录.png │ ├── 首页.png │ ├── alipay.jpg │ ├── wechat.png │ ├── 下级账号管理.png │ ├── 团队充值明细.png │ ├── 团队帐变报表.png │ └── 投注订单详情.png └── 视图 │ └── 返点赔率情况.txt ├── .gitignore ├── lottery-web └── src │ └── main │ ├── resources │ ├── 时时彩玩法.txt │ ├── static │ │ ├── images │ │ │ ├── Lottery.png │ │ │ ├── hot-game.png │ │ │ ├── index │ │ │ │ ├── quick.png │ │ │ │ ├── safety.png │ │ │ │ ├── drawing.png │ │ │ │ └── exchange.png │ │ │ ├── recharge │ │ │ │ ├── alipay.png │ │ │ │ ├── unionpay.png │ │ │ │ └── wechat.png │ │ │ ├── lottery-logo │ │ │ │ ├── cqssc.png │ │ │ │ ├── gd11x5.png │ │ │ │ ├── js11x5.png │ │ │ │ ├── jx11x5.png │ │ │ │ └── xjssc.png │ │ │ └── personal-tabs-icons │ │ │ │ ├── exit.png │ │ │ │ ├── logo.png │ │ │ │ ├── message.png │ │ │ │ ├── top-up.png │ │ │ │ ├── withdrawal.png │ │ │ │ ├── betting-record.png │ │ │ │ └── personal-center.png │ │ └── js │ │ │ └── common │ │ │ └── common.js │ ├── application.yml │ └── templates │ │ └── cqssc.html │ └── java │ └── me │ └── zohar │ ├── lottery │ ├── dictconfig │ │ └── controller │ │ │ └── DictConfigController.java │ ├── systemnotice │ │ └── controller │ │ │ └── SystemNoticeController.java │ ├── mastercontrol │ │ └── controller │ │ │ └── MasterControlController.java │ ├── config │ │ └── security │ │ │ ├── LogoutHandler.java │ │ │ ├── AuthenticationFailHandler.java │ │ │ ├── AuthenticationSuccessHandler.java │ │ │ └── UserAccountDetails.java │ ├── rechargewithdraw │ │ └── controller │ │ │ └── RechargeWithdrawLogController.java │ └── information │ │ └── controller │ │ └── LotteryInformationController.java │ └── WebApplication.java ├── lottery-admin └── src │ ├── main │ ├── resources │ │ ├── static │ │ │ ├── images │ │ │ │ └── hot-game.png │ │ │ └── js │ │ │ │ └── common │ │ │ │ └── common.js │ │ └── application.yml │ └── java │ │ └── me │ │ └── zohar │ │ ├── AdminApplication.java │ │ └── lottery │ │ ├── config │ │ └── security │ │ │ ├── LogoutHandler.java │ │ │ ├── AuthenticationFailHandler.java │ │ │ ├── AuthenticationSuccessHandler.java │ │ │ └── UserAccountDetails.java │ │ └── rechargewithdraw │ │ └── controller │ │ ├── RechargeWithdrawLogController.java │ │ ├── RechargeController.java │ │ └── WithdrawController.java │ └── test │ └── java │ └── me │ └── zohar │ ├── game │ ├── BettingCountTest.java │ └── GameTest.java │ └── LotteryApplicationTests.java ├── lottery-mobile └── src │ └── main │ ├── resources │ ├── static │ │ ├── images │ │ │ ├── index │ │ │ │ ├── login.png │ │ │ │ ├── recharge.png │ │ │ │ ├── register.png │ │ │ │ ├── service.png │ │ │ │ └── withdraw.png │ │ │ └── lottery-logo │ │ │ │ ├── cqssc.png │ │ │ │ ├── gd11x5.png │ │ │ │ ├── js11x5.png │ │ │ │ ├── jx11x5.png │ │ │ │ ├── tjssc.png │ │ │ │ └── xjssc.png │ │ ├── css │ │ │ └── common │ │ │ │ └── common.css │ │ └── js │ │ │ └── common │ │ │ └── common.js │ ├── application.yml │ └── templates │ │ └── common │ │ └── header.html │ └── java │ └── me │ └── zohar │ ├── lottery │ ├── dictconfig │ │ └── controller │ │ │ └── DictController.java │ ├── mastercontrol │ │ └── controller │ │ │ └── MasterControlController.java │ ├── PageController.java │ ├── game │ │ └── controller │ │ │ └── GameController.java │ ├── config │ │ └── security │ │ │ ├── LogoutHandler.java │ │ │ ├── AuthenticationFailHandler.java │ │ │ ├── CustomUserDetailsService.java │ │ │ ├── AuthenticationSuccessHandler.java │ │ │ └── UserAccountDetails.java │ └── rechargewithdraw │ │ └── controller │ │ ├── WithdrawController.java │ │ └── RechargeWithdrawLogController.java │ └── MobileApplication.java ├── .gitattributes ├── lottery-api └── src │ └── main │ └── java │ └── me │ └── zohar │ └── lottery │ ├── issue │ ├── param │ │ ├── SyncLotteryNumMsg.java │ │ ├── ManualLotteryParam.java │ │ ├── IssueEditParam.java │ │ ├── LotterySituationQueryCondParam.java │ │ ├── IssueSettingParam.java │ │ └── IssueGenerateRuleParam.java │ ├── repo │ │ ├── LotterySituationRepo.java │ │ ├── IssueSettingRepo.java │ │ ├── IssueGenerateRuleRepo.java │ │ └── IssueRepo.java │ ├── vo │ │ ├── IssueSettingDetailsVO.java │ │ └── IssueGenerateRuleVO.java │ └── domain │ │ └── IssueGenerateRule.java │ ├── systemnotice │ ├── param │ │ ├── SystemNoticeQueryCondParam.java │ │ └── AddOrUpdateSystemNoticeParam.java │ ├── repo │ │ └── SystemNoticeRepo.java │ ├── domain │ │ └── SystemNotice.java │ └── vo │ │ └── SystemNoticeVO.java │ ├── game │ ├── repo │ │ ├── OptionalNumRepo.java │ │ ├── NumLocateRepo.java │ │ ├── GameCategoryRepo.java │ │ ├── GamePlayRepo.java │ │ ├── GameRepo.java │ │ └── GameSituationRepo.java │ ├── param │ │ ├── OptionalNumParam.java │ │ ├── GameCategoryParam.java │ │ ├── NumLocateParam.java │ │ └── GameParam.java │ ├── domain │ │ ├── OptionalNum.java │ │ ├── GameCategory.java │ │ └── GameSituation.java │ └── vo │ │ ├── OptionalNumVO.java │ │ ├── GameCategoryVO.java │ │ └── NumLocateVO.java │ ├── useraccount │ ├── repo │ │ ├── LoginLogRepo.java │ │ ├── AccountChangeLogRepo.java │ │ └── UserAccountRepo.java │ ├── param │ │ ├── UserAccountQueryCondParam.java │ │ ├── ModifyLoginPwdParam.java │ │ ├── ModifyMoneyPwdParam.java │ │ ├── LoginLogQueryCondParam.java │ │ ├── LowerLevelAccountQueryCondParam.java │ │ ├── BindBankInfoParam.java │ │ ├── AccountChangeLogQueryCondParam.java │ │ ├── UserAccountEditParam.java │ │ ├── LowerLevelAccountChangeLogQueryCondParam.java │ │ ├── UserAccountRegisterParam.java │ │ └── AddUserAccountParam.java │ ├── vo │ │ ├── BankInfoVO.java │ │ ├── LoginAccountInfoVO.java │ │ ├── UserAccountInfoVO.java │ │ └── LoginLogVO.java │ └── domain │ │ └── LoginLog.java │ ├── dictconfig │ ├── param │ │ ├── UpdateDictDataParam.java │ │ ├── ConfigItemQueryCondParam.java │ │ ├── DictTypeQueryCondParam.java │ │ ├── DictDataParam.java │ │ ├── AddOrUpdateDictTypeParam.java │ │ └── ConfigParam.java │ ├── repo │ │ ├── DictTypeRepo.java │ │ ├── ConfigItemRepo.java │ │ └── DictItemRepo.java │ ├── ConfigHolder.java │ ├── domain │ │ ├── ConfigItem.java │ │ ├── DictType.java │ │ └── DictItem.java │ ├── DictHolder.java │ └── vo │ │ ├── DictTypeVO.java │ │ ├── DictItemVO.java │ │ └── ConfigItemVO.java │ ├── common │ ├── utils │ │ ├── IdUtils.java │ │ └── BallUtils.java │ ├── param │ │ └── PageParam.java │ ├── valid │ │ └── ParamValid.java │ ├── exception │ │ ├── ParamValidException.java │ │ └── BizException.java │ └── vo │ │ └── PageResult.java │ ├── information │ ├── param │ │ ├── LotteryInformationQueryCondParam.java │ │ ├── AddOrUpdateInformationCrawlerParam.java │ │ ├── SyncInformationParam.java │ │ └── AddOrUpdateInformationParam.java │ ├── repo │ │ ├── InformationCrawlerRepo.java │ │ └── LotteryInformationRepo.java │ ├── domain │ │ ├── InformationCrawler.java │ │ └── LotteryInformation.java │ └── vo │ │ └── LotteryInformationCrawlerVO.java │ ├── betting │ ├── repo │ │ ├── TrackingNumberOrderRepo.java │ │ ├── TrackingNumberContentRepo.java │ │ ├── TrackingNumberSituationRepo.java │ │ ├── BettingRebateRepo.java │ │ ├── TrackingNumberPlanRepo.java │ │ ├── BettingRecordRepo.java │ │ └── BettingOrderRepo.java │ └── param │ │ ├── ChangeOrderParam.java │ │ ├── TrackingNumberSituationQueryCondParam.java │ │ ├── BettingOrderQueryCondParam.java │ │ ├── LowerLevelBettingOrderQueryCondParam.java │ │ └── BettingRecordParam.java │ ├── rechargewithdraw │ ├── repo │ │ ├── WithdrawRecordRepo.java │ │ ├── RechargeWithdrawLogRepo.java │ │ └── RechargeOrderRepo.java │ ├── param │ │ ├── WithdrawRecordQueryCondParam.java │ │ ├── RechargeOrderQueryCondParam.java │ │ ├── RechargeWithdrawLogQueryCondParam.java │ │ ├── LowerLevelRechargeOrderQueryCondParam.java │ │ ├── LowerLevelWithdrawRecordQueryCondParam.java │ │ ├── MuspayCallbackParam.java │ │ ├── StartWithdrawParam.java │ │ └── RechargeOrderParam.java │ └── domain │ │ └── RechargeWithdrawLog.java │ ├── agent │ ├── repo │ │ ├── RebateAndOddsSituationRepo.java │ │ ├── RebateAndOddsRepo.java │ │ └── InviteCodeRepo.java │ ├── param │ │ ├── AddOrUpdateRebateAndOddsParam.java │ │ ├── GenerateInviteCodeParam.java │ │ └── AgentOpenAnAccountParam.java │ ├── domain │ │ ├── RebateAndOdds.java │ │ └── RebateAndOddsSituation.java │ └── vo │ │ ├── RebateAndOddsVO.java │ │ ├── RebateAndOddsSituationVO.java │ │ └── InviteCodeDetailsInfoVO.java │ ├── mastercontrol │ ├── repo │ │ ├── RechargeSettingRepo.java │ │ ├── InviteRegisterSettingRepo.java │ │ └── RegisterAmountSettingRepo.java │ ├── vo │ │ ├── RegisterAmountSettingVO.java │ │ ├── InviteRegisterSettingVO.java │ │ └── RechargeSettingVO.java │ └── domain │ │ ├── RegisterAmountSetting.java │ │ └── InviteRegisterSetting.java │ └── statisticalanalysis │ ├── param │ └── AccountProfitAndLossQueryCondParam.java │ └── domain │ └── EverydayProfitAndLoss.java ├── lottery-task ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── me │ │ └── zohar │ │ ├── lottery │ │ ├── config │ │ │ ├── schedule │ │ │ │ └── ScheduleConfig.java │ │ │ └── mq │ │ │ │ └── XxlMqConf.java │ │ ├── betting │ │ │ └── task │ │ │ │ └── BettingRebateAutoSettlementTask.java │ │ ├── information │ │ │ └── task │ │ │ │ └── SyncLotteryInformationTask.java │ │ ├── rechargewithdraw │ │ │ └── task │ │ │ │ ├── RechargeOrderTimeoutDealTask.java │ │ │ │ └── RechargeOrderAutoSettlementTask.java │ │ └── issue │ │ │ └── task │ │ │ └── GenerateIssueTask.java │ │ └── TaskApplication.java └── pom.xml ├── README.md └── pom.xml /彩种图标大全.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/彩种图标大全.png -------------------------------------------------------------------------------- /实施输出/截图/下级开户.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/下级开户.png -------------------------------------------------------------------------------- /实施输出/截图/充值.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/充值.png -------------------------------------------------------------------------------- /实施输出/截图/投注.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/投注.png -------------------------------------------------------------------------------- /实施输出/截图/投注记录.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/投注记录.png -------------------------------------------------------------------------------- /实施输出/截图/提现.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/提现.png -------------------------------------------------------------------------------- /实施输出/截图/撤单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/撤单.png -------------------------------------------------------------------------------- /实施输出/截图/购彩大厅.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/购彩大厅.png -------------------------------------------------------------------------------- /实施输出/截图/追号.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/追号.png -------------------------------------------------------------------------------- /实施输出/截图/追号记录.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/追号记录.png -------------------------------------------------------------------------------- /实施输出/截图/首页.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/首页.png -------------------------------------------------------------------------------- /实施输出/截图/alipay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/alipay.jpg -------------------------------------------------------------------------------- /实施输出/截图/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/wechat.png -------------------------------------------------------------------------------- /实施输出/截图/下级账号管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/下级账号管理.png -------------------------------------------------------------------------------- /实施输出/截图/团队充值明细.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/团队充值明细.png -------------------------------------------------------------------------------- /实施输出/截图/团队帐变报表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/团队帐变报表.png -------------------------------------------------------------------------------- /实施输出/截图/投注订单详情.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/实施输出/截图/投注订单详情.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .classpath 3 | .factorypath 4 | .project 5 | .settings 6 | .springBeans -------------------------------------------------------------------------------- /lottery-web/src/main/resources/时时彩玩法.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/时时彩玩法.txt -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/Lottery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/Lottery.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/hot-game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/hot-game.png -------------------------------------------------------------------------------- /lottery-admin/src/main/resources/static/images/hot-game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-admin/src/main/resources/static/images/hot-game.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/index/quick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/index/quick.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/index/safety.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/index/safety.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/index/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/index/login.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/index/drawing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/index/drawing.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/index/exchange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/index/exchange.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/index/recharge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/index/recharge.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/index/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/index/register.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/index/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/index/service.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/index/withdraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/index/withdraw.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/recharge/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/recharge/alipay.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/recharge/unionpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/recharge/unionpay.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/recharge/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/recharge/wechat.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/lottery-logo/cqssc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/lottery-logo/cqssc.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/lottery-logo/gd11x5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/lottery-logo/gd11x5.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/lottery-logo/js11x5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/lottery-logo/js11x5.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/lottery-logo/jx11x5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/lottery-logo/jx11x5.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/lottery-logo/xjssc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/lottery-logo/xjssc.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/lottery-logo/cqssc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/lottery-logo/cqssc.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/lottery-logo/gd11x5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/lottery-logo/gd11x5.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/lottery-logo/js11x5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/lottery-logo/js11x5.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/lottery-logo/jx11x5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/lottery-logo/jx11x5.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/lottery-logo/tjssc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/lottery-logo/tjssc.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/images/lottery-logo/xjssc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-mobile/src/main/resources/static/images/lottery-logo/xjssc.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/personal-tabs-icons/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/personal-tabs-icons/exit.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/personal-tabs-icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/personal-tabs-icons/logo.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/personal-tabs-icons/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/personal-tabs-icons/message.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/personal-tabs-icons/top-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/personal-tabs-icons/top-up.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/personal-tabs-icons/withdrawal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/personal-tabs-icons/withdrawal.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/personal-tabs-icons/betting-record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/personal-tabs-icons/betting-record.png -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/images/personal-tabs-icons/personal-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamezoo/lottery/HEAD/lottery-web/src/main/resources/static/images/personal-tabs-icons/personal-center.png -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/css/common/common.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | [v-cloak] { 4 | display: none; 5 | } 6 | 7 | a { 8 | cursor: pointer; 9 | } 10 | 11 | .page-body { 12 | padding-top: 2.5rem; 13 | padding-bottom: 4.5rem; 14 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.md linguist-language=Java 2 | *.yml linguist-language=Java 3 | *.html linguist-language=Java 4 | *.js linguist-language=Java 5 | *.xml linguist-language=Java 6 | *.css linguist-language=Java 7 | *.sql linguist-language=Java 8 | *.uml linguist-language=Java 9 | *.cmd linguist-language=Java 10 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/static/js/common/common.js: -------------------------------------------------------------------------------- 1 | Vue.http.interceptors.push(function(request) { 2 | return function(response) { 3 | if (response.body.code != 200) { 4 | response.ok = false; 5 | layer.alert(response.body.msg, { 6 | title : '提示', 7 | icon : 7, 8 | time : 3000 9 | }); 10 | } 11 | }; 12 | }); -------------------------------------------------------------------------------- /lottery-admin/src/main/resources/static/js/common/common.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 由于js存在精度丢失的问题,需要对其进行四舍五入处理 3 | * 4 | * @param num 5 | * @param digit 6 | * 小数位数, 不填则默认4为小数 7 | * @returns 8 | */ 9 | function numberFormat(num, digit) { 10 | if (digit == null) { 11 | digit = 4; 12 | } 13 | return parseFloat(Number(num).toFixed(digit)); 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/param/SyncLotteryNumMsg.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.param; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class SyncLotteryNumMsg { 9 | 10 | private String gameCode; 11 | 12 | private Long issueNum; 13 | 14 | private Integer retries; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/systemnotice/param/SystemNoticeQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.systemnotice.param; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import me.zohar.lottery.common.param.PageParam; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper = false) 9 | public class SystemNoticeQueryCondParam extends PageParam { 10 | 11 | private String noticeTitle; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/repo/OptionalNumRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.game.domain.OptionalNum; 7 | 8 | public interface OptionalNumRepo extends JpaRepository, JpaSpecificationExecutor { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/repo/LoginLogRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.useraccount.domain.LoginLog; 7 | 8 | public interface LoginLogRepo extends JpaRepository, JpaSpecificationExecutor { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/param/UpdateDictDataParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.param; 2 | 3 | import java.util.List; 4 | 5 | import javax.validation.Valid; 6 | import javax.validation.constraints.NotBlank; 7 | 8 | import lombok.Data; 9 | 10 | @Data 11 | public class UpdateDictDataParam { 12 | 13 | @NotBlank 14 | private String dictTypeId; 15 | 16 | @Valid 17 | private List dictDatas; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/common/utils/IdUtils.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.common.utils; 2 | 3 | import cn.hutool.core.lang.Snowflake; 4 | import cn.hutool.core.util.IdUtil; 5 | 6 | public class IdUtils { 7 | 8 | private static final Snowflake snowflake = IdUtil.createSnowflake(0, 0); 9 | 10 | /** 11 | * Snowflake ID 12 | * 13 | * @return 14 | */ 15 | public static String getId() { 16 | return snowflake.nextId() + ""; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/param/LotteryInformationQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.param; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import me.zohar.lottery.common.param.PageParam; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper = false) 9 | public class LotteryInformationQueryCondParam extends PageParam { 10 | 11 | private String title; 12 | 13 | private String source; 14 | 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/repo/LotterySituationRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.issue.domain.LotterySituation; 7 | 8 | public interface LotterySituationRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /实施输出/视图/返点赔率情况.txt: -------------------------------------------------------------------------------- 1 | create view v_rebate_and_odds_situation as 2 | select 3 | CONCAT(rebate,'/',odds) id, 4 | rebate,odds, 5 | sum(associated_account_num) associated_account_num, 6 | max(create_time) create_time 7 | from( 8 | select 9 | rebate,odds,create_time,0 associated_account_num 10 | from rebate_and_odds 11 | union all 12 | select 13 | rebate,odds,null create_time,count(1) associated_account_num 14 | from user_account GROUP BY rebate,odds 15 | ) t 16 | group by rebate,odds 17 | 18 | 19 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/repo/TrackingNumberOrderRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.betting.domain.TrackingNumberOrder; 7 | 8 | public interface TrackingNumberOrderRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/repo/AccountChangeLogRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.useraccount.domain.AccountChangeLog; 7 | 8 | public interface AccountChangeLogRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/repo/WithdrawRecordRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.rechargewithdraw.domain.WithdrawRecord; 7 | 8 | public interface WithdrawRecordRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/repo/RebateAndOddsSituationRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.agent.domain.RebateAndOddsSituation; 7 | 8 | public interface RebateAndOddsSituationRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/repo/TrackingNumberContentRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.betting.domain.TrackingNumberContent; 7 | 8 | public interface TrackingNumberContentRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/repo/DictTypeRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.dictconfig.domain.DictType; 7 | 8 | public interface DictTypeRepo extends JpaRepository, JpaSpecificationExecutor { 9 | 10 | DictType findByDictTypeCode(String dictTypeCode); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/repo/InformationCrawlerRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.information.domain.InformationCrawler; 7 | 8 | public interface InformationCrawlerRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/repo/IssueSettingRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.issue.domain.IssueSetting; 7 | 8 | public interface IssueSettingRepo extends JpaRepository, JpaSpecificationExecutor { 9 | 10 | IssueSetting findByGameId(String gameId); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/repo/TrackingNumberSituationRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.betting.domain.TrackingNumberSituation; 7 | 8 | public interface TrackingNumberSituationRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/repo/ConfigItemRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.dictconfig.domain.ConfigItem; 7 | 8 | public interface ConfigItemRepo extends JpaRepository, JpaSpecificationExecutor { 9 | 10 | ConfigItem findByConfigCode(String configCode); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/UserAccountQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import me.zohar.lottery.common.param.PageParam; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper=false) 9 | public class UserAccountQueryCondParam extends PageParam { 10 | 11 | /** 12 | * 用户名 13 | */ 14 | private String userName; 15 | 16 | /** 17 | * 真实姓名 18 | */ 19 | private String realName; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/param/ConfigItemQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.param; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import me.zohar.lottery.common.param.PageParam; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper = false) 9 | public class ConfigItemQueryCondParam extends PageParam { 10 | 11 | /** 12 | * 配置项code 13 | */ 14 | private String configCode; 15 | 16 | /** 17 | * 配置项名称 18 | */ 19 | private String configName; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/param/DictTypeQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.param; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import me.zohar.lottery.common.param.PageParam; 6 | 7 | @Data 8 | @EqualsAndHashCode(callSuper = false) 9 | public class DictTypeQueryCondParam extends PageParam { 10 | 11 | /** 12 | * 字典类型code 13 | */ 14 | private String dictTypeCode; 15 | 16 | /** 17 | * 字典类型名称 18 | */ 19 | private String dictTypeName; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/repo/RechargeWithdrawLogRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.rechargewithdraw.domain.RechargeWithdrawLog; 7 | 8 | public interface RechargeWithdrawLogRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/repo/NumLocateRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.game.domain.NumLocate; 9 | 10 | public interface NumLocateRepo extends JpaRepository, JpaSpecificationExecutor { 11 | 12 | List findByGamePlayId(String gamePlayId); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/common/param/PageParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.common.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * 分页条件入参 7 | * 8 | * @author zohar 9 | * @date 2019年1月16日 10 | * 11 | */ 12 | @Data 13 | public class PageParam { 14 | 15 | /** 16 | * 页码 17 | */ 18 | private Integer pageNum; 19 | 20 | /** 21 | * 每页大小 22 | */ 23 | private Integer pageSize; 24 | 25 | /** 26 | * 排序字段 27 | */ 28 | private String propertie; 29 | 30 | /** 31 | * 排序方式 32 | */ 33 | private String direction; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/common/valid/ParamValid.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.common.valid; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 参数校验注解 11 | * @author zohar 12 | * @date 2019年1月17日 13 | * 14 | */ 15 | @Target({ ElementType.METHOD }) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Documented 18 | public @interface ParamValid { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/repo/RechargeSettingRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.mastercontrol.domain.RechargeSetting; 7 | 8 | public interface RechargeSettingRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | RechargeSetting findTopByOrderByLatelyUpdateTime(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/param/ManualLotteryParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | import lombok.Data; 7 | 8 | @Data 9 | public class ManualLotteryParam { 10 | 11 | /** 12 | * 主键id 13 | */ 14 | @NotBlank 15 | private String id; 16 | 17 | /** 18 | * 全部开奖号码,以逗号分隔 19 | */ 20 | @NotBlank 21 | private String lotteryNum; 22 | 23 | /** 24 | * 自动结算标识 25 | */ 26 | @NotNull 27 | private Boolean autoSettlementFlag; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/repo/UserAccountRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.useraccount.domain.UserAccount; 7 | 8 | 9 | public interface UserAccountRepo extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | UserAccount findByUserName(String userName); 12 | 13 | Long countByInviterId(String inviterId); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/repo/InviteRegisterSettingRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.mastercontrol.domain.InviteRegisterSetting; 7 | 8 | public interface InviteRegisterSettingRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | InviteRegisterSetting findTopByOrderByEnabled(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/repo/RegisterAmountSettingRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.mastercontrol.domain.RegisterAmountSetting; 7 | 8 | public interface RegisterAmountSettingRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | RegisterAmountSetting findTopByOrderByEnabled(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/repo/RebateAndOddsRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.repo; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 | 6 | import me.zohar.lottery.agent.domain.RebateAndOdds; 7 | 8 | public interface RebateAndOddsRepo 9 | extends JpaRepository, JpaSpecificationExecutor { 10 | 11 | RebateAndOdds findTopByRebate(Double rebate); 12 | 13 | RebateAndOdds findTopByRebateAndOdds(Double rebate, Double odds); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/repo/IssueGenerateRuleRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.issue.domain.IssueGenerateRule; 9 | 10 | public interface IssueGenerateRuleRepo 11 | extends JpaRepository, JpaSpecificationExecutor { 12 | 13 | List findByIssueSettingId(String issueSettingId); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/repo/GameCategoryRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.game.domain.GameCategory; 9 | 10 | public interface GameCategoryRepo extends JpaRepository, JpaSpecificationExecutor { 11 | 12 | List findByOrderByOrderNo(); 13 | 14 | GameCategory findByGameCategoryCode(String gameCategoryCode); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/param/ChangeOrderParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class ChangeOrderParam { 9 | 10 | /** 11 | * 投注订单id 12 | */ 13 | @NotBlank 14 | private String bettingOrderId; 15 | 16 | /** 17 | * 投注记录id 18 | */ 19 | @NotBlank 20 | private String bettingRecordId; 21 | 22 | /** 23 | * 游戏玩法代码 24 | */ 25 | @NotBlank 26 | private String gamePlayCode; 27 | 28 | /** 29 | * 所选号码 30 | */ 31 | @NotBlank 32 | private String selectedNo; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/repo/GamePlayRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.game.domain.GamePlay; 9 | 10 | public interface GamePlayRepo extends JpaRepository, JpaSpecificationExecutor { 11 | 12 | List findByGameCodeOrderByOrderNo(String gameCode); 13 | 14 | GamePlay findByGameCodeAndGamePlayCode(String gameCode, String gamePlayCode); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/common/exception/ParamValidException.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.common.exception; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * 参数校验异常 7 | * 8 | * @author zohar 9 | * @date 2019年1月17日 10 | * 11 | */ 12 | @Getter 13 | public class ParamValidException extends RuntimeException { 14 | 15 | /** 16 | * 17 | */ 18 | private static final long serialVersionUID = 1L; 19 | 20 | private String code; 21 | 22 | private String msg; 23 | 24 | public ParamValidException(String code, String msg) { 25 | super(msg); 26 | this.code = code; 27 | this.msg = msg; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/systemnotice/repo/SystemNoticeRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.systemnotice.repo; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 8 | 9 | import me.zohar.lottery.systemnotice.domain.SystemNotice; 10 | 11 | public interface SystemNoticeRepo extends JpaRepository, JpaSpecificationExecutor { 12 | 13 | List findTop5ByPublishDateLessThanOrderByPublishDateDesc(Date publishDate); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/repo/BettingRebateRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.betting.domain.BettingRebate; 9 | 10 | public interface BettingRebateRepo 11 | extends JpaRepository, JpaSpecificationExecutor { 12 | 13 | List findBySettlementTimeIsNull(); 14 | 15 | List findByBettingOrderId(String bettingOrderId); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/repo/GameRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.game.domain.Game; 9 | 10 | public interface GameRepo extends JpaRepository, JpaSpecificationExecutor { 11 | 12 | Game findByGameCode(String gameCode); 13 | 14 | List findByStateOrderByOrderNo(String state); 15 | 16 | List findByGameCategoryIdOrderByOrderNoAsc(String gameCategoryId); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /lottery-task/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/lottery?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai 6 | username: root 7 | password: zohar001 8 | driverClassName: com.mysql.cj.jdbc.Driver 9 | jpa: 10 | show-sql: true 11 | generate-ddl: true 12 | hibernate: 13 | ddl-auto: none 14 | thymeleaf: 15 | cache: false 16 | redis: 17 | port: 6379 18 | host: localhost 19 | xxl: 20 | mq: 21 | admin: 22 | address: http://localhost:8088/xxl-mq-admin 23 | accessToken: null -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/ModifyLoginPwdParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import lombok.Data; 6 | 7 | /** 8 | * 修改登录密码入参 9 | * 10 | * @author zohar 11 | * @date 2019年1月19日 12 | * 13 | */ 14 | @Data 15 | public class ModifyLoginPwdParam { 16 | 17 | /** 18 | * 旧的登录密码 19 | */ 20 | @NotBlank 21 | private String oldLoginPwd; 22 | 23 | /** 24 | * 新的登录密码 25 | */ 26 | @NotBlank 27 | private String newLoginPwd; 28 | 29 | /** 30 | * 用户账号id 31 | */ 32 | @NotBlank 33 | private String userAccountId; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lottery-web/src/main/resources/static/js/common/common.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 由于js存在精度丢失的问题,需要对其进行四舍五入处理 3 | * 4 | * @param num 5 | * @param digit 6 | * 小数位数, 不填则默认4为小数 7 | * @returns 8 | */ 9 | function numberFormat(num, digit) { 10 | if (digit == null) { 11 | digit = 4; 12 | } 13 | return parseFloat(Number(num).toFixed(digit)); 14 | } 15 | 16 | /** 17 | * 获取url参数 18 | * 19 | * @param name 20 | * @returns 21 | */ 22 | function getQueryString(name) { 23 | var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); 24 | var r = window.location.search.substr(1).match(reg); 25 | if (r != null) 26 | return unescape(r[2]); 27 | return null; 28 | } 29 | -------------------------------------------------------------------------------- /lottery-admin/src/test/java/me/zohar/game/BettingCountTest.java: -------------------------------------------------------------------------------- 1 | package me.zohar.game; 2 | 3 | import org.junit.Test; 4 | import org.springframework.util.DigestUtils; 5 | 6 | import cn.hutool.core.date.DateTime; 7 | import cn.hutool.core.date.DateUtil; 8 | import cn.hutool.crypto.digest.DigestAlgorithm; 9 | import cn.hutool.crypto.digest.DigestUtil; 10 | import cn.hutool.crypto.digest.Digester; 11 | 12 | public class BettingCountTest { 13 | 14 | @Test 15 | public void test() { 16 | String startTime = "07:10"; 17 | DateTime dateTime = DateUtil.parse(startTime, "hh:mm"); 18 | System.out.println(dateTime); 19 | System.out.println(dateTime.hour(true)); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/repo/InviteCodeRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.repo; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.agent.domain.InviteCode; 9 | 10 | public interface InviteCodeRepo extends JpaRepository, JpaSpecificationExecutor { 11 | 12 | InviteCode findTopByInviterIdOrderByPeriodOfValidityDesc(String inviterId); 13 | 14 | InviteCode findTopByCodeAndPeriodOfValidityGreaterThanEqual(String code, Date periodOfValidity); 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/repo/TrackingNumberPlanRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.betting.domain.TrackingNumberPlan; 9 | 10 | public interface TrackingNumberPlanRepo 11 | extends JpaRepository, JpaSpecificationExecutor { 12 | 13 | TrackingNumberPlan findByBettingOrderId(String bettingOrderId); 14 | 15 | 16 | List findByTrackingNumberOrderId(String trackingNumberOrderId); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/repo/GameSituationRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.game.domain.GameSituation; 9 | 10 | public interface GameSituationRepo extends JpaRepository, JpaSpecificationExecutor { 11 | 12 | List findByOrderByHotGameFlagDesc(); 13 | 14 | List findTop5ByOrderByHotGameFlagDesc(); 15 | 16 | List findByGameCategoryIdOrderByHotGameFlagDesc(String gameCategoryId); 17 | } 18 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/ModifyMoneyPwdParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import lombok.Data; 6 | 7 | /** 8 | * 修改资金密码入参 9 | * @author zohar 10 | * @date 2019年1月19日 11 | * 12 | */ 13 | @Data 14 | public class ModifyMoneyPwdParam { 15 | 16 | /** 17 | * 旧的资金密码 18 | */ 19 | @NotBlank(message = "oldMoneyPwd不能为空") 20 | private String oldMoneyPwd; 21 | 22 | /** 23 | * 新的资金密码 24 | */ 25 | @NotBlank(message = "newMoneyPwd不能为空") 26 | private String newMoneyPwd; 27 | 28 | /** 29 | * 用户账号id 30 | */ 31 | @NotBlank(message = "userAccountId不能为空") 32 | private String userAccountId; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/repo/LotteryInformationRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.repo; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 8 | 9 | import me.zohar.lottery.information.domain.LotteryInformation; 10 | 11 | public interface LotteryInformationRepo 12 | extends JpaRepository, JpaSpecificationExecutor { 13 | 14 | LotteryInformation findBytitleAndPublishTime(String title, Date publishTime); 15 | 16 | List findTop13ByOrderByPublishTimeDesc(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/lottery/config/schedule/ScheduleConfig.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.schedule; 2 | 3 | import java.util.concurrent.Executors; 4 | 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | import org.springframework.scheduling.annotation.SchedulingConfigurer; 8 | import org.springframework.scheduling.config.ScheduledTaskRegistrar; 9 | 10 | @EnableScheduling 11 | @Configuration 12 | public class ScheduleConfig implements SchedulingConfigurer { 13 | 14 | @Override 15 | public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { 16 | taskRegistrar.setScheduler(Executors.newScheduledThreadPool(5)); 17 | } 18 | } -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/repo/DictItemRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.repo; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 7 | 8 | import me.zohar.lottery.dictconfig.domain.DictItem; 9 | 10 | public interface DictItemRepo extends JpaRepository, JpaSpecificationExecutor { 11 | 12 | DictItem findByDictTypeDictTypeCodeAndDictItemCode(String dictTypeCode, String dictItemCode); 13 | 14 | List findByDictTypeDictTypeCodeOrderByOrderNo(String dictTypeCode); 15 | 16 | List findByDictTypeIdOrderByOrderNo(String dictTypeId); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/common/utils/BallUtils.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.common.utils; 2 | 3 | /** 4 | * 号球工具类 5 | * 6 | * @author zohar 7 | * @date 2019年1月12日 8 | * 9 | */ 10 | public class BallUtils { 11 | 12 | public static int[][] buildSSCBall(String selectedNo) { 13 | String[] split = selectedNo.split(","); 14 | int[][] balls = new int[5][]; 15 | for (int i = 0; i < split.length; i++) { 16 | String s = split[i]; 17 | if ("-".equals(s)) { 18 | balls[i] = new int[0]; 19 | } else { 20 | balls[i] = new int[s.length()]; 21 | for (int j = 0; j < s.length(); j++) { 22 | balls[i][j] = Integer.parseInt(String.valueOf(s.charAt(j))); 23 | } 24 | } 25 | } 26 | return balls; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/param/IssueEditParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | import lombok.Data; 7 | 8 | /** 9 | * 期号编辑入参 10 | * 11 | * @author zohar 12 | * @date 2019年2月22日 13 | * 14 | */ 15 | @Data 16 | public class IssueEditParam { 17 | 18 | /** 19 | * 主键id 20 | */ 21 | @NotBlank 22 | private String id; 23 | 24 | /** 25 | * 自动开奖 26 | */ 27 | @NotNull 28 | private Boolean automaticLottery; 29 | 30 | /** 31 | * 自动结算 32 | */ 33 | @NotNull 34 | private Boolean automaticSettlement; 35 | 36 | /** 37 | * 该期是否作废 38 | */ 39 | @NotNull 40 | private Boolean issueInvalid; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/common/exception/BizException.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.common.exception; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * 自定义业务异常 7 | * 8 | * @author zohar 9 | * @date 2019年1月7日 10 | * 11 | */ 12 | @Getter 13 | public class BizException extends RuntimeException { 14 | 15 | /** 16 | * 17 | */ 18 | private static final long serialVersionUID = 1L; 19 | 20 | private String code; 21 | 22 | private String msg; 23 | 24 | public BizException(BizError bizError) { 25 | super(bizError.getMsg()); 26 | this.code = bizError.getCode(); 27 | this.msg = bizError.getMsg(); 28 | } 29 | 30 | public BizException(String code, String msg) { 31 | super(msg); 32 | this.code = code; 33 | this.msg = msg; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/param/DictDataParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import lombok.Data; 8 | import me.zohar.lottery.common.utils.IdUtils; 9 | import me.zohar.lottery.dictconfig.domain.DictItem; 10 | 11 | @Data 12 | public class DictDataParam { 13 | 14 | /** 15 | * 字典项code 16 | */ 17 | @NotBlank 18 | private String dictItemCode; 19 | 20 | /** 21 | * 字典项名称 22 | */ 23 | @NotBlank 24 | private String dictItemName; 25 | 26 | public DictItem convertToPo() { 27 | DictItem po = new DictItem(); 28 | BeanUtils.copyProperties(this, po); 29 | po.setId(IdUtils.getId()); 30 | return po; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/param/OptionalNumParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.param; 2 | 3 | import javax.validation.constraints.DecimalMin; 4 | import javax.validation.constraints.NotBlank; 5 | 6 | import org.springframework.beans.BeanUtils; 7 | 8 | import lombok.Data; 9 | import me.zohar.lottery.common.utils.IdUtils; 10 | import me.zohar.lottery.game.domain.OptionalNum; 11 | 12 | @Data 13 | public class OptionalNumParam { 14 | 15 | @NotBlank 16 | private String num; 17 | 18 | @DecimalMin(value = "0", inclusive = false) 19 | private Double odds; 20 | 21 | public OptionalNum convertToPo() { 22 | OptionalNum po = new OptionalNum(); 23 | BeanUtils.copyProperties(this, po); 24 | po.setId(IdUtils.getId()); 25 | return po; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/dictconfig/controller/DictController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | 8 | import me.zohar.lottery.common.vo.Result; 9 | import me.zohar.lottery.dictconfig.DictHolder; 10 | 11 | @Controller 12 | @RequestMapping("/dict") 13 | public class DictController { 14 | 15 | @GetMapping("/findDictItemInCache") 16 | @ResponseBody 17 | public Result findDictItemInCache(String dictTypeCode) { 18 | return Result.success().setData(DictHolder.findDictItem(dictTypeCode)); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /lottery-web/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/lottery?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai 6 | username: root 7 | password: zohar001 8 | driverClassName: com.mysql.cj.jdbc.Driver 9 | jpa: 10 | show-sql: true 11 | generate-ddl: true 12 | hibernate: 13 | ddl-auto: none 14 | thymeleaf: 15 | cache: false 16 | redis: 17 | port: 6379 18 | host: localhost 19 | jetcache: 20 | areaInCacheName: false 21 | local: 22 | default: 23 | type: linkedhashmap 24 | keyConvertor: fastjson 25 | remote: 26 | default: 27 | type: redis.lettuce 28 | keyConvertor: fastjson 29 | uri: redis://127.0.0.1:6379/ -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8082 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/lottery?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai 6 | username: root 7 | password: zohar001 8 | driverClassName: com.mysql.cj.jdbc.Driver 9 | jpa: 10 | show-sql: true 11 | generate-ddl: true 12 | hibernate: 13 | ddl-auto: none 14 | thymeleaf: 15 | cache: false 16 | redis: 17 | port: 6379 18 | host: localhost 19 | jetcache: 20 | areaInCacheName: false 21 | local: 22 | default: 23 | type: linkedhashmap 24 | keyConvertor: fastjson 25 | remote: 26 | default: 27 | type: redis.lettuce 28 | keyConvertor: fastjson 29 | uri: redis://127.0.0.1:6379/ -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/LoginLogQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | @Data 12 | @EqualsAndHashCode(callSuper=false) 13 | public class LoginLogQueryCondParam extends PageParam { 14 | 15 | private String ipAddr; 16 | 17 | private String userName; 18 | 19 | private String state; 20 | 21 | /** 22 | * 开始时间 23 | */ 24 | @DateTimeFormat(pattern = "yyyy-MM-dd") 25 | private Date startTime; 26 | 27 | /** 28 | * 结束时间 29 | */ 30 | @DateTimeFormat(pattern = "yyyy-MM-dd") 31 | private Date endTime; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/dictconfig/controller/DictConfigController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | 8 | import me.zohar.lottery.common.vo.Result; 9 | import me.zohar.lottery.dictconfig.DictHolder; 10 | 11 | @Controller 12 | @RequestMapping("/dictconfig") 13 | public class DictConfigController { 14 | 15 | @GetMapping("/findDictItemInCache") 16 | @ResponseBody 17 | public Result findDictItemInCache(String dictTypeCode) { 18 | return Result.success().setData(DictHolder.findDictItem(dictTypeCode)); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/LowerLevelAccountQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import lombok.Data; 6 | import lombok.EqualsAndHashCode; 7 | import me.zohar.lottery.common.param.PageParam; 8 | 9 | /** 10 | * 下级账号查询条件入参 11 | * 12 | * @author zohar 13 | * @date 2019年6月9日 14 | * 15 | */ 16 | @Data 17 | @EqualsAndHashCode(callSuper = false) 18 | public class LowerLevelAccountQueryCondParam extends PageParam { 19 | 20 | /** 21 | * 当前账号id 22 | */ 23 | @NotBlank 24 | private String currentAccountId; 25 | 26 | /** 27 | * 用户名 28 | */ 29 | private String userName; 30 | 31 | /** 32 | * 查询范围;10:所有账号,20:指定账号及直接下级 33 | */ 34 | @NotBlank 35 | private String queryScope; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/param/AddOrUpdateInformationCrawlerParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import lombok.Data; 8 | import me.zohar.lottery.common.utils.IdUtils; 9 | import me.zohar.lottery.information.domain.InformationCrawler; 10 | 11 | @Data 12 | public class AddOrUpdateInformationCrawlerParam { 13 | 14 | private String id; 15 | 16 | /** 17 | * 来源 18 | */ 19 | private String source; 20 | 21 | /** 22 | * 脚本 23 | */ 24 | private String script; 25 | 26 | public InformationCrawler convertToPo() { 27 | InformationCrawler po = new InformationCrawler(); 28 | BeanUtils.copyProperties(this, po); 29 | po.setId(IdUtils.getId()); 30 | po.setCreateTime(new Date()); 31 | return po; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/WebApplication.java: -------------------------------------------------------------------------------- 1 | package me.zohar; 2 | 3 | import org.springframework.boot.ApplicationArguments; 4 | import org.springframework.boot.ApplicationRunner; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | 8 | import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; 9 | import com.alicp.jetcache.anno.config.EnableMethodCache; 10 | 11 | @SpringBootApplication 12 | @EnableMethodCache(basePackages = "me.zohar.lottery") 13 | @EnableCreateCacheAnnotation 14 | public class WebApplication implements ApplicationRunner { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(WebApplication.class, args); 18 | } 19 | 20 | @Override 21 | public void run(ApplicationArguments args) throws Exception { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/AdminApplication.java: -------------------------------------------------------------------------------- 1 | package me.zohar; 2 | 3 | import org.springframework.boot.ApplicationArguments; 4 | import org.springframework.boot.ApplicationRunner; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | 8 | import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; 9 | import com.alicp.jetcache.anno.config.EnableMethodCache; 10 | 11 | @SpringBootApplication 12 | @EnableMethodCache(basePackages = "me.zohar.lottery") 13 | @EnableCreateCacheAnnotation 14 | public class AdminApplication implements ApplicationRunner { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(AdminApplication.class, args); 18 | } 19 | 20 | @Override 21 | public void run(ApplicationArguments args) throws Exception { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/BindBankInfoParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import lombok.Data; 6 | 7 | /** 8 | * 绑定银行卡信息入参 9 | * 10 | * @author zohar 11 | * @date 2019年1月20日 12 | * 13 | */ 14 | @Data 15 | public class BindBankInfoParam { 16 | 17 | /** 18 | * 开户银行 19 | */ 20 | @NotBlank(message = "openAccountBank不能为空") 21 | private String openAccountBank; 22 | 23 | /** 24 | * 开户人姓名 25 | */ 26 | @NotBlank(message = "accountHolder不能为空") 27 | private String accountHolder; 28 | 29 | /** 30 | * 银行卡账号 31 | */ 32 | @NotBlank(message = "bankCardAccount不能为空") 33 | private String bankCardAccount; 34 | 35 | /** 36 | * 用户账号id 37 | */ 38 | @NotBlank(message = "userAccountId不能为空") 39 | private String userAccountId; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/MobileApplication.java: -------------------------------------------------------------------------------- 1 | package me.zohar; 2 | 3 | import org.springframework.boot.ApplicationArguments; 4 | import org.springframework.boot.ApplicationRunner; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | 8 | import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; 9 | import com.alicp.jetcache.anno.config.EnableMethodCache; 10 | 11 | @SpringBootApplication 12 | @EnableMethodCache(basePackages = "me.zohar.lottery") 13 | @EnableCreateCacheAnnotation 14 | public class MobileApplication implements ApplicationRunner { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(MobileApplication.class, args); 18 | } 19 | 20 | @Override 21 | public void run(ApplicationArguments args) throws Exception { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/WithdrawRecordQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | @Data 12 | @EqualsAndHashCode(callSuper = false) 13 | public class WithdrawRecordQueryCondParam extends PageParam { 14 | 15 | /** 16 | * 订单号 17 | */ 18 | private String orderNo; 19 | 20 | /** 21 | * 状态 22 | */ 23 | private String state; 24 | 25 | /** 26 | * 提交开始时间 27 | */ 28 | @DateTimeFormat(pattern = "yyyy-MM-dd") 29 | private Date submitStartTime; 30 | 31 | /** 32 | * 提交结束时间 33 | */ 34 | @DateTimeFormat(pattern = "yyyy-MM-dd") 35 | private Date submitEndTime; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/lottery/betting/task/BettingRebateAutoSettlementTask.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.task; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.scheduling.annotation.Scheduled; 5 | import org.springframework.stereotype.Component; 6 | 7 | import lombok.extern.slf4j.Slf4j; 8 | import me.zohar.lottery.betting.service.BettingService; 9 | 10 | @Component 11 | @Slf4j 12 | public class BettingRebateAutoSettlementTask { 13 | 14 | @Autowired 15 | private BettingService bettingService; 16 | 17 | @Scheduled(fixedRate = 90000) 18 | public void execute() { 19 | try { 20 | log.info("投注返点自动结算定时任务start"); 21 | bettingService.bettingRebateAutoSettlement(); 22 | log.info("投注返点自动结算定时任务end"); 23 | } catch (Exception e) { 24 | log.error("投注返点自动结算定时任务", e); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/repo/RechargeOrderRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.repo; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 8 | 9 | import me.zohar.lottery.rechargewithdraw.domain.RechargeOrder; 10 | 11 | public interface RechargeOrderRepo 12 | extends JpaRepository, JpaSpecificationExecutor { 13 | 14 | List findByOrderStateAndUsefulTimeLessThan(String orderState, Date usefulTime); 15 | 16 | RechargeOrder findByOrderNo(String orderNo); 17 | 18 | /** 19 | * 获取所有已支付,未进行结算的充值订单 20 | * 21 | * @return 22 | */ 23 | List findByPayTimeIsNotNullAndSettlementTimeIsNullOrderBySubmitTime(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/param/SyncInformationParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.common.utils.IdUtils; 11 | import me.zohar.lottery.information.domain.LotteryInformation; 12 | 13 | @Data 14 | public class SyncInformationParam { 15 | 16 | private String title; 17 | 18 | private String content; 19 | 20 | private String source; 21 | 22 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") 23 | private Date publishTime; 24 | 25 | public LotteryInformation convertToPo() { 26 | LotteryInformation po = new LotteryInformation(); 27 | BeanUtils.copyProperties(this, po); 28 | po.setId(IdUtils.getId()); 29 | return po; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/lottery/information/task/SyncLotteryInformationTask.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.task; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.scheduling.annotation.Scheduled; 5 | import org.springframework.stereotype.Component; 6 | 7 | import lombok.extern.slf4j.Slf4j; 8 | import me.zohar.lottery.information.service.LotteryInformationService; 9 | 10 | @Component 11 | @Slf4j 12 | public class SyncLotteryInformationTask { 13 | 14 | @Autowired 15 | private LotteryInformationService lotteryInformationService; 16 | 17 | @Scheduled(cron = "0 0 10,20 * * ?") 18 | public void execute() { 19 | try { 20 | log.info("执行同步彩票资讯任务start"); 21 | lotteryInformationService.autoSyncInformation(); 22 | log.info("执行同步彩票资讯任务end"); 23 | } catch (Exception e) { 24 | log.error("执行同步彩票资讯任务发生异常", e); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /lottery-admin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/lottery?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai 6 | username: root 7 | password: zohar001 8 | driverClassName: com.mysql.cj.jdbc.Driver 9 | jpa: 10 | show-sql: true 11 | generate-ddl: true 12 | hibernate: 13 | ddl-auto: none 14 | properties: 15 | javax: 16 | persistence: 17 | validation: 18 | mode: none 19 | thymeleaf: 20 | cache: false 21 | redis: 22 | port: 6379 23 | host: localhost 24 | jetcache: 25 | areaInCacheName: false 26 | local: 27 | default: 28 | type: linkedhashmap 29 | keyConvertor: fastjson 30 | remote: 31 | default: 32 | type: redis.lettuce 33 | keyConvertor: fastjson 34 | uri: redis://127.0.0.1:6379/ -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/param/LotterySituationQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | @Data 12 | @EqualsAndHashCode(callSuper = false) 13 | public class LotterySituationQueryCondParam extends PageParam { 14 | 15 | /** 16 | * 游戏代码 17 | */ 18 | private String gameCode; 19 | 20 | /** 21 | * 期号 22 | */ 23 | private Long issueNum; 24 | 25 | /** 26 | * 状态 27 | */ 28 | private String state; 29 | 30 | /** 31 | * 开奖开始日期 32 | */ 33 | @DateTimeFormat(pattern = "yyyy-MM-dd") 34 | private Date lotteryStartDate; 35 | 36 | /** 37 | * 开奖结束日期 38 | */ 39 | @DateTimeFormat(pattern = "yyyy-MM-dd") 40 | private Date lotteryEndDate; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/param/AddOrUpdateDictTypeParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import lombok.Data; 8 | import me.zohar.lottery.common.utils.IdUtils; 9 | import me.zohar.lottery.dictconfig.domain.DictType; 10 | 11 | @Data 12 | public class AddOrUpdateDictTypeParam { 13 | 14 | /** 15 | * 主键id 16 | */ 17 | private String id; 18 | 19 | /** 20 | * 字典类型code 21 | */ 22 | @NotBlank 23 | private String dictTypeCode; 24 | 25 | /** 26 | * 字典类型名称 27 | */ 28 | @NotBlank 29 | private String dictTypeName; 30 | 31 | /** 32 | * 备注 33 | */ 34 | private String note; 35 | 36 | public DictType convertToPo() { 37 | DictType po = new DictType(); 38 | BeanUtils.copyProperties(this, po); 39 | po.setId(IdUtils.getId()); 40 | return po; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/param/ConfigParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import lombok.Data; 8 | import me.zohar.lottery.common.utils.IdUtils; 9 | import me.zohar.lottery.dictconfig.domain.ConfigItem; 10 | 11 | @Data 12 | public class ConfigParam { 13 | 14 | /** 15 | * 主键id 16 | */ 17 | private String id; 18 | 19 | /** 20 | * 配置项code 21 | */ 22 | @NotBlank 23 | private String configCode; 24 | 25 | /** 26 | * 配置项名称 27 | */ 28 | @NotBlank 29 | private String configName; 30 | 31 | /** 32 | * 配置项值 33 | */ 34 | @NotBlank 35 | private String configValue; 36 | 37 | public ConfigItem convertToPo() { 38 | ConfigItem po = new ConfigItem(); 39 | BeanUtils.copyProperties(this, po); 40 | po.setId(IdUtils.getId()); 41 | return po; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/lottery/config/mq/XxlMqConf.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.mq; 2 | 3 | import com.xxl.mq.client.factory.impl.XxlMqSpringClientFactory; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class XxlMqConf { 10 | 11 | @Value("${xxl.mq.admin.address}") 12 | private String adminAddress; 13 | @Value("${xxl.mq.accessToken}") 14 | private String accessToken; 15 | 16 | 17 | @Bean 18 | public XxlMqSpringClientFactory getXxlMqConsumer(){ 19 | XxlMqSpringClientFactory xxlMqSpringClientFactory = new XxlMqSpringClientFactory(); 20 | xxlMqSpringClientFactory.setAdminAddress(adminAddress); 21 | xxlMqSpringClientFactory.setAccessToken(accessToken); 22 | return xxlMqSpringClientFactory; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/param/TrackingNumberSituationQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | @Data 12 | @EqualsAndHashCode(callSuper = false) 13 | public class TrackingNumberSituationQueryCondParam extends PageParam { 14 | 15 | /** 16 | * 订单号 17 | */ 18 | private String orderNo; 19 | 20 | /** 21 | * 游戏代码 22 | */ 23 | private String gameCode; 24 | 25 | /** 26 | * 开始时间 27 | */ 28 | @DateTimeFormat(pattern = "yyyy-MM-dd") 29 | private Date startTime; 30 | 31 | /** 32 | * 结束时间 33 | */ 34 | @DateTimeFormat(pattern = "yyyy-MM-dd") 35 | private Date endTime; 36 | 37 | private String state; 38 | 39 | private String userAccountId; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/domain/InformationCrawler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | import org.hibernate.annotations.DynamicInsert; 11 | import org.hibernate.annotations.DynamicUpdate; 12 | 13 | import lombok.Getter; 14 | import lombok.Setter; 15 | 16 | @Getter 17 | @Setter 18 | @Entity 19 | @Table(name = "information_crawler") 20 | @DynamicInsert(true) 21 | @DynamicUpdate(true) 22 | public class InformationCrawler { 23 | 24 | /** 25 | * 主键id 26 | */ 27 | @Id 28 | @Column(name = "id", length = 32) 29 | private String id; 30 | 31 | /** 32 | * 来源 33 | */ 34 | private String source; 35 | 36 | /** 37 | * 脚本 38 | */ 39 | private String script; 40 | 41 | private Date createTime; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/param/AddOrUpdateInformationParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.common.utils.IdUtils; 11 | import me.zohar.lottery.information.domain.LotteryInformation; 12 | 13 | @Data 14 | public class AddOrUpdateInformationParam { 15 | 16 | private String id; 17 | 18 | private String title; 19 | 20 | private String content; 21 | 22 | private String source; 23 | 24 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") 25 | private Date publishTime; 26 | 27 | public LotteryInformation convertToPo() { 28 | LotteryInformation po = new LotteryInformation(); 29 | BeanUtils.copyProperties(this, po); 30 | po.setId(IdUtils.getId()); 31 | return po; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/AccountChangeLogQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | @Data 12 | @EqualsAndHashCode(callSuper = false) 13 | public class AccountChangeLogQueryCondParam extends PageParam { 14 | 15 | /** 16 | * 游戏代码 17 | */ 18 | private String gameCode; 19 | 20 | /** 21 | * 开始时间 22 | */ 23 | @DateTimeFormat(pattern = "yyyy-MM-dd") 24 | private Date startTime; 25 | 26 | /** 27 | * 结束时间 28 | */ 29 | @DateTimeFormat(pattern = "yyyy-MM-dd") 30 | private Date endTime; 31 | 32 | /** 33 | * 账变类型代码 34 | */ 35 | private String accountChangeTypeCode; 36 | 37 | /** 38 | * 用户账号id 39 | */ 40 | private String userAccountId; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/RechargeOrderQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | @Data 12 | @EqualsAndHashCode(callSuper = false) 13 | public class RechargeOrderQueryCondParam extends PageParam { 14 | 15 | /** 16 | * 订单号 17 | */ 18 | private String orderNo; 19 | 20 | /** 21 | * 订单状态 22 | */ 23 | private String orderState; 24 | 25 | /** 26 | * 充值方式代码 27 | */ 28 | private String rechargeWayCode; 29 | 30 | /** 31 | * 提交开始时间 32 | */ 33 | @DateTimeFormat(pattern = "yyyy-MM-dd") 34 | private Date submitStartTime; 35 | 36 | /** 37 | * 提交结束时间 38 | */ 39 | @DateTimeFormat(pattern = "yyyy-MM-dd") 40 | private Date submitEndTime; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/common/vo/PageResult.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.common.vo; 2 | 3 | import java.util.List; 4 | 5 | import lombok.Data; 6 | 7 | @Data 8 | public class PageResult { 9 | 10 | /** 11 | * 页码 12 | */ 13 | private int pageNum; 14 | 15 | /** 16 | * 每页大小 17 | */ 18 | private int pageSize; 19 | 20 | /** 21 | * 总页数 22 | */ 23 | private long totalPage; 24 | 25 | /** 26 | * 总记录数 27 | */ 28 | private long total; 29 | 30 | /** 31 | * 实际记录数 32 | */ 33 | private int size; 34 | 35 | /** 36 | * 数据集 37 | */ 38 | private List content; 39 | 40 | public PageResult(List content, int pageNum, int pageSize, long total) { 41 | this.content = content; 42 | this.pageNum = pageNum; 43 | this.pageSize = pageSize; 44 | this.totalPage = total == 0 ? 0 : total % pageSize == 0 ? (total / pageSize) : (total / pageSize + 1); 45 | this.total = total; 46 | this.size = content.size(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/RechargeWithdrawLogQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | /** 12 | * 账变日志查询条件 13 | * 14 | * @author zohar 15 | * @date 2019年1月22日 16 | * 17 | */ 18 | @Data 19 | @EqualsAndHashCode(callSuper = false) 20 | public class RechargeWithdrawLogQueryCondParam extends PageParam { 21 | 22 | /** 23 | * 订单类型 24 | */ 25 | private String orderType; 26 | 27 | /** 28 | * 开始时间 29 | */ 30 | @DateTimeFormat(pattern = "yyyy-MM-dd") 31 | private Date startTime; 32 | 33 | /** 34 | * 结束时间 35 | */ 36 | @DateTimeFormat(pattern = "yyyy-MM-dd") 37 | private Date endTime; 38 | 39 | /** 40 | * 用户账号id 41 | */ 42 | private String userAccountId; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/systemnotice/domain/SystemNotice.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.systemnotice.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Lob; 9 | import javax.persistence.Table; 10 | 11 | import org.hibernate.annotations.DynamicInsert; 12 | import org.hibernate.annotations.DynamicUpdate; 13 | 14 | import lombok.Getter; 15 | import lombok.Setter; 16 | 17 | @Getter 18 | @Setter 19 | @Entity 20 | @Table(name = "system_notice") 21 | @DynamicInsert(true) 22 | @DynamicUpdate(true) 23 | public class SystemNotice { 24 | 25 | /** 26 | * 主键id 27 | */ 28 | @Id 29 | @Column(name = "id", length = 32) 30 | private String id; 31 | 32 | private String noticeTitle; 33 | 34 | @Lob 35 | private String noticeContent; 36 | 37 | private Date createTime; 38 | 39 | /** 40 | * 发布日期 41 | */ 42 | private Date publishDate; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/resources/templates/common/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 19 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/lottery/rechargewithdraw/task/RechargeOrderTimeoutDealTask.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.task; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.scheduling.annotation.Scheduled; 5 | import org.springframework.stereotype.Component; 6 | 7 | import lombok.extern.slf4j.Slf4j; 8 | import me.zohar.lottery.rechargewithdraw.service.RechargeService; 9 | 10 | /** 11 | * 充值订单超时处理定时任务 12 | * 13 | * @author zohar 14 | * @date 2019年1月21日 15 | * 16 | */ 17 | @Component 18 | @Slf4j 19 | public class RechargeOrderTimeoutDealTask { 20 | 21 | @Autowired 22 | private RechargeService rechargeService; 23 | 24 | @Scheduled(fixedRate = 60000) 25 | public void execute() { 26 | try { 27 | log.info("充值订单超时处理定时任务start"); 28 | rechargeService.orderTimeoutDeal(); 29 | log.info("充值订单超时处理定时任务end"); 30 | } catch (Exception e) { 31 | log.error("充值订单超时处理定时任务", e); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/systemnotice/controller/SystemNoticeController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.systemnotice.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import me.zohar.lottery.common.vo.Result; 10 | import me.zohar.lottery.systemnotice.service.SystemNoticeService; 11 | 12 | @Controller 13 | @RequestMapping("/systemNotice") 14 | public class SystemNoticeController { 15 | 16 | @Autowired 17 | private SystemNoticeService systemNoticeService; 18 | 19 | @GetMapping("/findTop5PublishedSystemNotice") 20 | @ResponseBody 21 | public Result findTop5PublishedSystemNotice() { 22 | return Result.success().setData(systemNoticeService.findTop5PublishedSystemNotice()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/repo/BettingRecordRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.repo; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 8 | 9 | import me.zohar.lottery.betting.domain.BettingRecord; 10 | 11 | public interface BettingRecordRepo 12 | extends JpaRepository, JpaSpecificationExecutor { 13 | 14 | /** 15 | * 获取当前用户在指定游戏,大于指定时间的最新5次投注记录 16 | * 17 | * @param userAccountId 18 | * @param gameCategory 19 | * @param bettingTime 20 | * @return 21 | */ 22 | List findTop5ByBettingOrder_UserAccountIdAndBettingOrder_GameCodeAndBettingOrder_BettingTimeGreaterThanEqualOrderByBettingOrder_BettingTimeDesc( 23 | String userAccountId, String gameCode, Date bettingTime); 24 | 25 | List findByBettingOrderId(String bettingOrderId); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/lottery/rechargewithdraw/task/RechargeOrderAutoSettlementTask.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.task; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.scheduling.annotation.Scheduled; 5 | import org.springframework.stereotype.Component; 6 | 7 | import lombok.extern.slf4j.Slf4j; 8 | import me.zohar.lottery.rechargewithdraw.service.RechargeService; 9 | 10 | /** 11 | * 充值订单自动结算定时任务 12 | * 13 | * @author zohar 14 | * @date 2019年1月21日 15 | * 16 | */ 17 | @Component 18 | @Slf4j 19 | public class RechargeOrderAutoSettlementTask { 20 | 21 | @Autowired 22 | private RechargeService rechargeService; 23 | 24 | @Scheduled(fixedRate = 60000) 25 | public void execute() { 26 | try { 27 | log.info("充值订单自动结算定时任务start"); 28 | rechargeService.rechargeOrderAutoSettlement(); 29 | log.info("充值订单自动结算定时任务end"); 30 | } catch (Exception e) { 31 | log.error("充值订单自动结算定时任务", e); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/ConfigHolder.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig; 2 | 3 | import javax.annotation.PostConstruct; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Component; 7 | 8 | import me.zohar.lottery.dictconfig.service.ConfigService; 9 | import me.zohar.lottery.dictconfig.vo.ConfigItemVO; 10 | 11 | @Component 12 | public class ConfigHolder { 13 | 14 | @Autowired 15 | private ConfigService configService; 16 | 17 | private static ConfigHolder configHolder; 18 | 19 | @PostConstruct 20 | public void init() { 21 | configHolder = this; 22 | configHolder.configService = this.configService; 23 | } 24 | 25 | public static String getConfigValue(String configItemCode) { 26 | ConfigItemVO configItemVO = configHolder.configService.findConfigItemByConfigCode(configItemCode); 27 | if (configItemVO == null) { 28 | return null; 29 | } 30 | return configItemVO.getConfigValue(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/systemnotice/param/AddOrUpdateSystemNoticeParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.systemnotice.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import cn.hutool.core.date.DatePattern; 8 | import cn.hutool.core.date.DateUtil; 9 | import lombok.Data; 10 | import me.zohar.lottery.common.utils.IdUtils; 11 | import me.zohar.lottery.systemnotice.domain.SystemNotice; 12 | 13 | @Data 14 | public class AddOrUpdateSystemNoticeParam { 15 | 16 | private String id; 17 | 18 | private String noticeTitle; 19 | 20 | private String noticeContent; 21 | 22 | /** 23 | * 发布日期 24 | */ 25 | private String publishDate; 26 | 27 | public SystemNotice convertToPo() { 28 | SystemNotice po = new SystemNotice(); 29 | BeanUtils.copyProperties(this, po); 30 | po.setId(IdUtils.getId()); 31 | po.setCreateTime(new Date()); 32 | po.setPublishDate(DateUtil.parse(this.getPublishDate(), DatePattern.NORM_DATE_PATTERN)); 33 | return po; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/statisticalanalysis/param/AccountProfitAndLossQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.statisticalanalysis.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import me.zohar.lottery.common.param.PageParam; 12 | 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | public class AccountProfitAndLossQueryCondParam extends PageParam { 16 | 17 | /** 18 | * 当前账号id 19 | */ 20 | @NotBlank 21 | private String currentAccountId; 22 | 23 | /** 24 | * 用户名 25 | */ 26 | private String userName; 27 | 28 | /** 29 | * 账号类型 30 | */ 31 | private String accountType; 32 | 33 | /** 34 | * 开始时间 35 | */ 36 | @DateTimeFormat(pattern = "yyyy-MM-dd") 37 | private Date startTime; 38 | 39 | /** 40 | * 结束时间 41 | */ 42 | @DateTimeFormat(pattern = "yyyy-MM-dd") 43 | private Date endTime; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/TaskApplication.java: -------------------------------------------------------------------------------- 1 | package me.zohar; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.ApplicationArguments; 7 | import org.springframework.boot.ApplicationRunner; 8 | import org.springframework.boot.SpringApplication; 9 | import org.springframework.boot.autoconfigure.SpringBootApplication; 10 | 11 | import cn.hutool.core.date.DateField; 12 | import cn.hutool.core.date.DateUtil; 13 | import me.zohar.lottery.issue.service.IssueService; 14 | 15 | @SpringBootApplication 16 | public class TaskApplication implements ApplicationRunner { 17 | 18 | @Autowired 19 | private IssueService issueService; 20 | 21 | public static void main(String[] args) { 22 | SpringApplication.run(TaskApplication.class, args); 23 | } 24 | 25 | @Override 26 | public void run(ApplicationArguments args) throws Exception { 27 | issueService.generateIssue(DateUtil.offset(new Date(), DateField.DAY_OF_YEAR, 0)); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /lottery-task/src/main/java/me/zohar/lottery/issue/task/GenerateIssueTask.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.task; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.scheduling.annotation.Scheduled; 7 | import org.springframework.stereotype.Component; 8 | 9 | import cn.hutool.core.date.DateField; 10 | import cn.hutool.core.date.DateUtil; 11 | import lombok.extern.slf4j.Slf4j; 12 | import me.zohar.lottery.issue.service.IssueService; 13 | 14 | @Component 15 | @Slf4j 16 | public class GenerateIssueTask { 17 | 18 | @Autowired 19 | private IssueService issueService; 20 | 21 | /** 22 | * 每天零点10分执行一次 23 | */ 24 | @Scheduled(cron = "0 10 0 * * ?") 25 | public void execute() { 26 | try { 27 | log.info("执行生成期号数据定时任务start"); 28 | issueService.generateIssue(DateUtil.offset(new Date(), DateField.DAY_OF_YEAR, 0)); 29 | log.info("执行生成期号数据定时任务end"); 30 | } catch (Exception e) { 31 | log.error("执行生成期号数据定时任务发生异常", e); 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/LowerLevelRechargeOrderQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import me.zohar.lottery.common.param.PageParam; 12 | 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | public class LowerLevelRechargeOrderQueryCondParam extends PageParam { 16 | 17 | /** 18 | * 当前账号id 19 | */ 20 | @NotBlank 21 | private String currentAccountId; 22 | 23 | /** 24 | * 用户名 25 | */ 26 | private String userName; 27 | 28 | /** 29 | * 账号类型 30 | */ 31 | private String accountType; 32 | 33 | /** 34 | * 提交开始时间 35 | */ 36 | @DateTimeFormat(pattern = "yyyy-MM-dd") 37 | private Date submitStartTime; 38 | 39 | /** 40 | * 提交结束时间 41 | */ 42 | @DateTimeFormat(pattern = "yyyy-MM-dd") 43 | private Date submitEndTime; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/param/AddOrUpdateRebateAndOddsParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.DecimalMin; 6 | import javax.validation.constraints.NotNull; 7 | 8 | import org.springframework.beans.BeanUtils; 9 | 10 | import lombok.Data; 11 | import me.zohar.lottery.agent.domain.RebateAndOdds; 12 | import me.zohar.lottery.common.utils.IdUtils; 13 | 14 | @Data 15 | public class AddOrUpdateRebateAndOddsParam { 16 | 17 | private String id; 18 | 19 | /** 20 | * 返点 21 | */ 22 | @NotNull 23 | @DecimalMin(value = "0", inclusive = true) 24 | private Double rebate; 25 | 26 | /** 27 | * 赔率 28 | */ 29 | @NotNull 30 | @DecimalMin(value = "0", inclusive = true) 31 | private Double odds; 32 | 33 | public RebateAndOdds convertToPo(Date createTime) { 34 | RebateAndOdds po = new RebateAndOdds(); 35 | BeanUtils.copyProperties(this, po); 36 | po.setId(IdUtils.getId()); 37 | po.setCreateTime(createTime); 38 | return po; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/mastercontrol/controller/MasterControlController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import me.zohar.lottery.common.vo.Result; 10 | import me.zohar.lottery.mastercontrol.service.MasterControlService; 11 | 12 | /** 13 | * 总控 14 | * 15 | * @author zohar 16 | * @date 2019年3月9日 17 | * 18 | */ 19 | @Controller 20 | @RequestMapping("/masterControl") 21 | public class MasterControlController { 22 | 23 | @Autowired 24 | private MasterControlService service; 25 | 26 | @GetMapping("/getInviteRegisterSetting") 27 | @ResponseBody 28 | public Result getInviteRegisterSetting() { 29 | return Result.success().setData(service.getInviteRegisterSetting()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/mastercontrol/controller/MasterControlController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import me.zohar.lottery.common.vo.Result; 10 | import me.zohar.lottery.mastercontrol.service.MasterControlService; 11 | 12 | /** 13 | * 总控 14 | * 15 | * @author zohar 16 | * @date 2019年3月9日 17 | * 18 | */ 19 | @Controller 20 | @RequestMapping("/masterControl") 21 | public class MasterControlController { 22 | 23 | @Autowired 24 | private MasterControlService service; 25 | 26 | @GetMapping("/getInviteRegisterSetting") 27 | @ResponseBody 28 | public Result getInviteRegisterSetting() { 29 | return Result.success().setData(service.getInviteRegisterSetting()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/UserAccountEditParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import javax.validation.constraints.DecimalMin; 4 | import javax.validation.constraints.NotBlank; 5 | import javax.validation.constraints.NotNull; 6 | 7 | import lombok.Data; 8 | 9 | @Data 10 | public class UserAccountEditParam { 11 | 12 | /** 13 | * 主键id 14 | */ 15 | @NotBlank 16 | private String userAccountId; 17 | 18 | /** 19 | * 用户名 20 | */ 21 | @NotBlank 22 | private String userName; 23 | 24 | /** 25 | * 真实姓名 26 | */ 27 | @NotBlank 28 | private String realName; 29 | 30 | /** 31 | * 账号类型 32 | */ 33 | @NotBlank 34 | private String accountType; 35 | 36 | /** 37 | * 返点 38 | */ 39 | @NotNull 40 | @DecimalMin(value = "0", inclusive = true) 41 | private Double rebate; 42 | 43 | /** 44 | * 赔率 45 | */ 46 | @NotNull 47 | @DecimalMin(value = "0", inclusive = false) 48 | private Double odds; 49 | 50 | /** 51 | * 状态 52 | */ 53 | @NotBlank 54 | private String state; 55 | 56 | } 57 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/param/BettingOrderQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.param; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import me.zohar.lottery.common.param.PageParam; 10 | 11 | /** 12 | * 投注订单查询条件入参 13 | * @author zohar 14 | * @date 2019年1月19日 15 | * 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper=false) 19 | public class BettingOrderQueryCondParam extends PageParam { 20 | 21 | /** 22 | * 订单号 23 | */ 24 | private String orderNo; 25 | 26 | /** 27 | * 游戏代码 28 | */ 29 | private String gameCode; 30 | 31 | /** 32 | * 开始时间 33 | */ 34 | @DateTimeFormat(pattern="yyyy-MM-dd") 35 | private Date startTime; 36 | 37 | /** 38 | * 结束时间 39 | */ 40 | @DateTimeFormat(pattern="yyyy-MM-dd") 41 | private Date endTime; 42 | 43 | /** 44 | * 状态 45 | */ 46 | private String state; 47 | 48 | /** 49 | * 投注人用户账号id 50 | */ 51 | private String userAccountId; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 声明 2 | 3 | 源码只供学习使用,如用于商业活动与本人无关,请勿将系统用于非法业务 4 | 5 | ## 在线体验 6 | > 账号/密码:zohar001/123 7 | > 门户网站:http://zohar8888.xyz:8080/ 8 | > 后台管理:http://zohar8888.xyz:8081/ 9 | 10 | ## 交流群 11 | 加入qq交流群:567046072 12 | 13 | ## 截图 14 | 15 | | 首页 | 投注 | 投注订单详情 | 追号 | 16 | | :------: | :------: | :------: | :------: | 17 | | ![首页](/实施输出/截图/首页.png) | ![投注](/实施输出/截图/投注.png) | ![投注订单详情](/实施输出/截图/投注订单详情.png) | ![追号](/实施输出/截图/追号.png) | 18 | 19 | | 购彩大厅 | 投注记录 | 充值 | 提现 | 20 | | :------: | :------: | :------: | :------: | 21 | | ![购彩大厅](/实施输出/截图/购彩大厅.png) | ![投注记录](/实施输出/截图/投注记录.png) | ![充值](/实施输出/截图/充值.png) | ![提现](/实施输出/截图/提现.png) | 22 | 23 | | 追号记录 | 下级账号管理 | 下级开户 | 团队充值明细 | 24 | | :------: | :------: | :------: | :------: | 25 | | ![追号记录](/实施输出/截图/追号记录.png) | ![下级账号管理](/实施输出/截图/下级账号管理.png) | ![下级开户](/实施输出/截图/下级开户.png) | ![团队充值明细](/实施输出/截图/团队充值明细.png) | 26 | 27 | 28 | > 由于程序不断优化,界面细节可能有所变化,请以实际页面为准 29 | 30 | > 作者不喝咖啡 :coffee: 只喝茶 :tea: 觉得有帮助的可以请我喝茶 31 | 32 | 33 | | 支付宝 | 微信支付 | 34 | | :------: | :------: | 35 | | ![alipay](/实施输出/截图/alipay.jpg) | ![wepay](/实施输出/截图/wechat.png) | 36 | 37 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/repo/BettingOrderRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.repo; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 8 | 9 | import me.zohar.lottery.betting.domain.BettingOrder; 10 | 11 | public interface BettingOrderRepo extends JpaRepository, JpaSpecificationExecutor { 12 | 13 | /** 14 | * 根据游戏代码,期号,状态获取投注订单 15 | * 16 | * @param gameCode 17 | * @param issue 18 | * @param state 19 | * @return 20 | */ 21 | List findByGameCodeAndIssueNumAndState(String gameCode, Long issueNum, String state); 22 | 23 | List findTop50ByBettingTimeGreaterThanAndStateOrderByTotalWinningAmountDesc(Date bettingTime, 24 | String state); 25 | 26 | List findTop50ByStateOrderByTotalWinningAmountDesc(String state); 27 | 28 | List findByGameCodeAndIssueNum(String gameCode, Long issueNum); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/param/GameCategoryParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.param; 2 | 3 | import javax.validation.constraints.DecimalMin; 4 | import javax.validation.constraints.NotBlank; 5 | import javax.validation.constraints.NotNull; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.common.utils.IdUtils; 11 | import me.zohar.lottery.game.domain.GameCategory; 12 | 13 | @Data 14 | public class GameCategoryParam { 15 | 16 | /** 17 | * 主键id 18 | */ 19 | private String id; 20 | 21 | /** 22 | * 游戏类别code 23 | */ 24 | @NotBlank 25 | private String gameCategoryCode; 26 | 27 | /** 28 | * 游戏类别 29 | */ 30 | @NotBlank 31 | private String gameCategoryName; 32 | 33 | /** 34 | * 排序号 35 | */ 36 | @NotNull 37 | @DecimalMin(value = "0", inclusive = true) 38 | private Double orderNo; 39 | 40 | public GameCategory convertToPo() { 41 | GameCategory po = new GameCategory(); 42 | BeanUtils.copyProperties(this, po); 43 | po.setId(IdUtils.getId()); 44 | return po; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/vo/RegisterAmountSettingVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.vo; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.mastercontrol.domain.RegisterAmountSetting; 11 | 12 | @Data 13 | public class RegisterAmountSettingVO { 14 | 15 | private String id; 16 | 17 | /** 18 | * 启用标识 19 | */ 20 | private Boolean enabled; 21 | 22 | /** 23 | * 注册礼金 24 | */ 25 | private Double registerAmount; 26 | 27 | /** 28 | * 最近修改时间 29 | */ 30 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 31 | private Date latelyUpdateTime; 32 | 33 | public static RegisterAmountSettingVO convertFor(RegisterAmountSetting registerAmountSetting) { 34 | if (registerAmountSetting == null) { 35 | return null; 36 | } 37 | RegisterAmountSettingVO vo = new RegisterAmountSettingVO(); 38 | BeanUtils.copyProperties(registerAmountSetting, vo); 39 | return vo; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/vo/InviteRegisterSettingVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.vo; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.mastercontrol.domain.InviteRegisterSetting; 11 | 12 | @Data 13 | public class InviteRegisterSettingVO { 14 | 15 | private String id; 16 | 17 | /** 18 | * 邀请码有效时长 19 | */ 20 | private Integer effectiveDuration; 21 | 22 | /** 23 | * 启用标识 24 | */ 25 | private Boolean enabled; 26 | 27 | /** 28 | * 最近修改时间 29 | */ 30 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 31 | private Date latelyUpdateTime; 32 | 33 | public static InviteRegisterSettingVO convertFor(InviteRegisterSetting inviteRegisterSetting) { 34 | if (inviteRegisterSetting == null) { 35 | return null; 36 | } 37 | InviteRegisterSettingVO vo = new InviteRegisterSettingVO(); 38 | BeanUtils.copyProperties(inviteRegisterSetting, vo); 39 | return vo; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/LowerLevelWithdrawRecordQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import me.zohar.lottery.common.param.PageParam; 12 | 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | public class LowerLevelWithdrawRecordQueryCondParam extends PageParam { 16 | 17 | /** 18 | * 当前账号id 19 | */ 20 | @NotBlank 21 | private String currentAccountId; 22 | 23 | /** 24 | * 用户名 25 | */ 26 | private String userName; 27 | 28 | /** 29 | * 账号类型 30 | */ 31 | private String accountType; 32 | 33 | /** 34 | * 状态 35 | */ 36 | private String state; 37 | 38 | /** 39 | * 提交开始时间 40 | */ 41 | @DateTimeFormat(pattern = "yyyy-MM-dd") 42 | private Date submitStartTime; 43 | 44 | /** 45 | * 提交结束时间 46 | */ 47 | @DateTimeFormat(pattern = "yyyy-MM-dd") 48 | private Date submitEndTime; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/LowerLevelAccountChangeLogQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import me.zohar.lottery.common.param.PageParam; 12 | 13 | @Data 14 | @EqualsAndHashCode(callSuper = false) 15 | public class LowerLevelAccountChangeLogQueryCondParam extends PageParam { 16 | 17 | /** 18 | * 当前账号id 19 | */ 20 | @NotBlank 21 | private String currentAccountId; 22 | 23 | /** 24 | * 用户名 25 | */ 26 | private String userName; 27 | 28 | /** 29 | * 游戏代码 30 | */ 31 | private String gameCode; 32 | 33 | /** 34 | * 开始时间 35 | */ 36 | @DateTimeFormat(pattern = "yyyy-MM-dd") 37 | private Date startTime; 38 | 39 | /** 40 | * 结束时间 41 | */ 42 | @DateTimeFormat(pattern = "yyyy-MM-dd") 43 | private Date endTime; 44 | 45 | /** 46 | * 账变类型代码 47 | */ 48 | private String accountChangeTypeCode; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/vo/BankInfoVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.vo; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.useraccount.domain.UserAccount; 11 | 12 | /** 13 | * 银行资料 14 | * 15 | * @author zohar 16 | * @date 2019年1月20日 17 | * 18 | */ 19 | @Data 20 | public class BankInfoVO { 21 | 22 | /** 23 | * 开户银行 24 | */ 25 | private String openAccountBank; 26 | 27 | /** 28 | * 开户人姓名 29 | */ 30 | private String accountHolder; 31 | 32 | /** 33 | * 银行卡账号 34 | */ 35 | private String bankCardAccount; 36 | 37 | /** 38 | * 银行资料最近修改时间 39 | */ 40 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 41 | private Date bankInfoLatelyModifyTime; 42 | 43 | public static BankInfoVO convertFor(UserAccount userAccount) { 44 | if (userAccount == null) { 45 | return null; 46 | } 47 | BankInfoVO vo = new BankInfoVO(); 48 | BeanUtils.copyProperties(userAccount, vo); 49 | return vo; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/param/IssueSettingParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.param; 2 | 3 | import java.util.List; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | 8 | import org.springframework.beans.BeanUtils; 9 | 10 | import lombok.Data; 11 | import me.zohar.lottery.common.utils.IdUtils; 12 | import me.zohar.lottery.issue.domain.IssueSetting; 13 | 14 | @Data 15 | public class IssueSettingParam { 16 | 17 | /** 18 | * 主键id 19 | */ 20 | private String id; 21 | 22 | /** 23 | * 所属游戏id 24 | */ 25 | @NotBlank 26 | private String gameId; 27 | 28 | /** 29 | * 日期格式 30 | */ 31 | @NotBlank 32 | private String dateFormat; 33 | 34 | /** 35 | * 期号格式 36 | */ 37 | @NotBlank 38 | private String issueFormat; 39 | 40 | /** 41 | * 期号生成规则集合 42 | */ 43 | @NotEmpty 44 | private List issueGenerateRules; 45 | 46 | public IssueSetting convertToPo() { 47 | IssueSetting po = new IssueSetting(); 48 | BeanUtils.copyProperties(this, po); 49 | po.setId(IdUtils.getId()); 50 | return po; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/domain/LoginLog.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | import javax.persistence.Version; 10 | 11 | import org.hibernate.annotations.DynamicInsert; 12 | import org.hibernate.annotations.DynamicUpdate; 13 | 14 | import lombok.Getter; 15 | import lombok.Setter; 16 | 17 | @Getter 18 | @Setter 19 | @Entity 20 | @Table(name = "login_log") 21 | @DynamicInsert(true) 22 | @DynamicUpdate(true) 23 | public class LoginLog { 24 | 25 | /** 26 | * 主键id 27 | */ 28 | @Id 29 | @Column(name = "id", length = 32) 30 | private String id; 31 | 32 | private String state; 33 | 34 | private String ipAddr; 35 | 36 | private String loginLocation; 37 | 38 | private Date loginTime; 39 | 40 | private String browser; 41 | 42 | private String os; 43 | 44 | private String msg; 45 | 46 | private String userName; 47 | 48 | /** 49 | * 乐观锁版本号 50 | */ 51 | @Version 52 | private Long version; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/vo/RechargeSettingVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.vo; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.mastercontrol.domain.RechargeSetting; 11 | 12 | @Data 13 | public class RechargeSettingVO { 14 | 15 | private String id; 16 | 17 | /** 18 | * 订单有效时长 19 | */ 20 | private Integer orderEffectiveDuration; 21 | 22 | /** 23 | * 充值返水率 24 | */ 25 | private Integer returnWaterRate; 26 | 27 | /** 28 | * 充值返水率启用标识 29 | */ 30 | private Boolean returnWaterRateEnabled; 31 | 32 | /** 33 | * 最近修改时间 34 | */ 35 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 36 | private Date latelyUpdateTime; 37 | 38 | public static RechargeSettingVO convertFor(RechargeSetting rechargeSetting) { 39 | if (rechargeSetting == null) { 40 | return null; 41 | } 42 | RechargeSettingVO vo = new RechargeSettingVO(); 43 | BeanUtils.copyProperties(rechargeSetting, vo); 44 | return vo; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/domain/RebateAndOdds.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | import javax.persistence.Version; 10 | 11 | import org.hibernate.annotations.DynamicInsert; 12 | import org.hibernate.annotations.DynamicUpdate; 13 | 14 | import lombok.Getter; 15 | import lombok.Setter; 16 | 17 | /** 18 | * 返点/赔率 19 | * 20 | * @author zohar 21 | * @date 2019年6月2日 22 | * 23 | */ 24 | @Getter 25 | @Setter 26 | @Entity 27 | @Table(name = "rebate_and_odds") 28 | @DynamicInsert(true) 29 | @DynamicUpdate(true) 30 | public class RebateAndOdds { 31 | 32 | /** 33 | * 主键id 34 | */ 35 | @Id 36 | @Column(name = "id", length = 32) 37 | private String id; 38 | 39 | /** 40 | * 返点 41 | */ 42 | private Double rebate; 43 | 44 | /** 45 | * 赔率 46 | */ 47 | private Double odds; 48 | 49 | /** 50 | * 创建时间 51 | */ 52 | private Date createTime; 53 | 54 | /** 55 | * 乐观锁版本号 56 | */ 57 | @Version 58 | private Long version; 59 | 60 | } 61 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/vo/LoginAccountInfoVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.vo; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import lombok.Data; 6 | import me.zohar.lottery.dictconfig.DictHolder; 7 | import me.zohar.lottery.useraccount.domain.UserAccount; 8 | 9 | /** 10 | * 登录账号信息,包含密码 11 | * 12 | * @author zohar 13 | * @date 2019年1月25日 14 | * 15 | */ 16 | @Data 17 | public class LoginAccountInfoVO { 18 | 19 | /** 20 | * 主键id 21 | */ 22 | private String id; 23 | 24 | /** 25 | * 用户名 26 | */ 27 | private String userName; 28 | 29 | /** 30 | * 登录密码 31 | */ 32 | private String loginPwd; 33 | 34 | /** 35 | * 账号类型 36 | */ 37 | private String accountType; 38 | 39 | private String accountTypeName; 40 | 41 | public static LoginAccountInfoVO convertFor(UserAccount userAccount) { 42 | if (userAccount == null) { 43 | return null; 44 | } 45 | LoginAccountInfoVO vo = new LoginAccountInfoVO(); 46 | BeanUtils.copyProperties(userAccount, vo); 47 | vo.setAccountTypeName(DictHolder.getDictItemName("accountType", vo.getAccountType())); 48 | return vo; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/domain/ConfigItem.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.domain; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Id; 6 | import javax.persistence.Table; 7 | import javax.persistence.Version; 8 | 9 | import org.hibernate.annotations.DynamicInsert; 10 | import org.hibernate.annotations.DynamicUpdate; 11 | 12 | import lombok.Getter; 13 | import lombok.Setter; 14 | 15 | /** 16 | * 配置项 17 | * 18 | * @author zohar 19 | * @date 2019年1月21日 20 | * 21 | */ 22 | @Getter 23 | @Setter 24 | @Entity 25 | @Table(name = "config_item", schema = "lottery") 26 | @DynamicInsert(true) 27 | @DynamicUpdate(true) 28 | public class ConfigItem { 29 | 30 | /** 31 | * 主键id 32 | */ 33 | @Id 34 | @Column(name = "id", length = 32) 35 | private String id; 36 | 37 | /** 38 | * 配置项code 39 | */ 40 | private String configCode; 41 | 42 | /** 43 | * 配置项名称 44 | */ 45 | private String configName; 46 | 47 | /** 48 | * 配置项值 49 | */ 50 | private String configValue; 51 | 52 | /** 53 | * 乐观锁版本号 54 | */ 55 | @Version 56 | private Long version; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/domain/RebateAndOddsSituation.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.domain; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.Table; 10 | 11 | import org.hibernate.annotations.DynamicInsert; 12 | import org.hibernate.annotations.DynamicUpdate; 13 | 14 | import lombok.Getter; 15 | import lombok.Setter; 16 | 17 | @Getter 18 | @Setter 19 | @Entity 20 | @Table(name = "v_rebate_and_odds_situation") 21 | @DynamicInsert(true) 22 | @DynamicUpdate(true) 23 | public class RebateAndOddsSituation implements Serializable { 24 | 25 | /** 26 | * 27 | */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | /** 31 | * 主键id 32 | */ 33 | @Id 34 | @Column(name = "id", length = 32) 35 | private String id; 36 | 37 | /** 38 | * 返点 39 | */ 40 | private Double rebate; 41 | 42 | /** 43 | * 赔率 44 | */ 45 | private Double odds; 46 | 47 | /** 48 | * 关联账号数量 49 | */ 50 | private Integer associatedAccountNum; 51 | 52 | private Date createTime; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/param/IssueGenerateRuleParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.param; 2 | 3 | import javax.validation.constraints.DecimalMin; 4 | import javax.validation.constraints.NotBlank; 5 | import javax.validation.constraints.NotNull; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.common.utils.IdUtils; 11 | import me.zohar.lottery.issue.domain.IssueGenerateRule; 12 | 13 | @Data 14 | public class IssueGenerateRuleParam { 15 | 16 | /** 17 | * 开始时间(时分,如10:00) 18 | */ 19 | @NotBlank 20 | private String startTime; 21 | 22 | /** 23 | * 时间间隔(分钟) 24 | */ 25 | @NotNull 26 | @DecimalMin(value = "0", inclusive = false, message = "timeInterval不能少于或等于0") 27 | private Integer timeInterval; 28 | 29 | /** 30 | * 期数 31 | */ 32 | @NotNull 33 | @DecimalMin(value = "1", inclusive = true, message = "issueCount不能小于1") 34 | private Integer issueCount; 35 | 36 | public IssueGenerateRule convertToPo() { 37 | IssueGenerateRule po = new IssueGenerateRule(); 38 | BeanUtils.copyProperties(this, po); 39 | po.setId(IdUtils.getId()); 40 | return po; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /lottery-task/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | me.zohar 8 | lottery 9 | 0.0.1-SNAPSHOT 10 | 11 | lottery-task 12 | lottery-task 13 | jar 14 | 15 | UTF-8 16 | 17 | 18 | 19 | me.zohar 20 | lottery-api 21 | 0.0.1-SNAPSHOT 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-maven-plugin 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/DictHolder.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.PostConstruct; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Component; 9 | 10 | import me.zohar.lottery.dictconfig.service.DictService; 11 | import me.zohar.lottery.dictconfig.vo.DictItemVO; 12 | 13 | @Component 14 | public class DictHolder { 15 | 16 | @Autowired 17 | private DictService dictService; 18 | 19 | private static DictHolder dictHolder; 20 | 21 | @PostConstruct 22 | public void init() { 23 | dictHolder = this; 24 | dictHolder.dictService = this.dictService; 25 | } 26 | 27 | public static String getDictItemName(String dictTypeCode, String dictItemCode) { 28 | DictItemVO dictItemVO = dictHolder.dictService.findDictItemByDictTypeCodeAndDictItemCode(dictTypeCode, 29 | dictItemCode); 30 | if (dictItemVO == null) { 31 | return null; 32 | } 33 | return dictItemVO.getDictItemName(); 34 | } 35 | 36 | public static List findDictItem(String dictTypeCode) { 37 | return dictHolder.dictService.findDictItemByDictTypeCode(dictTypeCode); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | me.zohar 6 | lottery 7 | 0.0.1-SNAPSHOT 8 | pom 9 | 10 | 1.8 11 | 1.8 12 | UTF-8 13 | UTF-8 14 | 2.1.1.RELEASE 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-parent 19 | 2.1.1.RELEASE 20 | 21 | 22 | 23 | 24 | lottery-api 25 | lottery-task 26 | lottery-web 27 | lottery-mobile 28 | lottery-admin 29 | 30 | 31 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/param/NumLocateParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.param; 2 | 3 | import java.util.List; 4 | 5 | import javax.validation.constraints.DecimalMin; 6 | import javax.validation.constraints.NotBlank; 7 | import javax.validation.constraints.NotEmpty; 8 | import javax.validation.constraints.NotNull; 9 | 10 | import org.springframework.beans.BeanUtils; 11 | 12 | import lombok.Data; 13 | import me.zohar.lottery.common.utils.IdUtils; 14 | import me.zohar.lottery.game.domain.NumLocate; 15 | 16 | @Data 17 | public class NumLocateParam { 18 | 19 | /** 20 | * 号位名称 21 | */ 22 | @NotBlank 23 | private String numLocateName; 24 | 25 | /** 26 | * 候选的号码集合,以逗号分隔 27 | */ 28 | @NotBlank 29 | private String nums; 30 | 31 | /** 32 | * 最大可选多少个号码 33 | */ 34 | @DecimalMin(value = "1", inclusive = true) 35 | private Integer maxSelected; 36 | 37 | /** 38 | * 是否有过滤按钮 39 | */ 40 | @NotNull 41 | private Boolean hasFilterBtnFlag; 42 | 43 | @NotEmpty 44 | private List optionalNums; 45 | 46 | public NumLocate convertToPo() { 47 | NumLocate po = new NumLocate(); 48 | BeanUtils.copyProperties(this, po); 49 | po.setId(IdUtils.getId()); 50 | return po; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/vo/IssueSettingDetailsVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.BeanUtils; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.Data; 10 | import lombok.NoArgsConstructor; 11 | import me.zohar.lottery.issue.domain.IssueSetting; 12 | 13 | @Data 14 | @AllArgsConstructor 15 | @NoArgsConstructor 16 | public class IssueSettingDetailsVO { 17 | 18 | /** 19 | * 主键id 20 | */ 21 | private String id; 22 | 23 | /** 24 | * 所属游戏id 25 | */ 26 | private String gameId; 27 | 28 | /** 29 | * 日期格式 30 | */ 31 | private String dateFormat; 32 | 33 | /** 34 | * 期号格式 35 | */ 36 | private String issueFormat; 37 | 38 | private List issueGenerateRules = new ArrayList<>(); 39 | 40 | public static IssueSettingDetailsVO convertFor(IssueSetting issueSetting) { 41 | if (issueSetting == null) { 42 | return null; 43 | } 44 | IssueSettingDetailsVO vo = new IssueSettingDetailsVO(); 45 | BeanUtils.copyProperties(issueSetting, vo); 46 | vo.setIssueGenerateRules(IssueGenerateRuleVO.convertFor(issueSetting.getIssueGenerateRules())); 47 | return vo; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/domain/OptionalNum.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.domain; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Id; 6 | import javax.persistence.Table; 7 | import javax.persistence.Version; 8 | 9 | import org.hibernate.annotations.DynamicInsert; 10 | import org.hibernate.annotations.DynamicUpdate; 11 | 12 | import lombok.Getter; 13 | import lombok.Setter; 14 | 15 | /** 16 | * 可选号码 17 | * 18 | * @author zohar 19 | * @date 2019年2月27日 20 | * 21 | */ 22 | @Getter 23 | @Setter 24 | @Entity 25 | @Table(name = "optional_num", schema = "lottery") 26 | @DynamicInsert(true) 27 | @DynamicUpdate(true) 28 | public class OptionalNum { 29 | 30 | /** 31 | * 主键id 32 | */ 33 | @Id 34 | @Column(name = "id", length = 32) 35 | private String id; 36 | 37 | /** 38 | * 号码 39 | */ 40 | private String num; 41 | 42 | /** 43 | * 赔率 44 | */ 45 | private Double odds; 46 | 47 | /** 48 | * 排序号 49 | */ 50 | private Double orderNo; 51 | 52 | /** 53 | * 乐观锁版本号 54 | */ 55 | @Version 56 | private Long version; 57 | 58 | /** 59 | * 对应号位id 60 | */ 61 | @Column(name = "num_locate_id", length = 32) 62 | private String numLocateId; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/PageController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | @Controller 7 | public class PageController { 8 | 9 | /** 10 | * 首页 11 | * 12 | * @return 13 | */ 14 | @GetMapping("/") 15 | public String index() { 16 | return "index"; 17 | } 18 | 19 | @GetMapping("/login") 20 | public String login() { 21 | return "login"; 22 | } 23 | 24 | @GetMapping("/register") 25 | public String register() { 26 | return "register"; 27 | } 28 | 29 | /** 30 | * 游戏大厅 31 | * 32 | * @return 33 | */ 34 | @GetMapping("/game-hall") 35 | public String gameHall() { 36 | return "game-hall"; 37 | } 38 | 39 | /** 40 | * 开奖大厅 41 | * 42 | * @return 43 | */ 44 | @GetMapping("/lottery-hall") 45 | public String lotteryHall() { 46 | return "lottery-hall"; 47 | } 48 | 49 | /** 50 | * 我的主页 51 | * @return 52 | */ 53 | @GetMapping("/my-home-page") 54 | public String myHomePage() { 55 | return "my-home-page"; 56 | } 57 | 58 | /** 59 | * 提现 60 | * @return 61 | */ 62 | @GetMapping("/withdraw") 63 | public String withdraw() { 64 | return "withdraw"; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/vo/DictTypeVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.BeanUtils; 7 | 8 | import cn.hutool.core.collection.CollectionUtil; 9 | import lombok.Data; 10 | import me.zohar.lottery.dictconfig.domain.DictType; 11 | 12 | @Data 13 | public class DictTypeVO { 14 | 15 | /** 16 | * 主键id 17 | */ 18 | private String id; 19 | 20 | /** 21 | * 字典类型code 22 | */ 23 | private String dictTypeCode; 24 | 25 | /** 26 | * 字典类型名称 27 | */ 28 | private String dictTypeName; 29 | 30 | /** 31 | * 备注 32 | */ 33 | private String note; 34 | 35 | public static List convertFor(List dictTypes) { 36 | if (CollectionUtil.isEmpty(dictTypes)) { 37 | return new ArrayList<>(); 38 | } 39 | List vos = new ArrayList<>(); 40 | for (DictType dictType : dictTypes) { 41 | vos.add(convertFor(dictType)); 42 | } 43 | return vos; 44 | } 45 | 46 | public static DictTypeVO convertFor(DictType dictType) { 47 | if (dictType == null) { 48 | return null; 49 | } 50 | DictTypeVO vo = new DictTypeVO(); 51 | BeanUtils.copyProperties(dictType, vo); 52 | return vo; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/param/LowerLevelBettingOrderQueryCondParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import lombok.Data; 10 | import lombok.EqualsAndHashCode; 11 | import me.zohar.lottery.common.param.PageParam; 12 | 13 | /** 14 | * 下级账号投注订单查询条件入参 15 | * 16 | * @author zohar 17 | * @date 2019年1月19日 18 | * 19 | */ 20 | @Data 21 | @EqualsAndHashCode(callSuper = false) 22 | public class LowerLevelBettingOrderQueryCondParam extends PageParam { 23 | 24 | /** 25 | * 当前账号id 26 | */ 27 | @NotBlank 28 | private String currentAccountId; 29 | 30 | /** 31 | * 用户名 32 | */ 33 | private String userName; 34 | 35 | /** 36 | * 账号类型 37 | */ 38 | private String accountType; 39 | 40 | /** 41 | * 游戏代码 42 | */ 43 | private String gameCode; 44 | 45 | private Long issueNum; 46 | 47 | /** 48 | * 开始时间 49 | */ 50 | @DateTimeFormat(pattern = "yyyy-MM-dd") 51 | private Date startTime; 52 | 53 | /** 54 | * 结束时间 55 | */ 56 | @DateTimeFormat(pattern = "yyyy-MM-dd") 57 | private Date endTime; 58 | 59 | /** 60 | * 状态 61 | */ 62 | private String state; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/game/controller/GameController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import me.zohar.lottery.common.vo.Result; 10 | import me.zohar.lottery.game.service.GameService; 11 | 12 | @Controller 13 | @RequestMapping("/game") 14 | public class GameController { 15 | 16 | @Autowired 17 | private GameService gameService; 18 | 19 | @GetMapping("/findTop5HotGame") 20 | @ResponseBody 21 | public Result findTop5HotGame() { 22 | return Result.success().setData(gameService.findTop5HotGame()); 23 | } 24 | 25 | @GetMapping("/findAllGameSituation") 26 | @ResponseBody 27 | public Result findAllGameSituation() { 28 | return Result.success().setData(gameService.findAllGameSituation()); 29 | } 30 | 31 | @GetMapping("/findGamePlayAndNumLocateByGameCode") 32 | @ResponseBody 33 | public Result findGamePlayAndNumLocateByGameCode(String gameCode) { 34 | return Result.success().setData(gameService.findGamePlayDetailsByGameCode(gameCode)); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/lottery/config/security/LogoutHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.Authentication; 11 | import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | 18 | /** 19 | * 退出登录处理类 20 | * 21 | * @author zohar 22 | * @date 2019年1月23日 23 | * 24 | */ 25 | @Component 26 | public class LogoutHandler implements LogoutSuccessHandler { 27 | 28 | @Override 29 | public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) 30 | throws IOException, ServletException { 31 | System.out.println("logout...."); 32 | response.setCharacterEncoding("UTF-8"); 33 | response.setContentType("application/json"); 34 | PrintWriter out = response.getWriter(); 35 | out.println(JSONObject.toJSONString(Result.success().setMsg("退出成功"))); 36 | out.flush(); 37 | out.close(); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/config/security/LogoutHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.Authentication; 11 | import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | 18 | /** 19 | * 退出登录处理类 20 | * 21 | * @author zohar 22 | * @date 2019年1月23日 23 | * 24 | */ 25 | @Component 26 | public class LogoutHandler implements LogoutSuccessHandler { 27 | 28 | @Override 29 | public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) 30 | throws IOException, ServletException { 31 | System.out.println("logout...."); 32 | response.setCharacterEncoding("UTF-8"); 33 | response.setContentType("application/json"); 34 | PrintWriter out = response.getWriter(); 35 | out.println(JSONObject.toJSONString(Result.success().setMsg("退出成功"))); 36 | out.flush(); 37 | out.close(); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/config/security/LogoutHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.Authentication; 11 | import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | 18 | /** 19 | * 退出登录处理类 20 | * 21 | * @author zohar 22 | * @date 2019年1月23日 23 | * 24 | */ 25 | @Component 26 | public class LogoutHandler implements LogoutSuccessHandler { 27 | 28 | @Override 29 | public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) 30 | throws IOException, ServletException { 31 | System.out.println("logout...."); 32 | response.setCharacterEncoding("UTF-8"); 33 | response.setContentType("application/json"); 34 | PrintWriter out = response.getWriter(); 35 | out.println(JSONObject.toJSONString(Result.success().setMsg("退出成功"))); 36 | out.flush(); 37 | out.close(); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/MuspayCallbackParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import javax.validation.constraints.NotBlank; 4 | import javax.validation.constraints.NotNull; 5 | 6 | import lombok.Data; 7 | 8 | /** 9 | * muspay回调参数 10 | * 11 | * @author zohar 12 | * @date 2019年1月21日 13 | * 14 | */ 15 | @Data 16 | public class MuspayCallbackParam { 17 | 18 | /** 19 | * 商户ID 20 | */ 21 | @NotBlank(message = "fxid不能为空") 22 | private String fxid; 23 | 24 | /** 25 | * 商户订单号 26 | */ 27 | @NotBlank(message = "fxddh不能为空") 28 | private String fxddh; 29 | 30 | /** 31 | * 商品名称 32 | */ 33 | private String fxdesc; 34 | 35 | /** 36 | * 平台订单号 37 | */ 38 | @NotBlank(message = "fxorder不能为空") 39 | private String fxorder; 40 | 41 | /** 42 | * 支付金额 43 | */ 44 | @NotNull(message = "fxfee不能为空") 45 | private String fxfee; 46 | 47 | /** 48 | * 附加信息 49 | */ 50 | private String fxattch; 51 | 52 | /** 53 | * 支付成功时的时间,unix时间戳 54 | */ 55 | @NotNull(message = "fxtime不能为空") 56 | private Long fxtime; 57 | 58 | /** 59 | * 订单状态,1代表支付成功 60 | */ 61 | @NotNull(message = "fxstatus不能为空") 62 | private String fxstatus; 63 | 64 | /** 65 | * 通过签名算法计算得出的签名值 66 | */ 67 | @NotBlank(message = "fxsign不能为空") 68 | private String fxsign; 69 | 70 | } 71 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/lottery/config/security/AuthenticationFailHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.AuthenticationException; 11 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | 18 | /** 19 | * 登录失败处理类 20 | * 21 | * @author zohar 22 | * @date 2019年1月23日 23 | * 24 | */ 25 | @Component 26 | public class AuthenticationFailHandler extends SimpleUrlAuthenticationFailureHandler { 27 | 28 | @Override 29 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, 30 | AuthenticationException e) throws IOException, ServletException { 31 | response.setCharacterEncoding("UTF-8"); 32 | response.setContentType("application/json"); 33 | PrintWriter out = response.getWriter(); 34 | out.println(JSONObject.toJSONString(Result.fail(500, e.getMessage()))); 35 | out.flush(); 36 | out.close(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/vo/UserAccountInfoVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.vo; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import lombok.Data; 6 | import me.zohar.lottery.dictconfig.DictHolder; 7 | import me.zohar.lottery.useraccount.domain.UserAccount; 8 | 9 | /** 10 | * 用户账号信息vo 11 | * 12 | * @author zohar 13 | * @date 2018年12月27日 14 | * 15 | */ 16 | @Data 17 | public class UserAccountInfoVO { 18 | 19 | /** 20 | * 主键id 21 | */ 22 | private String id; 23 | 24 | /** 25 | * 用户名 26 | */ 27 | private String userName; 28 | 29 | /** 30 | * 真实姓名 31 | */ 32 | private String realName; 33 | 34 | /** 35 | * 账号类型 36 | */ 37 | private String accountType; 38 | 39 | private String accountTypeName; 40 | 41 | /** 42 | * 返点 43 | */ 44 | private Double rebate; 45 | 46 | /** 47 | * 赔率 48 | */ 49 | private Double odds; 50 | 51 | /** 52 | * 余额 53 | */ 54 | private Double balance; 55 | 56 | public static UserAccountInfoVO convertFor(UserAccount userAccount) { 57 | if (userAccount == null) { 58 | return null; 59 | } 60 | UserAccountInfoVO vo = new UserAccountInfoVO(); 61 | BeanUtils.copyProperties(userAccount, vo); 62 | vo.setAccountTypeName(DictHolder.getDictItemName("accountType", vo.getAccountType())); 63 | return vo; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/config/security/AuthenticationFailHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.AuthenticationException; 11 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | 18 | /** 19 | * 登录失败处理类 20 | * 21 | * @author zohar 22 | * @date 2019年1月23日 23 | * 24 | */ 25 | @Component 26 | public class AuthenticationFailHandler extends SimpleUrlAuthenticationFailureHandler { 27 | 28 | @Override 29 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, 30 | AuthenticationException e) throws IOException, ServletException { 31 | response.setCharacterEncoding("UTF-8"); 32 | response.setContentType("application/json"); 33 | PrintWriter out = response.getWriter(); 34 | out.println(JSONObject.toJSONString(Result.fail(500, "用户名或密码错误"))); 35 | out.flush(); 36 | out.close(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/config/security/AuthenticationFailHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.AuthenticationException; 11 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | 18 | /** 19 | * 登录失败处理类 20 | * 21 | * @author zohar 22 | * @date 2019年1月23日 23 | * 24 | */ 25 | @Component 26 | public class AuthenticationFailHandler extends SimpleUrlAuthenticationFailureHandler { 27 | 28 | @Override 29 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, 30 | AuthenticationException e) throws IOException, ServletException { 31 | 32 | response.setCharacterEncoding("UTF-8"); 33 | response.setContentType("application/json"); 34 | PrintWriter out = response.getWriter(); 35 | out.println(JSONObject.toJSONString(Result.fail(500, e.getMessage()))); 36 | out.flush(); 37 | out.close(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/rechargewithdraw/controller/WithdrawController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | 10 | import me.zohar.lottery.common.vo.Result; 11 | import me.zohar.lottery.config.security.UserAccountDetails; 12 | import me.zohar.lottery.rechargewithdraw.param.StartWithdrawParam; 13 | import me.zohar.lottery.rechargewithdraw.service.WithdrawService; 14 | 15 | @Controller 16 | @RequestMapping("/withdraw") 17 | public class WithdrawController { 18 | 19 | @Autowired 20 | private WithdrawService withdrawService; 21 | 22 | @PostMapping("/startWithdraw") 23 | @ResponseBody 24 | public Result startWithdraw(StartWithdrawParam param) { 25 | UserAccountDetails user = (UserAccountDetails) SecurityContextHolder.getContext().getAuthentication() 26 | .getPrincipal(); 27 | param.setUserAccountId(user.getUserAccountId()); 28 | withdrawService.startWithdraw(param); 29 | return Result.success(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/domain/LotteryInformation.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | import org.hibernate.annotations.DynamicInsert; 11 | import org.hibernate.annotations.DynamicUpdate; 12 | 13 | import lombok.Getter; 14 | import lombok.Setter; 15 | 16 | @Getter 17 | @Setter 18 | @Entity 19 | @Table(name = "lottery_information") 20 | @DynamicInsert(true) 21 | @DynamicUpdate(true) 22 | public class LotteryInformation { 23 | 24 | /** 25 | * 主键id 26 | */ 27 | @Id 28 | @Column(name = "id", length = 32) 29 | private String id; 30 | 31 | /** 32 | * 标题 33 | */ 34 | private String title; 35 | 36 | /** 37 | * 内容 38 | */ 39 | private String content; 40 | 41 | /** 42 | * 来源 43 | */ 44 | private String source; 45 | 46 | /** 47 | * 发布时间 48 | */ 49 | private Date publishTime; 50 | 51 | public static LotteryInformation build(String title, String content, String source) { 52 | LotteryInformation lotteryInformation = new LotteryInformation(); 53 | lotteryInformation.setTitle(title); 54 | lotteryInformation.setContent(content); 55 | lotteryInformation.setSource(source); 56 | return lotteryInformation; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/domain/RechargeWithdrawLog.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | import org.hibernate.annotations.DynamicInsert; 11 | import org.hibernate.annotations.DynamicUpdate; 12 | 13 | import lombok.Getter; 14 | import lombok.Setter; 15 | 16 | /** 17 | * 充值提现日志 18 | * 19 | * @author zohar 20 | * @date 2019年1月19日 21 | * 22 | */ 23 | @Getter 24 | @Setter 25 | @Entity 26 | @Table(name = "v_recharge_withdraw_log", schema = "lottery") 27 | @DynamicInsert(true) 28 | @DynamicUpdate(true) 29 | public class RechargeWithdrawLog { 30 | 31 | /** 32 | * 主键id 33 | */ 34 | @Id 35 | @Column(name = "id", length = 32) 36 | private String id; 37 | 38 | /** 39 | * 订单类型:充值,提现 40 | */ 41 | private String orderType; 42 | 43 | /** 44 | * 订单号 45 | */ 46 | private String orderNo; 47 | 48 | /** 49 | * 提交时间 50 | */ 51 | private Date submitTime; 52 | 53 | /** 54 | * 订单状态 55 | */ 56 | private String orderState; 57 | 58 | /** 59 | * 备注 60 | */ 61 | private String note; 62 | 63 | /** 64 | * 用户账号id 65 | */ 66 | @Column(name = "user_account_id", length = 32) 67 | private String userAccountId; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/config/security/CustomUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.userdetails.UserDetails; 5 | import org.springframework.security.core.userdetails.UserDetailsService; 6 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 7 | import org.springframework.stereotype.Service; 8 | 9 | import lombok.extern.slf4j.Slf4j; 10 | import me.zohar.lottery.useraccount.service.UserAccountService; 11 | import me.zohar.lottery.useraccount.vo.LoginAccountInfoVO; 12 | 13 | /** 14 | * 通过实现UserDetailsService接口提供复杂认证 15 | * 16 | * @author 黄振华 17 | * @date 2018年8月28日 18 | * 19 | */ 20 | @Service 21 | @Slf4j 22 | public class CustomUserDetailsService implements UserDetailsService { 23 | 24 | @Autowired 25 | private UserAccountService userAccountService; 26 | 27 | @Override 28 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 29 | LoginAccountInfoVO loginAccountInfo = userAccountService.getLoginAccountInfo(username); 30 | if (loginAccountInfo == null) { 31 | log.warn("账号不存在:{}", username); 32 | throw new UsernameNotFoundException("用户名或密码不正确"); 33 | } 34 | 35 | return new UserAccountDetails(loginAccountInfo); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /lottery-admin/src/test/java/me/zohar/game/GameTest.java: -------------------------------------------------------------------------------- 1 | package me.zohar.game; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.annotation.Rollback; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import me.zohar.lottery.common.utils.IdUtils; 12 | import me.zohar.lottery.game.domain.Game; 13 | import me.zohar.lottery.game.domain.GamePlay; 14 | import me.zohar.lottery.game.repo.GameRepo; 15 | 16 | @RunWith(SpringRunner.class) 17 | @SpringBootTest 18 | public class GameTest { 19 | 20 | @Autowired 21 | private GameRepo gameRepo; 22 | 23 | @Test 24 | @Transactional(readOnly = false) 25 | @Rollback(false) 26 | public void contextLoads() { 27 | Game cqssc = new Game(); 28 | cqssc.setId(IdUtils.getId()); 29 | cqssc.setGameCode("CQSSC"); 30 | cqssc.setGameName("重庆时时彩"); 31 | cqssc.setOrderNo(1d); 32 | cqssc.setState("1"); 33 | gameRepo.save(cqssc); 34 | 35 | Game xjssc = new Game(); 36 | xjssc.setId(IdUtils.getId()); 37 | xjssc.setGameCode("XJSSC"); 38 | xjssc.setGameName("新疆时时彩"); 39 | xjssc.setOrderNo(2d); 40 | xjssc.setState("1"); 41 | gameRepo.save(xjssc); 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/StartWithdrawParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.DecimalMin; 6 | import javax.validation.constraints.NotBlank; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import org.springframework.beans.BeanUtils; 10 | 11 | import lombok.Data; 12 | import me.zohar.lottery.common.utils.IdUtils; 13 | import me.zohar.lottery.constants.Constant; 14 | import me.zohar.lottery.rechargewithdraw.domain.WithdrawRecord; 15 | 16 | /** 17 | * 发起提现入参 18 | * 19 | * @author zohar 20 | * @date 2019年2月23日 21 | * 22 | */ 23 | @Data 24 | public class StartWithdrawParam { 25 | 26 | /** 27 | * 提现金额 28 | */ 29 | @NotNull 30 | @DecimalMin(value = "0", inclusive = false, message = "withdrawAmount不能少于或等于0") 31 | private Double withdrawAmount; 32 | 33 | /** 34 | * 资金密码 35 | */ 36 | @NotBlank 37 | private String moneyPwd; 38 | 39 | /** 40 | * 用户账号id 41 | */ 42 | @NotBlank 43 | private String userAccountId; 44 | 45 | public WithdrawRecord convertToPo() { 46 | WithdrawRecord po = new WithdrawRecord(); 47 | BeanUtils.copyProperties(this, po); 48 | po.setId(IdUtils.getId()); 49 | po.setOrderNo(po.getId()); 50 | po.setSubmitTime(new Date()); 51 | po.setState(Constant.提现记录状态_发起提现); 52 | return po; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/domain/IssueGenerateRule.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.domain; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Id; 6 | import javax.persistence.Table; 7 | 8 | import org.hibernate.annotations.DynamicInsert; 9 | import org.hibernate.annotations.DynamicUpdate; 10 | 11 | import lombok.AllArgsConstructor; 12 | import lombok.Getter; 13 | import lombok.NoArgsConstructor; 14 | import lombok.Setter; 15 | 16 | /** 17 | * 期号生成规则 18 | * 19 | * @author zohar 20 | * @date 2019年2月13日 21 | * 22 | */ 23 | @Getter 24 | @Setter 25 | @AllArgsConstructor 26 | @NoArgsConstructor 27 | @Entity 28 | @Table(name = "issue_generate_rule", schema = "lottery") 29 | @DynamicInsert(true) 30 | @DynamicUpdate(true) 31 | public class IssueGenerateRule { 32 | 33 | /** 34 | * 主键id 35 | */ 36 | @Id 37 | @Column(name = "id", length = 32) 38 | private String id; 39 | 40 | /** 41 | * 开始时间(时分,如10:00) 42 | */ 43 | private String startTime; 44 | 45 | /** 46 | * 时间间隔(分钟) 47 | */ 48 | private Integer timeInterval; 49 | 50 | /** 51 | * 期数 52 | */ 53 | private Integer issueCount; 54 | 55 | /** 56 | * 排序号 57 | */ 58 | private Double orderNo; 59 | 60 | /** 61 | * 对应期号设置id 62 | */ 63 | @Column(name = "issue_setting_id", length = 32) 64 | private String issueSettingId; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /lottery-web/src/main/resources/templates/cqssc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 重庆时时彩 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 |
22 |
23 |
24 |
25 |
26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/vo/OptionalNumVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import cn.hutool.core.collection.CollectionUtil; 10 | import lombok.Data; 11 | import me.zohar.lottery.game.domain.OptionalNum; 12 | 13 | @Data 14 | public class OptionalNumVO { 15 | 16 | /** 17 | * 主键id 18 | */ 19 | private String id; 20 | 21 | /** 22 | * 号码 23 | */ 24 | private String num; 25 | 26 | /** 27 | * 赔率 28 | */ 29 | private Double odds; 30 | 31 | /** 32 | * 排序号 33 | */ 34 | private Double orderNo; 35 | 36 | /** 37 | * 对应号位id 38 | */ 39 | private String numLocateId; 40 | 41 | public static List convertFor(Collection optionalNums) { 42 | if (CollectionUtil.isEmpty(optionalNums)) { 43 | return new ArrayList<>(); 44 | } 45 | List vos = new ArrayList<>(); 46 | for (OptionalNum optionalNum : optionalNums) { 47 | vos.add(convertFor(optionalNum)); 48 | } 49 | return vos; 50 | } 51 | 52 | public static OptionalNumVO convertFor(OptionalNum optionalNum) { 53 | if (optionalNum == null) { 54 | return null; 55 | } 56 | OptionalNumVO vo = new OptionalNumVO(); 57 | BeanUtils.copyProperties(optionalNum, vo); 58 | return vo; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/lottery/config/security/AuthenticationSuccessHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.Authentication; 11 | import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | import me.zohar.lottery.constants.Constant; 18 | 19 | /** 20 | * 登录成功处理类 21 | * 22 | * @author zohar 23 | * @date 2019年1月23日 24 | * 25 | */ 26 | @Component 27 | public class AuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { 28 | 29 | @Override 30 | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, 31 | Authentication authentication) throws IOException, ServletException { 32 | response.setCharacterEncoding("UTF-8"); 33 | response.setContentType("application/json"); 34 | PrintWriter out = response.getWriter(); 35 | out.println(JSONObject.toJSONString(Result.success().setMsg(Constant.登录提示_登录成功))); 36 | out.flush(); 37 | out.close(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/config/security/AuthenticationSuccessHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.security.core.Authentication; 11 | import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.fastjson.JSONObject; 15 | 16 | import me.zohar.lottery.common.vo.Result; 17 | import me.zohar.lottery.constants.Constant; 18 | 19 | /** 20 | * 登录成功处理类 21 | * 22 | * @author zohar 23 | * @date 2019年1月23日 24 | * 25 | */ 26 | @Component 27 | public class AuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { 28 | 29 | @Override 30 | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, 31 | Authentication authentication) throws IOException, ServletException { 32 | response.setCharacterEncoding("UTF-8"); 33 | response.setContentType("application/json"); 34 | PrintWriter out = response.getWriter(); 35 | out.println(JSONObject.toJSONString(Result.success().setMsg(Constant.登录提示_登录成功))); 36 | out.flush(); 37 | out.close(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/vo/DictItemVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import cn.hutool.core.collection.CollectionUtil; 10 | import lombok.Data; 11 | import me.zohar.lottery.dictconfig.domain.DictItem; 12 | 13 | @Data 14 | public class DictItemVO implements Serializable { 15 | 16 | /** 17 | * 18 | */ 19 | private static final long serialVersionUID = 1L; 20 | 21 | /** 22 | * 主键id 23 | */ 24 | private String id; 25 | 26 | /** 27 | * 字典项code 28 | */ 29 | private String dictItemCode; 30 | 31 | /** 32 | * 字典项名称 33 | */ 34 | private String dictItemName; 35 | 36 | /** 37 | * 排序号 38 | */ 39 | private Double orderNo; 40 | 41 | public static List convertFor(List dictItems) { 42 | if (CollectionUtil.isEmpty(dictItems)) { 43 | return new ArrayList<>(); 44 | } 45 | List vos = new ArrayList<>(); 46 | for (DictItem dictItem : dictItems) { 47 | vos.add(convertFor(dictItem)); 48 | } 49 | return vos; 50 | } 51 | 52 | public static DictItemVO convertFor(DictItem dictItem) { 53 | if (dictItem == null) { 54 | return null; 55 | } 56 | DictItemVO vo = new DictItemVO(); 57 | BeanUtils.copyProperties(dictItem, vo); 58 | return vo; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/UserAccountRegisterParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.Pattern; 7 | 8 | import org.springframework.beans.BeanUtils; 9 | 10 | import lombok.Data; 11 | import me.zohar.lottery.common.utils.IdUtils; 12 | import me.zohar.lottery.constants.Constant; 13 | import me.zohar.lottery.useraccount.domain.UserAccount; 14 | 15 | @Data 16 | public class UserAccountRegisterParam { 17 | 18 | /** 19 | * 邀请码 20 | */ 21 | private String inviteCode; 22 | 23 | /** 24 | * 用户名 25 | */ 26 | @NotBlank 27 | @Pattern(regexp = "^[A-Za-z][A-Za-z0-9]{5,11}$") 28 | private String userName; 29 | 30 | /** 31 | * 真实姓名 32 | */ 33 | @NotBlank 34 | private String realName; 35 | 36 | /** 37 | * 登录密码 38 | */ 39 | @NotBlank 40 | @Pattern(regexp = "^[A-Za-z][A-Za-z0-9]{5,14}$") 41 | private String loginPwd; 42 | 43 | public UserAccount convertToPo() { 44 | UserAccount po = new UserAccount(); 45 | BeanUtils.copyProperties(this, po); 46 | po.setId(IdUtils.getId()); 47 | po.setRegisteredTime(new Date()); 48 | po.setMoneyPwd(po.getLoginPwd()); 49 | po.setState(Constant.账号状态_启用); 50 | po.setAccountType(Constant.账号类型_会员); 51 | po.setBalance(0d); 52 | po.setAccountLevelPath(po.getId()); 53 | return po; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/param/GenerateInviteCodeParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.DecimalMin; 6 | import javax.validation.constraints.NotBlank; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import org.springframework.beans.BeanUtils; 10 | 11 | import cn.hutool.core.date.DateField; 12 | import cn.hutool.core.date.DateUtil; 13 | import lombok.Data; 14 | import me.zohar.lottery.agent.domain.InviteCode; 15 | import me.zohar.lottery.common.utils.IdUtils; 16 | 17 | @Data 18 | public class GenerateInviteCodeParam { 19 | 20 | @NotBlank 21 | private String accountType; 22 | 23 | /** 24 | * 返点 25 | */ 26 | @NotNull 27 | @DecimalMin(value = "0", inclusive = true) 28 | private Double rebate; 29 | 30 | /** 31 | * 赔率 32 | */ 33 | @NotNull 34 | @DecimalMin(value = "0", inclusive = true) 35 | private Double odds; 36 | 37 | /** 38 | * 邀请人账号id 39 | */ 40 | @NotBlank 41 | private String inviterId; 42 | 43 | public InviteCode convertToPo(String code, Integer effectiveDuration) { 44 | InviteCode po = new InviteCode(); 45 | BeanUtils.copyProperties(this, po); 46 | po.setId(IdUtils.getId()); 47 | po.setCode(code); 48 | po.setCreateTime(new Date()); 49 | po.setPeriodOfValidity(DateUtil.offset(po.getCreateTime(), DateField.DAY_OF_YEAR, effectiveDuration)); 50 | return po; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /lottery-admin/src/test/java/me/zohar/LotteryApplicationTests.java: -------------------------------------------------------------------------------- 1 | package me.zohar; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.annotation.Rollback; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import cn.hutool.core.date.DateUtil; 12 | import me.zohar.lottery.statisticalanalysis.param.AccountProfitAndLossQueryCondParam; 13 | import me.zohar.lottery.statisticalanalysis.service.StatisticalAnalysisService; 14 | 15 | @RunWith(SpringRunner.class) 16 | @SpringBootTest 17 | public class LotteryApplicationTests { 18 | 19 | @Autowired 20 | private StatisticalAnalysisService statisticalAnalysisService; 21 | 22 | @Test 23 | @Transactional(readOnly = false) 24 | @Rollback(false) 25 | public void contextLoads() { 26 | AccountProfitAndLossQueryCondParam param = new AccountProfitAndLossQueryCondParam(); 27 | param.setPageNum(1); 28 | param.setPageSize(10); 29 | param.setCurrentAccountId("1100805062633979904"); 30 | // param.setAccountType("member"); 31 | param.setStartTime(DateUtil.parse("2019-06-09")); 32 | param.setEndTime(DateUtil.parse("2019-06-09")); 33 | statisticalAnalysisService.findAccountProfitAndLossByPage(param); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/param/GameParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.param; 2 | 3 | import javax.validation.constraints.DecimalMin; 4 | import javax.validation.constraints.NotBlank; 5 | import javax.validation.constraints.NotNull; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.common.utils.IdUtils; 11 | import me.zohar.lottery.game.domain.Game; 12 | 13 | @Data 14 | public class GameParam { 15 | 16 | /** 17 | * 主键id 18 | */ 19 | private String id; 20 | 21 | /** 22 | * 游戏类别id 23 | */ 24 | @NotBlank 25 | private String gameCategoryId; 26 | 27 | /** 28 | * 游戏代码 29 | */ 30 | @NotBlank 31 | private String gameCode; 32 | 33 | /** 34 | * 游戏名称 35 | */ 36 | @NotBlank 37 | private String gameName; 38 | 39 | /** 40 | * 游戏说明 41 | */ 42 | private String gameDesc; 43 | 44 | @NotNull 45 | private Boolean hotGameFlag; 46 | 47 | /** 48 | * 状态,启用:1;禁用:0 49 | */ 50 | @NotBlank 51 | private String state; 52 | 53 | /** 54 | * 排序号 55 | */ 56 | @NotNull 57 | @DecimalMin(value = "0", inclusive = true, message = "orderNo不能少于0") 58 | private Double orderNo; 59 | 60 | /** 61 | * 复制的游戏代码 62 | */ 63 | private String copyGameCode; 64 | 65 | public Game convertToPo() { 66 | Game po = new Game(); 67 | BeanUtils.copyProperties(this, po); 68 | po.setId(IdUtils.getId()); 69 | return po; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/domain/GameCategory.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.domain; 2 | 3 | import java.util.Set; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.ConstraintMode; 7 | import javax.persistence.Entity; 8 | import javax.persistence.FetchType; 9 | import javax.persistence.ForeignKey; 10 | import javax.persistence.Id; 11 | import javax.persistence.JoinColumn; 12 | import javax.persistence.OneToMany; 13 | import javax.persistence.OrderBy; 14 | import javax.persistence.Table; 15 | 16 | import org.hibernate.annotations.DynamicInsert; 17 | import org.hibernate.annotations.DynamicUpdate; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | 22 | @Getter 23 | @Setter 24 | @Entity 25 | @Table(name = "game_category") 26 | @DynamicInsert(true) 27 | @DynamicUpdate(true) 28 | public class GameCategory { 29 | 30 | /** 31 | * 主键id 32 | */ 33 | @Id 34 | @Column(name = "id", length = 32) 35 | private String id; 36 | 37 | /** 38 | * 游戏类别code 39 | */ 40 | private String gameCategoryCode; 41 | 42 | /** 43 | * 游戏类别 44 | */ 45 | private String gameCategoryName; 46 | 47 | /** 48 | * 排序号 49 | */ 50 | private Double orderNo; 51 | 52 | /** 53 | * 游戏集合 54 | */ 55 | @OneToMany(fetch = FetchType.LAZY) 56 | @JoinColumn(name = "game_category_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT)) 57 | @OrderBy("orderNo ASC") 58 | private Set games; 59 | 60 | } 61 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/vo/RebateAndOddsVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | 11 | import cn.hutool.core.collection.CollectionUtil; 12 | import lombok.Data; 13 | import me.zohar.lottery.agent.domain.RebateAndOdds; 14 | 15 | @Data 16 | public class RebateAndOddsVO { 17 | 18 | private String id; 19 | 20 | /** 21 | * 返点 22 | */ 23 | private Double rebate; 24 | 25 | /** 26 | * 赔率 27 | */ 28 | private Double odds; 29 | 30 | /** 31 | * 创建时间 32 | */ 33 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 34 | private Date createTime; 35 | 36 | public static List convertFor(List rebateAndOddses) { 37 | if (CollectionUtil.isEmpty(rebateAndOddses)) { 38 | return new ArrayList<>(); 39 | } 40 | List vos = new ArrayList<>(); 41 | for (RebateAndOdds rebateAndOdds : rebateAndOddses) { 42 | vos.add(convertFor(rebateAndOdds)); 43 | } 44 | return vos; 45 | } 46 | 47 | public static RebateAndOddsVO convertFor(RebateAndOdds rebateAndOdds) { 48 | if (rebateAndOdds == null) { 49 | return null; 50 | } 51 | RebateAndOddsVO vo = new RebateAndOddsVO(); 52 | BeanUtils.copyProperties(rebateAndOdds, vo); 53 | return vo; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/vo/ConfigItemVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import cn.hutool.core.collection.CollectionUtil; 10 | import lombok.Data; 11 | import me.zohar.lottery.dictconfig.domain.ConfigItem; 12 | 13 | @Data 14 | public class ConfigItemVO implements Serializable { 15 | 16 | /** 17 | * 18 | */ 19 | private static final long serialVersionUID = 1L; 20 | 21 | /** 22 | * 主键id 23 | */ 24 | private String id; 25 | 26 | /** 27 | * 配置项code 28 | */ 29 | private String configCode; 30 | 31 | /** 32 | * 配置项名称 33 | */ 34 | private String configName; 35 | 36 | /** 37 | * 配置项值 38 | */ 39 | private String configValue; 40 | 41 | public static List convertFor(List configItems) { 42 | if (CollectionUtil.isEmpty(configItems)) { 43 | return new ArrayList<>(); 44 | } 45 | List vos = new ArrayList<>(); 46 | for (ConfigItem configItem : configItems) { 47 | vos.add(convertFor(configItem)); 48 | } 49 | return vos; 50 | } 51 | 52 | public static ConfigItemVO convertFor(ConfigItem configItem) { 53 | if (configItem == null) { 54 | return null; 55 | } 56 | ConfigItemVO vo = new ConfigItemVO(); 57 | BeanUtils.copyProperties(configItem, vo); 58 | return vo; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/vo/GameCategoryVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.vo; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.Collection; 6 | import java.util.List; 7 | 8 | import org.springframework.beans.BeanUtils; 9 | 10 | import cn.hutool.core.collection.CollectionUtil; 11 | import lombok.Data; 12 | import me.zohar.lottery.game.domain.GameCategory; 13 | 14 | @Data 15 | public class GameCategoryVO implements Serializable { 16 | 17 | /** 18 | * 19 | */ 20 | private static final long serialVersionUID = 1L; 21 | 22 | private String id; 23 | 24 | /** 25 | * 游戏类别code 26 | */ 27 | private String gameCategoryCode; 28 | 29 | /** 30 | * 游戏类别 31 | */ 32 | private String gameCategoryName; 33 | 34 | /** 35 | * 排序号 36 | */ 37 | private Double orderNo; 38 | 39 | public static List convertFor(Collection gameCategorys) { 40 | if (CollectionUtil.isEmpty(gameCategorys)) { 41 | return new ArrayList<>(); 42 | } 43 | List vos = new ArrayList<>(); 44 | for (GameCategory gameCategory : gameCategorys) { 45 | vos.add(convertFor(gameCategory)); 46 | } 47 | return vos; 48 | } 49 | 50 | public static GameCategoryVO convertFor(GameCategory gameCategory) { 51 | if (gameCategory == null) { 52 | return null; 53 | } 54 | GameCategoryVO vo = new GameCategoryVO(); 55 | BeanUtils.copyProperties(gameCategory, vo); 56 | return vo; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/systemnotice/vo/SystemNoticeVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.systemnotice.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | 11 | import cn.hutool.core.collection.CollectionUtil; 12 | import lombok.Data; 13 | import me.zohar.lottery.systemnotice.domain.SystemNotice; 14 | 15 | @Data 16 | public class SystemNoticeVO { 17 | 18 | private String id; 19 | 20 | private String noticeTitle; 21 | 22 | private String noticeContent; 23 | 24 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 25 | private Date createTime; 26 | 27 | /** 28 | * 发布日期 29 | */ 30 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") 31 | private Date publishDate; 32 | 33 | public static List convertFor(List systemNotices) { 34 | if (CollectionUtil.isEmpty(systemNotices)) { 35 | return new ArrayList<>(); 36 | } 37 | List vos = new ArrayList<>(); 38 | for (SystemNotice systemNotice : systemNotices) { 39 | vos.add(convertFor(systemNotice)); 40 | } 41 | return vos; 42 | } 43 | 44 | public static SystemNoticeVO convertFor(SystemNotice systemNotice) { 45 | if (systemNotice == null) { 46 | return null; 47 | } 48 | SystemNoticeVO vo = new SystemNoticeVO(); 49 | BeanUtils.copyProperties(systemNotice, vo); 50 | return vo; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/lottery/rechargewithdraw/controller/RechargeWithdrawLogController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | 10 | import me.zohar.lottery.common.vo.Result; 11 | import me.zohar.lottery.config.security.UserAccountDetails; 12 | import me.zohar.lottery.rechargewithdraw.param.RechargeWithdrawLogQueryCondParam; 13 | import me.zohar.lottery.rechargewithdraw.service.RechargeWithdrawLogService; 14 | 15 | @Controller 16 | @RequestMapping("/rechargeWithdrawLog") 17 | public class RechargeWithdrawLogController { 18 | 19 | @Autowired 20 | private RechargeWithdrawLogService rechargeWithdrawLogService; 21 | 22 | @GetMapping("/findMyRechargeWithdrawLogByPage") 23 | @ResponseBody 24 | public Result findMyRechargeWithdrawLogByPage(RechargeWithdrawLogQueryCondParam param) { 25 | UserAccountDetails user = (UserAccountDetails) SecurityContextHolder.getContext().getAuthentication() 26 | .getPrincipal(); 27 | param.setUserAccountId(user.getUserAccountId()); 28 | return Result.success().setData(rechargeWithdrawLogService.findMyRechargeWithdrawLogByPage(param)); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/rechargewithdraw/controller/RechargeWithdrawLogController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | 10 | import me.zohar.lottery.common.vo.Result; 11 | import me.zohar.lottery.config.security.UserAccountDetails; 12 | import me.zohar.lottery.rechargewithdraw.param.RechargeWithdrawLogQueryCondParam; 13 | import me.zohar.lottery.rechargewithdraw.service.RechargeWithdrawLogService; 14 | 15 | @Controller 16 | @RequestMapping("/rechargeWithdrawLog") 17 | public class RechargeWithdrawLogController { 18 | 19 | @Autowired 20 | private RechargeWithdrawLogService rechargeWithdrawLogService; 21 | 22 | @GetMapping("/findMyRechargeWithdrawLogByPage") 23 | @ResponseBody 24 | public Result findMyRechargeWithdrawLogByPage(RechargeWithdrawLogQueryCondParam param) { 25 | UserAccountDetails user = (UserAccountDetails) SecurityContextHolder.getContext().getAuthentication() 26 | .getPrincipal(); 27 | param.setUserAccountId(user.getUserAccountId()); 28 | return Result.success().setData(rechargeWithdrawLogService.findMyRechargeWithdrawLogByPage(param)); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/rechargewithdraw/controller/RechargeWithdrawLogController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | 10 | import me.zohar.lottery.common.vo.Result; 11 | import me.zohar.lottery.config.security.UserAccountDetails; 12 | import me.zohar.lottery.rechargewithdraw.param.RechargeWithdrawLogQueryCondParam; 13 | import me.zohar.lottery.rechargewithdraw.service.RechargeWithdrawLogService; 14 | 15 | @Controller 16 | @RequestMapping("/rechargeWithdrawLog") 17 | public class RechargeWithdrawLogController { 18 | 19 | @Autowired 20 | private RechargeWithdrawLogService rechargeWithdrawLogService; 21 | 22 | @GetMapping("/findMyRechargeWithdrawLogByPage") 23 | @ResponseBody 24 | public Result findMyRechargeWithdrawLogByPage(RechargeWithdrawLogQueryCondParam param) { 25 | UserAccountDetails user = (UserAccountDetails) SecurityContextHolder.getContext().getAuthentication() 26 | .getPrincipal(); 27 | param.setUserAccountId(user.getUserAccountId()); 28 | return Result.success().setData(rechargeWithdrawLogService.findMyRechargeWithdrawLogByPage(param)); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/domain/GameSituation.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | import org.hibernate.annotations.DynamicInsert; 11 | import org.hibernate.annotations.DynamicUpdate; 12 | 13 | import lombok.Getter; 14 | import lombok.Setter; 15 | 16 | @Getter 17 | @Setter 18 | @Entity 19 | @Table(name = "v_game_situation", schema = "lottery") 20 | @DynamicInsert(true) 21 | @DynamicUpdate(true) 22 | public class GameSituation { 23 | 24 | /** 25 | * 主键id 26 | */ 27 | @Id 28 | @Column(name = "id", length = 32) 29 | private String id; 30 | 31 | /** 32 | * 游戏代码 33 | */ 34 | private String gameCode; 35 | 36 | /** 37 | * 游戏名称 38 | */ 39 | private String gameName; 40 | 41 | private String gameCategoryId; 42 | 43 | private Boolean hotGameFlag; 44 | 45 | /** 46 | * 总期数 47 | */ 48 | private Long issueCount; 49 | 50 | /** 51 | * 当前期 52 | */ 53 | private Long currentIssue; 54 | 55 | private Long currentIssueInner; 56 | 57 | /** 58 | * 当前期结束时间 59 | */ 60 | private Date currentIssueEndTime; 61 | 62 | /** 63 | * 上一期 64 | */ 65 | private Long preIssue; 66 | 67 | /** 68 | * 上一期开奖号码 69 | */ 70 | private String preIssueLotteryNum; 71 | 72 | /** 73 | * 下一期 74 | */ 75 | private Long nextIssue; 76 | 77 | /** 78 | * 下一期结束时间 79 | */ 80 | private Date nextIssueEndTime; 81 | 82 | } 83 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/lottery/rechargewithdraw/controller/RechargeController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import me.zohar.lottery.common.vo.Result; 10 | import me.zohar.lottery.rechargewithdraw.param.RechargeOrderQueryCondParam; 11 | import me.zohar.lottery.rechargewithdraw.service.RechargeService; 12 | 13 | /** 14 | * 15 | * @author zohar 16 | * @date 2019年1月21日 17 | * 18 | */ 19 | @Controller 20 | @RequestMapping("/recharge") 21 | public class RechargeController { 22 | 23 | @Autowired 24 | private RechargeService rechargeService; 25 | 26 | @GetMapping("/findRechargeOrderByPage") 27 | @ResponseBody 28 | public Result findRechargeOrderByPage(RechargeOrderQueryCondParam param) { 29 | return Result.success().setData(rechargeService.findRechargeOrderByPage(param)); 30 | } 31 | 32 | @GetMapping("/cancelOrder") 33 | @ResponseBody 34 | public Result cancelOrder(String id) { 35 | rechargeService.cancelOrder(id); 36 | return Result.success(); 37 | } 38 | 39 | @GetMapping("/manualSettlement") 40 | @ResponseBody 41 | public Result manualSettlement(String orderNo) { 42 | rechargeService.manualSettlement(orderNo); 43 | return Result.success(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/statisticalanalysis/domain/EverydayProfitAndLoss.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.statisticalanalysis.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.Id; 7 | import javax.persistence.Table; 8 | 9 | import org.hibernate.annotations.DynamicInsert; 10 | import org.hibernate.annotations.DynamicUpdate; 11 | 12 | import lombok.Getter; 13 | import lombok.Setter; 14 | 15 | /** 16 | * 每日盈亏 17 | * 18 | * @author zohar 19 | * @date 2019年6月10日 20 | * 21 | */ 22 | @Getter 23 | @Setter 24 | @Entity 25 | @Table(name = "v_everyday_profit_and_loss") 26 | @DynamicInsert(true) 27 | @DynamicUpdate(true) 28 | public class EverydayProfitAndLoss { 29 | 30 | /** 31 | * 主键id 32 | */ 33 | @Id 34 | private String id; 35 | 36 | private String userAccountId; 37 | 38 | /** 39 | * 用户名 40 | */ 41 | private String userName; 42 | 43 | /** 44 | * 账号类型 45 | */ 46 | private String accountType; 47 | 48 | /** 49 | * 账号级别 50 | */ 51 | private Integer accountLevel; 52 | 53 | /** 54 | * 账号级别路径 55 | */ 56 | private String accountLevelPath; 57 | 58 | /** 59 | * 余额 60 | */ 61 | private Double balance; 62 | 63 | private Date everyday; 64 | 65 | private Double rechargeAmount; 66 | 67 | private Double withdrawAmount; 68 | 69 | private Double totalBettingAmount; 70 | 71 | private Double totalWinningAmount; 72 | 73 | private Double rebateAmount; 74 | 75 | private Double lowerLevelRebateAmount; 76 | 77 | private Double bettingProfitAndLoss; 78 | 79 | } 80 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/information/controller/LotteryInformationController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import me.zohar.lottery.common.vo.Result; 10 | import me.zohar.lottery.information.param.LotteryInformationQueryCondParam; 11 | import me.zohar.lottery.information.service.LotteryInformationService; 12 | 13 | @Controller 14 | @RequestMapping("/lotteryInformation") 15 | public class LotteryInformationController { 16 | 17 | @Autowired 18 | private LotteryInformationService lotteryInformationService; 19 | 20 | @GetMapping("/findInformationById") 21 | @ResponseBody 22 | public Result findInformationById(String id) { 23 | return Result.success().setData(lotteryInformationService.findInformationById(id)); 24 | } 25 | 26 | @GetMapping("/findTop13Information") 27 | @ResponseBody 28 | public Result findTop13Information() { 29 | return Result.success().setData(lotteryInformationService.findTop13Information()); 30 | } 31 | 32 | @GetMapping("/findLotteryInformationByPage") 33 | @ResponseBody 34 | public Result findLotteryInformationByPage(LotteryInformationQueryCondParam param) { 35 | return Result.success().setData(lotteryInformationService.findLotteryInformationByPage(param)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/game/vo/NumLocateVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.game.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import cn.hutool.core.collection.CollectionUtil; 10 | import lombok.Data; 11 | import me.zohar.lottery.game.domain.NumLocate; 12 | 13 | @Data 14 | public class NumLocateVO { 15 | 16 | /** 17 | * 主键id 18 | */ 19 | private String id; 20 | 21 | /** 22 | * 号位名称 23 | */ 24 | private String numLocateName; 25 | 26 | /** 27 | * 候选的号码集合,以逗号分隔 28 | */ 29 | private String nums; 30 | 31 | /** 32 | * 最大可选多少个号码 33 | */ 34 | private Integer maxSelected; 35 | 36 | /** 37 | * 是否有过滤按钮 38 | */ 39 | private Boolean hasFilterBtnFlag; 40 | 41 | /** 42 | * 对应游戏玩法id 43 | */ 44 | private String gamePlayId; 45 | 46 | /** 47 | * 候选号码集合 48 | */ 49 | private List optionalNums = new ArrayList<>(); 50 | 51 | public static List convertFor(Collection numLocates) { 52 | if (CollectionUtil.isEmpty(numLocates)) { 53 | return new ArrayList<>(); 54 | } 55 | List vos = new ArrayList<>(); 56 | for (NumLocate numLocate : numLocates) { 57 | vos.add(convertFor(numLocate)); 58 | } 59 | return vos; 60 | } 61 | 62 | public static NumLocateVO convertFor(NumLocate numLocate) { 63 | if (numLocate == null) { 64 | return null; 65 | } 66 | NumLocateVO vo = new NumLocateVO(); 67 | BeanUtils.copyProperties(numLocate, vo); 68 | return vo; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/vo/LoginLogVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | 11 | import cn.hutool.core.collection.CollectionUtil; 12 | import lombok.Data; 13 | import me.zohar.lottery.dictconfig.DictHolder; 14 | import me.zohar.lottery.useraccount.domain.LoginLog; 15 | 16 | @Data 17 | public class LoginLogVO { 18 | 19 | private String id; 20 | 21 | private String state; 22 | 23 | private String stateName; 24 | 25 | private String ipAddr; 26 | 27 | private String loginLocation; 28 | 29 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 30 | private Date loginTime; 31 | 32 | private String browser; 33 | 34 | private String os; 35 | 36 | private String msg; 37 | 38 | private String userName; 39 | 40 | public static List convertFor(List loginLogs) { 41 | if (CollectionUtil.isEmpty(loginLogs)) { 42 | return new ArrayList<>(); 43 | } 44 | List vos = new ArrayList<>(); 45 | for (LoginLog loginLog : loginLogs) { 46 | vos.add(convertFor(loginLog)); 47 | } 48 | return vos; 49 | } 50 | 51 | public static LoginLogVO convertFor(LoginLog loginLog) { 52 | if (loginLog == null) { 53 | return null; 54 | } 55 | LoginLogVO vo = new LoginLogVO(); 56 | BeanUtils.copyProperties(loginLog, vo); 57 | vo.setStateName(DictHolder.getDictItemName("loginState", vo.getState())); 58 | return vo; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/domain/DictType.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.domain; 2 | 3 | import java.util.Set; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.ConstraintMode; 7 | import javax.persistence.Entity; 8 | import javax.persistence.FetchType; 9 | import javax.persistence.ForeignKey; 10 | import javax.persistence.Id; 11 | import javax.persistence.JoinColumn; 12 | import javax.persistence.OneToMany; 13 | import javax.persistence.OrderBy; 14 | import javax.persistence.Table; 15 | import javax.persistence.Version; 16 | 17 | import org.hibernate.annotations.DynamicInsert; 18 | import org.hibernate.annotations.DynamicUpdate; 19 | 20 | import lombok.Getter; 21 | import lombok.Setter; 22 | 23 | /** 24 | * 字典类型 25 | * 26 | * @author zohar 27 | * @date 2019年1月19日 28 | * 29 | */ 30 | @Getter 31 | @Setter 32 | @Entity 33 | @Table(name = "dict_type", schema = "lottery") 34 | @DynamicInsert(true) 35 | @DynamicUpdate(true) 36 | public class DictType { 37 | 38 | /** 39 | * 主键id 40 | */ 41 | @Id 42 | @Column(name = "id", length = 32) 43 | private String id; 44 | 45 | /** 46 | * 字典类型code 47 | */ 48 | private String dictTypeCode; 49 | 50 | /** 51 | * 字典类型名称 52 | */ 53 | private String dictTypeName; 54 | 55 | /** 56 | * 备注 57 | */ 58 | private String note; 59 | 60 | /** 61 | * 乐观锁版本号 62 | */ 63 | @Version 64 | private Long version; 65 | 66 | @OneToMany(fetch = FetchType.LAZY) 67 | @JoinColumn(name = "dict_type_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT)) 68 | @OrderBy("orderNo ASC") 69 | private Set dictItems; 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/information/vo/LotteryInformationCrawlerVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.information.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | 11 | import cn.hutool.core.collection.CollectionUtil; 12 | import lombok.Data; 13 | import me.zohar.lottery.information.domain.InformationCrawler; 14 | 15 | @Data 16 | public class LotteryInformationCrawlerVO { 17 | 18 | private String id; 19 | 20 | /** 21 | * 来源 22 | */ 23 | private String source; 24 | 25 | /** 26 | * 脚本 27 | */ 28 | private String script; 29 | 30 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 31 | private Date createTime; 32 | 33 | public static List convertFor( 34 | List lotteryInformationCrawlers) { 35 | if (CollectionUtil.isEmpty(lotteryInformationCrawlers)) { 36 | return new ArrayList<>(); 37 | } 38 | List vos = new ArrayList<>(); 39 | for (InformationCrawler lotteryInformationCrawler : lotteryInformationCrawlers) { 40 | vos.add(convertFor(lotteryInformationCrawler)); 41 | } 42 | return vos; 43 | } 44 | 45 | public static LotteryInformationCrawlerVO convertFor(InformationCrawler lotteryInformationCrawler) { 46 | if (lotteryInformationCrawler == null) { 47 | return null; 48 | } 49 | LotteryInformationCrawlerVO vo = new LotteryInformationCrawlerVO(); 50 | BeanUtils.copyProperties(lotteryInformationCrawler, vo); 51 | return vo; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/useraccount/param/AddUserAccountParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.useraccount.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.DecimalMin; 6 | import javax.validation.constraints.NotBlank; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import org.springframework.beans.BeanUtils; 10 | 11 | import lombok.Data; 12 | import me.zohar.lottery.common.utils.IdUtils; 13 | import me.zohar.lottery.useraccount.domain.UserAccount; 14 | 15 | @Data 16 | public class AddUserAccountParam { 17 | 18 | /** 19 | * 邀请人 20 | */ 21 | private String inviterUserName; 22 | 23 | /** 24 | * 用户名 25 | */ 26 | @NotBlank 27 | private String userName; 28 | 29 | /** 30 | * 真实姓名 31 | */ 32 | @NotBlank 33 | private String realName; 34 | 35 | /** 36 | * 账号类型 37 | */ 38 | private String accountType; 39 | 40 | /** 41 | * 返点 42 | */ 43 | @NotNull 44 | @DecimalMin(value = "0", inclusive = true) 45 | private Double rebate; 46 | 47 | /** 48 | * 赔率 49 | */ 50 | @NotNull 51 | @DecimalMin(value = "0", inclusive = false) 52 | private Double odds; 53 | 54 | /** 55 | * 状态 56 | */ 57 | private String state; 58 | 59 | /** 60 | * 登录密码 61 | */ 62 | @NotBlank 63 | private String loginPwd; 64 | 65 | public UserAccount convertToPo() { 66 | UserAccount po = new UserAccount(); 67 | BeanUtils.copyProperties(this, po); 68 | po.setId(IdUtils.getId()); 69 | po.setAccountLevel(0); 70 | po.setAccountLevelPath(po.getId()); 71 | po.setBalance(0d); 72 | po.setRegisteredTime(new Date()); 73 | po.setMoneyPwd(po.getLoginPwd()); 74 | return po; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/lottery/rechargewithdraw/controller/WithdrawController.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | 9 | import me.zohar.lottery.common.vo.Result; 10 | import me.zohar.lottery.rechargewithdraw.param.WithdrawRecordQueryCondParam; 11 | import me.zohar.lottery.rechargewithdraw.service.WithdrawService; 12 | 13 | @Controller 14 | @RequestMapping("/withdraw") 15 | public class WithdrawController { 16 | 17 | @Autowired 18 | private WithdrawService withdrawService; 19 | 20 | @GetMapping("/approved") 21 | @ResponseBody 22 | public Result approved(String id, String note) { 23 | withdrawService.approved(id, note); 24 | return Result.success(); 25 | } 26 | 27 | @GetMapping("/notApproved") 28 | @ResponseBody 29 | public Result notApproved(String id, String note) { 30 | withdrawService.notApproved(id, note); 31 | return Result.success(); 32 | } 33 | 34 | @GetMapping("/confirmCredited") 35 | @ResponseBody 36 | public Result confirmCredited(String id) { 37 | withdrawService.confirmCredited(id); 38 | return Result.success(); 39 | } 40 | 41 | @GetMapping("/findWithdrawRecordByPage") 42 | @ResponseBody 43 | public Result findWithdrawRecordByPage(WithdrawRecordQueryCondParam param) { 44 | return Result.success().setData(withdrawService.findWithdrawRecordByPage(param)); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/vo/RebateAndOddsSituationVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | 11 | import cn.hutool.core.collection.CollectionUtil; 12 | import lombok.Data; 13 | import me.zohar.lottery.agent.domain.RebateAndOddsSituation; 14 | 15 | @Data 16 | public class RebateAndOddsSituationVO { 17 | 18 | private String id; 19 | 20 | /** 21 | * 返点 22 | */ 23 | private Double rebate; 24 | 25 | /** 26 | * 赔率 27 | */ 28 | private Double odds; 29 | 30 | /** 31 | * 关联账号数量 32 | */ 33 | private Integer associatedAccountNum; 34 | 35 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 36 | private Date createTime; 37 | 38 | public static List convertFor(List rebateAndOddsSituations) { 39 | if (CollectionUtil.isEmpty(rebateAndOddsSituations)) { 40 | return new ArrayList<>(); 41 | } 42 | List vos = new ArrayList<>(); 43 | for (RebateAndOddsSituation rebateAndOddsSituation : rebateAndOddsSituations) { 44 | vos.add(convertFor(rebateAndOddsSituation)); 45 | } 46 | return vos; 47 | } 48 | 49 | public static RebateAndOddsSituationVO convertFor(RebateAndOddsSituation rebateAndOddsSituation) { 50 | if (rebateAndOddsSituation == null) { 51 | return null; 52 | } 53 | RebateAndOddsSituationVO vo = new RebateAndOddsSituationVO(); 54 | BeanUtils.copyProperties(rebateAndOddsSituation, vo); 55 | return vo; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/betting/param/BettingRecordParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.betting.param; 2 | 3 | import javax.validation.constraints.DecimalMin; 4 | import javax.validation.constraints.NotBlank; 5 | import javax.validation.constraints.NotNull; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.betting.domain.BettingRecord; 11 | import me.zohar.lottery.betting.domain.TrackingNumberContent; 12 | import me.zohar.lottery.common.utils.IdUtils; 13 | 14 | /** 15 | * 投注记录入参 16 | * 17 | * @author zohar 18 | * @date 2019年1月6日 19 | * 20 | */ 21 | @Data 22 | public class BettingRecordParam { 23 | 24 | /** 25 | * 游戏玩法代码 26 | */ 27 | @NotBlank 28 | private String gamePlayCode; 29 | 30 | /** 31 | * 所选号码 32 | */ 33 | @NotBlank 34 | private String selectedNo; 35 | 36 | /** 37 | * 注数 38 | */ 39 | @NotNull 40 | @DecimalMin(value = "1", inclusive = true) 41 | private Long bettingCount; 42 | 43 | public BettingRecord convertToPo(Double bettingAmount, Double odds) { 44 | BettingRecord po = new BettingRecord(); 45 | BeanUtils.copyProperties(this, po); 46 | po.setId(IdUtils.getId()); 47 | po.setBettingAmount(bettingAmount); 48 | po.setOdds(odds); 49 | po.setWinningAmount(0d); 50 | po.setProfitAndLoss(-bettingAmount); 51 | return po; 52 | } 53 | 54 | public TrackingNumberContent convertToTrackingNumberContentPo(String trackingNumberOrderId) { 55 | TrackingNumberContent po = new TrackingNumberContent(); 56 | BeanUtils.copyProperties(this, po); 57 | po.setId(IdUtils.getId()); 58 | po.setTrackingNumberOrderId(trackingNumberOrderId); 59 | return po; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/domain/RegisterAmountSetting.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | import org.hibernate.annotations.DynamicInsert; 11 | import org.hibernate.annotations.DynamicUpdate; 12 | import lombok.AllArgsConstructor; 13 | import lombok.Getter; 14 | import lombok.NoArgsConstructor; 15 | import lombok.Setter; 16 | import me.zohar.lottery.common.utils.IdUtils; 17 | 18 | /** 19 | * 注册礼金设置 20 | * 21 | * @author zohar 22 | * @date 2019年3月10日 23 | * 24 | */ 25 | @Getter 26 | @Setter 27 | @AllArgsConstructor 28 | @NoArgsConstructor 29 | @Entity 30 | @Table(name = "register_amount_setting", schema = "lottery") 31 | @DynamicInsert(true) 32 | @DynamicUpdate(true) 33 | public class RegisterAmountSetting { 34 | 35 | /** 36 | * 主键id 37 | */ 38 | @Id 39 | @Column(name = "id", length = 32) 40 | private String id; 41 | 42 | /** 43 | * 启用标识 44 | */ 45 | private Boolean enabled; 46 | 47 | /** 48 | * 注册礼金 49 | */ 50 | private Double registerAmount; 51 | 52 | /** 53 | * 最近修改时间 54 | */ 55 | private Date latelyUpdateTime; 56 | 57 | public void update(Double registerAmount, Boolean enabled) { 58 | this.setRegisterAmount(registerAmount); 59 | this.setEnabled(enabled); 60 | this.setLatelyUpdateTime(new Date()); 61 | } 62 | 63 | public static RegisterAmountSetting build() { 64 | RegisterAmountSetting registerAmount = new RegisterAmountSetting(); 65 | registerAmount.setId(IdUtils.getId()); 66 | return registerAmount; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/rechargewithdraw/param/RechargeOrderParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.rechargewithdraw.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.DecimalMin; 6 | import javax.validation.constraints.NotBlank; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import org.springframework.beans.BeanUtils; 10 | 11 | import cn.hutool.core.date.DateField; 12 | import cn.hutool.core.date.DateUtil; 13 | import lombok.Data; 14 | import me.zohar.lottery.common.utils.IdUtils; 15 | import me.zohar.lottery.constants.Constant; 16 | import me.zohar.lottery.rechargewithdraw.domain.RechargeOrder; 17 | 18 | /** 19 | * 充值订单入参 20 | * 21 | * @author zohar 22 | * @date 2019年1月21日 23 | * 24 | */ 25 | @Data 26 | public class RechargeOrderParam { 27 | 28 | /** 29 | * 充值方式代码 30 | */ 31 | @NotBlank 32 | private String rechargeWayCode; 33 | 34 | /** 35 | * 充值金额 36 | */ 37 | @NotNull 38 | @DecimalMin(value = "0", inclusive = false) 39 | private Double rechargeAmount; 40 | 41 | /** 42 | * 用户账号id 43 | */ 44 | @NotBlank 45 | private String userAccountId; 46 | 47 | /** 48 | * 构建充值订单 49 | * 50 | * @param orderEffectiveDuration 51 | * 订单有效时长 52 | * @return 53 | */ 54 | public RechargeOrder convertToPo(Integer orderEffectiveDuration) { 55 | RechargeOrder po = new RechargeOrder(); 56 | BeanUtils.copyProperties(this, po); 57 | po.setId(IdUtils.getId()); 58 | po.setSubmitTime(new Date()); 59 | po.setUsefulTime(DateUtil.offset(po.getSubmitTime(), DateField.MINUTE, orderEffectiveDuration)); 60 | po.setOrderNo(po.getId()); 61 | po.setOrderState(Constant.充值订单状态_待支付); 62 | return po; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/repo/IssueRepo.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.repo; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 8 | 9 | import me.zohar.lottery.issue.domain.Issue; 10 | 11 | public interface IssueRepo extends JpaRepository, JpaSpecificationExecutor { 12 | 13 | List findByGameCodeAndLotteryDateAndLotteryTimeGreaterThanEqualOrderByLotteryTimeAsc(String gameCode, 14 | Date lotteryDate, Date lotteryTime); 15 | 16 | List findByGameCodeAndLotteryDateOrderByLotteryTimeDesc(String gameCode, Date lotteryDate); 17 | 18 | /** 19 | * 根据游戏,开始时间,结束时间获取开奖结果 20 | * 21 | * @param startTime 22 | * @param endTime 23 | * @return 24 | */ 25 | Issue findTopByGameCodeAndStartTimeLessThanEqualAndEndTimeGreaterThan(String gameCode, Date startTime, 26 | Date endTime); 27 | 28 | Issue findByGameCodeAndIssueNum(String gameCode, Long issueNum); 29 | 30 | Issue findTopByGameCodeAndIssueNumLessThanOrderByIssueNumDesc(String gameCode, Long issueNum); 31 | 32 | List findTop5ByGameCodeAndEndTimeLessThanOrderByIssueNumDesc(String gameCode, Date endTime); 33 | 34 | List findTop50ByGameCodeAndEndTimeLessThanOrderByIssueNumDesc(String gameCode, Date endTime); 35 | 36 | /** 37 | * 获取下一期 38 | * 39 | * @param startTime 40 | * @return 41 | */ 42 | Issue findTopByGameCodeAndStartTimeGreaterThanOrderByLotteryTimeAsc(String gameCode, Date startTime); 43 | 44 | Issue findTopByGameCodeAndEndTimeLessThanEqualOrderByEndTimeDesc(String gameCode, Date now); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/param/AgentOpenAnAccountParam.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.param; 2 | 3 | import java.util.Date; 4 | 5 | import javax.validation.constraints.DecimalMin; 6 | import javax.validation.constraints.NotBlank; 7 | import javax.validation.constraints.NotNull; 8 | import javax.validation.constraints.Pattern; 9 | 10 | import org.springframework.beans.BeanUtils; 11 | 12 | import lombok.Data; 13 | import me.zohar.lottery.common.utils.IdUtils; 14 | import me.zohar.lottery.constants.Constant; 15 | import me.zohar.lottery.useraccount.domain.UserAccount; 16 | 17 | @Data 18 | public class AgentOpenAnAccountParam { 19 | 20 | /** 21 | * 用户名 22 | */ 23 | @NotBlank 24 | @Pattern(regexp = "^[A-Za-z][A-Za-z0-9]{5,11}$") 25 | private String userName; 26 | 27 | /** 28 | * 登录密码 29 | */ 30 | @NotBlank 31 | @Pattern(regexp = "^[A-Za-z][A-Za-z0-9]{5,14}$") 32 | private String loginPwd; 33 | 34 | /** 35 | * 返点 36 | */ 37 | @NotNull 38 | @DecimalMin(value = "0", inclusive = true) 39 | private Double rebate; 40 | 41 | /** 42 | * 赔率 43 | */ 44 | @NotNull 45 | @DecimalMin(value = "0", inclusive = true) 46 | private Double odds; 47 | 48 | /** 49 | * 邀请人账号id 50 | */ 51 | @NotBlank 52 | private String inviterId; 53 | 54 | public UserAccount convertToPo(Integer accountLevel) { 55 | UserAccount po = new UserAccount(); 56 | BeanUtils.copyProperties(this, po); 57 | po.setId(IdUtils.getId()); 58 | po.setAccountType(Constant.账号类型_代理); 59 | po.setAccountLevel(accountLevel); 60 | po.setMoneyPwd(po.getLoginPwd()); 61 | po.setBalance(0d); 62 | po.setState(Constant.账号状态_启用); 63 | po.setRegisteredTime(new Date()); 64 | return po; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /lottery-admin/src/main/java/me/zohar/lottery/config/security/UserAccountDetails.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.util.Collection; 4 | 5 | import org.springframework.security.core.GrantedAuthority; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | 8 | import me.zohar.lottery.useraccount.vo.LoginAccountInfoVO; 9 | 10 | public class UserAccountDetails implements UserDetails { 11 | 12 | /** 13 | * 14 | */ 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String id; 18 | 19 | private String userName; 20 | 21 | private String loginPwd; 22 | 23 | public UserAccountDetails(LoginAccountInfoVO loginAccountInfo) { 24 | if (loginAccountInfo != null) { 25 | this.id = loginAccountInfo.getId(); 26 | this.userName = loginAccountInfo.getUserName(); 27 | this.loginPwd = loginAccountInfo.getLoginPwd(); 28 | } 29 | } 30 | 31 | /** 32 | * 获取登陆用户账号id 33 | * 34 | * @return 35 | */ 36 | public String getUserAccountId() { 37 | return this.id; 38 | } 39 | 40 | @Override 41 | public Collection getAuthorities() { 42 | return null; 43 | } 44 | 45 | @Override 46 | public String getPassword() { 47 | return this.loginPwd; 48 | } 49 | 50 | @Override 51 | public String getUsername() { 52 | return this.userName; 53 | } 54 | 55 | @Override 56 | public boolean isAccountNonExpired() { 57 | return true; 58 | } 59 | 60 | @Override 61 | public boolean isAccountNonLocked() { 62 | return true; 63 | } 64 | 65 | @Override 66 | public boolean isCredentialsNonExpired() { 67 | return true; 68 | } 69 | 70 | @Override 71 | public boolean isEnabled() { 72 | return true; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/dictconfig/domain/DictItem.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.dictconfig.domain; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.ConstraintMode; 5 | import javax.persistence.Entity; 6 | import javax.persistence.FetchType; 7 | import javax.persistence.ForeignKey; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.ManyToOne; 11 | import javax.persistence.Table; 12 | import javax.persistence.Version; 13 | 14 | import org.hibernate.annotations.DynamicInsert; 15 | import org.hibernate.annotations.DynamicUpdate; 16 | 17 | import lombok.Getter; 18 | import lombok.Setter; 19 | 20 | /** 21 | * 字典项 22 | * 23 | * @author zohar 24 | * @date 2019年1月19日 25 | * 26 | */ 27 | @Getter 28 | @Setter 29 | @Entity 30 | @Table(name = "dict_item") 31 | @DynamicInsert(true) 32 | @DynamicUpdate(true) 33 | public class DictItem { 34 | 35 | /** 36 | * 主键id 37 | */ 38 | @Id 39 | @Column(name = "id", length = 32) 40 | private String id; 41 | 42 | /** 43 | * 字典项code 44 | */ 45 | private String dictItemCode; 46 | 47 | /** 48 | * 字典项名称 49 | */ 50 | private String dictItemName; 51 | 52 | /** 53 | * 排序号 54 | */ 55 | private Double orderNo; 56 | 57 | /** 58 | * 乐观锁版本号 59 | */ 60 | @Version 61 | private Long version; 62 | 63 | /** 64 | * 所属字典类型id 65 | */ 66 | @Column(name = "dict_type_id", length = 32) 67 | private String dictTypeId; 68 | 69 | /** 70 | * 所属字典类型 71 | */ 72 | @ManyToOne(fetch = FetchType.LAZY) 73 | @JoinColumn(name = "dict_type_id", updatable = false, insertable = false, foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT)) 74 | private DictType dictType; 75 | 76 | } 77 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/mastercontrol/domain/InviteRegisterSetting.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.mastercontrol.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | import org.hibernate.annotations.DynamicInsert; 11 | import org.hibernate.annotations.DynamicUpdate; 12 | 13 | import lombok.AllArgsConstructor; 14 | import lombok.Getter; 15 | import lombok.NoArgsConstructor; 16 | import lombok.Setter; 17 | import me.zohar.lottery.common.utils.IdUtils; 18 | 19 | /** 20 | * 邀请注册设置 21 | * 22 | * @author zohar 23 | * @date 2019年3月12日 24 | * 25 | */ 26 | @Getter 27 | @Setter 28 | @AllArgsConstructor 29 | @NoArgsConstructor 30 | @Entity 31 | @Table(name = "invite_register_setting", schema = "lottery") 32 | @DynamicInsert(true) 33 | @DynamicUpdate(true) 34 | public class InviteRegisterSetting { 35 | 36 | /** 37 | * 主键id 38 | */ 39 | @Id 40 | @Column(name = "id", length = 32) 41 | private String id; 42 | 43 | /** 44 | * 邀请码有效时长 45 | */ 46 | private Integer effectiveDuration; 47 | 48 | /** 49 | * 启用标识 50 | */ 51 | private Boolean enabled; 52 | 53 | /** 54 | * 最近修改时间 55 | */ 56 | private Date latelyUpdateTime; 57 | 58 | public void update(Integer effectiveDuration, Boolean enabled) { 59 | this.setEffectiveDuration(effectiveDuration); 60 | this.setEnabled(enabled); 61 | this.setLatelyUpdateTime(new Date()); 62 | } 63 | 64 | public static InviteRegisterSetting build() { 65 | InviteRegisterSetting registerAmount = new InviteRegisterSetting(); 66 | registerAmount.setId(IdUtils.getId()); 67 | return registerAmount; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /lottery-web/src/main/java/me/zohar/lottery/config/security/UserAccountDetails.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.util.Collection; 4 | 5 | import org.springframework.security.core.GrantedAuthority; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | 8 | import me.zohar.lottery.useraccount.vo.LoginAccountInfoVO; 9 | 10 | public class UserAccountDetails implements UserDetails { 11 | 12 | /** 13 | * 14 | */ 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String id; 18 | 19 | private String userName; 20 | 21 | private String loginPwd; 22 | 23 | public UserAccountDetails(LoginAccountInfoVO loginAccountInfo) { 24 | if (loginAccountInfo != null) { 25 | this.id = loginAccountInfo.getId(); 26 | this.userName = loginAccountInfo.getUserName(); 27 | this.loginPwd = loginAccountInfo.getLoginPwd(); 28 | } 29 | } 30 | 31 | /** 32 | * 获取登陆用户账号id 33 | * 34 | * @return 35 | */ 36 | public String getUserAccountId() { 37 | return this.id; 38 | } 39 | 40 | @Override 41 | public Collection getAuthorities() { 42 | return null; 43 | } 44 | 45 | @Override 46 | public String getPassword() { 47 | return this.loginPwd; 48 | } 49 | 50 | @Override 51 | public String getUsername() { 52 | return this.userName; 53 | } 54 | 55 | @Override 56 | public boolean isAccountNonExpired() { 57 | return true; 58 | } 59 | 60 | @Override 61 | public boolean isAccountNonLocked() { 62 | return true; 63 | } 64 | 65 | @Override 66 | public boolean isCredentialsNonExpired() { 67 | return true; 68 | } 69 | 70 | @Override 71 | public boolean isEnabled() { 72 | return true; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/config/security/AuthenticationSuccessHandler.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.security.core.Authentication; 12 | import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; 13 | import org.springframework.stereotype.Component; 14 | 15 | import com.alibaba.fastjson.JSONObject; 16 | 17 | import me.zohar.lottery.common.vo.Result; 18 | import me.zohar.lottery.useraccount.service.UserAccountService; 19 | 20 | /** 21 | * 登录成功处理类 22 | * 23 | * @author zohar 24 | * @date 2019年1月23日 25 | * 26 | */ 27 | @Component 28 | public class AuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { 29 | 30 | @Autowired 31 | private UserAccountService userAccountService; 32 | 33 | @Override 34 | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, 35 | Authentication authentication) throws IOException, ServletException { 36 | UserAccountDetails user = (UserAccountDetails) authentication.getPrincipal(); 37 | userAccountService.updateLatelyLoginTime(user.getUserAccountId()); 38 | 39 | response.setCharacterEncoding("UTF-8"); 40 | response.setContentType("application/json"); 41 | PrintWriter out = response.getWriter(); 42 | out.println(JSONObject.toJSONString(Result.success().setMsg("登录成功"))); 43 | out.flush(); 44 | out.close(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lottery-mobile/src/main/java/me/zohar/lottery/config/security/UserAccountDetails.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.config.security; 2 | 3 | import java.util.Collection; 4 | 5 | import org.springframework.security.core.GrantedAuthority; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | 8 | import me.zohar.lottery.useraccount.vo.LoginAccountInfoVO; 9 | 10 | public class UserAccountDetails implements UserDetails { 11 | 12 | /** 13 | * 14 | */ 15 | private static final long serialVersionUID = 1L; 16 | 17 | private String id; 18 | 19 | private String userName; 20 | 21 | private String loginPwd; 22 | 23 | public UserAccountDetails(LoginAccountInfoVO loginAccountInfo) { 24 | if (loginAccountInfo != null) { 25 | this.id = loginAccountInfo.getId(); 26 | this.userName = loginAccountInfo.getUserName(); 27 | this.loginPwd = loginAccountInfo.getLoginPwd(); 28 | } 29 | } 30 | 31 | /** 32 | * 获取登陆用户账号id 33 | * 34 | * @return 35 | */ 36 | public String getUserAccountId() { 37 | return this.id; 38 | } 39 | 40 | @Override 41 | public Collection getAuthorities() { 42 | return null; 43 | } 44 | 45 | @Override 46 | public String getPassword() { 47 | return this.loginPwd; 48 | } 49 | 50 | @Override 51 | public String getUsername() { 52 | return this.userName; 53 | } 54 | 55 | @Override 56 | public boolean isAccountNonExpired() { 57 | return true; 58 | } 59 | 60 | @Override 61 | public boolean isAccountNonLocked() { 62 | return true; 63 | } 64 | 65 | @Override 66 | public boolean isCredentialsNonExpired() { 67 | return true; 68 | } 69 | 70 | @Override 71 | public boolean isEnabled() { 72 | return true; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/agent/vo/InviteCodeDetailsInfoVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.agent.vo; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; 8 | 9 | import lombok.Data; 10 | import me.zohar.lottery.agent.domain.InviteCode; 11 | import me.zohar.lottery.dictconfig.ConfigHolder; 12 | 13 | @Data 14 | public class InviteCodeDetailsInfoVO { 15 | 16 | /** 17 | * 主键id 18 | */ 19 | private String id; 20 | 21 | /** 22 | * 邀请码 23 | */ 24 | private String code; 25 | 26 | /** 27 | * 账号类型 28 | */ 29 | private String accountType; 30 | 31 | /** 32 | * 返点 33 | */ 34 | private Double rebate; 35 | 36 | /** 37 | * 赔率 38 | */ 39 | private Double odds; 40 | 41 | /** 42 | * 创建时间 43 | */ 44 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 45 | private Date createTime; 46 | 47 | /** 48 | * 有效期 49 | */ 50 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 51 | private Date periodOfValidity; 52 | 53 | private String inviterId; 54 | 55 | /** 56 | * 有效标识 57 | */ 58 | private Boolean validFlag; 59 | 60 | /** 61 | * 邀请注册链接 62 | */ 63 | private String inviteRegisterLink; 64 | 65 | public static InviteCodeDetailsInfoVO convertFor(InviteCode inviteCode) { 66 | if (inviteCode == null) { 67 | return null; 68 | } 69 | InviteCodeDetailsInfoVO vo = new InviteCodeDetailsInfoVO(); 70 | BeanUtils.copyProperties(inviteCode, vo); 71 | vo.setValidFlag(vo.getPeriodOfValidity().getTime() > new Date().getTime()); 72 | vo.setInviteRegisterLink(ConfigHolder.getConfigValue("register.inviteRegisterLink") + vo.getCode()); 73 | return vo; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /lottery-api/src/main/java/me/zohar/lottery/issue/vo/IssueGenerateRuleVO.java: -------------------------------------------------------------------------------- 1 | package me.zohar.lottery.issue.vo; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | import cn.hutool.core.collection.CollectionUtil; 10 | import lombok.AllArgsConstructor; 11 | import lombok.Data; 12 | import lombok.NoArgsConstructor; 13 | import me.zohar.lottery.issue.domain.IssueGenerateRule; 14 | 15 | @Data 16 | @AllArgsConstructor 17 | @NoArgsConstructor 18 | public class IssueGenerateRuleVO { 19 | 20 | /** 21 | * 主键id 22 | */ 23 | private String id; 24 | 25 | /** 26 | * 开始时间(时分,如10:00) 27 | */ 28 | private String startTime; 29 | 30 | /** 31 | * 时间间隔(分钟) 32 | */ 33 | private Integer timeInterval; 34 | 35 | /** 36 | * 期数 37 | */ 38 | private Integer issueCount; 39 | 40 | /** 41 | * 排序号 42 | */ 43 | private Double orderNo; 44 | 45 | /** 46 | * 对应期号设置id 47 | */ 48 | private String issueSettingId; 49 | 50 | public static List convertFor(Collection issueGenerateRules) { 51 | if (CollectionUtil.isEmpty(issueGenerateRules)) { 52 | return new ArrayList<>(); 53 | } 54 | List vos = new ArrayList<>(); 55 | for (IssueGenerateRule issueGenerateRule : issueGenerateRules) { 56 | vos.add(convertFor(issueGenerateRule)); 57 | } 58 | return vos; 59 | } 60 | 61 | public static IssueGenerateRuleVO convertFor(IssueGenerateRule issueGenerateRule) { 62 | if (issueGenerateRule == null) { 63 | return null; 64 | } 65 | IssueGenerateRuleVO vo = new IssueGenerateRuleVO(); 66 | BeanUtils.copyProperties(issueGenerateRule, vo); 67 | return vo; 68 | } 69 | 70 | } 71 | --------------------------------------------------------------------------------