├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── src ├── main │ ├── resources │ │ ├── banner.jpg │ │ ├── static │ │ │ ├── assets │ │ │ │ ├── images │ │ │ │ │ ├── ok.gif │ │ │ │ │ ├── caret.png │ │ │ │ │ ├── close.png │ │ │ │ │ ├── icons.gif │ │ │ │ │ ├── icons.png │ │ │ │ │ ├── pop-bg.png │ │ │ │ │ ├── spacer.gif │ │ │ │ │ └── videologo.gif │ │ │ │ ├── img │ │ │ │ │ └── bg-img.jpg │ │ │ │ ├── icon │ │ │ │ │ └── common.jpg │ │ │ │ ├── dialogs │ │ │ │ │ ├── emotion │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ ├── 0.gif │ │ │ │ │ │ │ ├── bface.gif │ │ │ │ │ │ │ ├── cface.gif │ │ │ │ │ │ │ ├── fface.gif │ │ │ │ │ │ │ ├── tface.gif │ │ │ │ │ │ │ ├── wface.gif │ │ │ │ │ │ │ ├── yface.gif │ │ │ │ │ │ │ ├── jxface2.gif │ │ │ │ │ │ │ └── neweditor-tab-bg.png │ │ │ │ │ │ └── emotion.css │ │ │ │ │ ├── image │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ ├── close.png │ │ │ │ │ │ │ ├── upload1.png │ │ │ │ │ │ │ └── upload2.png │ │ │ │ │ │ └── image.css │ │ │ │ │ ├── formula │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ └── formula.png │ │ │ │ │ │ ├── formula.css │ │ │ │ │ │ └── formula.js │ │ │ │ │ ├── video │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ ├── center_focus.jpg │ │ │ │ │ │ │ ├── left_focus.jpg │ │ │ │ │ │ │ ├── none_focus.jpg │ │ │ │ │ │ │ └── right_focus.jpg │ │ │ │ │ │ └── video.css │ │ │ │ │ ├── link │ │ │ │ │ │ └── link.js │ │ │ │ │ └── map │ │ │ │ │ │ └── map.html │ │ │ │ ├── font-awesome │ │ │ │ │ └── fonts │ │ │ │ │ │ ├── FontAwesome.otf │ │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ │ ├── umeditor │ │ │ │ │ ├── dialogs │ │ │ │ │ │ ├── emotion │ │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ │ ├── 0.gif │ │ │ │ │ │ │ │ ├── bface.gif │ │ │ │ │ │ │ │ ├── cface.gif │ │ │ │ │ │ │ │ ├── fface.gif │ │ │ │ │ │ │ │ ├── tface.gif │ │ │ │ │ │ │ │ ├── wface.gif │ │ │ │ │ │ │ │ ├── yface.gif │ │ │ │ │ │ │ │ ├── jxface2.gif │ │ │ │ │ │ │ │ └── neweditor-tab-bg.png │ │ │ │ │ │ │ └── emotion.css │ │ │ │ │ │ ├── image │ │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ │ ├── close.png │ │ │ │ │ │ │ │ ├── upload1.png │ │ │ │ │ │ │ │ └── upload2.png │ │ │ │ │ │ │ └── image.css │ │ │ │ │ │ ├── formula │ │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ │ └── formula.png │ │ │ │ │ │ │ ├── formula.css │ │ │ │ │ │ │ └── formula.js │ │ │ │ │ │ ├── video │ │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ │ ├── left_focus.jpg │ │ │ │ │ │ │ │ ├── none_focus.jpg │ │ │ │ │ │ │ │ ├── center_focus.jpg │ │ │ │ │ │ │ │ └── right_focus.jpg │ │ │ │ │ │ │ └── video.css │ │ │ │ │ │ ├── link │ │ │ │ │ │ │ └── link.js │ │ │ │ │ │ └── map │ │ │ │ │ │ │ └── map.html │ │ │ │ │ └── zh-cn.js │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regulard41d.eot │ │ │ │ ├── materialize │ │ │ │ │ └── fonts │ │ │ │ │ │ └── roboto │ │ │ │ │ │ ├── Roboto-Bold.eot │ │ │ │ │ │ ├── Roboto-Bold.ttf │ │ │ │ │ │ ├── Roboto-Bold.woff │ │ │ │ │ │ ├── Roboto-Bold.woff2 │ │ │ │ │ │ ├── Roboto-Light.eot │ │ │ │ │ │ ├── Roboto-Light.ttf │ │ │ │ │ │ ├── Roboto-Light.woff │ │ │ │ │ │ ├── Roboto-Medium.eot │ │ │ │ │ │ ├── Roboto-Medium.ttf │ │ │ │ │ │ ├── Roboto-Thin.eot │ │ │ │ │ │ ├── Roboto-Thin.ttf │ │ │ │ │ │ ├── Roboto-Thin.woff │ │ │ │ │ │ ├── Roboto-Thin.woff2 │ │ │ │ │ │ ├── Roboto-Light.woff2 │ │ │ │ │ │ ├── Roboto-Medium.woff │ │ │ │ │ │ ├── Roboto-Medium.woff2 │ │ │ │ │ │ ├── Roboto-Regular.eot │ │ │ │ │ │ ├── Roboto-Regular.ttf │ │ │ │ │ │ ├── Roboto-Regular.woff │ │ │ │ │ │ └── Roboto-Regular.woff2 │ │ │ │ └── js │ │ │ │ │ ├── morris │ │ │ │ │ └── morris-0.4.3.min.css │ │ │ │ │ ├── easypiechart-data.js │ │ │ │ │ ├── jquery.metisMenu.js │ │ │ │ │ ├── Lightweight-Chart │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.html │ │ │ │ │ └── index - Copy.html │ │ │ │ │ ├── chart-data.js │ │ │ │ │ └── dataTables │ │ │ │ │ └── dataTables.bootstrap.css │ │ │ ├── um.html │ │ │ ├── modelTest.html │ │ │ └── login.html │ │ ├── emailConfig.properties │ │ ├── templates │ │ │ ├── 404.html │ │ │ ├── hello.html │ │ │ └── login.html │ │ └── application.properties │ └── java │ │ └── cn │ │ └── lger │ │ ├── exception │ │ ├── IdNotFoundException.java │ │ ├── BalanceNotEnoughException.java │ │ ├── IntegralNotEnoughException.java │ │ ├── GiftNumberNotEnoughException.java │ │ └── CommodityNumberNotEnoughException.java │ │ ├── util │ │ ├── UUIDRandomUtil.java │ │ ├── MemberNumberRandomUtil.java │ │ └── FileUploadUtil.java │ │ ├── dao │ │ ├── CommodityDao.java │ │ ├── AdminDao.java │ │ ├── TransactionRecordDao.java │ │ ├── ExchangeRecordDao.java │ │ ├── MemberGradeDao.java │ │ ├── GiftDao.java │ │ └── MemberDao.java │ │ ├── domain │ │ ├── AdminRole.java │ │ ├── ExchangeRecord.java │ │ ├── TransactionRecord.java │ │ ├── Gift.java │ │ ├── MemberGrade.java │ │ ├── Admin.java │ │ ├── Commodity.java │ │ └── Member.java │ │ ├── ServletInitializer.java │ │ ├── service │ │ ├── AdminService.java │ │ ├── TransactionRecordService.java │ │ ├── ExchangeRecordService.java │ │ ├── MemberGradeService.java │ │ ├── GiftService.java │ │ ├── MemberService.java │ │ └── CommodityService.java │ │ ├── MembershipApplication.java │ │ ├── web │ │ ├── LoginController.java │ │ ├── TransactionRecordController.java │ │ ├── ExchangeRecordController.java │ │ ├── MemberGradeController.java │ │ ├── CommodityController.java │ │ ├── BirthdayWarningController.java │ │ ├── GiftController.java │ │ ├── AdminController.java │ │ └── MemberController.java │ │ └── security │ │ ├── CustomerUserDetailsService.java │ │ ├── CustomerLoginSuccessHandler.java │ │ ├── SecurityConfig.java │ │ └── CustomerUserDetails.java └── test │ └── java │ └── cn │ └── lger │ ├── util │ ├── TestDateRandom.java │ └── TestParseTime.java │ ├── MembershipApplicationTests.java │ └── dao │ ├── TestRandom.java │ ├── TestMemberGradeDao.java │ ├── TestAdminDao.java │ ├── TestTransactionRecordDao.java │ └── TestMemberDao.java ├── .gitignore ├── README.md ├── membership.uml ├── pom.xml └── mvnw.cmd /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/banner.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/ok.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/ok.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/img/bg-img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/img/bg-img.jpg -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip 2 | -------------------------------------------------------------------------------- /src/main/resources/emailConfig.properties: -------------------------------------------------------------------------------- 1 | email.account=XXXXXXX@163.com 2 | email.password=XXXXXXX 3 | email.smtp=smtp.163.com 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/icon/common.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/icon/common.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/caret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/caret.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/close.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/icons.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/icons.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/pop-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/pop-bg.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/spacer.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/images/videologo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/images/videologo.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/0.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/bface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/bface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/cface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/cface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/fface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/fface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/tface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/tface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/wface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/wface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/yface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/yface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/image/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/image/images/close.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/image/images/upload1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/image/images/upload1.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/image/images/upload2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/image/images/upload2.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/jxface2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/jxface2.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/formula/images/formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/formula/images/formula.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/video/images/center_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/video/images/center_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/video/images/left_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/video/images/left_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/video/images/none_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/video/images/none_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/video/images/right_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/video/images/right_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/0.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/image/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/image/images/close.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/assets/fonts/glyphicons-halflings-regulard41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/fonts/glyphicons-halflings-regulard41d.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.woff -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Bold.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.woff -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.woff -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Thin.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/bface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/bface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/cface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/cface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/fface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/fface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/tface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/tface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/wface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/wface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/yface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/yface.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/image/images/upload1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/image/images/upload1.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/image/images/upload2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/image/images/upload2.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/images/neweditor-tab-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/dialogs/emotion/images/neweditor-tab-bg.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Light.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.woff -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Medium.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.eot -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.woff -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/jxface2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/jxface2.gif -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/formula/images/formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/formula/images/formula.png -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/video/images/left_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/video/images/left_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/video/images/none_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/video/images/none_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/templates/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 404 6 | 7 | 8 | 404 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/materialize/fonts/roboto/Roboto-Regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/video/images/center_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/video/images/center_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/video/images/right_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/video/images/right_focus.jpg -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/images/neweditor-tab-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Pro/membership/HEAD/src/main/resources/static/assets/umeditor/dialogs/emotion/images/neweditor-tab-bg.png -------------------------------------------------------------------------------- /src/main/java/cn/lger/exception/IdNotFoundException.java: -------------------------------------------------------------------------------- 1 | package cn.lger.exception; 2 | 3 | /** 4 | * Code that Changed the World 5 | * Pro said 6 | * Created by Pro on 2017-12-17. 7 | */ 8 | public class IdNotFoundException extends RuntimeException{ 9 | 10 | public IdNotFoundException(){ 11 | super("id找不到"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ -------------------------------------------------------------------------------- /src/main/java/cn/lger/exception/BalanceNotEnoughException.java: -------------------------------------------------------------------------------- 1 | package cn.lger.exception; 2 | 3 | /** 4 | * Code that Changed the World 5 | * Pro said 6 | * Created by Pro on 2017-12-17. 7 | */ 8 | public class BalanceNotEnoughException extends RuntimeException{ 9 | 10 | public BalanceNotEnoughException(){ 11 | super("余额不足"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/exception/IntegralNotEnoughException.java: -------------------------------------------------------------------------------- 1 | package cn.lger.exception; 2 | 3 | /** 4 | * Code that Changed the World 5 | * Pro said 6 | * Created by Pro on 2017-12-17. 7 | */ 8 | public class IntegralNotEnoughException extends RuntimeException{ 9 | 10 | public IntegralNotEnoughException(){ 11 | super("账户积分不足"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/exception/GiftNumberNotEnoughException.java: -------------------------------------------------------------------------------- 1 | package cn.lger.exception; 2 | 3 | /** 4 | * Code that Changed the World 5 | * Pro said 6 | * Created by Pro on 2017-12-17. 7 | */ 8 | public class GiftNumberNotEnoughException extends RuntimeException{ 9 | 10 | public GiftNumberNotEnoughException(){ 11 | super("礼品数量不足"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/test/java/cn/lger/util/TestDateRandom.java: -------------------------------------------------------------------------------- 1 | package cn.lger.util; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * Code that Changed the World 7 | * Pro said 8 | * Created by Pro on 2017-12-15. 9 | */ 10 | public class TestDateRandom { 11 | 12 | @Test 13 | public void test01() { 14 | System.out.println(MemberNumberRandomUtil.randomMemberNumber() ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/exception/CommodityNumberNotEnoughException.java: -------------------------------------------------------------------------------- 1 | package cn.lger.exception; 2 | 3 | /** 4 | * Code that Changed the World 5 | * Pro said 6 | * Created by Pro on 2017-12-17. 7 | */ 8 | public class CommodityNumberNotEnoughException extends RuntimeException{ 9 | 10 | public CommodityNumberNotEnoughException(){ 11 | super("商品数量不足"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/util/UUIDRandomUtil.java: -------------------------------------------------------------------------------- 1 | package cn.lger.util; 2 | 3 | import java.util.UUID; 4 | 5 | /** 6 | * Code that Changed the World 7 | * Pro said 8 | * Created by Pro on 2017-12-15. 9 | */ 10 | public class UUIDRandomUtil { 11 | 12 | public static String get32UUID() { 13 | return UUID.randomUUID().toString().trim().replaceAll("-", ""); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/cn/lger/MembershipApplicationTests.java: -------------------------------------------------------------------------------- 1 | package cn.lger; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class MembershipApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/dao/CommodityDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.Commodity; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * Code that Changed the World 9 | * Pro said 10 | * Created by Pro on 2017-12-17. 11 | */ 12 | @Repository 13 | public interface CommodityDao extends JpaRepository{ 14 | 15 | Commodity findCommodityById(String id); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/morris/morris-0.4.3.min.css: -------------------------------------------------------------------------------- 1 | .morris-hover{position:absolute;z-index:1000;}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255, 255, 255, 0.8);border:solid 2px rgba(230, 230, 230, 0.8);font-family:sans-serif;font-size:12px;text-align:center;}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0;} 2 | .morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0;} -------------------------------------------------------------------------------- /src/test/java/cn/lger/dao/TestRandom.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.Random; 6 | 7 | /** 8 | * Code that Changed the World 9 | * Pro said 10 | * Created by Pro on 2017-12-19. 11 | */ 12 | public class TestRandom { 13 | 14 | @Test 15 | public void test01(){ 16 | Random random = new Random(); 17 | for (int i = 0; i <= 100; i++){ 18 | System.out.println(random.nextInt(100)); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/AdminRole.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | /** 4 | * Code that Changed the World 5 | * Pro said 6 | * Created by Pro on 2017-12-13. 7 | */ 8 | public enum AdminRole { 9 | //超级管理员,super 10 | S_ADMIN("S_ADMIN"), 11 | //普通管理员,general 12 | G_ADMIN("G_ADMIN"); 13 | 14 | private String role; 15 | 16 | AdminRole(String role){ 17 | this.role = role; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return role; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/dao/AdminDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.Admin; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | /** 8 | * Code that Changed the World 9 | * Pro said 10 | * Created by Pro on 2017-12-13. 11 | */ 12 | @Repository 13 | public interface AdminDao extends JpaRepository{ 14 | 15 | Admin findByUsernameAndPassword(String username, String password); 16 | 17 | Admin findAdminByUsername(String username); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package cn.lger; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | /** 7 | * Code that Changed the World 8 | * Pro said 9 | * Created by Pro on 2017-12-20. 10 | */ 11 | public class ServletInitializer extends SpringBootServletInitializer { 12 | 13 | @Override 14 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 15 | return application.sources(MembershipApplication.class); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/cn/lger/util/TestParseTime.java: -------------------------------------------------------------------------------- 1 | package cn.lger.util; 2 | 3 | import org.junit.Test; 4 | 5 | import java.time.LocalDate; 6 | 7 | /** 8 | * Code that Changed the World 9 | * Pro said 10 | * Created by Pro on 2017-12-15. 11 | */ 12 | public class TestParseTime { 13 | 14 | @Test 15 | public void test01(){ 16 | System.out.println(LocalDate.parse("2017-11-01")); 17 | } 18 | 19 | @Test 20 | public void test02(){ 21 | int month = LocalDate.now().getMonthValue(); 22 | int day = LocalDate.now().getDayOfMonth(); 23 | System.out.println(month+"-"+day); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.service; 2 | 3 | import cn.lger.dao.AdminDao; 4 | import cn.lger.domain.Admin; 5 | import org.springframework.stereotype.Service; 6 | 7 | import javax.annotation.Resource; 8 | 9 | /** 10 | * Code that Changed the World 11 | * Pro said 12 | * Created by Pro on 2017-12-19. 13 | */ 14 | @Service 15 | public class AdminService { 16 | 17 | @Resource 18 | private AdminDao adminDao; 19 | 20 | public Admin findAdminByUsernameAndPassword(String username, String password){ 21 | return adminDao.findByUsernameAndPassword(username, password); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 简易应用——Spring Boot会员管理系统 2 | 3 | 包含功能: 4 | 5 | - 会员管理:主要为管理员提供了添加、查询、状态修改(这里有正常、挂失、停用)、会员消费、会员注销功能; 6 | - 商品消费:提供了添加、修改、购买、查询积分记录等功能; 7 | - 礼品消费:礼品设置、数量修改、兑换记录查询等功能; 8 | - 积分抽奖:通过管理员设置抽奖积分然后随机分配给一位会员; 9 | - 生日提醒:通过富文本编辑器提供人性化的邮件提醒服务; 10 | 11 | tips: 12 | - 本项目使用从Spring Boot1.5.9修改到了Spring Boot2.0.0 13 | - 摒弃自定义过滤器设置登录,改用Spring Security 14 | 15 | 16 | 升级后部分修改: 17 | - 加入Spring Security框架 18 | - 部分Dao方法不能使用,比如findById返回对象由实体对象改为为Optional对象 19 | - 修改部分bug,如:会员状态无法修改情况 20 | 21 | 22 | 默认密码都是123,登录名为 admin || 123 23 | 24 | 项目导入运行步骤可以前往博客文章[CSDN](http://blog.csdn.net/lger_pro/article/details/79181044)或[cnblogs](https://www.cnblogs.com/lger/p/8366320.html) -------------------------------------------------------------------------------- /src/main/java/cn/lger/util/MemberNumberRandomUtil.java: -------------------------------------------------------------------------------- 1 | package cn.lger.util; 2 | 3 | import java.text.SimpleDateFormat; 4 | 5 | /** 6 | * Code that Changed the World 7 | * Pro said 8 | * Created by Pro on 2017-12-15. 9 | */ 10 | public class MemberNumberRandomUtil { 11 | 12 | public static SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmssSS"); 13 | 14 | public synchronized static String randomMemberNumber(){ 15 | try { 16 | Thread.sleep(1); 17 | } catch (InterruptedException e) { 18 | e.printStackTrace(); 19 | } 20 | return date.format(System.currentTimeMillis()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/easypiechart-data.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $('#easypiechart-teal').easyPieChart({ 3 | scaleColor: false, 4 | barColor: '#1ebfae' 5 | }); 6 | }); 7 | 8 | $(function() { 9 | $('#easypiechart-orange').easyPieChart({ 10 | scaleColor: false, 11 | barColor: '#ffb53e' 12 | }); 13 | }); 14 | 15 | $(function() { 16 | $('#easypiechart-red').easyPieChart({ 17 | scaleColor: false, 18 | barColor: '#f9243f' 19 | }); 20 | }); 21 | 22 | $(function() { 23 | $('#easypiechart-blue').easyPieChart({ 24 | scaleColor: false, 25 | barColor: '#30a5ff' 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/dao/TransactionRecordDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.TransactionRecord; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.stereotype.Repository; 8 | 9 | /** 10 | * Code that Changed the World 11 | * Pro said 12 | * Created by Pro on 2017-12-17. 13 | */ 14 | @Repository 15 | public interface TransactionRecordDao extends JpaRepository{ 16 | 17 | Page findAll(Pageable pageable); 18 | 19 | Page findAllByMemberId(Pageable pageable, String memberId); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | debug=true 3 | spring.datasource.url=jdbc:mysql://localhost:3306/db_membership 4 | spring.datasource.username=root 5 | spring.datasource.password=root 6 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 7 | 8 | spring.thymeleaf.prefix=classpath:/templates/ 9 | spring.thymeleaf.suffix=.html 10 | spring.thymeleaf.cache=false 11 | spring.thymeleaf.mode=LEGACYHTML5 12 | 13 | spring.jpa.show-sql=true 14 | spring.jpa.hibernate.ddl-auto=update 15 | 16 | #spring.mvc.static-path-pattern=/static/** 17 | #logging.level.org.springframework.security = debug 18 | #logging.level.org.springframework.security.web = warn 19 | #logging.level.org.springframework.web = warn 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/dao/ExchangeRecordDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.ExchangeRecord; 4 | import cn.lger.domain.TransactionRecord; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | import org.springframework.stereotype.Repository; 9 | 10 | /** 11 | * Code that Changed the World 12 | * Pro said 13 | * Created by Pro on 2017-12-17. 14 | */ 15 | @Repository 16 | public interface ExchangeRecordDao extends JpaRepository{ 17 | 18 | Page findAll(Pageable pageable); 19 | 20 | Page findAllByMemberId(Pageable pageable, String memberId); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/dao/MemberGradeDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.MemberGrade; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Query; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Code that Changed the World 13 | * Pro said 14 | * Created by Pro on 2017-12-06. 15 | */ 16 | public interface MemberGradeDao extends JpaRepository { 17 | 18 | MemberGrade findMemberGradeById(Integer id); 19 | 20 | List findMemberGradeByGradeName(String gradeName); 21 | 22 | Page findAll(Pageable pageable); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/dao/GiftDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.Gift; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.jpa.repository.Modifying; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import javax.transaction.Transactional; 10 | 11 | /** 12 | * Code that Changed the World 13 | * Pro said 14 | * Created by Pro on 2017-12-17. 15 | */ 16 | @Repository 17 | public interface GiftDao extends JpaRepository{ 18 | 19 | @Modifying 20 | @Transactional 21 | @Query("update Gift gift set gift.giftNumber = ?2 where gift.id = ?1") 22 | void updateGiftNumberById(Integer giftId, Integer giftNumber); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/templates/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | hello 10 | hahaha 11 |

12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Settings 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/MembershipApplication.java: -------------------------------------------------------------------------------- 1 | package cn.lger; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.ServletComponentScan; 6 | import org.springframework.context.annotation.PropertySource; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | @SpringBootApplication 11 | //@ServletComponentScan 去掉该注解后filter登录验证无效 12 | @Controller 13 | public class MembershipApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(MembershipApplication.class, args); 17 | } 18 | 19 | @RequestMapping("/") 20 | public String index() { 21 | return "index"; 22 | } 23 | 24 | @RequestMapping("/home") 25 | public String home() { 26 | return "index"; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/resources/static/um.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Home 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |

图片上传和视频上传功能未做,请使用其他功能测试

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/test/java/cn/lger/dao/TestMemberGradeDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.MemberGrade; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.junit4.SpringRunner; 8 | 9 | import javax.annotation.Resource; 10 | 11 | /** 12 | * Code that Changed the World 13 | * Pro said 14 | * Created by Pro on 2017-12-16. 15 | */ 16 | @SpringBootTest 17 | @RunWith(SpringRunner.class) 18 | public class TestMemberGradeDao { 19 | 20 | @Resource 21 | private MemberGradeDao memberGradeDao; 22 | 23 | /** 24 | * 测试取出数据改变后数据库中的数据是否改变 25 | */ 26 | @Test 27 | public void test01(){ 28 | MemberGrade memberGrade = memberGradeDao.findMemberGradeById(1); 29 | System.out.println(memberGrade); 30 | memberGrade.setComment("测试数据存取"); 31 | memberGradeDao.save(memberGrade); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/dao/MemberDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.Member; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Query; 8 | 9 | import java.time.LocalDate; 10 | import java.util.List; 11 | 12 | /** 13 | * Code that Changed the World 14 | * Pro said 15 | * Created by Pro on 2017-12-06. 16 | */ 17 | public interface MemberDao extends JpaRepository { 18 | 19 | Member findMemberById(String id); 20 | 21 | Page findAll(Pageable pageable); 22 | 23 | @Query("select m from Member m where m.memberName = ?1") 24 | Page findAllByMemberName(String memberName, Pageable pageable); 25 | 26 | @Query("select count(m.id) from Member m") 27 | int queryAllCount(); 28 | 29 | List findByBirthday(LocalDate birthday); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/formula/formula.css: -------------------------------------------------------------------------------- 1 | .edui-popup-formula .edui-formula-wrapper { 2 | padding: 15px; 3 | } 4 | .edui-popup-formula .edui-formula-wrapper .edui-tab-nav{ 5 | height: auto; 6 | *height: 31px; 7 | } 8 | .edui-popup-formula .edui-formula-wrapper .edui-tab-text { 9 | font-size: 12px; 10 | } 11 | .edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth { 12 | clear: both; 13 | width: 0; 14 | height: 0; 15 | } 16 | .edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul { 17 | margin: 0px; 18 | padding: 0px; 19 | } 20 | .edui-popup-formula .edui-formula-wrapper .edui-tab-content { 21 | padding: 5px 0px 0px 0px; 22 | } 23 | .edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item { 24 | display: block; 25 | float: left; 26 | margin: 0px 3px 3px 0px; 27 | width: 30px; 28 | height: 30px; 29 | border:1px solid #cccccc; 30 | background-image: url("images/formula.png"); 31 | cursor: pointer; 32 | } -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/formula/formula.css: -------------------------------------------------------------------------------- 1 | .edui-popup-formula .edui-formula-wrapper { 2 | padding: 15px; 3 | } 4 | .edui-popup-formula .edui-formula-wrapper .edui-tab-nav{ 5 | height: auto; 6 | *height: 31px; 7 | } 8 | .edui-popup-formula .edui-formula-wrapper .edui-tab-text { 9 | font-size: 12px; 10 | } 11 | .edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth { 12 | clear: both; 13 | width: 0; 14 | height: 0; 15 | } 16 | .edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul { 17 | margin: 0px; 18 | padding: 0px; 19 | } 20 | .edui-popup-formula .edui-formula-wrapper .edui-tab-content { 21 | padding: 5px 0px 0px 0px; 22 | } 23 | .edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item { 24 | display: block; 25 | float: left; 26 | margin: 0px 3px 3px 0px; 27 | width: 30px; 28 | height: 30px; 29 | border:1px solid #cccccc; 30 | background-image: url("images/formula.png"); 31 | cursor: pointer; 32 | } -------------------------------------------------------------------------------- /src/main/java/cn/lger/service/TransactionRecordService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.service; 2 | 3 | import cn.lger.dao.TransactionRecordDao; 4 | import cn.lger.domain.TransactionRecord; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.data.domain.PageRequest; 7 | import org.springframework.data.domain.Pageable; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | * Code that Changed the World 14 | * Pro said 15 | * Created by Pro on 2017-12-17. 16 | */ 17 | @Service 18 | public class TransactionRecordService { 19 | 20 | @Resource 21 | private TransactionRecordDao transactionRecordDao; 22 | 23 | public Page findTransactionRecord(Integer currentPage){ 24 | Pageable pageable = PageRequest.of(currentPage, 3); 25 | return transactionRecordDao.findAll(pageable); 26 | } 27 | 28 | public Page findTransactionRecordByMemberId(Integer currentPage, String memberId) { 29 | Pageable pageable = PageRequest.of(currentPage, 3); 30 | return transactionRecordDao.findAllByMemberId(pageable, memberId); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/LoginController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import org.apache.catalina.servlet4preview.http.HttpServletRequest; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | 9 | /** 10 | * Code that Changed the World 11 | * Pro said 12 | * Created by Pro on 2017-12-19. 13 | */ 14 | @Controller 15 | public class LoginController { 16 | 17 | @RequestMapping(value = "/login", method = RequestMethod.GET) 18 | public String getLoginView(HttpServletRequest request) { 19 | if (request.getSession().getAttribute("admin") != null) 20 | return "index"; 21 | return "login"; 22 | } 23 | 24 | @RequestMapping(value = "/login", method = RequestMethod.POST) 25 | public String login(String username, String password, Model model) { 26 | model.addAttribute("username", username); 27 | model.addAttribute("password", password); 28 | model.addAttribute("error", "登录失败"); 29 | return "login"; 30 | } 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/service/ExchangeRecordService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.service; 2 | 3 | import cn.lger.dao.ExchangeRecordDao; 4 | import cn.lger.dao.TransactionRecordDao; 5 | import cn.lger.domain.ExchangeRecord; 6 | import cn.lger.domain.TransactionRecord; 7 | import org.springframework.data.domain.Page; 8 | import org.springframework.data.domain.PageRequest; 9 | import org.springframework.data.domain.Pageable; 10 | import org.springframework.stereotype.Service; 11 | 12 | import javax.annotation.Resource; 13 | 14 | /** 15 | * Code that Changed the World 16 | * Pro said 17 | * Created by Pro on 2017-12-17. 18 | */ 19 | @Service 20 | public class ExchangeRecordService { 21 | 22 | @Resource 23 | private ExchangeRecordDao exchangeRecordDao; 24 | 25 | public Page findTransactionRecord(Integer currentPage){ 26 | Pageable pageable = PageRequest.of(currentPage, 3); 27 | return exchangeRecordDao.findAll(pageable); 28 | } 29 | 30 | public Page findTransactionRecordByMemberId(Integer currentPage, String memberId) { 31 | Pageable pageable = PageRequest.of(currentPage, 3); 32 | return exchangeRecordDao.findAllByMemberId(pageable, memberId); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/ExchangeRecord.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | import org.hibernate.annotations.GenericGenerator; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.Id; 8 | import javax.persistence.ManyToOne; 9 | 10 | /** 11 | * Code that Changed the World 12 | * Pro said 13 | * Created by Pro on 2017-12-17. 14 | */ 15 | @Entity 16 | public class ExchangeRecord { 17 | 18 | @Id 19 | @GeneratedValue(generator="id") 20 | @GenericGenerator(name="id",strategy="uuid") 21 | private String id; 22 | @ManyToOne 23 | private Member member; 24 | @ManyToOne 25 | private Gift gift; 26 | 27 | public String getId() { 28 | return id; 29 | } 30 | 31 | public void setId(String id) { 32 | this.id = id; 33 | } 34 | 35 | public Member getMember() { 36 | return member; 37 | } 38 | 39 | public void setMember(Member member) { 40 | this.member = member; 41 | } 42 | 43 | public Gift getGift() { 44 | return gift; 45 | } 46 | 47 | public void setGift(Gift gift) { 48 | this.gift = gift; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "ExchangeRecord{" + 54 | "id='" + id + '\'' + 55 | ", member=" + member + 56 | ", gift=" + gift + 57 | '}'; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/TransactionRecordController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.domain.TransactionRecord; 4 | import cn.lger.service.TransactionRecordService; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | * Code that Changed the World 15 | * Pro said 16 | * Created by Pro on 2017-12-17. 17 | */ 18 | @Controller 19 | public class TransactionRecordController { 20 | 21 | @Resource 22 | private TransactionRecordService transactionRecordService; 23 | 24 | @GetMapping("/transactionRecord") 25 | public String getTransactionRecord(){ 26 | return "transactionRecord"; 27 | } 28 | 29 | @PostMapping("/transactionRecord") 30 | @ResponseBody 31 | public Page transactionRecord(Integer currentPage, String memberId){ 32 | if (currentPage == null || currentPage <0) 33 | currentPage = 0; 34 | if (memberId == null || "".equals(memberId)){ 35 | return transactionRecordService.findTransactionRecord(currentPage); 36 | } 37 | return transactionRecordService.findTransactionRecordByMemberId(currentPage, memberId); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/util/FileUploadUtil.java: -------------------------------------------------------------------------------- 1 | package cn.lger.util; 2 | 3 | import org.springframework.util.ClassUtils; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.util.Objects; 9 | 10 | /** 11 | * Code that Changed the World 12 | * Pro said 13 | * Created by Pro on 2017-12-15. 14 | */ 15 | public class FileUploadUtil { 16 | 17 | /** 18 | * 上传文件 19 | * @param multipartFile multipartFile 20 | * @param prefixPath 前缀路径 21 | * @param fileName 上传后的文件名 22 | * @return 上传后最终的相对路径+文件名 23 | * @throws Exception 有可能空指针异常和IO异常 24 | */ 25 | public static String upload(MultipartFile multipartFile, String prefixPath, String fileName) throws Exception { 26 | //得出上传的绝对路径 27 | String uploadPath = Objects.requireNonNull(ClassUtils.getDefaultClassLoader().getResource("")).getPath() +"/static"+ prefixPath; 28 | File file = new File(uploadPath); 29 | if (!file.exists()) 30 | if (file.mkdirs()) 31 | System.out.println("成功创建目录"); 32 | //获取上传的后缀名 33 | String suffixName = multipartFile.getOriginalFilename().substring(multipartFile.getOriginalFilename().lastIndexOf(".")); 34 | //新建最终确定的文件 35 | file = new File(uploadPath+fileName+suffixName); 36 | multipartFile.transferTo(file); 37 | return prefixPath+fileName+suffixName; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/security/CustomerUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.security; 2 | 3 | import cn.lger.dao.AdminDao; 4 | import cn.lger.domain.Admin; 5 | import org.springframework.security.core.authority.AuthorityUtils; 6 | import org.springframework.security.core.userdetails.User; 7 | import org.springframework.security.core.userdetails.UserDetails; 8 | import org.springframework.security.core.userdetails.UserDetailsService; 9 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 10 | import org.springframework.stereotype.Component; 11 | 12 | import javax.annotation.Resource; 13 | 14 | /** 15 | * Code that Changed the World 16 | * Pro said 17 | * Created by Pro on 2018-04-05. 18 | */ 19 | @Component //注册为Spring组件 20 | public class CustomerUserDetailsService implements UserDetailsService{ 21 | 22 | @Resource 23 | private AdminDao adminDao; 24 | 25 | @Override 26 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 27 | //通过dao查找当前用户名对应的用户 28 | Admin admin = adminDao.findAdminByUsername(username); 29 | if (admin == null){ 30 | throw new UsernameNotFoundException("This username: "+username+"is not exist"); 31 | } 32 | //返回一个定制的UserDetails 33 | //AuthorityUtils.createAuthorityList(admin.getRole())就是将我们该用户所有的权限(角色)生成一个集合 34 | return new CustomerUserDetails(admin, AuthorityUtils.createAuthorityList(admin.getRole())); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/ExchangeRecordController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.domain.ExchangeRecord; 4 | import cn.lger.domain.TransactionRecord; 5 | import cn.lger.service.ExchangeRecordService; 6 | import cn.lger.service.TransactionRecordService; 7 | import org.springframework.data.domain.Page; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | 13 | import javax.annotation.Resource; 14 | 15 | /** 16 | * Code that Changed the World 17 | * Pro said 18 | * Created by Pro on 2017-12-17. 19 | */ 20 | @Controller 21 | public class ExchangeRecordController { 22 | 23 | @Resource 24 | private ExchangeRecordService exchangeRecordService; 25 | 26 | @GetMapping("/exchangeRecord") 27 | public String getExchangeRecord(){ 28 | return "exchangeRecord"; 29 | } 30 | 31 | @PostMapping("/exchangeRecord") 32 | @ResponseBody 33 | public Page exchangeRecord(Integer currentPage, String memberId){ 34 | if (currentPage == null || currentPage <0) 35 | currentPage = 0; 36 | if (memberId == null || "".equals(memberId)){ 37 | return exchangeRecordService.findTransactionRecord(currentPage); 38 | } 39 | return exchangeRecordService.findTransactionRecordByMemberId(currentPage, memberId); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/TransactionRecord.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | import org.hibernate.annotations.GenericGenerator; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.Id; 8 | import javax.persistence.ManyToOne; 9 | 10 | /** 11 | * Code that Changed the World 12 | * Pro said 13 | * Created by Pro on 2017-12-17. 14 | */ 15 | @Entity 16 | public class TransactionRecord { 17 | 18 | @Id 19 | @GeneratedValue(generator="id") 20 | @GenericGenerator(name="id",strategy="uuid") 21 | private String id; 22 | @ManyToOne 23 | private Member member; 24 | @ManyToOne 25 | private Commodity commodity; 26 | 27 | public String getId() { 28 | return id; 29 | } 30 | 31 | public void setId(String id) { 32 | this.id = id; 33 | } 34 | 35 | public Member getMember() { 36 | return member; 37 | } 38 | 39 | public void setMember(Member member) { 40 | this.member = member; 41 | } 42 | 43 | public Commodity getCommodity() { 44 | return commodity; 45 | } 46 | 47 | public void setCommodity(Commodity commodity) { 48 | this.commodity = commodity; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "TransactionRecord{" + 54 | "id='" + id + '\'' + 55 | ", member=" + member + 56 | ", commodity=" + commodity + 57 | '}'; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/security/CustomerLoginSuccessHandler.java: -------------------------------------------------------------------------------- 1 | package cn.lger.security; 2 | 3 | import org.springframework.security.core.Authentication; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.security.core.userdetails.UserDetails; 6 | import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; 7 | import org.springframework.stereotype.Component; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.io.IOException; 13 | 14 | /** 15 | * Code that Changed the World 16 | * Pro said 17 | * Created by Pro on 2018-04-05. 18 | */ 19 | @Component 20 | public class CustomerLoginSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { 21 | 22 | @Override 23 | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { 24 | //SecurityContextHolder是Spring Security的核心组件,可获取框架爱内的一些信息 25 | //这里我得到登录成功后的UserDetails 26 | Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 27 | if (principal instanceof UserDetails) { 28 | request.getSession().setAttribute("admin", ((CustomerUserDetails) principal).getAdmin()); 29 | } 30 | super.onAuthenticationSuccess(request, response, authentication); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/Gift.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | 8 | /** 9 | * Code that Changed the World 10 | * Pro said 11 | * Created by Pro on 2017-12-13. 12 | */ 13 | @Entity 14 | public class Gift { 15 | 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | private Integer id; 19 | private String giftName; 20 | private Integer giftIntegral; 21 | private Integer giftNumber; 22 | private Float giftPrice; 23 | 24 | public Float getGiftPrice() { 25 | return giftPrice; 26 | } 27 | 28 | public void setGiftPrice(Float giftPrice) { 29 | this.giftPrice = giftPrice; 30 | } 31 | 32 | public Integer getId() { 33 | return id; 34 | } 35 | 36 | public void setId(Integer id) { 37 | this.id = id; 38 | } 39 | 40 | public String getGiftName() { 41 | return giftName; 42 | } 43 | 44 | public void setGiftName(String giftName) { 45 | this.giftName = giftName; 46 | } 47 | 48 | public Integer getGiftIntegral() { 49 | return giftIntegral; 50 | } 51 | 52 | public void setGiftIntegral(Integer giftIntegral) { 53 | this.giftIntegral = giftIntegral; 54 | } 55 | 56 | public Integer getGiftNumber() { 57 | return giftNumber; 58 | } 59 | 60 | public void setGiftNumber(Integer giftNumber) { 61 | this.giftNumber = giftNumber; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/jquery.metisMenu.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 3 | var pluginName = "metisMenu", 4 | defaults = { 5 | toggle: true 6 | }; 7 | 8 | function Plugin(element, options) { 9 | this.element = element; 10 | this.settings = $.extend({}, defaults, options); 11 | this._defaults = defaults; 12 | this._name = pluginName; 13 | this.init(); 14 | } 15 | 16 | Plugin.prototype = { 17 | init: function () { 18 | 19 | var $this = $(this.element), 20 | $toggle = this.settings.toggle; 21 | 22 | $this.find('li.active').has('ul').children('ul').addClass('collapse in'); 23 | $this.find('li').not('.active').has('ul').children('ul').addClass('collapse'); 24 | 25 | $this.find('li').has('ul').children('a').on('click', function (e) { 26 | e.preventDefault(); 27 | 28 | $(this).parent('li').toggleClass('active').children('ul').collapse('toggle'); 29 | 30 | if ($toggle) { 31 | $(this).parent('li').siblings().removeClass('active').children('ul.in').collapse('hide'); 32 | } 33 | }); 34 | } 35 | }; 36 | 37 | $.fn[ pluginName ] = function (options) { 38 | return this.each(function () { 39 | if (!$.data(this, "plugin_" + pluginName)) { 40 | $.data(this, "plugin_" + pluginName, new Plugin(this, options)); 41 | } 42 | }); 43 | }; 44 | 45 | })(jQuery, window, document); 46 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/MemberGradeController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.domain.MemberGrade; 4 | import cn.lger.service.MemberGradeService; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.ResponseBody; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | * Code that Changed the World 15 | * Pro said 16 | * Created by Pro on 2017-12-16. 17 | */ 18 | @Controller 19 | public class MemberGradeController { 20 | 21 | @Resource 22 | private MemberGradeService memberGradeService; 23 | 24 | @GetMapping("/memberGrade") 25 | public String getMemberGradeView(){ 26 | return "memberGrade"; 27 | } 28 | 29 | @PostMapping("/memberGrade") 30 | @ResponseBody 31 | public Page memberGrade(Integer currentPage){ 32 | return memberGradeService.findAll(currentPage); 33 | } 34 | 35 | @PostMapping("/updateMemberGrade") 36 | @ResponseBody 37 | public String updateMemberGrade(MemberGrade memberGrade){ 38 | try{ 39 | memberGradeService.updateMemberGrade(memberGrade); 40 | } catch (Exception e){ 41 | e.printStackTrace(); 42 | return "error"; 43 | } 44 | return "success"; 45 | } 46 | 47 | @PostMapping("/addMemberGrade") 48 | @ResponseBody 49 | public MemberGrade addMemberGrade(MemberGrade memberGrade){ 50 | return memberGradeService.add(memberGrade); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/Lightweight-Chart/README.md: -------------------------------------------------------------------------------- 1 | # cssCharts.js 2 | jquery plugin to create simple donut, bar or line charts with dom nodes. style with css. 3 | 4 | [http://thysultan.com/projects/cssCharts/](http://thysultan.com/projects/cssCharts/) 5 | 6 | ### Include: 7 | 8 | ```html 9 | 10 | 11 | ``` 12 | 13 | ### run: 14 | 15 | ```javascript 16 | 17 | $('.bar-chart').cssCharts({type:"bar"}); 18 | $('.donut-chart').cssCharts({type:"donut"}); 19 | $('.line-chart').cssCharts({type:"line"}); 20 | 21 | ``` 22 | ### example donut/pie chart 23 | 24 | optional: to trigger countUp counter for the donut chart as seen on the preview page. 25 | 26 | ```javascript 27 | $('.donut-chart').cssCharts({type:"donut"}).trigger('show-donut-chart'); 28 | ``` 29 | 30 | add "pie-chart" class to .donut-chart if you want to convert it to a pie chart, i.e 31 | 32 | ```html 33 |
34 | ``` 35 | 36 | - - - 37 | 38 | ### example line chart 39 | 40 | ```html 41 |
    42 | $('.line-chart').cssCharts({type:"line"}); 43 | ``` 44 | 45 | * insure x cordinates are 0 - ascending. 46 | * insure y cordinates are 0 or greater. 47 | 48 | - - - 49 | 50 | ### example bar chart 51 | 52 | ```html 53 |
      54 | $('.bar-chart').cssCharts({type:"bar"}); 55 | ``` 56 | 57 | - - - 58 | 59 | style to your hearts content, see index.html for an example implementation. 60 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/MemberGrade.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | 8 | /** 9 | * Code that Changed the World 10 | * Pro said 11 | * Created by Pro on 2017-12-06. 12 | */ 13 | @Entity 14 | public class MemberGrade { 15 | 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | private Integer id; 19 | //等级名 20 | private String gradeName; 21 | //折扣 22 | private Float discount; 23 | //备注信息 24 | private String comment = ""; 25 | 26 | public String getComment() { 27 | return comment; 28 | } 29 | 30 | public void setComment(String comment) { 31 | this.comment = comment; 32 | } 33 | 34 | public Integer getId() { 35 | return id; 36 | } 37 | 38 | public void setId(Integer id) { 39 | this.id = id; 40 | } 41 | 42 | public String getGradeName() { 43 | return gradeName; 44 | } 45 | 46 | public void setGradeName(String gradeName) { 47 | this.gradeName = gradeName; 48 | } 49 | 50 | public Float getDiscount() { 51 | return discount; 52 | } 53 | 54 | public void setDiscount(Float discount) { 55 | this.discount = discount; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return "MemberGrade{" + 61 | "id=" + id + 62 | ", gradeName='" + gradeName + '\'' + 63 | ", discount=" + discount + 64 | ", comment='" + comment + '\'' + 65 | '}'; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/service/MemberGradeService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.service; 2 | 3 | import cn.lger.dao.MemberGradeDao; 4 | import cn.lger.domain.MemberGrade; 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.data.domain.PageRequest; 7 | import org.springframework.data.domain.Pageable; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import javax.annotation.Resource; 12 | import java.util.List; 13 | 14 | /** 15 | * Code that Changed the World 16 | * Pro said 17 | * Created by Pro on 2017-12-14. 18 | */ 19 | @Service 20 | public class MemberGradeService { 21 | 22 | @Resource 23 | private MemberGradeDao memberGradeDao; 24 | 25 | public List findAll(){ 26 | return memberGradeDao.findAll(); 27 | } 28 | 29 | public List findMemberGradeByGradeName(String name){ 30 | return memberGradeDao.findMemberGradeByGradeName(name); 31 | } 32 | 33 | public Page findAll(Integer currentPage){ 34 | Pageable pageable = new PageRequest(currentPage, 5); 35 | return memberGradeDao.findAll(pageable); 36 | } 37 | 38 | @Transactional 39 | public void updateMemberGrade(MemberGrade memberGrade){ 40 | if (memberGradeDao.findMemberGradeById(memberGrade.getId())!=null){ 41 | memberGradeDao.save(memberGrade); 42 | return; 43 | } 44 | throw new RuntimeException("MemberGrade中不存在当前的id:"+memberGrade.getId()); 45 | } 46 | 47 | public MemberGrade add(MemberGrade memberGrade){ 48 | return memberGradeDao.save(memberGrade); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/Admin.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | import javax.validation.constraints.NotNull; 8 | 9 | /** 10 | * Code that Changed the World 11 | * Pro said 12 | * Created by Pro on 2017-12-13. 13 | */ 14 | @Entity 15 | public class Admin { 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | private Integer id; 19 | private String username; 20 | private String password; 21 | private String role; 22 | private String email; 23 | private String phone; 24 | 25 | public String getEmail() { 26 | return email; 27 | } 28 | 29 | public void setEmail(String email) { 30 | this.email = email; 31 | } 32 | 33 | public String getPhone() { 34 | return phone; 35 | } 36 | 37 | public void setPhone(String phone) { 38 | this.phone = phone; 39 | } 40 | 41 | public Integer getId() { 42 | return id; 43 | } 44 | 45 | public void setId(Integer id) { 46 | this.id = id; 47 | } 48 | 49 | public String getUsername() { 50 | return username; 51 | } 52 | 53 | public void setUsername(String username) { 54 | this.username = username; 55 | } 56 | 57 | public String getPassword() { 58 | return password; 59 | } 60 | 61 | public void setPassword(String password) { 62 | this.password = password; 63 | } 64 | 65 | public String getRole() { 66 | return role; 67 | } 68 | 69 | public void setRole(@NotNull AdminRole role) { 70 | this.role = role.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/test/java/cn/lger/dao/TestAdminDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.Admin; 4 | import cn.lger.domain.AdminRole; 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.test.annotation.Commit; 10 | import org.springframework.test.annotation.Rollback; 11 | import org.springframework.test.context.junit4.SpringRunner; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import javax.annotation.Resource; 15 | import java.io.IOException; 16 | 17 | /** 18 | * Code that Changed the World 19 | * Pro said 20 | * Created by Pro on 2017-12-13. 21 | */ 22 | @SpringBootTest 23 | @RunWith(SpringRunner.class) 24 | public class TestAdminDao { 25 | 26 | @Resource 27 | private AdminDao adminDao; 28 | 29 | /** 30 | * 测试保存会员 31 | */ 32 | @Test 33 | @Transactional 34 | public void test01(){ 35 | Admin admin = new Admin(); 36 | admin.setId(123); 37 | admin.setUsername("123"); 38 | admin.setPassword("123"); 39 | admin.setRole(AdminRole.G_ADMIN); 40 | 41 | adminDao.save(admin); 42 | } 43 | 44 | /** 45 | * 测试保存超级会员 46 | */ 47 | @Test 48 | public void test02(){ 49 | Admin admin = new Admin(); 50 | admin.setUsername("admin"); 51 | admin.setPassword("admin"); 52 | admin.setRole(AdminRole.S_ADMIN); 53 | 54 | adminDao.save(admin); 55 | } 56 | 57 | @Test 58 | public void test03() throws IOException { 59 | Admin admin = adminDao.findAdminByUsername("asds"); 60 | // Runtime.getRuntime().exec( "cmd cls "); 61 | System.out.println(admin == null); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/Commodity.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | import org.hibernate.annotations.GenericGenerator; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.Id; 9 | 10 | /** 11 | * Code that Changed the World 12 | * Pro said 13 | * Created by Pro on 2017-12-13. 14 | */ 15 | @Entity 16 | public class Commodity { 17 | 18 | @Id 19 | @GeneratedValue(generator="id") 20 | @GenericGenerator(name="id",strategy="uuid") 21 | private String id; 22 | private String commodityName; 23 | private Long commodityIntegral; 24 | private Integer commodityNumber; 25 | private Float commodityPrice; 26 | 27 | public String getId() { 28 | return id; 29 | } 30 | 31 | public void setId(String id) { 32 | this.id = id; 33 | } 34 | 35 | public String getCommodityName() { 36 | return commodityName; 37 | } 38 | 39 | public void setCommodityName(String commodityName) { 40 | this.commodityName = commodityName; 41 | } 42 | 43 | public Long getCommodityIntegral() { 44 | return commodityIntegral; 45 | } 46 | 47 | public void setCommodityIntegral(Long commodityIntegral) { 48 | this.commodityIntegral = commodityIntegral; 49 | } 50 | 51 | public Integer getCommodityNumber() { 52 | return commodityNumber; 53 | } 54 | 55 | public void setCommodityNumber(Integer commodityNumber) { 56 | this.commodityNumber = commodityNumber; 57 | } 58 | 59 | public Float getCommodityPrice() { 60 | return commodityPrice; 61 | } 62 | 63 | public void setCommodityPrice(Float commodityPrice) { 64 | this.commodityPrice = commodityPrice; 65 | } 66 | 67 | @Override 68 | public String toString() { 69 | return "Commodity{" + 70 | "id='" + id + '\'' + 71 | ", commodityName='" + commodityName + '\'' + 72 | ", commodityIntegral=" + commodityIntegral + 73 | ", commodityNumber=" + commodityNumber + 74 | ", commodityPrice=" + commodityPrice + 75 | '}'; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/resources/static/modelTest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/emotion/emotion.css: -------------------------------------------------------------------------------- 1 | .edui-popup-emotion .edui-emotion-jd img{ 2 | background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; 3 | cursor:pointer;width:35px;height:35px;display:block; 4 | } 5 | .edui-popup-emotion .edui-emotion-pp img{ 6 | background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; 7 | cursor:pointer;width:25px;height:25px;display:block; 8 | } 9 | 10 | .edui-popup-emotion .edui-emotion-ldw img{ 11 | background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; 12 | cursor:pointer;width:35px;height:35px;display:block; 13 | } 14 | 15 | .edui-popup-emotion .edui-emotion-tsj img{ 16 | background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; 17 | cursor:pointer;width:35px;height:35px;display:block; 18 | } 19 | 20 | .edui-popup-emotion .edui-emotion-cat img{ 21 | background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; 22 | cursor:pointer;width:35px;height:35px;display:block; 23 | } 24 | 25 | .edui-popup-emotion .edui-emotion-bb img{ 26 | background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; 27 | cursor:pointer;width:35px;height:35px;display:block; 28 | } 29 | 30 | .edui-popup-emotion .edui-emotion-youa img{ 31 | background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; 32 | cursor:pointer;width:35px;height:35px;display:block; 33 | } 34 | 35 | .edui-popup-emotion .edui-emotion-smileytable { 36 | width: 100%; 37 | border-spacing: 0; 38 | border-collapse: collapse; 39 | table-layout: fixed; 40 | } 41 | 42 | .edui-popup-emotion .edui-emotion-wrapper { 43 | padding: 15px; 44 | } 45 | 46 | .edui-popup-emotion .edui-tab-nav{ 47 | height: auto; 48 | *height: 31px; 49 | } 50 | .edui-popup-emotion .edui-emotion-tabs{ 51 | clear: both; 52 | width: 0; 53 | height: 0; 54 | } 55 | 56 | .edui-popup-emotion .edui-tab-content { 57 | padding: 15px 0; 58 | } 59 | 60 | .edui-popup-emotion .edui-emotion-preview-box { 61 | width:90px; 62 | height:76px; 63 | border:2px solid #9cb945; 64 | background:#FFFFFF; 65 | background-position:center; 66 | background-repeat:no-repeat; 67 | position: absolute; 68 | top: 67px; 69 | left: 494px; 70 | display: none; 71 | } 72 | 73 | .edui-popup-emotion .edui-tab-text { 74 | font-size: 12px; 75 | } 76 | 77 | .edui-popup-emotion .edui-emotion-preview-left { 78 | left: 15px; 79 | } 80 | 81 | .edui-popup-emotion .edui-emotion-preview-img { 82 | width: 100%; 83 | height: 100%; 84 | display: block; 85 | background-repeat: no-repeat; 86 | background-position: center center; 87 | } 88 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/emotion/emotion.css: -------------------------------------------------------------------------------- 1 | .edui-popup-emotion .edui-emotion-jd img{ 2 | background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; 3 | cursor:pointer;width:35px;height:35px;display:block; 4 | } 5 | .edui-popup-emotion .edui-emotion-pp img{ 6 | background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; 7 | cursor:pointer;width:25px;height:25px;display:block; 8 | } 9 | 10 | .edui-popup-emotion .edui-emotion-ldw img{ 11 | background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; 12 | cursor:pointer;width:35px;height:35px;display:block; 13 | } 14 | 15 | .edui-popup-emotion .edui-emotion-tsj img{ 16 | background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; 17 | cursor:pointer;width:35px;height:35px;display:block; 18 | } 19 | 20 | .edui-popup-emotion .edui-emotion-cat img{ 21 | background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; 22 | cursor:pointer;width:35px;height:35px;display:block; 23 | } 24 | 25 | .edui-popup-emotion .edui-emotion-bb img{ 26 | background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; 27 | cursor:pointer;width:35px;height:35px;display:block; 28 | } 29 | 30 | .edui-popup-emotion .edui-emotion-youa img{ 31 | background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; 32 | cursor:pointer;width:35px;height:35px;display:block; 33 | } 34 | 35 | .edui-popup-emotion .edui-emotion-smileytable { 36 | width: 100%; 37 | border-spacing: 0; 38 | border-collapse: collapse; 39 | table-layout: fixed; 40 | } 41 | 42 | .edui-popup-emotion .edui-emotion-wrapper { 43 | padding: 15px; 44 | } 45 | 46 | .edui-popup-emotion .edui-tab-nav{ 47 | height: auto; 48 | *height: 31px; 49 | } 50 | .edui-popup-emotion .edui-emotion-tabs{ 51 | clear: both; 52 | width: 0; 53 | height: 0; 54 | } 55 | 56 | .edui-popup-emotion .edui-tab-content { 57 | padding: 15px 0; 58 | } 59 | 60 | .edui-popup-emotion .edui-emotion-preview-box { 61 | width:90px; 62 | height:76px; 63 | border:2px solid #9cb945; 64 | background:#FFFFFF; 65 | background-position:center; 66 | background-repeat:no-repeat; 67 | position: absolute; 68 | top: 67px; 69 | left: 494px; 70 | display: none; 71 | } 72 | 73 | .edui-popup-emotion .edui-tab-text { 74 | font-size: 12px; 75 | } 76 | 77 | .edui-popup-emotion .edui-emotion-preview-left { 78 | left: 15px; 79 | } 80 | 81 | .edui-popup-emotion .edui-emotion-preview-img { 82 | width: 100%; 83 | height: 100%; 84 | display: block; 85 | background-repeat: no-repeat; 86 | background-position: center center; 87 | } 88 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/video/video.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | .edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} 3 | .edui-dialog-video .edui-video-tabbody{height:335px;} 4 | .edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;} 5 | .edui-dialog-video .edui-video-panel table td{vertical-align: middle;} 6 | .edui-dialog-video #eduiVideoUrl { 7 | width: 470px; 8 | height: 21px; 9 | line-height: 21px; 10 | margin: 8px 5px; 11 | background: #FFF; 12 | border: 1px solid #d7d7d7; 13 | } 14 | .edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} 15 | .edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} 16 | .edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} 17 | .edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ 18 | .edui-dialog-video #searchList p{margin-left: 10px;} 19 | .edui-dialog-video #eduiVideoType{ 20 | width: 65px; 21 | height: 23px; 22 | line-height: 22px; 23 | border: 1px solid #d7d7d7; 24 | } 25 | .edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{ 26 | /*width: 80px;*/ 27 | height: 25px; 28 | line-height: 25px; 29 | background: #eee; 30 | border: 1px solid #d7d7d7; 31 | cursor: pointer; 32 | padding: 0 5px; 33 | } 34 | 35 | 36 | 37 | .edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} 38 | .edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} 39 | .edui-dialog-video .edui-video-wrapper fieldset{ 40 | border: 1px solid #ddd; 41 | padding-left: 5px; 42 | margin-bottom: 20px; 43 | padding-bottom: 5px; 44 | width: 115px; 45 | } 46 | .edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;} 47 | .edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;} 48 | .edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{ 49 | width: 65px; 50 | height: 21px; 51 | line-height: 21px; 52 | margin: 8px 5px; 53 | background: #FFF; 54 | border: 1px solid #d7d7d7; 55 | } 56 | .edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;} 57 | .edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} 58 | .edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)} 59 | .edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/video/video.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | .edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} 3 | .edui-dialog-video .edui-video-tabbody{height:335px;} 4 | .edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;} 5 | .edui-dialog-video .edui-video-panel table td{vertical-align: middle;} 6 | .edui-dialog-video #eduiVideoUrl { 7 | width: 470px; 8 | height: 21px; 9 | line-height: 21px; 10 | margin: 8px 5px; 11 | background: #FFF; 12 | border: 1px solid #d7d7d7; 13 | } 14 | .edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} 15 | .edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} 16 | .edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} 17 | .edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ 18 | .edui-dialog-video #searchList p{margin-left: 10px;} 19 | .edui-dialog-video #eduiVideoType{ 20 | width: 65px; 21 | height: 23px; 22 | line-height: 22px; 23 | border: 1px solid #d7d7d7; 24 | } 25 | .edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{ 26 | /*width: 80px;*/ 27 | height: 25px; 28 | line-height: 25px; 29 | background: #eee; 30 | border: 1px solid #d7d7d7; 31 | cursor: pointer; 32 | padding: 0 5px; 33 | } 34 | 35 | 36 | 37 | .edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} 38 | .edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} 39 | .edui-dialog-video .edui-video-wrapper fieldset{ 40 | border: 1px solid #ddd; 41 | padding-left: 5px; 42 | margin-bottom: 20px; 43 | padding-bottom: 5px; 44 | width: 115px; 45 | } 46 | .edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;} 47 | .edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;} 48 | .edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{ 49 | width: 65px; 50 | height: 21px; 51 | line-height: 21px; 52 | margin: 8px 5px; 53 | background: #FFF; 54 | border: 1px solid #d7d7d7; 55 | } 56 | .edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;} 57 | .edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} 58 | .edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)} 59 | .edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} -------------------------------------------------------------------------------- /src/test/java/cn/lger/dao/TestTransactionRecordDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.Commodity; 4 | import cn.lger.domain.TransactionRecord; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.data.domain.Page; 9 | import org.springframework.data.domain.PageRequest; 10 | import org.springframework.data.domain.Pageable; 11 | import org.springframework.test.annotation.Rollback; 12 | import org.springframework.test.context.junit4.SpringRunner; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import javax.annotation.Resource; 16 | 17 | /** 18 | * Code that Changed the World 19 | * Pro said 20 | * Created by Pro on 2017-12-13. 21 | */ 22 | @SpringBootTest 23 | @RunWith(SpringRunner.class) 24 | public class TestTransactionRecordDao { 25 | 26 | @Resource 27 | private TransactionRecordDao transactionRecordDao; 28 | @Resource 29 | private MemberDao memberDao; 30 | @Resource 31 | private CommodityDao commodityDao; 32 | 33 | /** 34 | * 测试保存 35 | */ 36 | @Test 37 | public void test01(){ 38 | TransactionRecord transactionRecord = new TransactionRecord(); 39 | transactionRecord.setCommodity(commodityDao.findCommodityById("2c9ba08b60634aab016063caa6650000")); 40 | transactionRecord.setMember(memberDao.findMemberById("20171215143945448")); 41 | transactionRecordDao.save(transactionRecord); 42 | } 43 | 44 | /** 45 | * 测试保存 46 | */ 47 | @Test 48 | public void test02(){ 49 | TransactionRecord transactionRecord = 50 | transactionRecordDao.findById("2c9ba08b6064ba9d016064bab7110000").get(); 51 | System.out.println(transactionRecord); 52 | } 53 | 54 | @Test 55 | public void test03(){ 56 | Pageable pageable = new PageRequest(0, 3); 57 | Page page = transactionRecordDao.findAll(pageable); 58 | System.out.println(page); 59 | } 60 | 61 | @Test 62 | public void test04(){ 63 | Pageable pageable = new PageRequest(0, 3); 64 | Page page = transactionRecordDao.findAllByMemberId(pageable, "20171215143945448"); 65 | System.out.println(page); 66 | } 67 | 68 | @Test 69 | @Transactional 70 | // @Rollback(false) 71 | public void test05(){ 72 | Commodity commodity = new Commodity(); 73 | commodity.setId("2c9bweew6dsb7110000"); 74 | // commodity.setCommodityName("132ffdsadf东风公司东风公司第三方公司的 上的"); 75 | commodity.setCommodityPrice(123F); 76 | commodity.setCommodityIntegral(111L); 77 | 78 | // commodityDao.save(commodity); 79 | commodity.setCommodityName("safd"); 80 | // commodityDao.flush(); 81 | commodityDao.save(commodity); 82 | 83 | // commodityDao.flush(); 84 | // int a = 1 / 0; 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/security/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package cn.lger.security; 2 | 3 | import cn.lger.domain.AdminRole; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 6 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 7 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 8 | import org.springframework.security.config.annotation.web.builders.WebSecurity; 9 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 10 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 11 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 12 | 13 | import javax.annotation.Resource; 14 | 15 | /** 16 | * Code that Changed the World 17 | * Pro said 18 | * Created by Pro on 2018-04-05. 19 | */ 20 | @EnableWebSecurity 21 | @EnableGlobalMethodSecurity(prePostEnabled = true) //开启方法上的认证 22 | public class SecurityConfig extends WebSecurityConfigurerAdapter { 23 | 24 | @Resource 25 | private CustomerUserDetailsService userDetailsService; 26 | @Resource 27 | private CustomerLoginSuccessHandler successHandler; 28 | @Resource 29 | private BCryptPasswordEncoder encoder; 30 | 31 | @Bean 32 | public BCryptPasswordEncoder encoder() { 33 | return new BCryptPasswordEncoder(); 34 | } 35 | 36 | @Override 37 | public void configure(WebSecurity web) throws Exception { 38 | web.ignoring().antMatchers("/assets/**"); //不过滤静态资源 39 | super.configure(web); 40 | } 41 | 42 | @Override 43 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 44 | auth.userDetailsService(userDetailsService) //注册自己定制的UserDetailsService 45 | .passwordEncoder(encoder); // 配置密码加密器 46 | } 47 | 48 | @Override 49 | protected void configure(HttpSecurity http) throws Exception { 50 | 51 | http 52 | .authorizeRequests() //获取请求方面的验证器 53 | .antMatchers("/", "/error").permitAll()// 访问当前配置的路径可通过认证 54 | //访问其他路径需要认证和角色权限 55 | .anyRequest().hasAnyAuthority(AdminRole.G_ADMIN.toString(), AdminRole.S_ADMIN.toString()) 56 | // .anyRequest().authenticated() 57 | .and() 58 | .formLogin() //获取登录认证验证器 59 | .loginPage("/login") //注册自定义的登录页面URL 60 | .failureForwardUrl("/login") //登录失败后以登录时的请求转发到该链接 61 | .successHandler(successHandler) //登录成功后调用该处理器 62 | .permitAll() //登录请求给予通过认证 63 | .and() 64 | .logout() //推出登录 65 | .logoutSuccessUrl("/login") //退出后访问URL 66 | .and() 67 | .csrf().disable(); //关闭csrf,默认开启 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/test/java/cn/lger/dao/TestMemberDao.java: -------------------------------------------------------------------------------- 1 | package cn.lger.dao; 2 | 3 | import cn.lger.domain.Member; 4 | import cn.lger.domain.MemberGrade; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.data.domain.*; 9 | import org.springframework.test.context.junit4.SpringRunner; 10 | 11 | import javax.annotation.Resource; 12 | import java.time.LocalDate; 13 | import java.util.List; 14 | 15 | /** 16 | * Code that Changed the World 17 | * Pro said 18 | * Created by Pro on 2017-12-06. 19 | */ 20 | @SpringBootTest 21 | @RunWith(SpringRunner.class) 22 | public class TestMemberDao { 23 | 24 | @Resource 25 | private MemberDao memberDao; 26 | @Resource 27 | private MemberGradeDao memberGradeDao; 28 | 29 | /** 30 | * 测试会员保存 31 | */ 32 | @Test 33 | public void test01(){ 34 | Member member = new Member(); 35 | member.setId("123123123"); 36 | member.setBalance((float) 123.0); 37 | member.setSex("男"); 38 | member.setBirthday(LocalDate.now().toString()); 39 | member.setIconPath("/assets/icon/01.jpg"); 40 | MemberGrade memberGrade = memberGradeDao.findMemberGradeById(1); 41 | member.setMemberGrade(memberGrade); 42 | member.setPassword("123"); 43 | member.setPhone("122222222"); 44 | member.setState("正常"); 45 | member.setMemberName("sdhfhsdf"); 46 | member.setMemberIntegral(123L); 47 | 48 | System.out.println(memberDao.save(member)); 49 | } 50 | 51 | @Test 52 | public void test02(){ 53 | Member member = memberDao.findMemberById("123123123"); 54 | System.out.println(member); 55 | } 56 | 57 | /** 58 | * 查找一页内容 59 | */ 60 | @Test 61 | public void test03(){ 62 | Pageable pageable = new PageRequest(0, 3, Sort.Direction.ASC, "id"); 63 | Page page = memberDao.findAll(pageable); 64 | System.out.println(); 65 | } 66 | 67 | @Test 68 | public void test04(){ 69 | Pageable pageable = new PageRequest(0, 3, Sort.Direction.ASC, "id"); 70 | System.out.println(memberDao.findAllByMemberName("123", pageable)); 71 | } 72 | 73 | /** 74 | * 测试删除功能 75 | */ 76 | @Test 77 | public void test05(){ 78 | memberDao.deleteById("201712151"); 79 | } 80 | 81 | 82 | 83 | @Test 84 | public void test07(){ 85 | Pageable pageable = new PageRequest(0, 1); 86 | Page page = memberDao.findAll(pageable); 87 | PageImpl page1 = (PageImpl) page; 88 | System.out.println(page1.getContent().get(0)); 89 | } 90 | 91 | @Test 92 | public void test08(){ 93 | List members = memberDao.findByBirthday(LocalDate.now()); 94 | for (Member m: members 95 | ) { 96 | System.out.println(m); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/image/image.css: -------------------------------------------------------------------------------- 1 | .edui-dialog-image .edui-image-wrapper{font-size: 12px;margin: 15px;} 2 | 3 | /*upload*/ 4 | .edui-dialog-image .edui-image-upload1{position: absolute;top:50%;left:50%;width:44px;height:38px;margin-top:-19px; margin-left: -22px;} 5 | .edui-dialog-image .edui-image-upload2{position:relative;float:left;width:120px;height:120px;margin:5px 0 0 5px;} 6 | 7 | .edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;} 8 | .edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)} 9 | 10 | .edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('images/upload1.png')} 11 | .edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;} 12 | .edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('images/upload2.png')} 13 | 14 | .edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px; 15 | color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;} 16 | 17 | .edui-dialog-image .edui-image-content{height:330px;width:100%;position: relative;} 18 | 19 | .edui-dialog-image .edui-image-mask{display: none;position: absolute;top:0;left:0;width: 100%; height: 100%;background-color:#fff; 20 | text-align: center;line-height:300px;color:#000;font-size:14px;font-weight:bold;opacity: 0.6;filter: alpha(opacity=60);} 21 | .edui-dialog-image .edui-image-mask.edui-active{display: block;} 22 | 23 | /*network*/ 24 | .edui-dialog-image .edui-image-searchBar{margin: 10px;} 25 | .edui-dialog-image .edui-image-searchBar .edui-image-searchTxt{display: inline-block !important;*display: inline !important;*zoom:1;width:400px; border: 1px solid #c5d2ff; height: 20px; line-height: 18px; font-size: 14px; padding: 3px; margin: 0;outline:0;} 26 | .edui-dialog-image .edui-image-searchBar .edui-image-searchAdd{display: inline-block !important;*display: inline !important;*zoom:1; 27 | width:60px; text-align:center;height: 25px;text-align: center;line-height: 25px; 28 | background-color: #ffffff;padding: 0; border: 1px solid #ababab;margin-left: 20px;cursor: pointer; 29 | } 30 | .edui-dialog-image .edui-image-searchBar .edui-image-searchAdd.hover{ 31 | background-color: #d5e1f2; 32 | padding: 0; 33 | border: 1px solid #a3bde3; 34 | } 35 | .edui-dialog-image .edui-image-searchRes{height:280px;overflow:auto;} 36 | 37 | 38 | /*common*/ 39 | .edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;} 40 | .edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;} 41 | .edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('images/close.png');width:17px;height:17px;cursor:pointer;z-index:1} 42 | .edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;} 43 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/image/image.css: -------------------------------------------------------------------------------- 1 | .edui-dialog-image .edui-image-wrapper{font-size: 12px;margin: 15px;} 2 | 3 | /*upload*/ 4 | .edui-dialog-image .edui-image-upload1{position: absolute;top:50%;left:50%;width:44px;height:38px;margin-top:-19px; margin-left: -22px;} 5 | .edui-dialog-image .edui-image-upload2{position:relative;float:left;width:120px;height:120px;margin:5px 0 0 5px;} 6 | 7 | .edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;} 8 | .edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)} 9 | 10 | .edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('images/upload1.png')} 11 | .edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;} 12 | .edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('images/upload2.png')} 13 | 14 | .edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px; 15 | color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;} 16 | 17 | .edui-dialog-image .edui-image-content{height:330px;width:100%;position: relative;} 18 | 19 | .edui-dialog-image .edui-image-mask{display: none;position: absolute;top:0;left:0;width: 100%; height: 100%;background-color:#fff; 20 | text-align: center;line-height:300px;color:#000;font-size:14px;font-weight:bold;opacity: 0.6;filter: alpha(opacity=60);} 21 | .edui-dialog-image .edui-image-mask.edui-active{display: block;} 22 | 23 | /*network*/ 24 | .edui-dialog-image .edui-image-searchBar{margin: 10px;} 25 | .edui-dialog-image .edui-image-searchBar .edui-image-searchTxt{display: inline-block !important;*display: inline !important;*zoom:1;width:400px; border: 1px solid #c5d2ff; height: 20px; line-height: 18px; font-size: 14px; padding: 3px; margin: 0;outline:0;} 26 | .edui-dialog-image .edui-image-searchBar .edui-image-searchAdd{display: inline-block !important;*display: inline !important;*zoom:1; 27 | width:60px; text-align:center;height: 25px;text-align: center;line-height: 25px; 28 | background-color: #ffffff;padding: 0; border: 1px solid #ababab;margin-left: 20px;cursor: pointer; 29 | } 30 | .edui-dialog-image .edui-image-searchBar .edui-image-searchAdd.hover{ 31 | background-color: #d5e1f2; 32 | padding: 0; 33 | border: 1px solid #a3bde3; 34 | } 35 | .edui-dialog-image .edui-image-searchRes{height:280px;overflow:auto;} 36 | 37 | 38 | /*common*/ 39 | .edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;} 40 | .edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;} 41 | .edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('images/close.png');width:17px;height:17px;cursor:pointer;z-index:1} 42 | .edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;} 43 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/service/GiftService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.service; 2 | 3 | import cn.lger.dao.ExchangeRecordDao; 4 | import cn.lger.dao.GiftDao; 5 | import cn.lger.dao.MemberDao; 6 | import cn.lger.domain.ExchangeRecord; 7 | import cn.lger.domain.Gift; 8 | import cn.lger.domain.Member; 9 | import cn.lger.exception.GiftNumberNotEnoughException; 10 | import cn.lger.exception.IdNotFoundException; 11 | import cn.lger.exception.IntegralNotEnoughException; 12 | import org.springframework.data.domain.Page; 13 | import org.springframework.data.domain.PageRequest; 14 | import org.springframework.data.domain.Pageable; 15 | import org.springframework.stereotype.Service; 16 | import org.springframework.transaction.annotation.Transactional; 17 | 18 | import javax.annotation.Resource; 19 | import java.util.List; 20 | 21 | /** 22 | * Code that Changed the World 23 | * Pro said 24 | * Created by Pro on 2017-12-18. 25 | */ 26 | 27 | @Service 28 | public class GiftService { 29 | 30 | @Resource 31 | private GiftDao giftDao; 32 | @Resource 33 | private MemberDao memberDao; 34 | @Resource 35 | private ExchangeRecordDao exchangeRecordDao; 36 | 37 | public Gift add(Gift gift) { 38 | return giftDao.save(gift); 39 | } 40 | 41 | public Page findGifts(Integer currentPage) { 42 | if (currentPage == null) { 43 | currentPage = 1; 44 | } 45 | Pageable pageable = new PageRequest(currentPage, 3); 46 | return giftDao.findAll(pageable); 47 | } 48 | 49 | public void modifyGiftNumber(Integer giftNumber, Integer giftId) { 50 | giftDao.updateGiftNumberById(giftId, giftNumber); 51 | } 52 | 53 | public void deleteGift(Integer giftId) { 54 | giftDao.deleteById(giftId); 55 | } 56 | 57 | @Transactional 58 | public void integralExchange(String memberId, Integer giftId) { 59 | Member member = memberDao.findMemberById(memberId); 60 | Gift gift = giftDao.findById(giftId).isPresent()?giftDao.findById(giftId).get():null; 61 | 62 | //确保存在两个id的实体 63 | if (member != null && gift != null) { 64 | Long resultIntegral = member.getMemberIntegral() - gift.getGiftIntegral(); 65 | if (resultIntegral < 0) { 66 | throw new IntegralNotEnoughException(); 67 | } 68 | int giftNum = gift.getGiftNumber() - 1; 69 | if (giftNum < 0) { 70 | throw new GiftNumberNotEnoughException(); 71 | } else { 72 | gift.setGiftNumber(giftNum); 73 | member.setMemberIntegral(resultIntegral); 74 | memberDao.save(member); 75 | giftDao.save(gift); 76 | ExchangeRecord exchangeRecord = new ExchangeRecord(); 77 | exchangeRecord.setGift(gift); 78 | exchangeRecord.setMember(member); 79 | exchangeRecordDao.save(exchangeRecord); 80 | return; 81 | } 82 | } 83 | throw new IdNotFoundException(); 84 | } 85 | 86 | public List findAll() { 87 | return giftDao.findAll(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/link/link.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var utils = UM.utils; 3 | function hrefStartWith(href, arr) { 4 | href = href.replace(/^\s+|\s+$/g, ''); 5 | for (var i = 0, ai; ai = arr[i++];) { 6 | if (href.indexOf(ai) == 0) { 7 | return true; 8 | } 9 | } 10 | return false; 11 | } 12 | 13 | UM.registerWidget('link', { 14 | tpl: "" + 18 | "" + 19 | "" + 20 | "" + 21 | "" + 22 | "" + 23 | "" + 24 | "" + 25 | "" + 26 | "" + 27 | "" + 28 | "" + 32 | "" + 33 | // "" + 34 | // "" + 35 | // "" + 36 | "", 37 | initContent: function (editor) { 38 | var lang = editor.getLang('link'); 39 | if (lang) { 40 | var html = $.parseTmpl(this.tpl, lang.static); 41 | } 42 | this.root().html(html); 43 | }, 44 | initEvent: function (editor, $w) { 45 | var link = editor.queryCommandValue('link'); 46 | if(link){ 47 | $('#edui-link-Jhref',$w).val(utils.html($(link).attr('href'))); 48 | $('#edui-link-Jtitle',$w).val($(link).attr('title')); 49 | $(link).attr('target') == '_blank' && $('#edui-link-Jtarget').attr('checked',true) 50 | } 51 | $('#edui-link-Jhref',$w).focus(); 52 | }, 53 | buttons: { 54 | 'ok': { 55 | exec: function (editor, $w) { 56 | var href = $('#edui-link-Jhref').val().replace(/^\s+|\s+$/g, ''); 57 | 58 | if (href) { 59 | editor.execCommand('link', { 60 | 'href': href, 61 | 'target': $("#edui-link-Jtarget:checked").length ? "_blank" : '_self', 62 | 'title': $("#edui-link-Jtitle").val().replace(/^\s+|\s+$/g, ''), 63 | '_href': href 64 | }); 65 | } 66 | } 67 | }, 68 | 'cancel':{} 69 | }, 70 | width: 400 71 | }) 72 | })(); 73 | 74 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/link/link.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var utils = UM.utils; 3 | function hrefStartWith(href, arr) { 4 | href = href.replace(/^\s+|\s+$/g, ''); 5 | for (var i = 0, ai; ai = arr[i++];) { 6 | if (href.indexOf(ai) == 0) { 7 | return true; 8 | } 9 | } 10 | return false; 11 | } 12 | 13 | UM.registerWidget('link', { 14 | tpl: "" + 18 | "" + 19 | "" + 20 | "" + 21 | "" + 22 | "" + 23 | "" + 24 | "" + 25 | "" + 26 | "" + 27 | "" + 28 | "" + 32 | "" + 33 | // "" + 34 | // "" + 35 | // "" + 36 | "", 37 | initContent: function (editor) { 38 | var lang = editor.getLang('link'); 39 | if (lang) { 40 | var html = $.parseTmpl(this.tpl, lang.static); 41 | } 42 | this.root().html(html); 43 | }, 44 | initEvent: function (editor, $w) { 45 | var link = editor.queryCommandValue('link'); 46 | if(link){ 47 | $('#edui-link-Jhref',$w).val(utils.html($(link).attr('href'))); 48 | $('#edui-link-Jtitle',$w).val($(link).attr('title')); 49 | $(link).attr('target') == '_blank' && $('#edui-link-Jtarget').attr('checked',true) 50 | } 51 | $('#edui-link-Jhref',$w).focus(); 52 | }, 53 | buttons: { 54 | 'ok': { 55 | exec: function (editor, $w) { 56 | var href = $('#edui-link-Jhref').val().replace(/^\s+|\s+$/g, ''); 57 | 58 | if (href) { 59 | editor.execCommand('link', { 60 | 'href': href, 61 | 'target': $("#edui-link-Jtarget:checked").length ? "_blank" : '_self', 62 | 'title': $("#edui-link-Jtitle").val().replace(/^\s+|\s+$/g, ''), 63 | '_href': href 64 | }); 65 | } 66 | } 67 | }, 68 | 'cancel':{} 69 | }, 70 | width: 400 71 | }) 72 | })(); 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/CommodityController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.domain.Commodity; 4 | import cn.lger.exception.BalanceNotEnoughException; 5 | import cn.lger.exception.CommodityNumberNotEnoughException; 6 | import cn.lger.exception.IdNotFoundException; 7 | import cn.lger.service.CommodityService; 8 | import org.springframework.data.domain.Page; 9 | import org.springframework.data.domain.PageRequest; 10 | import org.springframework.data.domain.Pageable; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | import org.springframework.web.bind.annotation.PostMapping; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import javax.annotation.Resource; 17 | 18 | /** 19 | * Code that Changed the World 20 | * Pro said 21 | * Created by Pro on 2017-12-17. 22 | */ 23 | @Controller 24 | public class CommodityController { 25 | 26 | @Resource 27 | private CommodityService commodityService; 28 | 29 | @GetMapping("/addCommodity") 30 | public String getAddCommodityView(){ 31 | return "addCommodity"; 32 | } 33 | 34 | @PostMapping("/addCommodity") 35 | @ResponseBody 36 | public Commodity addCommodity(Commodity commodity){ 37 | try{ 38 | return commodityService.add(commodity); 39 | } catch (Exception e){ 40 | e.printStackTrace(); 41 | return null; 42 | } 43 | } 44 | 45 | @GetMapping("/purchaseCommodity") 46 | public String getPurchaseCommodityView(){ 47 | return "purchaseCommodity"; 48 | } 49 | 50 | @PostMapping("/purchaseCommodity") 51 | @ResponseBody 52 | public String purchaseCommodity(String memberId, String commodityId, boolean balance){ 53 | try{ 54 | commodityService.purchaseCommodity(memberId, commodityId, balance); 55 | } catch (CommodityNumberNotEnoughException e){ 56 | e.printStackTrace(); 57 | return "商品数量不足"; 58 | } catch (BalanceNotEnoughException e){ 59 | e.printStackTrace(); 60 | return "会员余额不足"; 61 | } catch (IdNotFoundException e){ 62 | e.printStackTrace(); 63 | return "会员账号或商品账号不存在"; 64 | } 65 | return "success"; 66 | } 67 | 68 | @GetMapping("/modifyCommodity") 69 | public String getModifyCommodityView(){ 70 | return "modifyCommodity"; 71 | } 72 | 73 | @PostMapping("/updateCommodity") 74 | @ResponseBody 75 | public String updateCommodity(Commodity commodity){ 76 | try{ 77 | commodityService.updateMemberGrade(commodity); 78 | } catch (Exception e){ 79 | e.printStackTrace(); 80 | return "error"; 81 | } 82 | return "success"; 83 | } 84 | 85 | @PostMapping("/queryAllCommodity") 86 | @ResponseBody 87 | public Page queryAllCommodity(Integer currentPage){ 88 | if (currentPage == null || currentPage < 0){ 89 | currentPage = 0; 90 | } 91 | Pageable pageable = new PageRequest(currentPage, 3); 92 | return commodityService.findAll(pageable); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/security/CustomerUserDetails.java: -------------------------------------------------------------------------------- 1 | package cn.lger.security; 2 | 3 | import cn.lger.domain.Admin; 4 | import org.springframework.security.core.GrantedAuthority; 5 | import org.springframework.security.core.userdetails.User; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | 8 | import javax.validation.constraints.NotNull; 9 | import java.util.Collection; 10 | import java.util.Collections; 11 | import java.util.Set; 12 | 13 | /** 14 | * Code that Changed the World 15 | * Pro said 16 | * Created by Pro on 2018-04-05. 17 | */ 18 | public class CustomerUserDetails implements UserDetails { 19 | 20 | private Admin admin = null; 21 | //存放权限的集合 22 | private final Collection authorities; 23 | private final boolean accountNonExpired; 24 | private final boolean accountNonLocked; 25 | private final boolean credentialsNonExpired; 26 | private final boolean enabled; 27 | 28 | public CustomerUserDetails(Admin admin, Collection authorities) { 29 | this(admin, true, true, true,true,authorities); 30 | } 31 | 32 | public CustomerUserDetails(Admin admin, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection authorities) { 33 | if(admin.getUsername() != null && !"".equals(admin.getUsername()) && admin.getPassword() != null) { 34 | this.admin = admin; 35 | this.enabled = enabled; 36 | this.accountNonExpired = accountNonExpired; 37 | this.credentialsNonExpired = credentialsNonExpired; 38 | this.accountNonLocked = accountNonLocked; 39 | this.authorities = authorities; 40 | } else { 41 | throw new IllegalArgumentException("Cannot pass null or empty values to constructor"); 42 | } 43 | } 44 | 45 | public Admin getAdmin() { 46 | return admin; 47 | } 48 | 49 | public void setAdmin(@NotNull Admin admin) { 50 | this.admin = admin; 51 | } 52 | 53 | public boolean equals(Object rhs) { 54 | return rhs instanceof CustomerUserDetails && this.getUsername().equals(((CustomerUserDetails) rhs).getUsername()); 55 | } 56 | 57 | public int hashCode() { 58 | return this.getUsername().hashCode(); 59 | } 60 | 61 | @Override 62 | public Collection getAuthorities() { 63 | return this.authorities; 64 | } 65 | 66 | @Override 67 | public String getPassword() { 68 | return this.admin.getPassword(); 69 | } 70 | 71 | @Override 72 | public String getUsername() { 73 | return this.admin.getUsername(); 74 | } 75 | 76 | @Override 77 | public boolean isAccountNonExpired() { 78 | return this.accountNonExpired; 79 | } 80 | 81 | @Override 82 | public boolean isAccountNonLocked() { 83 | return this.accountNonLocked; 84 | } 85 | 86 | @Override 87 | public boolean isCredentialsNonExpired() { 88 | return this.credentialsNonExpired; 89 | } 90 | 91 | @Override 92 | public boolean isEnabled() { 93 | return this.enabled; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /membership.uml: -------------------------------------------------------------------------------- 1 | 2 | 3 | JAVA 4 | 5 | 6 | cn.lger.domain.Admin 7 | cn.lger.web.GiftController 8 | cn.lger.dao.AdminDao 9 | cn.lger.web.CommodityController 10 | cn.lger.service.GiftService 11 | cn.lger.service.TransactionRecordService 12 | cn.lger.domain.Gift 13 | cn.lger.domain.Commodity 14 | cn.lger.domain.AdminRole 15 | cn.lger.domain.Member 16 | cn.lger.util.FileUploadUtil 17 | cn.lger.util.UUIDRandomUtil 18 | cn.lger.web.BirthdayWarningController 19 | cn.lger.service.CommodityService 20 | cn.lger.service.MemberGradeService 21 | cn.lger.dao.TransactionRecordDao 22 | cn.lger.web.TransactionRecordController 23 | cn.lger.domain.TransactionRecord 24 | cn.lger.dao.MemberGradeDao 25 | cn.lger.service.AdminService 26 | cn.lger.web.AdminController 27 | cn.lger.dao.MemberDao 28 | cn.lger.web.MemberGradeController 29 | cn.lger.domain.MemberGrade 30 | cn.lger.dao.CommodityDao 31 | cn.lger.service.ExchangeRecordService 32 | cn.lger.service.MemberService 33 | cn.lger.domain.ExchangeRecord 34 | cn.lger.web.ExchangeRecordController 35 | cn.lger.dao.GiftDao 36 | cn.lger.dao.ExchangeRecordDao 37 | cn.lger.util.MemberNumberRandomUtil 38 | cn.lger.web.LoginController 39 | cn.lger.web.MemberController 40 | 41 | 42 | 43 | 44 | 45 | cn.lger.service.TransactionRecordService 46 | 47 | 48 | All 49 | private 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/service/MemberService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.service; 2 | 3 | import cn.lger.dao.MemberDao; 4 | import cn.lger.domain.Member; 5 | import org.springframework.data.domain.*; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import javax.annotation.Resource; 10 | import java.time.LocalDate; 11 | import java.time.Month; 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | import java.util.Random; 15 | 16 | /** 17 | * Code that Changed the World 18 | * Pro said 19 | * Created by Pro on 2017-12-06. 20 | */ 21 | 22 | @Service 23 | public class MemberService { 24 | @Resource 25 | private MemberDao memberDao; 26 | 27 | public Member addMember(Member member){ 28 | return memberDao.save(member); 29 | } 30 | 31 | public Member findMemberById(String id){ 32 | return memberDao.findMemberById(id); 33 | } 34 | 35 | public Page findMembers(Integer currentPage){ 36 | if (currentPage == null){ 37 | currentPage = 1; 38 | } 39 | Pageable pageable = new PageRequest(currentPage, 3, Sort.Direction.ASC, "id"); 40 | return memberDao.findAll(pageable); 41 | } 42 | 43 | public Page findMembersByMemberName(Integer currentPage, String memberName){ 44 | if (currentPage == null){ 45 | currentPage = 1; 46 | } 47 | Pageable pageable = PageRequest.of(currentPage, 3, Sort.Direction.ASC, "id"); 48 | return memberDao.findAllByMemberName(memberName, pageable); 49 | } 50 | 51 | @Transactional 52 | public void modifyMemberState(String id, String state) { 53 | Member member = memberDao.findMemberById(id); 54 | if (member !=null){ 55 | member.setState(state); 56 | memberDao.save(member); 57 | return; 58 | } 59 | throw new RuntimeException("Member中不存在当前的id:"+id); 60 | } 61 | 62 | public void deleteMember(String memberId){ 63 | memberDao.deleteById(memberId); 64 | } 65 | 66 | @Transactional 67 | public void balanceRecharge(String id, String balance) { 68 | Member member = memberDao.findMemberById(id); 69 | if (member != null){ 70 | member.setBalance(member.getBalance()+Float.valueOf(balance)); 71 | memberDao.save(member); 72 | return; 73 | } 74 | throw new RuntimeException("Member中不存在当前的id:"+id); 75 | } 76 | 77 | @Transactional 78 | public Member integralLottery(Integer allIntegral) { 79 | int count = memberDao.queryAllCount(); 80 | Random random = new Random(); 81 | count = random.nextInt(count); 82 | Pageable pageable = PageRequest.of(count, 1); 83 | Page page = memberDao.findAll(pageable); 84 | PageImpl page1 = (PageImpl) page; 85 | Member member = (Member) page1.getContent().get(0); 86 | member.setMemberIntegral(allIntegral + member.getMemberIntegral()); 87 | return memberDao.save(member); 88 | } 89 | 90 | public List findBirthdayToday() { 91 | List email = new ArrayList(); 92 | // List members = memberDao.findByBirthday(LocalDate.now()); 93 | List members = memberDao.findAll(); 94 | int month = LocalDate.now().getMonthValue(); 95 | int day = LocalDate.now().getDayOfMonth(); 96 | for (Member m: members) { 97 | if (m.getLocalDate().getMonthValue() == month && m.getLocalDate().getDayOfMonth() == day) 98 | email.add(m.getEmail()); 99 | } 100 | return email; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/BirthdayWarningController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.service.MemberService; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.context.annotation.PropertySource; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | 13 | import javax.annotation.Resource; 14 | import javax.mail.MessagingException; 15 | import javax.mail.Session; 16 | import javax.mail.Transport; 17 | import javax.mail.internet.InternetAddress; 18 | import javax.mail.internet.MimeMessage; 19 | import java.util.Date; 20 | import java.util.List; 21 | import java.util.Map; 22 | import java.util.Properties; 23 | 24 | /** 25 | * Code that Changed the World 26 | * Pro said 27 | * Created by Pro on 2017-12-20. 28 | */ 29 | @Controller 30 | @PropertySource("classpath:emailConfig.properties") 31 | public class BirthdayWarningController { 32 | 33 | @Resource 34 | private MemberService memberService; 35 | 36 | @Value("${email.account}") 37 | private String emailAccount; 38 | @Value("${email.password}") 39 | private String emailPassword; 40 | @Value("${email.smtp}") 41 | private String emailSmtp; 42 | 43 | @GetMapping("/birthdayWarning") 44 | public String getBirthdayWarningView(Map model){ 45 | if (memberService.findBirthdayToday().size()==0){ 46 | model.put("msg", "null"); 47 | } 48 | return "birthdayWarning"; 49 | } 50 | 51 | @PostMapping("/birthdayWarning") 52 | @ResponseBody 53 | public String birthdayWarning(String content){ 54 | 55 | try { 56 | // System.out.println(content); 57 | Properties props = new Properties(); // 参数配置 58 | props.setProperty("mail.transport.protocol", "smtp"); // 使用的协议(JavaMail规范要求) 59 | props.setProperty("mail.smtp.host", emailSmtp); // 发件人的邮箱的 SMTP 服务器地址 60 | props.setProperty("mail.smtp.auth", "true"); // 需要请求认证 61 | Session session = Session.getInstance(props); 62 | session.setDebug(true); // 设置为debug模式, 可以查看详细的发送 log 63 | List receiveMailAccounts = memberService.findBirthdayToday(); 64 | 65 | 66 | for (String receiveMailAccount : receiveMailAccounts){ 67 | Transport transport = session.getTransport(); 68 | MimeMessage message = createMimeMessage(session, emailAccount, receiveMailAccount,content); 69 | transport.connect(emailAccount, emailPassword); 70 | transport.sendMessage(message, message.getAllRecipients()); 71 | transport.close(); 72 | } 73 | 74 | } catch (Exception e) { 75 | e.printStackTrace(); 76 | return "error"; 77 | 78 | } 79 | return "success"; 80 | } 81 | 82 | private MimeMessage createMimeMessage(Session session, String sendMail, String receiveMail, String content) throws Exception { 83 | MimeMessage message = new MimeMessage(session); 84 | message.setFrom(new InternetAddress(sendMail, "测试JMail", "UTF-8")); 85 | message.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(receiveMail, "亲爱的 先生/小姐", "UTF-8")); 86 | message.setSubject("生日快乐", "UTF-8"); 87 | message.setContent(content, "text/html;charset=UTF-8"); 88 | message.setSentDate(new Date()); 89 | message.saveChanges(); 90 | return message; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | cn.lger 7 | membership 8 | 0.0.1-SNAPSHOT 9 | war 10 | 11 | membership 12 | membership project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.0.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-data-jpa 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-jdbc 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-starter-thymeleaf 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-web 43 | 44 | 45 | 46 | mysql 47 | mysql-connector-java 48 | runtime 49 | 50 | 51 | org.springframework.boot 52 | spring-boot-starter-test 53 | test 54 | 55 | 56 | 57 | 58 | net.sourceforge.nekohtml 59 | nekohtml 60 | 1.9.22 61 | 62 | 63 | 64 | 65 | org.hibernate 66 | hibernate-java8 67 | 5.1.2.Final 68 | 69 | 70 | 71 | 72 | org.springframework.boot 73 | spring-boot-devtools 74 | true 75 | true 76 | 77 | 78 | 79 | 80 | javax.mail 81 | mail 82 | 1.4.7 83 | 84 | 85 | 86 | 87 | org.springframework.boot 88 | spring-boot-starter-security 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | org.springframework.boot 97 | spring-boot-maven-plugin 98 | 99 | 100 | true 101 | 102 | 103 | 104 | 105 | org.apache.maven.plugins 106 | maven-surefire-plugin 107 | 108 | true 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/GiftController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.domain.Gift; 4 | import cn.lger.exception.GiftNumberNotEnoughException; 5 | import cn.lger.exception.IdNotFoundException; 6 | import cn.lger.exception.IntegralNotEnoughException; 7 | import cn.lger.service.GiftService; 8 | import org.springframework.data.domain.Page; 9 | import org.springframework.data.domain.PageRequest; 10 | import org.springframework.data.domain.Pageable; 11 | import org.springframework.data.domain.Sort; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.web.bind.annotation.GetMapping; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import javax.annotation.Resource; 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | /** 22 | * Code that Changed the World 23 | * Pro said 24 | * Created by Pro on 2017-12-18. 25 | */ 26 | @Controller 27 | public class GiftController { 28 | 29 | @Resource 30 | private GiftService giftService; 31 | 32 | @GetMapping("/setGift") 33 | public String getSetGiftView(){ 34 | return "setGift"; 35 | } 36 | 37 | @PostMapping("/setGift") 38 | @ResponseBody 39 | public String setGift(Gift gift){ 40 | try{ 41 | giftService.add(gift); 42 | } catch (Exception e){ 43 | e.printStackTrace(); 44 | return "error"; 45 | } 46 | return "success"; 47 | } 48 | 49 | @PostMapping("/queryGift") 50 | @ResponseBody 51 | public Page queryGift(Integer currentPage){ 52 | return giftService.findGifts(currentPage); 53 | } 54 | 55 | 56 | @GetMapping("/modifyGiftNumber") 57 | public String getModifyGiftNumberView(){ 58 | return "modifyGiftNumber"; 59 | } 60 | 61 | 62 | @PostMapping("/modifyGiftNumber") 63 | @ResponseBody 64 | public String modifyGiftNumber(Integer giftNumber, Integer giftId){ 65 | try{ 66 | if (giftNumber == null || giftNumber <= 0 || giftId == null) 67 | return "error"; 68 | giftService.modifyGiftNumber(giftNumber, giftId); 69 | } catch (Exception e){ 70 | e.printStackTrace(); 71 | return "error"; 72 | } 73 | return "success"; 74 | } 75 | 76 | @PostMapping("/deleteGift") 77 | @ResponseBody 78 | public String deleteGift(Integer giftId){ 79 | try{ 80 | if (giftId == null) 81 | return "error"; 82 | giftService.deleteGift(giftId); 83 | } catch (Exception e){ 84 | e.printStackTrace(); 85 | return "error"; 86 | } 87 | return "success"; 88 | } 89 | 90 | @GetMapping("/integralExchange") 91 | public String getIntegralExchangeView(Map model){ 92 | model.put("gifts", giftService.findAll()); 93 | return "/integralExchange"; 94 | } 95 | 96 | @PostMapping("/integralExchange") 97 | @ResponseBody 98 | public String integralExchange(String memberId, Integer giftId) { 99 | try { 100 | if (giftId == null || memberId == null || "".equals(memberId)) { 101 | return "输入不正确!"; 102 | } 103 | giftService.integralExchange(memberId, giftId); 104 | } catch (IntegralNotEnoughException e) { 105 | e.printStackTrace(); 106 | return "会员积分不足"; 107 | } catch (IdNotFoundException e) { 108 | e.printStackTrace(); 109 | return "会员账号不存在"; 110 | } catch (GiftNumberNotEnoughException e) { 111 | e.printStackTrace(); 112 | return "礼品已经下架"; 113 | } 114 | return "success"; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/service/CommodityService.java: -------------------------------------------------------------------------------- 1 | package cn.lger.service; 2 | 3 | import cn.lger.dao.CommodityDao; 4 | import cn.lger.dao.MemberDao; 5 | import cn.lger.dao.TransactionRecordDao; 6 | import cn.lger.domain.Commodity; 7 | import cn.lger.domain.Member; 8 | import cn.lger.domain.TransactionRecord; 9 | import cn.lger.exception.BalanceNotEnoughException; 10 | import cn.lger.exception.CommodityNumberNotEnoughException; 11 | import cn.lger.exception.IdNotFoundException; 12 | import org.springframework.data.domain.Page; 13 | import org.springframework.data.domain.Pageable; 14 | import org.springframework.stereotype.Service; 15 | import org.springframework.transaction.annotation.Transactional; 16 | 17 | import javax.annotation.Resource; 18 | 19 | /** 20 | * Code that Changed the World 21 | * Pro said 22 | * Created by Pro on 2017-12-17. 23 | */ 24 | @Service 25 | public class CommodityService { 26 | 27 | @Resource 28 | private CommodityDao commodityDao; 29 | @Resource 30 | private MemberDao memberDao; 31 | @Resource 32 | private TransactionRecordDao transactionRecordDao; 33 | 34 | public Commodity add(Commodity commodity) { 35 | return commodityDao.save(commodity); 36 | } 37 | 38 | @Transactional 39 | public void purchaseCommodity(String memberId, String commodityId, boolean balance) { 40 | Member member = memberDao.findMemberById(memberId); 41 | Commodity commodity = commodityDao.findCommodityById(commodityId); 42 | //确保存在两个id的实体 43 | if (member != null && commodity != null) { 44 | //确保商品数量充足 45 | if (commodity.getCommodityNumber() - 1 < 0) 46 | throw new CommodityNumberNotEnoughException(); 47 | //是否余额支付 48 | if (balance) { 49 | //确保余额足够支付 50 | if ((int) (member.getBalance() - commodity.getCommodityPrice()) >= 0) { 51 | //重新设定余额 52 | member.setBalance(member.getBalance() - commodity.getCommodityPrice()); 53 | //商品数量少1 54 | commodity.setCommodityNumber(commodity.getCommodityNumber() - 1); 55 | //商品积分增加 56 | member.setMemberIntegral(member.getMemberIntegral()+commodity.getCommodityIntegral()); 57 | memberDao.save(member); 58 | commodityDao.save(commodity); 59 | TransactionRecord transactionRecord = new TransactionRecord(); 60 | transactionRecord.setMember(member); 61 | transactionRecord.setCommodity(commodity); 62 | transactionRecordDao.save(transactionRecord); 63 | return; 64 | } 65 | throw new BalanceNotEnoughException(); 66 | } else { 67 | commodity.setCommodityNumber(commodity.getCommodityNumber() - 1); 68 | member.setMemberIntegral(member.getMemberIntegral()+commodity.getCommodityIntegral()); 69 | memberDao.save(member); 70 | commodityDao.save(commodity); 71 | TransactionRecord transactionRecord = new TransactionRecord(); 72 | transactionRecord.setMember(member); 73 | transactionRecord.setCommodity(commodity); 74 | transactionRecordDao.save(transactionRecord); 75 | return; 76 | } 77 | 78 | } 79 | throw new IdNotFoundException(); 80 | } 81 | 82 | 83 | public void updateMemberGrade(Commodity commodity) { 84 | if (commodityDao.findById(commodity.getId())!=null){ 85 | commodityDao.save(commodity); 86 | return; 87 | } 88 | throw new RuntimeException("Commodity中不存在当前的id:"+commodity.getId()); 89 | } 90 | 91 | public Page findAll(Pageable pageable) { 92 | return commodityDao.findAll(pageable); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/domain/Member.java: -------------------------------------------------------------------------------- 1 | package cn.lger.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | import javax.persistence.ManyToOne; 6 | import java.time.LocalDate; 7 | 8 | /** 9 | * Code that Changed the World 10 | * Pro said 11 | * Created by Pro on 2017-12-06. 12 | */ 13 | @Entity 14 | public class Member { 15 | 16 | @Id 17 | private String id; 18 | private String iconPath; 19 | private String memberName; 20 | private String password; 21 | private String phone; 22 | private LocalDate birthday; 23 | private String sex; 24 | //会员等级 25 | @ManyToOne 26 | private MemberGrade memberGrade; 27 | //会员积分 28 | private Long memberIntegral; 29 | //会员余额 30 | private Float balance; 31 | //会员状态 挂失、停用、正常 32 | private String state; 33 | private String email; 34 | 35 | 36 | public String getEmail() { 37 | return email; 38 | } 39 | 40 | public void setEmail(String email) { 41 | this.email = email; 42 | } 43 | 44 | public String getId() { 45 | return id; 46 | } 47 | 48 | public void setId(String id) { 49 | this.id = id; 50 | } 51 | 52 | public String getIconPath() { 53 | return iconPath; 54 | } 55 | 56 | public void setIconPath(String iconPath) { 57 | this.iconPath = iconPath; 58 | } 59 | 60 | public String getMemberName() { 61 | return memberName; 62 | } 63 | 64 | public void setMemberName(String memberName) { 65 | this.memberName = memberName; 66 | } 67 | 68 | public String getPassword() { 69 | return password; 70 | } 71 | 72 | public void setPassword(String password) { 73 | this.password = password; 74 | } 75 | 76 | public String getPhone() { 77 | return phone; 78 | } 79 | 80 | public void setPhone(String phone) { 81 | this.phone = phone; 82 | } 83 | 84 | public String getBirthday() { 85 | return birthday.toString(); 86 | } 87 | 88 | public void setBirthday(String birthday) { 89 | this.birthday = LocalDate.parse(birthday); 90 | } 91 | 92 | public String getSex() { 93 | return sex; 94 | } 95 | 96 | public void setSex(String sex) { 97 | this.sex = sex; 98 | } 99 | 100 | public MemberGrade getMemberGrade() { 101 | return memberGrade; 102 | } 103 | 104 | public void setMemberGrade(MemberGrade memberGrade) { 105 | this.memberGrade = memberGrade; 106 | } 107 | 108 | public Long getMemberIntegral() { 109 | return memberIntegral; 110 | } 111 | 112 | public void setMemberIntegral(Long memberIntegral) { 113 | this.memberIntegral = memberIntegral; 114 | } 115 | 116 | public Float getBalance() { 117 | return balance; 118 | } 119 | 120 | public void setBalance(Float balance) { 121 | this.balance = balance; 122 | } 123 | 124 | public String getState() { 125 | return state; 126 | } 127 | 128 | public void setState(String state) { 129 | this.state = state; 130 | } 131 | 132 | public LocalDate getLocalDate(){ 133 | return this.birthday; 134 | } 135 | 136 | @Override 137 | public String toString() { 138 | return "Member{" + 139 | "id='" + id + '\'' + 140 | ", iconPath='" + iconPath + '\'' + 141 | ", memberName='" + memberName + '\'' + 142 | ", password='" + password + '\'' + 143 | ", phone='" + phone + '\'' + 144 | ", birthday=" + birthday + 145 | ", sex='" + sex + '\'' + 146 | ", memberGrade=" + memberGrade + 147 | ", memberIntegral=" + memberIntegral + 148 | ", balance=" + balance + 149 | ", state='" + state + '\'' + 150 | '}'; 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/chart-data.js: -------------------------------------------------------------------------------- 1 | var randomScalingFactor = function(){ return Math.round(Math.random()*1000)}; 2 | 3 | var lineChartData = { 4 | labels : ["January","February","March","April","May","June","July"], 5 | datasets : [ 6 | { 7 | label: "My First dataset", 8 | fillColor : "rgba(220,220,220,0.2)", 9 | strokeColor : "rgba(220,220,220,1)", 10 | pointColor : "rgba(220,220,220,1)", 11 | pointStrokeColor : "#fff", 12 | pointHighlightFill : "#fff", 13 | pointHighlightStroke : "rgba(220,220,220,1)", 14 | data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] 15 | }, 16 | { 17 | label: "My Second dataset", 18 | fillColor : "rgba(48, 164, 255, 0.2)", 19 | strokeColor : "rgba(48, 164, 255, 1)", 20 | pointColor : "rgba(48, 164, 255, 1)", 21 | pointStrokeColor : "#fff", 22 | pointHighlightFill : "#fff", 23 | pointHighlightStroke : "rgba(48, 164, 255, 1)", 24 | data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] 25 | } 26 | ] 27 | 28 | } 29 | 30 | var barChartData = { 31 | labels : ["January","February","March","April","May","June","July"], 32 | datasets : [ 33 | { 34 | fillColor : "rgba(220,220,220,0.5)", 35 | strokeColor : "rgba(220,220,220,0.8)", 36 | highlightFill: "rgba(220,220,220,0.75)", 37 | highlightStroke: "rgba(220,220,220,1)", 38 | data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] 39 | }, 40 | { 41 | fillColor : "rgba(48, 164, 255, 0.2)", 42 | strokeColor : "rgba(48, 164, 255, 0.8)", 43 | highlightFill : "rgba(48, 164, 255, 0.75)", 44 | highlightStroke : "rgba(48, 164, 255, 1)", 45 | data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] 46 | } 47 | ] 48 | 49 | } 50 | 51 | var pieData = [ 52 | { 53 | value: 300, 54 | color:"#30a5ff", 55 | highlight: "#62b9fb", 56 | label: "Blue" 57 | }, 58 | { 59 | value: 50, 60 | color: "#ffb53e", 61 | highlight: "#fac878", 62 | label: "Orange" 63 | }, 64 | { 65 | value: 100, 66 | color: "#1ebfae", 67 | highlight: "#3cdfce", 68 | label: "Teal" 69 | }, 70 | { 71 | value: 120, 72 | color: "#f9243f", 73 | highlight: "#f6495f", 74 | label: "Red" 75 | } 76 | 77 | ]; 78 | 79 | var doughnutData = [ 80 | { 81 | value: 300, 82 | color:"#30a5ff", 83 | highlight: "#62b9fb", 84 | label: "Blue" 85 | }, 86 | { 87 | value: 50, 88 | color: "#ffb53e", 89 | highlight: "#fac878", 90 | label: "Orange" 91 | }, 92 | { 93 | value: 100, 94 | color: "#1ebfae", 95 | highlight: "#3cdfce", 96 | label: "Teal" 97 | }, 98 | { 99 | value: 120, 100 | color: "#f9243f", 101 | highlight: "#f6495f", 102 | label: "Red" 103 | } 104 | 105 | ]; 106 | 107 | window.onload = function(){ 108 | var chart1 = document.getElementById("line-chart").getContext("2d"); 109 | window.myLine = new Chart(chart1).Line(lineChartData, { 110 | responsive: true 111 | }); 112 | var chart2 = document.getElementById("bar-chart").getContext("2d"); 113 | window.myBar = new Chart(chart2).Bar(barChartData, { 114 | responsive : true 115 | }); 116 | var chart3 = document.getElementById("doughnut-chart").getContext("2d"); 117 | window.myDoughnut = new Chart(chart3).Doughnut(doughnutData, {responsive : true 118 | }); 119 | var chart4 = document.getElementById("pie-chart").getContext("2d"); 120 | window.myPie = new Chart(chart4).Pie(pieData, {responsive : true 121 | }); 122 | 123 | }; -------------------------------------------------------------------------------- /src/main/resources/static/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | login 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
      17 |
      18 | 19 |
      20 |
      21 | 22 |

      管理员登录

      23 | 24 |
      25 | 26 |
      27 | 28 |
      29 |
      30 | 31 |
      32 | 33 |
      34 |
      35 |
      36 | 37 |
      38 | 39 |
      40 |
      41 |
      42 |
      43 |
      44 | 62 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/AdminController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.dao.AdminDao; 4 | import cn.lger.domain.Admin; 5 | import cn.lger.domain.AdminRole; 6 | import org.springframework.data.domain.Page; 7 | import org.springframework.data.domain.PageRequest; 8 | import org.springframework.data.domain.Pageable; 9 | import org.springframework.security.access.prepost.PreAuthorize; 10 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.util.StringUtils; 13 | import org.springframework.web.bind.annotation.GetMapping; 14 | import org.springframework.web.bind.annotation.PostMapping; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import javax.annotation.Resource; 18 | import javax.servlet.http.HttpSession; 19 | import java.util.Optional; 20 | 21 | /** 22 | * Code that Changed the World 23 | * Pro said 24 | * Created by Pro on 2017-12-19. 25 | */ 26 | @Controller 27 | public class AdminController { 28 | 29 | @Resource 30 | private AdminDao adminDao; 31 | 32 | @Resource 33 | private BCryptPasswordEncoder bCryptPasswordEncoder; 34 | 35 | @PostMapping("/modifyAdmin") 36 | @ResponseBody 37 | public String modifyAdmin(Admin admin, HttpSession session){ 38 | Admin adminSession = (Admin) session.getAttribute("admin"); 39 | Optional optional = adminDao.findById(adminSession.getId()); 40 | if (optional.isPresent()) { 41 | Admin adminFromDB = optional.get(); 42 | if (StringUtils.hasText(admin.getPassword())) { 43 | adminFromDB.setPassword(bCryptPasswordEncoder.encode(admin.getPassword())); 44 | } 45 | adminFromDB.setUsername(admin.getUsername()); 46 | adminFromDB.setEmail(admin.getEmail()); 47 | adminFromDB.setPhone(admin.getPhone()); 48 | adminDao.save(adminFromDB); 49 | session.removeAttribute("admin"); 50 | session.setAttribute("admin", adminFromDB); 51 | return "修改成功"; 52 | } 53 | return "修改失败"; 54 | } 55 | 56 | @GetMapping("/addAdmin") 57 | public String getAddAdminView(){ 58 | return "addAdmin"; 59 | } 60 | 61 | @GetMapping("/deleteAdmin") 62 | public String getDeleteView(){ 63 | return "deleteAdmin"; 64 | } 65 | 66 | @GetMapping("/myAccount") 67 | public String getAccountView(){ 68 | return "modifyAdmin"; 69 | } 70 | 71 | @GetMapping("/logout") 72 | public String logout(HttpSession session){ 73 | session.removeAttribute("admin"); 74 | return "login"; 75 | } 76 | 77 | @PreAuthorize("hasAnyAuthority('S_ADMIN')") 78 | @PostMapping("/addAdmin") 79 | @ResponseBody 80 | public String addAdmin(Admin admin, HttpSession session){ 81 | Admin admin1 = (Admin) session.getAttribute("admin"); 82 | if (!admin1.getRole().equals(AdminRole.S_ADMIN.toString())){ 83 | return "你不是超级管理员"; 84 | } 85 | admin.setPassword(bCryptPasswordEncoder.encode(admin.getPassword())); 86 | admin.setRole(AdminRole.G_ADMIN); 87 | adminDao.save(admin); 88 | return "添加成功"; 89 | } 90 | 91 | @PostMapping("/queryAllAdmin") 92 | @ResponseBody 93 | public Page queryAllAdmin(Integer currentPage){ 94 | if (currentPage == null || currentPage < 0){ 95 | currentPage = 0; 96 | } 97 | Pageable pageable = PageRequest.of(currentPage, 3); 98 | return adminDao.findAll(pageable); 99 | } 100 | 101 | @PreAuthorize("hasAnyAuthority('S_ADMIN')") 102 | @PostMapping("/deleteAdmin") 103 | @ResponseBody 104 | public String deleteAdmin(Integer id, HttpSession session){ 105 | Admin admin1 = (Admin) session.getAttribute("admin"); 106 | if (!admin1.getRole().equals(AdminRole.S_ADMIN.toString())){ 107 | return "你不是超级管理员"; 108 | } 109 | try{ 110 | if (id != null){ 111 | Admin admin = (Admin) session.getAttribute("admin"); 112 | if (admin.getId().equals(id)) 113 | return "你不能删除自己"; 114 | adminDao.deleteById(id); 115 | return "success"; 116 | } 117 | return "id不能为空"; 118 | }catch (Exception e){ 119 | e.printStackTrace(); 120 | return "删除失败"; 121 | } 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/Lightweight-Chart/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | cssCharts.js - jquery css charts 8 | 9 | 10 | 11 | 12 | 13 | 25 | 26 | 27 |
      28 | 29 |
      30 |

      cssCharts.js plugin

      by 31 | @thysultan on 32 | github 33 |

      34 |
      35 | 36 |

      bar chart

      37 |
      38 | 39 |
      40 |
        41 |
        42 | 43 | 44 | 45 | 46 |

        donut chart v1

        47 |
        48 | 49 |
        50 |
        51 |
        52 | 53 |

        donut chart v2

        54 |
        55 | 56 |
        57 |
        58 |
        59 | 60 |

        donut chart v2

        61 |
        62 | 63 |
        64 |
        65 |
        66 | 67 | 68 | 69 |

        line chart v1

        70 |
        71 | 72 |
        73 |
          74 |
          75 | 76 | 77 |

          line chart v2

          78 |
          79 | 80 |
          81 |
            82 |
            83 | 84 |

            line chart v3

            85 |
            86 | 87 |
            88 |
              89 |
              90 | 91 |

              line chart v4

              92 |
              93 | 94 |
              95 |
                96 |
                97 | 98 | 99 | 100 |


                101 |

                pie chart v1

                102 |
                103 | 104 |
                105 |
                106 |
                107 | 108 |
                109 | 110 | 119 | 120 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/Lightweight-Chart/index - Copy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | cssCharts.js - jquery css charts 8 | 9 | 10 | 11 | 12 | 13 | 25 | 26 | 27 |
                28 | 29 |
                30 |

                cssCharts.js plugin

                by 31 | @thysultan on 32 | github 33 |

                34 |
                35 | 36 |

                bar chart

                37 |
                38 | 39 |
                40 |
                  41 |
                  42 | 43 | 44 | 45 | 46 |

                  donut chart v1

                  47 |
                  48 | 49 |
                  50 |
                  51 |
                  52 | 53 |

                  donut chart v2

                  54 |
                  55 | 56 |
                  57 |
                  58 |
                  59 | 60 |

                  donut chart v2

                  61 |
                  62 | 63 |
                  64 |
                  65 |
                  66 | 67 | 68 | 69 |

                  line chart v1

                  70 |
                  71 | 72 |
                  73 |
                    74 |
                    75 | 76 | 77 |

                    line chart v2

                    78 |
                    79 | 80 |
                    81 |
                      82 |
                      83 | 84 |

                      line chart v3

                      85 |
                      86 | 87 |
                      88 |
                        89 |
                        90 | 91 |

                        line chart v4

                        92 |
                        93 | 94 |
                        95 |
                          96 |
                          97 | 98 | 99 | 100 |


                          101 |

                          pie chart v1

                          102 |
                          103 | 104 |
                          105 |
                          106 |
                          107 | 108 |
                          109 | 110 | 119 | 120 | -------------------------------------------------------------------------------- /src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | login 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
                          18 |
                          19 | 20 |
                          21 |
                          22 | 23 |

                          管理员登录

                          24 | 25 |
                          26 |
                          27 | 28 |
                          29 | 30 |
                          31 |
                          32 | 33 |
                          34 | 35 |
                          36 |
                          37 |
                          38 | 39 |
                          40 | 41 |
                          42 |
                          43 | 44 |
                          45 |
                          46 |
                          47 |
                          48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/main/java/cn/lger/web/MemberController.java: -------------------------------------------------------------------------------- 1 | package cn.lger.web; 2 | 3 | import cn.lger.domain.Member; 4 | import cn.lger.domain.MemberGrade; 5 | import cn.lger.exception.IdNotFoundException; 6 | import cn.lger.exception.IntegralNotEnoughException; 7 | import cn.lger.service.GiftService; 8 | import cn.lger.service.MemberGradeService; 9 | import cn.lger.service.MemberService; 10 | import cn.lger.util.FileUploadUtil; 11 | import cn.lger.util.MemberNumberRandomUtil; 12 | import cn.lger.util.UUIDRandomUtil; 13 | import org.springframework.data.domain.Page; 14 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 15 | import org.springframework.stereotype.Controller; 16 | import org.springframework.web.bind.annotation.GetMapping; 17 | import org.springframework.web.bind.annotation.PostMapping; 18 | import org.springframework.web.bind.annotation.ResponseBody; 19 | import org.springframework.web.multipart.MultipartFile; 20 | 21 | import javax.annotation.Resource; 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * Code that Changed the World 27 | * Pro said 28 | * Created by Pro on 2017-12-06. 29 | */ 30 | 31 | @Controller 32 | public class MemberController { 33 | 34 | @Resource 35 | private MemberService memberService; 36 | @Resource 37 | private MemberGradeService memberGradeService; 38 | @Resource 39 | private BCryptPasswordEncoder encoder; 40 | 41 | 42 | @GetMapping("/addMember") 43 | public String getAddMemberView() { 44 | return "addMember"; 45 | } 46 | 47 | @PostMapping("/addMember") 48 | public String addMember(Member member, String gradeName, MultipartFile icon, Map model) { 49 | //处理上传文件 50 | try { 51 | if (icon == null) 52 | return "error"; 53 | if (icon.getOriginalFilename().equals("")) 54 | member.setIconPath("/assets/icon/common.jpg"); 55 | else 56 | member.setIconPath(FileUploadUtil.upload(icon, "/assets/icon/", UUIDRandomUtil.get32UUID())); 57 | } catch (Exception e) { 58 | e.printStackTrace(); 59 | return "error"; 60 | } 61 | member.setId(MemberNumberRandomUtil.randomMemberNumber()); 62 | //通过会员等级名获取会员类型 63 | List list = memberGradeService.findMemberGradeByGradeName(gradeName); 64 | //保证输入的会员名是存在的 65 | if (list.get(0) == null) 66 | return "error"; 67 | //设置会员类型 68 | member.setMemberGrade(list.get(0)); 69 | member.setState("正常"); 70 | member.setBalance((float) 0); 71 | member.setMemberIntegral(0L); 72 | member.setPassword(encoder.encode(member.getPassword())); 73 | // System.out.println(member); 74 | member = memberService.addMember(member); 75 | 76 | model.put("member", member); 77 | return "addMemberSuccess"; 78 | } 79 | 80 | @GetMapping("/getGrade") 81 | @ResponseBody 82 | public List getGrade() { 83 | return memberGradeService.findAll(); 84 | } 85 | 86 | @GetMapping("/queryMember") 87 | public String getQueryMemberView() { 88 | return "queryMember"; 89 | } 90 | 91 | @PostMapping("/queryMember") 92 | @ResponseBody 93 | public Page queryMember(Integer currentPage, String memberName) { 94 | if (memberName == null || memberName.trim().equals("")) 95 | return memberService.findMembers(currentPage); 96 | return memberService.findMembersByMemberName(currentPage, memberName); 97 | } 98 | 99 | @GetMapping("/modifyMemberState") 100 | public String getModifyMemberStateView() { 101 | return "modifyMemberState"; 102 | } 103 | 104 | @PostMapping("/modifyMemberState") 105 | @ResponseBody 106 | public String modifyMemberStateView(String id, String state) { 107 | memberService.modifyMemberState(id, state); 108 | return "modifyMemberState"; 109 | } 110 | 111 | @GetMapping("/deleteMember") 112 | public String getDeleteMemberView() { 113 | return "deleteMember"; 114 | } 115 | 116 | @PostMapping("/deleteMember") 117 | @ResponseBody 118 | public String deleteMember(String id) { 119 | try { 120 | memberService.deleteMember(id); 121 | } catch (Exception e) { 122 | e.printStackTrace(); 123 | return "error"; 124 | } 125 | return "success"; 126 | } 127 | 128 | @GetMapping("/balanceRecharge") 129 | public String getBalanceRechargeView() { 130 | return "/balanceRecharge"; 131 | } 132 | 133 | @PostMapping("/balanceRecharge") 134 | @ResponseBody 135 | public String balanceRecharge(String id, String balance) { 136 | try { 137 | memberService.balanceRecharge(id, balance); 138 | } catch (Exception e) { 139 | e.printStackTrace(); 140 | return "error"; 141 | } 142 | return "success"; 143 | } 144 | 145 | @GetMapping("/integralLottery") 146 | public String getIntegralLotteryView() { 147 | return "integralLottery"; 148 | } 149 | 150 | @PostMapping("/integralLottery") 151 | @ResponseBody 152 | public Member integralLottery(Integer allIntegral) { 153 | if (allIntegral == null) 154 | return null; 155 | try { 156 | return memberService.integralLottery(allIntegral); 157 | } catch (Exception e) { 158 | e.printStackTrace(); 159 | } 160 | return null; 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 84 | @REM Fallback to current working directory if not found. 85 | 86 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 87 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 88 | 89 | set EXEC_DIR=%CD% 90 | set WDIR=%EXEC_DIR% 91 | :findBaseDir 92 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 93 | cd .. 94 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 95 | set WDIR=%CD% 96 | goto findBaseDir 97 | 98 | :baseDirFound 99 | set MAVEN_PROJECTBASEDIR=%WDIR% 100 | cd "%EXEC_DIR%" 101 | goto endDetectBaseDir 102 | 103 | :baseDirNotFound 104 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 105 | cd "%EXEC_DIR%" 106 | 107 | :endDetectBaseDir 108 | 109 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 110 | 111 | @setlocal EnableExtensions EnableDelayedExpansion 112 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 113 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 114 | 115 | :endReadAdditionalConfig 116 | 117 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 118 | 119 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 120 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 121 | 122 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 123 | if ERRORLEVEL 1 goto error 124 | goto end 125 | 126 | :error 127 | set ERROR_CODE=1 128 | 129 | :end 130 | @endlocal & set ERROR_CODE=%ERROR_CODE% 131 | 132 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 133 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 134 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 135 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 136 | :skipRcPost 137 | 138 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 139 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 140 | 141 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 142 | 143 | exit /B %ERROR_CODE% 144 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/formula/formula.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 3 | var editor = null; 4 | 5 | UM.registerWidget('formula', { 6 | 7 | tpl: "formula.css\">" + 8 | "
                          " + 9 | "
                            " + 10 | "
                            " + 11 | "
                            ", 12 | 13 | sourceData: { 14 | formula: { 15 | 'common': [ 16 | "{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }", 17 | "{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }" 18 | ], 19 | 'symbol': [ 20 | "+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup", 21 | "=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty", 22 | "{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq", 23 | "{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow", 24 | "{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow" 25 | ], 26 | 'letter': [ 27 | "{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu", 28 | "{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi", 29 | "{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega" 30 | ] 31 | } 32 | }, 33 | initContent: function (_editor, $widget) { 34 | 35 | var me = this, 36 | formula = me.sourceData.formula, 37 | lang = _editor.getLang('formula').static, 38 | formulaUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/formula/', 39 | options = $.extend({}, lang, { 'formula_url': formulaUrl }), 40 | $root = me.root(); 41 | 42 | if (me.inited) { 43 | me.preventDefault(); 44 | return; 45 | } 46 | me.inited = true; 47 | 48 | editor = _editor; 49 | me.$widget = $widget; 50 | 51 | $root.html($.parseTmpl(me.tpl, options)); 52 | me.tabs = $.eduitab({selector: "#edui-formula-tab-Jpanel"}); 53 | 54 | /* 初始化popup的内容 */ 55 | var headHtml = [], xMax = 0, yMax = 0, 56 | $tabContent = me.root().find('.edui-tab-content'); 57 | $.each(formula, function (k, v) { 58 | var contentHtml = []; 59 | $.each(v, function (i, f) { 60 | contentHtml.push('
                          • '); 61 | if (++xMax >=8) { 62 | ++yMax; xMax = 0; 63 | } 64 | }); 65 | yMax++; xMax = 0; 66 | $tabContent.append('
                              ' + contentHtml.join('') + '
                            '); 67 | headHtml.push('
                          • ' + lang['lang_tab_' + k] + '
                          • '); 68 | }); 69 | headHtml.push('
                          • '); 70 | $root.find('.edui-tab-nav').html(headHtml.join('')); 71 | $root.find('.edui-tab-content').append('
                            '); 72 | 73 | /* 选中第一个tab */ 74 | me.switchTab(0); 75 | }, 76 | initEvent: function () { 77 | var me = this; 78 | 79 | //防止点击过后关闭popup 80 | me.root().on('click', function (e) { 81 | return false; 82 | }); 83 | 84 | //点击tab切换菜单 85 | me.root().find('.edui-tab-nav').delegate('.edui-tab-item', 'click', function (evt) { 86 | me.switchTab(this); 87 | return false; 88 | }); 89 | 90 | //点击选中公式 91 | me.root().find('.edui-tab-pane').delegate('.edui-formula-latex-item', 'click', function (evt) { 92 | var $item = $(this), 93 | latex = $item.attr('data-latex') || ''; 94 | 95 | if (latex) { 96 | me.insertLatex(latex.replace("{/}", "\\")); 97 | } 98 | me.$widget.edui().hide(); 99 | return false; 100 | }); 101 | }, 102 | switchTab:function(index){ 103 | var me = this, 104 | $root = me.root(), 105 | index = $.isNumeric(index) ? index:$.inArray(index, $root.find('.edui-tab-nav .edui-tab-item')); 106 | 107 | $root.find('.edui-tab-nav .edui-tab-item').removeClass('edui-active').eq(index).addClass('edui-active'); 108 | $root.find('.edui-tab-content .edui-tab-pane').removeClass('edui-active').eq(index).addClass('edui-active'); 109 | 110 | /* 自动长高 */ 111 | me.autoHeight(0); 112 | }, 113 | autoHeight: function () { 114 | this.$widget.height(this.root() + 2); 115 | }, 116 | insertLatex: function (latex) { 117 | editor.execCommand('formula', latex ); 118 | }, 119 | width: 350, 120 | height: 400 121 | }); 122 | 123 | })(); 124 | 125 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/formula/formula.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 3 | var editor = null; 4 | 5 | UM.registerWidget('formula', { 6 | 7 | tpl: "formula.css\">" + 8 | "
                            " + 9 | "
                              " + 10 | "
                              " + 11 | "
                              ", 12 | 13 | sourceData: { 14 | formula: { 15 | 'common': [ 16 | "{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }", 17 | "{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }" 18 | ], 19 | 'symbol': [ 20 | "+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup", 21 | "=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty", 22 | "{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq", 23 | "{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow", 24 | "{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow" 25 | ], 26 | 'letter': [ 27 | "{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu", 28 | "{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi", 29 | "{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega" 30 | ] 31 | } 32 | }, 33 | initContent: function (_editor, $widget) { 34 | 35 | var me = this, 36 | formula = me.sourceData.formula, 37 | lang = _editor.getLang('formula').static, 38 | formulaUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/formula/', 39 | options = $.extend({}, lang, { 'formula_url': formulaUrl }), 40 | $root = me.root(); 41 | 42 | if (me.inited) { 43 | me.preventDefault(); 44 | return; 45 | } 46 | me.inited = true; 47 | 48 | editor = _editor; 49 | me.$widget = $widget; 50 | 51 | $root.html($.parseTmpl(me.tpl, options)); 52 | me.tabs = $.eduitab({selector: "#edui-formula-tab-Jpanel"}); 53 | 54 | /* 初始化popup的内容 */ 55 | var headHtml = [], xMax = 0, yMax = 0, 56 | $tabContent = me.root().find('.edui-tab-content'); 57 | $.each(formula, function (k, v) { 58 | var contentHtml = []; 59 | $.each(v, function (i, f) { 60 | contentHtml.push('
                            • '); 61 | if (++xMax >=8) { 62 | ++yMax; xMax = 0; 63 | } 64 | }); 65 | yMax++; xMax = 0; 66 | $tabContent.append('
                                ' + contentHtml.join('') + '
                              '); 67 | headHtml.push('
                            • ' + lang['lang_tab_' + k] + '
                            • '); 68 | }); 69 | headHtml.push('
                            • '); 70 | $root.find('.edui-tab-nav').html(headHtml.join('')); 71 | $root.find('.edui-tab-content').append('
                              '); 72 | 73 | /* 选中第一个tab */ 74 | me.switchTab(0); 75 | }, 76 | initEvent: function () { 77 | var me = this; 78 | 79 | //防止点击过后关闭popup 80 | me.root().on('click', function (e) { 81 | return false; 82 | }); 83 | 84 | //点击tab切换菜单 85 | me.root().find('.edui-tab-nav').delegate('.edui-tab-item', 'click', function (evt) { 86 | me.switchTab(this); 87 | return false; 88 | }); 89 | 90 | //点击选中公式 91 | me.root().find('.edui-tab-pane').delegate('.edui-formula-latex-item', 'click', function (evt) { 92 | var $item = $(this), 93 | latex = $item.attr('data-latex') || ''; 94 | 95 | if (latex) { 96 | me.insertLatex(latex.replace("{/}", "\\")); 97 | } 98 | me.$widget.edui().hide(); 99 | return false; 100 | }); 101 | }, 102 | switchTab:function(index){ 103 | var me = this, 104 | $root = me.root(), 105 | index = $.isNumeric(index) ? index:$.inArray(index, $root.find('.edui-tab-nav .edui-tab-item')); 106 | 107 | $root.find('.edui-tab-nav .edui-tab-item').removeClass('edui-active').eq(index).addClass('edui-active'); 108 | $root.find('.edui-tab-content .edui-tab-pane').removeClass('edui-active').eq(index).addClass('edui-active'); 109 | 110 | /* 自动长高 */ 111 | me.autoHeight(0); 112 | }, 113 | autoHeight: function () { 114 | this.$widget.height(this.root() + 2); 115 | }, 116 | insertLatex: function (latex) { 117 | editor.execCommand('formula', latex ); 118 | }, 119 | width: 350, 120 | height: 400 121 | }); 122 | 123 | })(); 124 | 125 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/dialogs/map/map.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 百度地图API自定义地图 9 | 10 | 17 | 18 | 19 | 20 | 21 | 22 |
                              23 | 24 | 148 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/dialogs/map/map.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 百度地图API自定义地图 9 | 10 | 17 | 18 | 19 | 20 | 21 | 22 |
                              23 | 24 | 148 | -------------------------------------------------------------------------------- /src/main/resources/static/assets/umeditor/zh-cn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 中文语言包 3 | */ 4 | UM.I18N['zh-cn'] = { 5 | 'labelMap':{ 6 | 'anchor':'锚点', 'undo':'撤销', 'redo':'重做', 'bold':'加粗', 'indent':'首行缩进', 'snapscreen':'截图', 7 | 'italic':'斜体', 'underline':'下划线', 'strikethrough':'删除线', 'subscript':'下标','fontborder':'字符边框', 8 | 'superscript':'上标', 'formatmatch':'格式刷', 'source':'源代码', 'blockquote':'引用', 9 | 'pasteplain':'纯文本粘贴模式', 'selectall':'全选', 'print':'打印', 'preview':'预览', 10 | 'horizontal':'分隔线', 'removeformat':'清除格式', 'time':'时间', 'date':'日期', 11 | 'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格', 12 | 'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格', 13 | 'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言','fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'image':'图片', 14 | 'edittable':'表格属性','edittd':'单元格属性', 'link':'超链接','emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'百度地图', 'gmap':'Google地图', 15 | 'video':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐', 16 | 'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表', 17 | 'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入', 18 | 'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'highlightcode':'插入代码', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认', 19 | 'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存', 20 | 'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', 'webapp':'百度应用', 21 | 'touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦','music':'音乐','inserttable':'插入表格', 22 | 'drafts': '草稿箱', 'formula':'数学公式' 23 | 24 | 25 | }, 26 | 'paragraph':{'p':'段落', 'h1':'标题 1', 'h2':'标题 2', 'h3':'标题 3', 'h4':'标题 4', 'h5':'标题 5', 'h6':'标题 6'}, 27 | 'fontfamily':{ 28 | 'songti':'宋体', 29 | 'kaiti':'楷体', 30 | 'heiti':'黑体', 31 | 'lishu':'隶书', 32 | 'yahei':'微软雅黑', 33 | 'andaleMono':'andale mono', 34 | 'arial': 'arial', 35 | 'arialBlack':'arial black', 36 | 'comicSansMs':'comic sans ms', 37 | 'impact':'impact', 38 | 'timesNewRoman':'times new roman' 39 | }, 40 | 'ok':"确认", 41 | 'cancel':"取消", 42 | 'closeDialog':"关闭对话框", 43 | 'tableDrag':"表格拖动必须引入uiUtils.js文件!", 44 | 'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!", 45 | 'anthorMsg':"链接", 46 | 'clearColor':'清空颜色', 47 | 'standardColor':'标准颜色', 48 | 'themeColor':'主题颜色', 49 | 'property':'属性', 50 | 'default':'默认', 51 | 'modify':'修改', 52 | 'justifyleft':'左对齐', 53 | 'justifyright':'右对齐', 54 | 'justifycenter':'居中', 55 | 'justify':'默认', 56 | 'clear':'清除', 57 | 'anchorMsg':'锚点', 58 | 'delete':'删除', 59 | 'clickToUpload':"点击上传", 60 | 'unset':'尚未设置语言文件', 61 | 't_row':'行', 62 | 't_col':'列', 63 | 'more':'更多', 64 | 'pasteOpt':'粘贴选项', 65 | 'pasteSourceFormat':"保留源格式", 66 | 'tagFormat':'只保留标签', 67 | 'pasteTextFormat':'只保留文本', 68 | 69 | //===============dialog i18N======================= 70 | 'image':{ 71 | 'static':{ 72 | 'lang_tab_local':"本地上传", 73 | 'lang_tab_imgSearch':"网络图片", 74 | 'lang_input_dragTip':"支持图片拖拽上传", 75 | 'lang_btn_add':"添加" 76 | }, 77 | 'uploadError': '上传出错' 78 | }, 79 | 'emotion':{ 80 | 'static':{ 81 | 'lang_input_choice':'精选', 82 | 'lang_input_Tuzki':'兔斯基', 83 | 'lang_input_BOBO':'BOBO', 84 | 'lang_input_lvdouwa':'绿豆蛙', 85 | 'lang_input_babyCat':'baby猫', 86 | 'lang_input_bubble':'泡泡', 87 | 'lang_input_youa':'有啊' 88 | } 89 | }, 90 | 'gmap':{ 91 | 'static':{ 92 | 'lang_input_address':'地址', 93 | 'lang_input_search':'搜索', 94 | 'address':{'value':"北京"} 95 | }, 96 | 'searchError':'无法定位到该地址!' 97 | }, 98 | 'link':{ 99 | 'static':{ 100 | 'lang_input_text':'文本内容:', 101 | 'lang_input_url':'链接地址:', 102 | 'lang_input_title':'标题:', 103 | 'lang_input_target':'是否在新窗口打开:' 104 | }, 105 | 'validLink':'只支持选中一个链接时生效', 106 | 'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀' 107 | }, 108 | 'map':{ 109 | 'static':{ 110 | 'lang_city':"城市", 111 | 'lang_address':"地址", 112 | 'city':{'value':"北京"}, 113 | 'lang_search':"搜索", 114 | 'lang_dynamicmap':"插入动态地图" 115 | }, 116 | 'cityMsg':"请选择城市", 117 | 'errorMsg':"抱歉,找不到该位置!" 118 | }, 119 | 'video':{ 120 | 'static':{ 121 | 'lang_tab_insertV':"插入视频", 122 | 'lang_video_url':"视频网址", 123 | 'lang_video_size':"视频尺寸", 124 | 'lang_videoW':"宽度", 125 | 'lang_videoH':"高度", 126 | 'lang_alignment':"对齐方式", 127 | 'videoSearchTxt':{'value':"请输入搜索关键字!"}, 128 | 'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]}, 129 | 'videoSearchBtn':{'value':"百度一下"}, 130 | 'videoSearchReset':{'value':"清空结果"} 131 | }, 132 | 'numError':"请输入正确的数值,如123,400", 133 | 'floatLeft':"左浮动", 134 | 'floatRight':"右浮动", 135 | 'default':"默认", 136 | 'block':"独占一行", 137 | 'urlError':"输入的视频地址有误,请检查后再试!", 138 | 'loading':"  视频加载中,请等待……", 139 | 'clickToSelect':"点击选中", 140 | 'goToSource':'访问源视频', 141 | 'noVideo':"    抱歉,找不到对应的视频,请重试!" 142 | }, 143 | 'formula':{ 144 | 'static':{ 145 | 'lang_tab_common':'常用公式', 146 | 'lang_tab_symbol':'符号', 147 | 'lang_tab_letter':'字母' 148 | } 149 | } 150 | }; -------------------------------------------------------------------------------- /src/main/resources/static/assets/js/dataTables/dataTables.bootstrap.css: -------------------------------------------------------------------------------- 1 | div.dataTables_length label { 2 | float: left; 3 | text-align: left; 4 | font-weight: normal; 5 | } 6 | 7 | div.dataTables_length select { 8 | width: 75px; 9 | } 10 | 11 | div.dataTables_filter label { 12 | float: right; 13 | font-weight: normal; 14 | } 15 | 16 | div.dataTables_filter input { 17 | width: 16em; 18 | } 19 | 20 | div.dataTables_info { 21 | padding-top: 8px; 22 | } 23 | 24 | div.dataTables_paginate { 25 | float: right; 26 | margin: 0; 27 | } 28 | 29 | div.dataTables_paginate ul.pagination { 30 | margin: 2px 0; 31 | white-space: nowrap; 32 | } 33 | 34 | table.dataTable, 35 | table.dataTable td, 36 | table.dataTable th { 37 | -webkit-box-sizing: content-box; 38 | -moz-box-sizing: content-box; 39 | box-sizing: content-box; 40 | } 41 | 42 | table.dataTable { 43 | clear: both; 44 | margin-top: 6px !important; 45 | margin-bottom: 6px !important; 46 | max-width: none !important; 47 | } 48 | 49 | table.dataTable thead .sorting, 50 | table.dataTable thead .sorting_asc, 51 | table.dataTable thead .sorting_desc, 52 | table.dataTable thead .sorting_asc_disabled, 53 | table.dataTable thead .sorting_desc_disabled { 54 | cursor: pointer; 55 | } 56 | 57 | table.dataTable thead .sorting { 58 | background: url('../images/sort_both.png') no-repeat center right; 59 | } 60 | 61 | table.dataTable thead .sorting_asc { 62 | background: url('../images/sort_asc.png') no-repeat center right; 63 | } 64 | 65 | table.dataTable thead .sorting_desc { 66 | background: url('../images/sort_desc.png') no-repeat center right; 67 | } 68 | 69 | table.dataTable thead .sorting_asc_disabled { 70 | background: url('../images/sort_asc_disabled.png') no-repeat center right; 71 | } 72 | 73 | table.dataTable thead .sorting_desc_disabled { 74 | background: url('../images/sort_desc_disabled.png') no-repeat center right; 75 | } 76 | 77 | table.dataTable th:active { 78 | outline: none; 79 | } 80 | 81 | /* Scrolling */ 82 | 83 | div.dataTables_scrollHead table { 84 | margin-bottom: 0 !important; 85 | border-bottom-left-radius: 0; 86 | border-bottom-right-radius: 0; 87 | } 88 | 89 | div.dataTables_scrollHead table thead tr:last-child th:first-child, 90 | div.dataTables_scrollHead table thead tr:last-child td:first-child { 91 | border-bottom-left-radius: 0 !important; 92 | border-bottom-right-radius: 0 !important; 93 | } 94 | 95 | div.dataTables_scrollBody table { 96 | margin-top: 0 !important; 97 | margin-bottom: 0 !important; 98 | border-top: none; 99 | } 100 | 101 | div.dataTables_scrollBody tbody tr:first-child th, 102 | div.dataTables_scrollBody tbody tr:first-child td { 103 | border-top: none; 104 | } 105 | 106 | div.dataTables_scrollFoot table { 107 | margin-top: 0 !important; 108 | border-top: none; 109 | } 110 | 111 | /* 112 | * TableTools styles 113 | */ 114 | 115 | .table tbody tr.active td, 116 | .table tbody tr.active th { 117 | color: white; 118 | background-color: #08C; 119 | } 120 | 121 | .table tbody tr.active:hover td, 122 | .table tbody tr.active:hover th { 123 | background-color: #0075b0 !important; 124 | } 125 | 126 | .table tbody tr.active a { 127 | color: white; 128 | } 129 | 130 | .table-striped tbody tr.active:nth-child(odd) td, 131 | .table-striped tbody tr.active:nth-child(odd) th { 132 | background-color: #017ebc; 133 | } 134 | 135 | table.DTTT_selectable tbody tr { 136 | cursor: pointer; 137 | } 138 | 139 | div.DTTT .btn { 140 | font-size: 12px; 141 | color: #333 !important; 142 | } 143 | 144 | div.DTTT .btn:hover { 145 | text-decoration: none !important; 146 | } 147 | 148 | ul.DTTT_dropdown.dropdown-menu { 149 | z-index: 2003; 150 | } 151 | 152 | ul.DTTT_dropdown.dropdown-menu a { 153 | color: #333 !important; /* needed only when demo_page.css is included */ 154 | } 155 | 156 | ul.DTTT_dropdown.dropdown-menu li { 157 | position: relative; 158 | } 159 | 160 | ul.DTTT_dropdown.dropdown-menu li:hover a { 161 | color: white !important; 162 | background-color: #0088cc; 163 | } 164 | 165 | div.DTTT_collection_background { 166 | z-index: 2002; 167 | } 168 | 169 | /* TableTools information display */ 170 | 171 | div.DTTT_print_info.modal { 172 | height: 150px; 173 | margin-top: -75px; 174 | text-align: center; 175 | } 176 | 177 | div.DTTT_print_info h6 { 178 | margin: 1em; 179 | font-size: 28px; 180 | font-weight: normal; 181 | line-height: 28px; 182 | } 183 | 184 | div.DTTT_print_info p { 185 | font-size: 14px; 186 | line-height: 20px; 187 | } 188 | 189 | /* 190 | * FixedColumns styles 191 | */ 192 | 193 | div.DTFC_LeftHeadWrapper table, 194 | div.DTFC_LeftFootWrapper table, 195 | div.DTFC_RightHeadWrapper table, 196 | div.DTFC_RightFootWrapper table, 197 | table.DTFC_Cloned tr.even { 198 | background-color: white; 199 | } 200 | 201 | div.DTFC_RightHeadWrapper table, 202 | div.DTFC_LeftHeadWrapper table { 203 | margin-bottom: 0 !important; 204 | border-top-right-radius: 0 !important; 205 | border-bottom-left-radius: 0 !important; 206 | border-bottom-right-radius: 0 !important; 207 | } 208 | 209 | div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child, 210 | div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child, 211 | div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child, 212 | div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child { 213 | border-bottom-left-radius: 0 !important; 214 | border-bottom-right-radius: 0 !important; 215 | } 216 | 217 | div.DTFC_RightBodyWrapper table, 218 | div.DTFC_LeftBodyWrapper table { 219 | margin-bottom: 0 !important; 220 | border-top: none; 221 | } 222 | 223 | div.DTFC_RightBodyWrapper tbody tr:first-child th, 224 | div.DTFC_RightBodyWrapper tbody tr:first-child td, 225 | div.DTFC_LeftBodyWrapper tbody tr:first-child th, 226 | div.DTFC_LeftBodyWrapper tbody tr:first-child td { 227 | border-top: none; 228 | } 229 | 230 | div.DTFC_RightFootWrapper table, 231 | div.DTFC_LeftFootWrapper table { 232 | border-top: none; 233 | } --------------------------------------------------------------------------------