├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── LICENSE ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── wm │ │ ├── WmApplication.java │ │ ├── common │ │ ├── BaseContext.java │ │ ├── CustomException.java │ │ ├── GlobalExceptionHandler.java │ │ ├── MyMetaObjecthandler.java │ │ └── R.java │ │ ├── config │ │ ├── JacksonObjectMapper.java │ │ ├── MybatisPlusConfig.java │ │ └── WebMvcConfig.java │ │ ├── controller │ │ ├── AddressBookController.java │ │ ├── CategoryController.java │ │ ├── CommonController.java │ │ ├── DishController.java │ │ ├── EmployeeController.java │ │ ├── OrderController.java │ │ ├── OrderDetailController.java │ │ ├── SetmealControlle.java │ │ ├── ShoppingCartController.java │ │ └── UserController.java │ │ ├── dto │ │ ├── DishDto.java │ │ └── SetmealDto.java │ │ ├── entity │ │ ├── AddressBook.java │ │ ├── Category.java │ │ ├── Dish.java │ │ ├── DishFlavor.java │ │ ├── Employee.java │ │ ├── OrderDetail.java │ │ ├── Orders.java │ │ ├── Setmeal.java │ │ ├── SetmealDish.java │ │ ├── ShoppingCart.java │ │ └── User.java │ │ ├── filter │ │ └── LoginCheckFilter.java │ │ ├── mapper │ │ ├── AddressBookMapper.java │ │ ├── CategoryMapper.java │ │ ├── DishFlavorMapper.java │ │ ├── DishMapper.java │ │ ├── EmployeeMapper.java │ │ ├── OrderDetailMapper.java │ │ ├── OrderMapper.java │ │ ├── SetmealDishMapper.java │ │ ├── SetmealMapper.java │ │ ├── ShoppingCartMapper.java │ │ └── UserMapper.java │ │ └── service │ │ ├── AddressBookService.java │ │ ├── CategoryService.java │ │ ├── DishFlavorService.java │ │ ├── DishService.java │ │ ├── EmployeeService.java │ │ ├── OrderDetailService.java │ │ ├── OrderService.java │ │ ├── SetmealDishService.java │ │ ├── SetmealService.java │ │ ├── ShoppingCartService.java │ │ ├── UserService.java │ │ └── impl │ │ ├── AddressBookServiceImpl.java │ │ ├── CategoryServiceImpl.java │ │ ├── DishFlavorImpl.java │ │ ├── DishServiceImpl.java │ │ ├── EmployeeServiceImpl.java │ │ ├── OrderDetailServiceImpl.java │ │ ├── OrderServiceImpl.java │ │ ├── SetmealDishServiceImpl.java │ │ ├── SetmealServiceImpl.java │ │ ├── ShoppingCartServiceImpl.java │ │ └── UserServiceImpl.java └── resources │ ├── application.yml │ └── static │ ├── backend │ ├── api │ │ ├── category.js │ │ ├── combo.js │ │ ├── food.js │ │ ├── login.js │ │ ├── member.js │ │ └── order.js │ ├── favicon.ico │ ├── images │ │ ├── 404-images │ │ │ ├── 404-cloud.png │ │ │ └── 404.png │ │ ├── icons │ │ │ ├── btn_back@2x.png │ │ │ ├── btn_clean@2x.png │ │ │ ├── btn_close@2x.png │ │ │ ├── icon_index.png │ │ │ ├── icon_upload@2x.png │ │ │ ├── jine_m-2@2x.png │ │ │ ├── renshu@2x.png │ │ │ └── xiangmujine@2x.png │ │ ├── img_brand01@2x.png │ │ ├── img_denglu_bj.jpg │ │ ├── login │ │ │ ├── login-l.png │ │ │ ├── login-logo.png │ │ │ └── logo.png │ │ ├── logo.png │ │ └── noImg.png │ ├── index.html │ ├── js │ │ ├── common.js │ │ ├── index.js │ │ ├── request.js │ │ └── validate.js │ ├── page │ │ ├── category │ │ │ └── list.html │ │ ├── combo │ │ │ ├── add.html │ │ │ └── list.html │ │ ├── demo │ │ │ └── upload.html │ │ ├── food │ │ │ ├── add.html │ │ │ └── list.html │ │ ├── login │ │ │ └── login.html │ │ ├── member │ │ │ ├── add.html │ │ │ └── list.html │ │ └── order │ │ │ └── list.html │ ├── plugins │ │ ├── axios │ │ │ └── axios.min.js │ │ ├── element-ui │ │ │ ├── fonts │ │ │ │ ├── element-icons.ttf │ │ │ │ └── element-icons.woff │ │ │ ├── index.css │ │ │ └── index.js │ │ └── vue │ │ │ └── vue.js │ └── styles │ │ ├── common.css │ │ ├── fonts │ │ ├── element-icons.ttf │ │ └── element-icons.woff │ │ ├── icon │ │ ├── demo.css │ │ ├── demo_index.html │ │ ├── iconfont.css │ │ ├── iconfont.js │ │ ├── iconfont.json │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ └── iconfont.woff2 │ │ ├── index.css │ │ ├── login.css │ │ └── page.css │ └── front │ ├── api │ ├── address.js │ ├── login.js │ ├── main.js │ └── order.js │ ├── cartData.json │ ├── fonts │ ├── DIN-Bold.otf │ ├── DIN-Medium.otf │ ├── PingFangSC-Medium.ttf │ ├── PingFangSC-Regular.ttf │ └── PingFangSC-Semibold.ttf │ ├── images │ ├── add.png │ ├── cart.png │ ├── cart_active.png │ ├── checked_false.png │ ├── checked_true.png │ ├── close.png │ ├── demo1.png │ ├── demo2.png │ ├── demo3.png │ ├── demo4.png │ ├── edit.png │ ├── favico.ico │ ├── headPage.png │ ├── home.png │ ├── location.png │ ├── locations.png │ ├── logo.png │ ├── mainBg.png │ ├── money.png │ ├── noImg.png │ ├── no_order.png │ ├── no_wifi.png │ ├── orders.png │ ├── subtract.png │ ├── success.png │ ├── time.png │ ├── user.png │ └── women.png │ ├── index.html │ ├── js │ ├── base.js │ ├── common.js │ ├── request.js │ └── vant.min.js │ ├── page │ ├── add-order.html │ ├── address-edit.html │ ├── address.html │ ├── login.html │ ├── no-wify.html │ ├── order.html │ ├── pay-success.html │ └── user.html │ └── styles │ ├── add-order.css │ ├── address-edit.css │ ├── address.css │ ├── index.css │ ├── login.css │ ├── main.css │ ├── no-wify.css │ ├── order.css │ ├── pay-success.css │ ├── user.css │ └── vant.min.css └── test └── java └── com └── wm └── WmApplicationTests.java /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /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 https://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 Maven 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 keystroke 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 set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.6.5 9 | 10 | 11 | com 12 | wm 13 | 0.0.1-SNAPSHOT 14 | wm 15 | wm 16 | 17 | 1.8 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter 23 | 24 | 25 | com.tencentcloudapi 26 | tencentcloud-sdk-java 27 | 3.1.270 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-test 32 | test 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-web 38 | compile 39 | 40 | 41 | 42 | com.baomidou 43 | mybatis-plus-boot-starter 44 | 3.4.2 45 | 46 | 47 | 48 | org.projectlombok 49 | lombok 50 | 1.18.20 51 | 52 | 53 | 54 | com.alibaba 55 | fastjson 56 | 1.2.76 57 | 58 | 59 | 60 | commons-lang 61 | commons-lang 62 | 2.6 63 | 64 | 65 | 66 | mysql 67 | mysql-connector-java 68 | runtime 69 | 70 | 71 | 72 | com.alibaba 73 | druid-spring-boot-starter 74 | 1.1.23 75 | 76 | 77 | com.baomidou 78 | mybatis-plus-core 79 | 3.4.2 80 | 81 | 82 | 83 | 84 | 85 | 86 | org.springframework.boot 87 | spring-boot-maven-plugin 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /src/main/java/com/wm/WmApplication.java: -------------------------------------------------------------------------------- 1 | package com.wm; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.web.servlet.ServletComponentScan; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | @Slf4j 10 | @SpringBootApplication 11 | @ServletComponentScan 12 | @EnableTransactionManagement 13 | public class WmApplication { 14 | public static void main(String[] args) { 15 | SpringApplication.run(WmApplication.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/wm/common/BaseContext.java: -------------------------------------------------------------------------------- 1 | package com.wm.common; 2 | 3 | public class BaseContext { 4 | private static ThreadLocal threadLocal = new ThreadLocal<>(); 5 | public static void setCurrentId(Long id){ 6 | threadLocal.set(id); 7 | } 8 | public static Long getCurrentId(){ 9 | return threadLocal.get(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/wm/common/CustomException.java: -------------------------------------------------------------------------------- 1 | package com.wm.common; 2 | 3 | /** 4 | * 自定义业务异常类 5 | */ 6 | public class CustomException extends RuntimeException { 7 | public CustomException(String message){ 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/wm/common/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.wm.common; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.ControllerAdvice; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import java.sql.SQLIntegrityConstraintViolationException; 11 | //全局异常处理 12 | @ControllerAdvice(annotations = {RestController.class, Controller.class}) 13 | @ResponseBody 14 | @Slf4j 15 | public class GlobalExceptionHandler { 16 | @ExceptionHandler(SQLIntegrityConstraintViolationException.class) 17 | public R executeException(SQLIntegrityConstraintViolationException ex){ 18 | log.error(ex.getMessage()); 19 | if(ex.getMessage().contains("Duplicate entry")){ 20 | return R.error("已存在"); 21 | } 22 | return R.error("未知错误!"); 23 | } 24 | 25 | //配置全局异常业务处理 26 | @ExceptionHandler(CustomException.class) 27 | public R exceptionHandler(CustomException ex){ 28 | log.error(ex.getMessage()); 29 | return R.error(ex.getMessage()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/wm/common/MyMetaObjecthandler.java: -------------------------------------------------------------------------------- 1 | package com.wm.common; 2 | 3 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.apache.ibatis.reflection.MetaObject; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.time.LocalDateTime; 9 | @Component 10 | @Slf4j 11 | public class MyMetaObjecthandler implements MetaObjectHandler { 12 | /** 13 | * 插入操作,自动填充 14 | * @param metaObject 15 | */ 16 | 17 | @Override 18 | public void insertFill(MetaObject metaObject) { 19 | log.info("公共字段自动填充[insert]..."); 20 | log.info(metaObject.toString()); 21 | metaObject.setValue("createTime", LocalDateTime.now()); 22 | metaObject.setValue("updateTime",LocalDateTime.now()); 23 | metaObject.setValue("createUser",new Long(BaseContext.getCurrentId())); 24 | metaObject.setValue("updateUser",new Long(BaseContext.getCurrentId())); 25 | } 26 | 27 | @Override 28 | public void updateFill(MetaObject metaObject) { 29 | log.info("公共字段自动填充[update]..."); 30 | log.info(metaObject.toString()); 31 | metaObject.setValue("updateTime",LocalDateTime.now()); 32 | metaObject.setValue("updateUser",new Long(BaseContext.getCurrentId())); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/wm/common/R.java: -------------------------------------------------------------------------------- 1 | package com.wm.common; 2 | 3 | import lombok.Data; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | /** 8 | * 通用返回结果,服务端响应的数据最终都会封装成此对象 9 | * @param 10 | */ 11 | @Data 12 | public class R { 13 | 14 | private Integer code; //编码:1成功,0和其它数字为失败 15 | 16 | private String msg; //错误信息 17 | 18 | private T data; //数据 19 | 20 | private Map map = new HashMap(); //动态数据 21 | 22 | public static R success(T object) { 23 | R r = new R(); 24 | r.data = object; 25 | r.code = 1; 26 | return r; 27 | } 28 | 29 | public static R error(String msg) { 30 | R r = new R(); 31 | r.msg = msg; 32 | r.code = 0; 33 | return r; 34 | } 35 | 36 | public R add(String key, Object value) { 37 | this.map.put(key, value); 38 | return this; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/wm/config/JacksonObjectMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.config; 2 | 3 | import com.fasterxml.jackson.databind.DeserializationFeature; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import com.fasterxml.jackson.databind.module.SimpleModule; 6 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 7 | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; 8 | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; 9 | import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer; 10 | import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; 11 | import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; 12 | import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; 13 | import java.math.BigInteger; 14 | import java.time.LocalDate; 15 | import java.time.LocalDateTime; 16 | import java.time.LocalTime; 17 | import java.time.format.DateTimeFormatter; 18 | import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES; 19 | 20 | /** 21 | * 对象映射器:基于jackson将Java对象转为json,或者将json转为Java对象 22 | * 将JSON解析为Java对象的过程称为 [从JSON反序列化Java对象] 23 | * 从Java对象生成JSON的过程称为 [序列化Java对象到JSON] 24 | */ 25 | public class JacksonObjectMapper extends ObjectMapper { 26 | 27 | 28 | 29 | public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; 30 | public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; 31 | public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss"; 32 | 33 | public JacksonObjectMapper() { 34 | super(); 35 | //收到未知属性时不报异常 36 | this.configure(FAIL_ON_UNKNOWN_PROPERTIES, false); 37 | 38 | //反序列化时,属性不存在的兼容处理 39 | this.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); 40 | 41 | 42 | SimpleModule simpleModule = new SimpleModule() 43 | .addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT))) 44 | .addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT))) 45 | .addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT))) 46 | 47 | .addSerializer(BigInteger.class, ToStringSerializer.instance) 48 | .addSerializer(Long.class, ToStringSerializer.instance) 49 | .addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT))) 50 | .addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT))) 51 | .addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT))); 52 | 53 | //注册功能模块 例如,可以添加自定义序列化器和反序列化器 54 | this.registerModule(simpleModule); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/wm/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.wm.config; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; 4 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | public class MybatisPlusConfig { 10 | @Bean 11 | public MybatisPlusInterceptor mybatisPlusInterceptor(){ 12 | MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor(); 13 | mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 14 | return mybatisPlusInterceptor; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/wm/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.wm.config; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.http.converter.HttpMessageConverter; 6 | import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; 7 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 9 | 10 | import java.util.List; 11 | 12 | @Slf4j //打印日志 13 | @Configuration 14 | public class WebMvcConfig extends WebMvcConfigurationSupport { 15 | @Override 16 | protected void addResourceHandlers(ResourceHandlerRegistry registry) { 17 | log.info("开始进行静态资源映射..."); 18 | //拦截请求 19 | registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/static/backend/"); 20 | registry.addResourceHandler("/front/**").addResourceLocations("classpath:/static/front/"); 21 | } 22 | 23 | 24 | /** 25 | * 扩展mvc框架的消息转换器 26 | * @param converters 27 | */ 28 | @Override 29 | protected void extendMessageConverters(List> converters) { 30 | log.info("扩展消息转换器..."); 31 | //创建消息转换器对象 32 | MappingJackson2HttpMessageConverter messageConverter = new MappingJackson2HttpMessageConverter(); 33 | //设置对象转换器,底层使用Jackson将Java对象转为json 34 | messageConverter.setObjectMapper(new JacksonObjectMapper()); 35 | //将上面的消息转换器对象追加到mvc框架的转换器集合中 36 | converters.add(0,messageConverter); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/AddressBookController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 | import com.wm.common.BaseContext; 7 | import com.wm.common.R; 8 | import com.wm.entity.AddressBook; 9 | import com.wm.service.AddressBookService; 10 | import lombok.extern.slf4j.Slf4j; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.util.CollectionUtils; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * 地址簿管理 19 | */ 20 | @Slf4j 21 | @RestController 22 | @RequestMapping("/addressBook") 23 | public class AddressBookController { 24 | 25 | @Autowired 26 | private AddressBookService addressBookService; 27 | 28 | /** 29 | * 新增 30 | */ 31 | @PostMapping 32 | public R save(@RequestBody AddressBook addressBook) { 33 | addressBook.setUserId(BaseContext.getCurrentId()); 34 | log.info("addressBook:{}", addressBook); 35 | addressBookService.save(addressBook); 36 | return R.success(addressBook); 37 | } 38 | 39 | /** 40 | * 设置默认地址 41 | */ 42 | @PutMapping("default") 43 | public R setDefault(@RequestBody AddressBook addressBook) { 44 | log.info("addressBook:{}", addressBook); 45 | LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); 46 | wrapper.eq(AddressBook::getUserId, BaseContext.getCurrentId()); 47 | wrapper.set(AddressBook::getIsDefault, 0); 48 | //SQL:update address_book set is_default = 0 where user_id = ? 49 | addressBookService.update(wrapper); 50 | 51 | addressBook.setIsDefault(1); 52 | //SQL:update address_book set is_default = 1 where id = ? 53 | addressBookService.updateById(addressBook); 54 | return R.success(addressBook); 55 | } 56 | 57 | /** 58 | * 根据id查询地址 59 | */ 60 | @GetMapping("/{id}") 61 | public R get(@PathVariable Long id) { 62 | AddressBook addressBook = addressBookService.getById(id); 63 | if (addressBook != null) { 64 | return R.success(addressBook); 65 | } else { 66 | return R.error("没有找到该对象"); 67 | } 68 | } 69 | 70 | /** 71 | * 查询默认地址 72 | */ 73 | @GetMapping("default") 74 | public R getDefault() { 75 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 76 | queryWrapper.eq(AddressBook::getUserId, BaseContext.getCurrentId()); 77 | queryWrapper.eq(AddressBook::getIsDefault, 1); 78 | 79 | //SQL:select * from address_book where user_id = ? and is_default = 1 80 | AddressBook addressBook = addressBookService.getOne(queryWrapper); 81 | 82 | if (null == addressBook) { 83 | return R.error("没有找到该对象"); 84 | } else { 85 | return R.success(addressBook); 86 | } 87 | } 88 | 89 | /** 90 | * 查询指定用户的全部地址 91 | */ 92 | @GetMapping("/list") 93 | public R> list(AddressBook addressBook) { 94 | addressBook.setUserId(BaseContext.getCurrentId()); 95 | log.info("addressBook:{}", addressBook); 96 | 97 | //条件构造器 98 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 99 | queryWrapper.eq(null != addressBook.getUserId(), AddressBook::getUserId, addressBook.getUserId()); 100 | queryWrapper.orderByDesc(AddressBook::getUpdateTime); 101 | 102 | //SQL:select * from address_book where user_id = ? order by update_time desc 103 | return R.success(addressBookService.list(queryWrapper)); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/CategoryController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.wm.common.R; 6 | import com.wm.dto.DishDto; 7 | import com.wm.entity.Category; 8 | import com.wm.service.CategoryService; 9 | import com.wm.service.DishService; 10 | import javafx.scene.canvas.GraphicsContext; 11 | import lombok.extern.slf4j.Slf4j; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | import java.util.List; 16 | 17 | @RestController 18 | @Slf4j 19 | @RequestMapping("/category") 20 | public class CategoryController { 21 | @Autowired 22 | private CategoryService categoryService; 23 | @PostMapping 24 | public R save(@RequestBody Category category){ 25 | log.info("category:{}",category); 26 | categoryService.save(category); 27 | return R.success("新增分类成功"); 28 | } 29 | @GetMapping("/page") 30 | public R page(int page, int pageSize){ 31 | //分页构造器 32 | Page pageInfo = new Page<>(page,pageSize); 33 | //条件构造器 34 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 35 | //添加排序条件,根据sort进行排序 36 | queryWrapper.orderByAsc(Category::getSort); 37 | //分页查询 38 | categoryService.page(pageInfo,queryWrapper); 39 | return R.success(pageInfo); 40 | } 41 | @DeleteMapping 42 | public R delete(Long id){ 43 | log.info("删除分类,id为:{}",id); 44 | //categoryService.removeById(id); 45 | categoryService.remove(id); 46 | return R.success("分类信息删除成功"); 47 | } 48 | 49 | @PutMapping 50 | public R update(@RequestBody Category category){ 51 | log.info("修改分类信息:{}",category); 52 | categoryService.updateById(category); 53 | return R.success("修改分类信息成功"); 54 | } 55 | @GetMapping("/list") 56 | public R> list(Category category){ 57 | //条件构造器 58 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 59 | //添加条件 60 | queryWrapper.eq(category.getType() != null,Category::getType,category.getType()); 61 | //添加排序条件 62 | queryWrapper.orderByAsc(Category::getSort).orderByDesc(Category::getUpdateTime); 63 | 64 | List list = categoryService.list(queryWrapper); 65 | return R.success(list); 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/CommonController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.wm.common.R; 4 | import lombok.extern.slf4j.Slf4j; 5 | 6 | 7 | import org.springframework.beans.factory.annotation.Value; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | import org.springframework.web.multipart.MultipartFile; 13 | 14 | import javax.servlet.ServletOutputStream; 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.io.File; 17 | import java.io.FileInputStream; 18 | import java.io.IOException; 19 | import java.util.UUID; 20 | 21 | @RestController 22 | @Slf4j 23 | @RequestMapping("/common") 24 | public class CommonController { 25 | @Value("${wm.path}") 26 | private String basePath; 27 | @PostMapping("/upload") 28 | public R upload(MultipartFile file){ 29 | log.info(file.toString()); 30 | //获取原始文件名 31 | String originalFilename = file.getOriginalFilename(); 32 | //获取文件类型(后缀) 33 | String suffix = originalFilename.substring(originalFilename.lastIndexOf(".")); 34 | //使用UUID重新生成文件名,防止文件名称重复造成文件覆盖 35 | String fileName = UUID.randomUUID().toString() + suffix; 36 | //创建一个目录对象 37 | File dir = new File(basePath); 38 | if(!dir.exists()){ 39 | dir.mkdirs(); 40 | } 41 | try { 42 | file.transferTo(new File(basePath+fileName)); 43 | } catch (IOException e) { 44 | e.printStackTrace(); 45 | } 46 | return R.success(fileName); 47 | } 48 | 49 | @GetMapping("/download") 50 | public void download(String name, HttpServletResponse response){ 51 | try { 52 | //输入流,通过输入流读取文件内容 53 | FileInputStream fileInputStream = new FileInputStream(new File(basePath + name)); 54 | 55 | //输出流,通过输出流将文件写回浏览器 56 | ServletOutputStream outputStream = response.getOutputStream(); 57 | response.setContentType("image/jpeg"); 58 | 59 | int len = 0; 60 | byte[] bytes = new byte[1024]; 61 | while ((len = fileInputStream.read(bytes)) != -1){ 62 | outputStream.write(bytes,0,len); 63 | outputStream.flush(); 64 | } 65 | 66 | //关闭资源 67 | outputStream.close(); 68 | fileInputStream.close(); 69 | } catch (Exception e) { 70 | e.printStackTrace(); 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/DishController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.wm.common.R; 6 | import com.wm.dto.DishDto; 7 | import com.wm.entity.Category; 8 | import com.wm.entity.Dish; 9 | import com.wm.service.CategoryService; 10 | import com.wm.service.DishFlavorService; 11 | import com.wm.service.DishService; 12 | import lombok.extern.slf4j.Slf4j; 13 | import org.springframework.beans.BeanUtils; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.*; 16 | 17 | import java.util.List; 18 | import java.util.stream.Collectors; 19 | 20 | @Slf4j 21 | @RestController 22 | @RequestMapping("/dish") 23 | public class DishController { 24 | @Autowired 25 | private DishService dishService; 26 | @Autowired 27 | private DishFlavorService dishFlavorService; 28 | @Autowired 29 | private CategoryService categoryService; 30 | @PostMapping 31 | public R save(@RequestBody DishDto dishDto){ 32 | log.info(dishDto.toString()); 33 | 34 | dishService.saveWithFlavor(dishDto); 35 | 36 | return R.success("新增菜品成功"); 37 | } 38 | @GetMapping("/page") 39 | public R page(int page, int pageSize, String name){ 40 | //构造分页构造器对象 41 | Page pageInfo = new Page<>(page,pageSize); 42 | Page dishDtoPage = new Page<>(); 43 | 44 | //条件构造器 45 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 46 | //添加过滤条件 47 | queryWrapper.like(name != null,Dish::getName,name); 48 | //添加排序条件 49 | queryWrapper.orderByDesc(Dish::getUpdateTime); 50 | 51 | //执行分页查询 52 | dishService.page(pageInfo,queryWrapper); 53 | 54 | //对象拷贝 55 | BeanUtils.copyProperties(pageInfo,dishDtoPage,"records"); 56 | List records = pageInfo.getRecords(); 57 | List list = records.stream().map((item) -> { 58 | 59 | DishDto dishDto = new DishDto(); 60 | BeanUtils.copyProperties(item,dishDto); 61 | Long categoryId = item.getCategoryId();//分类id 62 | //根据id查询分类对象 63 | Category category = categoryService.getById(categoryId); 64 | 65 | if(category != null){ 66 | String categoryName = category.getName(); 67 | dishDto.setCategoryName(categoryName); 68 | } 69 | return dishDto; 70 | }).collect(Collectors.toList()); 71 | dishDtoPage.setRecords(list); 72 | 73 | return R.success(dishDtoPage); 74 | } 75 | @PutMapping 76 | public R update(@RequestBody DishDto dishDto){ 77 | log.info(dishDto.toString()); 78 | dishService.updateWithFlavor(dishDto); 79 | return R.success("更新成功!"); 80 | } 81 | /** 82 | * 根据条件查询对应的菜品数据 83 | * @param dish 84 | * @return 85 | */ 86 | @GetMapping("/list") 87 | public R> list(Dish dish){ 88 | //构造查询条件 89 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 90 | queryWrapper.eq(dish.getCategoryId() != null ,Dish::getCategoryId,dish.getCategoryId()); 91 | //添加条件,查询状态为1(起售状态)的菜品 92 | queryWrapper.eq(Dish::getStatus,1); 93 | //添加排序条件 94 | queryWrapper.orderByAsc(Dish::getSort).orderByDesc(Dish::getUpdateTime); 95 | 96 | List list = dishService.list(queryWrapper); 97 | 98 | return R.success(list); 99 | } 100 | 101 | } 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/EmployeeController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.wm.common.BaseContext; 6 | import com.wm.common.R; 7 | import com.wm.entity.Employee; 8 | import com.wm.service.EmployeeService; 9 | import lombok.extern.slf4j.Slf4j; 10 | import org.apache.commons.lang.StringUtils; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.util.DigestUtils; 14 | import org.springframework.web.bind.annotation.*; 15 | 16 | import javax.servlet.http.HttpServletRequest; 17 | import java.time.LocalDateTime; 18 | 19 | @Slf4j 20 | @RestController 21 | @RequestMapping("/employee") 22 | public class EmployeeController { 23 | 24 | @Autowired 25 | private EmployeeService employeeService; 26 | 27 | /** 28 | * 员工登录 29 | * @param request 30 | * @param employee 31 | * @return 32 | */ 33 | @PostMapping("/login") 34 | public R login(HttpServletRequest request,@RequestBody Employee employee){ 35 | 36 | //将页面提交的密码password进行md5加密处理 37 | String password = employee.getPassword(); 38 | password = DigestUtils.md5DigestAsHex(password.getBytes()); 39 | 40 | //根据页面提交的用户名username查询数据库 41 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 42 | queryWrapper.eq(Employee::getUsername,employee.getUsername()); 43 | Employee emp = employeeService.getOne(queryWrapper); 44 | 45 | //3、如果没有查询到则返回登录失败结果 46 | if(emp == null){ 47 | return R.error("登录失败"); 48 | } 49 | 50 | //4、密码比对,如果不一致则返回登录失败结果 51 | if(!emp.getPassword().equals(password)){ 52 | return R.error("登录失败"); 53 | } 54 | 55 | //5、查看员工状态,如果为已禁用状态,则返回员工已禁用结果 56 | if(emp.getStatus() == 0){ 57 | return R.error("账号已禁用"); 58 | } 59 | 60 | //6、登录成功,将员工id存入Session并返回登录成功结果 61 | request.getSession().setAttribute("employee",emp.getId()); 62 | return R.success(emp); 63 | } 64 | 65 | /** 66 | * 员工退出 67 | * @param request 68 | * @return 69 | */ 70 | @PostMapping("/logout") 71 | public R logout(HttpServletRequest request){ 72 | //清理Session中保存的当前登录员工的id 73 | request.getSession().removeAttribute("employee"); 74 | return R.success("退出成功"); 75 | } 76 | /** 77 | * 新增员工 78 | * @param employee 79 | * @return 80 | */ 81 | @PostMapping 82 | public R save(HttpServletRequest request,@RequestBody Employee employee){ 83 | log.info("新增员工,员工信息:{}",employee.toString()); 84 | 85 | //设置初始密码123456,需要进行md5加密处理 86 | employee.setPassword(DigestUtils.md5DigestAsHex("123456".getBytes())); 87 | //公共字段自动赋值 88 | // employee.setCreateTime(LocalDateTime.now()); 89 | // employee.setUpdateTime(LocalDateTime.now()); 90 | //获得当前登录用户的id 91 | // Long empId = (Long) request.getSession().getAttribute("employee"); 92 | // employee.setCreateUser(empId); 93 | // employee.setUpdateUser(empId); 94 | employeeService.save(employee); 95 | return R.success("新增员工成功"); 96 | } 97 | 98 | @GetMapping("/page") 99 | public R page(int page, int pageSize, String name){ 100 | log.info("page = {},pageSize = {},name = {}" ,page,pageSize,name); 101 | //构造分页构造器 102 | Page pageInfo = new Page(page,pageSize); 103 | //构造条件构造器 104 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); 105 | //添加过滤条件 106 | queryWrapper.like(StringUtils.isNotEmpty(name),Employee::getName,name); 107 | //添加排序条件 108 | queryWrapper.orderByDesc(Employee::getUpdateTime); 109 | //执行查询 110 | employeeService.page(pageInfo,queryWrapper); 111 | return R.success(pageInfo); 112 | } 113 | @PutMapping 114 | public R update(HttpServletRequest request,@RequestBody Employee employee){ 115 | log.info(employee.toString()); 116 | // Long empId = (Long)request.getSession().getAttribute("employee"); 117 | //公共字段自动赋值 118 | System.out.println(BaseContext.getCurrentId()); 119 | System.out.println(employee); 120 | // employee.setUpdateTime(LocalDateTime.now()); 121 | // employee.setUpdateUser(empId); 122 | employeeService.updateById(employee); 123 | 124 | return R.success("员工信息修改成功"); 125 | } 126 | 127 | @GetMapping("/{id}") 128 | public R getById(@PathVariable Long id){ 129 | log.info("根据id查询员工信息..."); 130 | Employee employee = employeeService.getById(id); 131 | if(employee != null){ 132 | return R.success(employee); 133 | } 134 | return R.error("没有查询到对应员工信息"); 135 | } 136 | 137 | } 138 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.wm.common.R; 4 | import com.wm.entity.Orders; 5 | import com.wm.service.OrderService; 6 | import com.wm.service.OrderService; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | /** 15 | * 订单 16 | */ 17 | @Slf4j 18 | @RestController 19 | @RequestMapping("/order") 20 | public class OrderController { 21 | 22 | @Autowired 23 | private OrderService orderService; 24 | 25 | /** 26 | * 用户下单 27 | * @param orders 28 | * @return 29 | */ 30 | @PostMapping("/submit") 31 | public R submit(@RequestBody Orders orders){ 32 | log.info("订单数据:{}",orders); 33 | orderService.submit(orders); 34 | return R.success("下单成功"); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/OrderDetailController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.wm.service.OrderDetailService; 4 | import com.wm.service.OrderDetailService; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | /** 10 | * 订单明细 11 | */ 12 | @Slf4j 13 | @RestController 14 | @RequestMapping("/orderDetail") 15 | public class OrderDetailController { 16 | 17 | @Autowired 18 | private OrderDetailService orderDetailService; 19 | 20 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/SetmealControlle.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.wm.common.R; 6 | import com.wm.dto.SetmealDto; 7 | import com.wm.entity.Category; 8 | import com.wm.entity.Setmeal; 9 | import com.wm.service.CategoryService; 10 | import com.wm.service.SetmealDishService; 11 | import com.wm.service.SetmealService; 12 | import lombok.extern.slf4j.Slf4j; 13 | import org.springframework.beans.BeanUtils; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.*; 16 | 17 | import java.util.List; 18 | import java.util.stream.Collectors; 19 | 20 | @RestController 21 | @RequestMapping("/setmeal") 22 | @Slf4j 23 | public class SetmealControlle { 24 | @Autowired 25 | private SetmealService setmealService; 26 | @Autowired 27 | private SetmealDishService setmealDishService; 28 | @Autowired 29 | private CategoryService categoryService; 30 | @PostMapping 31 | public R save(@RequestBody SetmealDto setmealDto){ 32 | log.info("套餐信息:{}",setmealDto); 33 | 34 | setmealService.saveWithDish(setmealDto); 35 | 36 | return R.success("新增套餐成功"); 37 | } 38 | /** 39 | * 套餐分页查询 40 | * @param page 41 | * @param pageSize 42 | * @param name 43 | * @return 44 | */ 45 | @GetMapping("/page") 46 | public R page(int page,int pageSize,String name){ 47 | //分页构造器对象 48 | Page pageInfo = new Page<>(page,pageSize); 49 | Page dtoPage = new Page<>(); 50 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 51 | //添加查询条件,根据name进行like模糊查询 52 | queryWrapper.like(name != null,Setmeal::getName,name); 53 | //添加排序条件,根据更新时间降序排列 54 | queryWrapper.orderByDesc(Setmeal::getUpdateTime); 55 | setmealService.page(pageInfo,queryWrapper); 56 | //对象拷贝 57 | BeanUtils.copyProperties(pageInfo,dtoPage,"records"); 58 | List records = pageInfo.getRecords(); 59 | 60 | List list = records.stream().map((item) -> { 61 | SetmealDto setmealDto = new SetmealDto(); 62 | //对象拷贝 63 | BeanUtils.copyProperties(item,setmealDto); 64 | //分类id 65 | Long categoryId = item.getCategoryId(); 66 | //根据分类id查询分类对象 67 | Category category = categoryService.getById(categoryId); 68 | if(category != null){ 69 | //分类名称 70 | String categoryName = category.getName(); 71 | setmealDto.setCategoryName(categoryName); 72 | } 73 | return setmealDto; 74 | }).collect(Collectors.toList()); 75 | 76 | dtoPage.setRecords(list); 77 | return R.success(dtoPage); 78 | } 79 | @DeleteMapping 80 | public R delete(@RequestParam List ids){ 81 | log.info("ids:{}",ids); 82 | setmealService.removeWithDish(ids); 83 | return R.success("套餐数据删除成功"); 84 | } 85 | 86 | /** 87 | * 根据条件查询套餐数据 88 | * @param setmeal 89 | * @return 90 | */ 91 | @GetMapping("/list") 92 | public R> list(Setmeal setmeal){ 93 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 94 | queryWrapper.eq(setmeal.getCategoryId() != null,Setmeal::getCategoryId,setmeal.getCategoryId()); 95 | queryWrapper.eq(setmeal.getStatus() != null,Setmeal::getStatus,setmeal.getStatus()); 96 | queryWrapper.orderByDesc(Setmeal::getUpdateTime); 97 | List list = setmealService.list(queryWrapper); 98 | return R.success(list); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/ShoppingCartController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.wm.common.BaseContext; 5 | import com.wm.common.R; 6 | import com.wm.entity.ShoppingCart; 7 | import com.wm.service.ShoppingCartService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import java.time.LocalDateTime; 13 | import java.util.List; 14 | 15 | @Slf4j 16 | @RestController 17 | @RequestMapping("/shoppingCart") 18 | public class ShoppingCartController { 19 | @Autowired 20 | private ShoppingCartService shoppingCartService; 21 | @PostMapping("/add") 22 | public R add(@RequestBody ShoppingCart shoppingCart){ 23 | log.info("购物车数据:{}",shoppingCart); 24 | //设置用户id,指定当前是哪个用户的购物车数据 25 | Long currentId = BaseContext.getCurrentId(); 26 | shoppingCart.setUserId(currentId); 27 | 28 | Long dishId = shoppingCart.getDishId(); 29 | 30 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 31 | queryWrapper.eq(ShoppingCart::getUserId,currentId); 32 | 33 | if(dishId != null){ 34 | //添加到购物车的是菜品 35 | queryWrapper.eq(ShoppingCart::getDishId,dishId); 36 | }else{ 37 | //添加到购物车的是套餐 38 | queryWrapper.eq(ShoppingCart::getSetmealId,shoppingCart.getSetmealId()); 39 | } 40 | 41 | //查询当前菜品或者套餐是否在购物车中 42 | //SQL:select * from shopping_cart where user_id = ? and dish_id/setmeal_id = ? 43 | ShoppingCart cartServiceOne = shoppingCartService.getOne(queryWrapper); 44 | 45 | if(cartServiceOne != null){ 46 | //如果已经存在,就在原来数量基础上加一 47 | Integer number = cartServiceOne.getNumber(); 48 | cartServiceOne.setNumber(number + 1); 49 | shoppingCartService.updateById(cartServiceOne); 50 | }else{ 51 | //如果不存在,则添加到购物车,数量默认就是一 52 | shoppingCart.setNumber(1); 53 | shoppingCart.setCreateTime(LocalDateTime.now()); 54 | shoppingCartService.save(shoppingCart); 55 | cartServiceOne = shoppingCart; 56 | } 57 | return R.success(cartServiceOne); 58 | } 59 | @GetMapping("/list") 60 | public R> list(){ 61 | log.info("查看购物车..."); 62 | 63 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 64 | queryWrapper.eq(ShoppingCart::getUserId,BaseContext.getCurrentId()); 65 | queryWrapper.orderByAsc(ShoppingCart::getCreateTime); 66 | 67 | List list = shoppingCartService.list(queryWrapper); 68 | 69 | return R.success(list); 70 | } 71 | @DeleteMapping("/clean") 72 | public R clean(){ 73 | //SQL:delete from shopping_cart where user_id = ? 74 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 75 | queryWrapper.eq(ShoppingCart::getUserId,BaseContext.getCurrentId()); 76 | 77 | shoppingCartService.remove(queryWrapper); 78 | return R.success("清空购物车成功"); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/wm/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.wm.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.wm.common.R; 5 | import com.wm.entity.User; 6 | import com.wm.service.UserService; 7 | //import com.wm.utils.SMSUtils; 8 | //import com.wm.utils.ValidateCodeUtils; 9 | import lombok.extern.slf4j.Slf4j; 10 | import org.apache.commons.lang.StringUtils; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.PostMapping; 13 | import org.springframework.web.bind.annotation.RequestBody; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RestController; 16 | 17 | import javax.servlet.http.HttpSession; 18 | import java.util.Map; 19 | 20 | @RestController 21 | @RequestMapping("/user") 22 | @Slf4j 23 | public class UserController { 24 | 25 | @Autowired 26 | private UserService userService; 27 | 28 | /** 29 | * 发送手机短信验证码 30 | * @param user 31 | * @return 32 | */ 33 | // @PostMapping("/sendMsg") 34 | // public R sendMsg(@RequestBody User user, HttpSession session){ 35 | // //获取手机号 36 | // String phone = user.getPhone(); 37 | // 38 | // if(StringUtils.isNotEmpty(phone)){ 39 | // //生成随机的4位验证码 40 | // String code = ValidateCodeUtils.generateValidateCode(4).toString(); 41 | // log.info("code={}",code); 42 | // 43 | // //调用阿里云提供的短信服务API完成发送短信 44 | // //SMSUtils.sendMessage("瑞吉外卖","",phone,code); 45 | // 46 | // //需要将生成的验证码保存到Session 47 | // session.setAttribute(phone,code); 48 | // 49 | // return R.success("手机验证码短信发送成功"); 50 | // } 51 | // 52 | // return R.error("短信发送失败"); 53 | // } 54 | 55 | /** 56 | * 移动端用户登录 57 | * @param map 58 | * @param session 59 | * @return 60 | */ 61 | // @PostMapping("/login") 62 | // public R login(@RequestBody Map map, HttpSession session){ 63 | // log.info(map.toString()); 64 | // 65 | // //获取手机号 66 | // String phone = map.get("phone").toString(); 67 | // 68 | // //获取验证码 69 | // String code = map.get("code").toString(); 70 | // 71 | // //从Session中获取保存的验证码 72 | // Object codeInSession = session.getAttribute(phone); 73 | // 74 | // //进行验证码的比对(页面提交的验证码和Session中保存的验证码比对) 75 | // if(codeInSession != null && codeInSession.equals(code)){ 76 | // //如果能够比对成功,说明登录成功 77 | // 78 | // LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); 79 | // queryWrapper.eq(User::getPhone,phone); 80 | // 81 | // User user = userService.getOne(queryWrapper); 82 | // if(user == null){ 83 | // //判断当前手机号对应的用户是否为新用户,如果是新用户就自动完成注册 84 | // user = new User(); 85 | // user.setPhone(phone); 86 | // user.setStatus(1); 87 | // userService.save(user); 88 | // } 89 | // session.setAttribute("user",user.getId()); 90 | // return R.success(user); 91 | // } 92 | // return R.error("登录失败"); 93 | // } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/wm/dto/DishDto.java: -------------------------------------------------------------------------------- 1 | package com.wm.dto; 2 | 3 | import com.wm.entity.Dish; 4 | import com.wm.entity.DishFlavor; 5 | import com.wm.entity.Dish; 6 | import com.wm.entity.DishFlavor; 7 | import lombok.Data; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | @Data 12 | public class DishDto extends Dish { 13 | 14 | private List flavors = new ArrayList<>(); 15 | 16 | private String categoryName;//菜品分类名称 17 | 18 | private Integer copies; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/wm/dto/SetmealDto.java: -------------------------------------------------------------------------------- 1 | package com.wm.dto; 2 | 3 | import com.wm.entity.Setmeal; 4 | import com.wm.entity.SetmealDish; 5 | import lombok.Data; 6 | import java.util.List; 7 | 8 | @Data 9 | public class SetmealDto extends Setmeal { 10 | 11 | private List setmealDishes; 12 | 13 | private String categoryName; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/AddressBook.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.time.LocalDateTime; 9 | 10 | @Data 11 | public class AddressBook implements Serializable { 12 | private static final long serialVersionUID = 1L; 13 | 14 | private Long id; 15 | 16 | //用户id 17 | private Long userId; 18 | 19 | //收货人 20 | private String consignee; 21 | 22 | //手机号 23 | private String phone; 24 | 25 | //性别 0 女 1 男 26 | private String sex; 27 | 28 | //省级区划编号 29 | private String provinceCode; 30 | 31 | //省级名称 32 | private String provinceName; 33 | 34 | //市级区划编号 35 | private String cityCode; 36 | 37 | //市级名称 38 | private String cityName; 39 | 40 | //区级区划编号 41 | private String districtCode; 42 | 43 | //区级名称 44 | private String districtName; 45 | 46 | //详细地址 47 | private String detail; 48 | 49 | //标签 50 | private String label; 51 | 52 | //是否默认 0 否 1是 53 | private Integer isDefault; 54 | 55 | //创建时间 56 | @TableField(fill = FieldFill.INSERT) 57 | private LocalDateTime createTime; 58 | 59 | //更新时间 60 | @TableField(fill = FieldFill.INSERT_UPDATE) 61 | private LocalDateTime updateTime; 62 | 63 | //创建人 64 | @TableField(fill = FieldFill.INSERT) 65 | private Long createUser; 66 | 67 | //修改人 68 | @TableField(fill = FieldFill.INSERT_UPDATE) 69 | private Long updateUser; 70 | 71 | //是否删除 72 | private Integer isDeleted; 73 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/Category.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import lombok.Data; 6 | 7 | import java.io.Serializable; 8 | import java.time.LocalDateTime; 9 | 10 | @Data 11 | public class Category implements Serializable { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | private Long id; 16 | 17 | //类型 1 菜品分类 2 套餐分类 18 | private Integer type; 19 | 20 | //分类名称 21 | private String name; 22 | 23 | //顺序 24 | private Integer sort; 25 | 26 | //创建时间 27 | @TableField(fill = FieldFill.INSERT) 28 | private LocalDateTime createTime; 29 | 30 | //更新时间 31 | @TableField(fill = FieldFill.INSERT_UPDATE) 32 | private LocalDateTime updateTime; 33 | 34 | //创建人 35 | @TableField(fill = FieldFill.INSERT) 36 | private Long createUser; 37 | 38 | //修改人 39 | @TableField(fill = FieldFill.INSERT_UPDATE) 40 | private Long updateUser; 41 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/Dish.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableField; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import lombok.Data; 8 | import java.io.Serializable; 9 | import java.math.BigDecimal; 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | 菜品 14 | */ 15 | @Data 16 | public class Dish implements Serializable { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | private Long id; 21 | 22 | 23 | //菜品名称 24 | private String name; 25 | 26 | 27 | //菜品分类id 28 | private Long categoryId; 29 | 30 | 31 | //菜品价格 32 | private BigDecimal price; 33 | 34 | 35 | //商品码 36 | private String code; 37 | 38 | 39 | //图片 40 | private String image; 41 | 42 | 43 | //描述信息 44 | private String description; 45 | 46 | 47 | //0 停售 1 起售 48 | private Integer status; 49 | 50 | 51 | //顺序 52 | private Integer sort; 53 | 54 | 55 | @TableField(fill = FieldFill.INSERT) 56 | private LocalDateTime createTime; 57 | 58 | 59 | @TableField(fill = FieldFill.INSERT_UPDATE) 60 | private LocalDateTime updateTime; 61 | 62 | 63 | @TableField(fill = FieldFill.INSERT) 64 | private Long createUser; 65 | 66 | 67 | @TableField(fill = FieldFill.INSERT_UPDATE) 68 | private Long updateUser; 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/DishFlavor.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableField; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import lombok.Data; 8 | import java.io.Serializable; 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | 菜品口味 13 | */ 14 | @Data 15 | public class DishFlavor implements Serializable { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | private Long id; 20 | 21 | //菜品id 22 | private Long dishId; 23 | 24 | 25 | //口味名称 26 | private String name; 27 | 28 | 29 | //口味数据list 30 | private String value; 31 | 32 | 33 | @TableField(fill = FieldFill.INSERT) 34 | private LocalDateTime createTime; 35 | 36 | 37 | @TableField(fill = FieldFill.INSERT_UPDATE) 38 | private LocalDateTime updateTime; 39 | 40 | 41 | @TableField(fill = FieldFill.INSERT) 42 | private Long createUser; 43 | 44 | 45 | @TableField(fill = FieldFill.INSERT_UPDATE) 46 | private Long updateUser; 47 | 48 | 49 | //是否删除 50 | private Integer isDeleted; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/Employee.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | import java.io.Serializable; 8 | import java.time.LocalDateTime; 9 | 10 | /** 11 | * 员工实体 12 | */ 13 | @Data 14 | public class Employee implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | private Long id; 19 | 20 | private String username; 21 | 22 | private String name; 23 | 24 | private String password; 25 | 26 | private String phone; 27 | 28 | private String sex; 29 | 30 | private String idNumber;//身份证号码 31 | 32 | private Integer status; 33 | 34 | 35 | @TableField(fill = FieldFill.INSERT) //插入时填充字段 36 | private LocalDateTime createTime; 37 | @TableField(fill = FieldFill.INSERT_UPDATE) //插入和更新时填充字段 38 | private LocalDateTime updateTime; 39 | 40 | @TableField(fill = FieldFill.INSERT) //插入时填充字段 41 | private Long createUser; 42 | 43 | @TableField(fill = FieldFill.INSERT_UPDATE) //插入和更新时填充字段 44 | private Long updateUser; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/OrderDetail.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import lombok.Data; 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * 订单明细 11 | */ 12 | @Data 13 | public class OrderDetail implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | private Long id; 18 | 19 | //名称 20 | private String name; 21 | 22 | //订单id 23 | private Long orderId; 24 | 25 | 26 | //菜品id 27 | private Long dishId; 28 | 29 | 30 | //套餐id 31 | private Long setmealId; 32 | 33 | 34 | //口味 35 | private String dishFlavor; 36 | 37 | 38 | //数量 39 | private Integer number; 40 | 41 | //金额 42 | private BigDecimal amount; 43 | 44 | //图片 45 | private String image; 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/Orders.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import lombok.Data; 4 | import java.io.Serializable; 5 | import java.math.BigDecimal; 6 | import java.time.LocalDateTime; 7 | 8 | /** 9 | * 订单 10 | */ 11 | @Data 12 | public class Orders implements Serializable { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | private Long id; 17 | 18 | //订单号 19 | private String number; 20 | 21 | //订单状态 1待付款,2待派送,3已派送,4已完成,5已取消 22 | private Integer status; 23 | 24 | 25 | //下单用户id 26 | private Long userId; 27 | 28 | //地址id 29 | private Long addressBookId; 30 | 31 | 32 | //下单时间 33 | private LocalDateTime orderTime; 34 | 35 | 36 | //结账时间 37 | private LocalDateTime checkoutTime; 38 | 39 | 40 | //支付方式 1微信,2支付宝 41 | private Integer payMethod; 42 | 43 | 44 | //实收金额 45 | private BigDecimal amount; 46 | 47 | //备注 48 | private String remark; 49 | 50 | //用户名 51 | private String userName; 52 | 53 | //手机号 54 | private String phone; 55 | 56 | //地址 57 | private String address; 58 | 59 | //收货人 60 | private String consignee; 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/Setmeal.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.IdType; 5 | import com.baomidou.mybatisplus.annotation.TableField; 6 | import com.baomidou.mybatisplus.annotation.TableId; 7 | import lombok.Data; 8 | import java.io.Serializable; 9 | import java.math.BigDecimal; 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | * 套餐 14 | */ 15 | @Data 16 | public class Setmeal implements Serializable { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | private Long id; 21 | 22 | 23 | //分类id 24 | private Long categoryId; 25 | 26 | 27 | //套餐名称 28 | private String name; 29 | 30 | 31 | //套餐价格 32 | private BigDecimal price; 33 | 34 | 35 | //状态 0:停用 1:启用 36 | private Integer status; 37 | 38 | 39 | //编码 40 | private String code; 41 | 42 | 43 | //描述信息 44 | private String description; 45 | 46 | 47 | //图片 48 | private String image; 49 | 50 | 51 | @TableField(fill = FieldFill.INSERT) 52 | private LocalDateTime createTime; 53 | 54 | 55 | @TableField(fill = FieldFill.INSERT_UPDATE) 56 | private LocalDateTime updateTime; 57 | 58 | 59 | @TableField(fill = FieldFill.INSERT) 60 | private Long createUser; 61 | 62 | 63 | @TableField(fill = FieldFill.INSERT_UPDATE) 64 | private Long updateUser; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/SetmealDish.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import lombok.Data; 6 | import java.io.Serializable; 7 | import java.math.BigDecimal; 8 | import java.time.LocalDateTime; 9 | 10 | /** 11 | * 套餐菜品关系 12 | */ 13 | @Data 14 | public class SetmealDish implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | private Long id; 19 | 20 | 21 | //套餐id 22 | private Long setmealId; 23 | 24 | 25 | //菜品id 26 | private Long dishId; 27 | 28 | 29 | //菜品名称 (冗余字段) 30 | private String name; 31 | 32 | //菜品原价 33 | private BigDecimal price; 34 | 35 | //份数 36 | private Integer copies; 37 | 38 | 39 | //排序 40 | private Integer sort; 41 | 42 | 43 | @TableField(fill = FieldFill.INSERT) 44 | private LocalDateTime createTime; 45 | 46 | 47 | @TableField(fill = FieldFill.INSERT_UPDATE) 48 | private LocalDateTime updateTime; 49 | 50 | 51 | @TableField(fill = FieldFill.INSERT) 52 | private Long createUser; 53 | 54 | 55 | @TableField(fill = FieldFill.INSERT_UPDATE) 56 | private Long updateUser; 57 | 58 | 59 | //是否删除 60 | private Integer isDeleted; 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/ShoppingCart.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.math.BigDecimal; 7 | import java.time.LocalDateTime; 8 | 9 | /** 10 | * 购物车 11 | */ 12 | @Data 13 | public class ShoppingCart implements Serializable { 14 | private static final long serialVersionUID = 1L; 15 | 16 | private Long id; 17 | 18 | //名称 19 | private String name; 20 | 21 | //用户id 22 | private Long userId; 23 | 24 | //菜品id 25 | private Long dishId; 26 | 27 | //套餐id 28 | private Long setmealId; 29 | 30 | //口味 31 | private String dishFlavor; 32 | 33 | //数量 34 | private Integer number; 35 | 36 | //金额 37 | private BigDecimal amount; 38 | 39 | //图片 40 | private String image; 41 | 42 | private LocalDateTime createTime; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/wm/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.wm.entity; 2 | 3 | import lombok.Data; 4 | import java.time.LocalDateTime; 5 | import java.util.Date; 6 | import java.util.List; 7 | import java.io.Serializable; 8 | import com.baomidou.mybatisplus.annotation.IdType; 9 | import com.baomidou.mybatisplus.annotation.TableId; 10 | /** 11 | * 用户信息 12 | */ 13 | @Data 14 | public class User implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | private Long id; 19 | 20 | 21 | //姓名 22 | private String name; 23 | 24 | 25 | //手机号 26 | private String phone; 27 | 28 | 29 | //性别 0 女 1 男 30 | private String sex; 31 | 32 | 33 | //身份证号 34 | private String idNumber; 35 | 36 | 37 | //头像 38 | private String avatar; 39 | 40 | 41 | //状态 0:禁用,1:正常 42 | private Integer status; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/wm/filter/LoginCheckFilter.java: -------------------------------------------------------------------------------- 1 | package com.wm.filter; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | 5 | import com.wm.common.BaseContext; 6 | import com.wm.common.R; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.util.AntPathMatcher; 9 | 10 | import javax.servlet.*; 11 | import javax.servlet.annotation.WebFilter; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import java.io.IOException; 15 | 16 | /** 17 | * 检查用户是否已经完成登录 18 | */ 19 | @WebFilter(filterName = "loginCheckFilter",urlPatterns = "/*") 20 | @Slf4j 21 | public class LoginCheckFilter implements Filter{ 22 | //路径匹配器,支持通配符 23 | public static final AntPathMatcher PATH_MATCHER = new AntPathMatcher(); 24 | 25 | @Override 26 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { 27 | HttpServletRequest request = (HttpServletRequest) servletRequest; 28 | HttpServletResponse response = (HttpServletResponse) servletResponse; 29 | 30 | //1、获取本次请求的URI 31 | String requestURI = request.getRequestURI();// /backend/index.html 32 | 33 | log.info("拦截到请求:{}",requestURI); 34 | 35 | //定义不需要处理的请求路径 36 | String[] urls = new String[]{ 37 | "/employee/login", 38 | "/employee/logout", 39 | "/backend/**", 40 | "/front/**", 41 | "/common/**", 42 | "/user/sendMsg", 43 | "/user/login", 44 | "/category/*", 45 | "/shoppingCart/*", 46 | "/addressBook/*", 47 | "/dish/*", 48 | "/shoppingCart/*", 49 | "/setmeal/*" 50 | }; 51 | 52 | 53 | //2、判断本次请求是否需要处理 54 | boolean check = check(urls, requestURI); 55 | 56 | //3、如果不需要处理,则直接放行 57 | if(check){ 58 | log.info("本次请求{}不需要处理",requestURI); 59 | filterChain.doFilter(request,response); 60 | return; 61 | } 62 | 63 | //4、判断登录状态,如果已登录,则直接放行 64 | if(request.getSession().getAttribute("employee") != null){ 65 | log.info("用户已登录,用户id为:{}",request.getSession().getAttribute("employee")); 66 | Long id = (Long) request.getSession().getAttribute("employee"); 67 | BaseContext.setCurrentId(id); 68 | filterChain.doFilter(request,response); 69 | return; 70 | } 71 | 72 | log.info("用户未登录"); 73 | //5、如果未登录则返回未登录结果,通过输出流方式向客户端页面响应数据 74 | response.getWriter().write(JSON.toJSONString(R.error("未登录!请先登录"))); 75 | return; 76 | 77 | } 78 | 79 | /** 80 | * 路径匹配,检查本次请求是否需要放行 81 | * @param urls 82 | * @param requestURI 83 | * @return 84 | */ 85 | public boolean check(String[] urls,String requestURI){ 86 | for (String url : urls) { 87 | boolean match = PATH_MATCHER.match(url, requestURI); 88 | if(match){ 89 | return true; 90 | } 91 | } 92 | return false; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/AddressBookMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.AddressBook; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.tomcat.jni.Address; 7 | @Mapper 8 | public interface AddressBookMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/CategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.Category; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface CategoryMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/DishFlavorMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.DishFlavor; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface DishFlavorMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/DishMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.Dish; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface DishMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/EmployeeMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.Employee; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface EmployeeMapper extends BaseMapper{ 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/OrderDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.OrderDetail; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface OrderDetailMapper extends BaseMapper { 9 | 10 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.Orders; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface OrderMapper extends BaseMapper { 9 | 10 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/SetmealDishMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.SetmealDish; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface SetmealDishMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/SetmealMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.Setmeal; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface SetmealMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/ShoppingCartMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.ShoppingCart; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface ShoppingCartMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.wm.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.wm.entity.User; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface UserMapper extends BaseMapper{ 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/AddressBookService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.AddressBook; 5 | 6 | public interface AddressBookService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.Category; 5 | 6 | public interface CategoryService extends IService { 7 | public void remove(Long id); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/DishFlavorService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.dto.DishDto; 5 | import com.wm.entity.DishFlavor; 6 | 7 | public interface DishFlavorService extends IService { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/DishService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.dto.DishDto; 5 | import com.wm.entity.Dish; 6 | 7 | public interface DishService extends IService { 8 | //新增菜品,同时插入菜品对应的口味数据,需要操作两张表:dish、dish_flavor 9 | public void saveWithFlavor(DishDto dishDto); 10 | 11 | //根据id查询菜品信息和对应的口味信息 12 | public DishDto getByIdWithFlavor(Long id); 13 | 14 | //更新菜品信息,同时更新对应的口味信息 15 | public void updateWithFlavor(DishDto dishDto); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/EmployeeService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.Employee; 5 | 6 | public interface EmployeeService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/OrderDetailService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.OrderDetail; 5 | 6 | public interface OrderDetailService extends IService { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.Orders; 5 | 6 | public interface OrderService extends IService { 7 | 8 | /** 9 | * 用户下单 10 | * @param orders 11 | */ 12 | public void submit(Orders orders); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/SetmealDishService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.SetmealDish; 5 | 6 | 7 | public interface SetmealDishService extends IService { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/SetmealService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.dto.SetmealDto; 5 | import com.wm.entity.Setmeal; 6 | 7 | import java.util.List; 8 | 9 | public interface SetmealService extends IService { 10 | public void saveWithDish(SetmealDto setmealDto); 11 | public void removeWithDish(List ids); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/ShoppingCartService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.ShoppingCart; 5 | 6 | public interface ShoppingCartService extends IService { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.wm.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.IService; 4 | import com.wm.entity.Employee; 5 | import com.wm.entity.User; 6 | 7 | public interface UserService extends IService { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/AddressBookServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.wm.entity.AddressBook; 5 | import com.wm.mapper.AddressBookMapper; 6 | import com.wm.service.AddressBookService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class AddressBookServiceImpl extends ServiceImpl implements AddressBookService { 11 | 12 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/CategoryServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.wm.common.CustomException; 6 | import com.wm.entity.Category; 7 | import com.wm.entity.Dish; 8 | import com.wm.entity.Setmeal; 9 | import com.wm.mapper.CategoryMapper; 10 | import com.wm.service.CategoryService; 11 | import com.wm.service.DishService; 12 | import com.wm.service.SetmealService; 13 | import lombok.extern.slf4j.Slf4j; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.stereotype.Service; 16 | @Slf4j 17 | @Service 18 | public class CategoryServiceImpl extends ServiceImpl implements CategoryService { 19 | @Autowired 20 | private DishService dishService; 21 | @Autowired 22 | private SetmealService setmealService; 23 | @Override 24 | public void remove(Long id){ 25 | //根据id 查询菜品数据 26 | LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); 27 | wrapper.eq(Dish::getCategoryId,id); 28 | int count = dishService.count(wrapper); 29 | //如果count大于0,已经关联,抛出一个业务异常 30 | if(count > 0 ){ 31 | throw new CustomException("当前分类下关联了菜品,不能删除"); // 抛出一个业务异常 32 | 33 | } 34 | //查询是否关联了菜单 35 | LambdaQueryWrapper wrapper2 = new LambdaQueryWrapper<>(); 36 | wrapper2.eq(Setmeal::getCategoryId,id); 37 | int count1 = setmealService.count(wrapper2); 38 | if(count1 > 0){ 39 | throw new CustomException("当前分类下关联了套餐,不能删除"); 40 | 41 | } 42 | super.removeById(id); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/DishFlavorImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.wm.entity.DishFlavor; 5 | import com.wm.mapper.DishFlavorMapper; 6 | import com.wm.service.DishFlavorService; 7 | import com.wm.service.DishService; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.stereotype.Service; 10 | 11 | @Service 12 | public class DishFlavorImpl extends ServiceImpl implements DishFlavorService { 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/DishServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 5 | import com.wm.dto.DishDto; 6 | import com.wm.entity.Dish; 7 | import com.wm.entity.DishFlavor; 8 | import com.wm.mapper.DishMapper; 9 | import com.wm.service.DishFlavorService; 10 | import com.wm.service.DishService; 11 | import lombok.extern.slf4j.Slf4j; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Service; 14 | import org.springframework.transaction.annotation.Transactional; 15 | 16 | import java.util.List; 17 | import java.util.stream.Collectors; 18 | 19 | @Service 20 | @Slf4j 21 | public class DishServiceImpl extends ServiceImpl implements DishService { 22 | @Autowired 23 | private DishFlavorService dishFlavorService; 24 | @Transactional 25 | public void saveWithFlavor(DishDto dishDto) { 26 | this.save(dishDto); 27 | Long dishId = dishDto.getId();//菜品id 28 | //菜品口味 29 | List flavors = dishDto.getFlavors(); 30 | flavors = flavors.stream().map((item) -> { 31 | item.setDishId(dishId); 32 | return item; 33 | }).collect(Collectors.toList()); 34 | 35 | //保存菜品口味数据到菜品口味表dish_flavor 36 | dishFlavorService.saveBatch(flavors); 37 | } 38 | 39 | @Override 40 | public DishDto getByIdWithFlavor(Long id) { 41 | 42 | return null; 43 | } 44 | 45 | @Override 46 | public void updateWithFlavor(DishDto dishDto) { 47 | //更新dish表基本信息 48 | this.updateById(dishDto); 49 | //清理当前菜品对应口味数据---dish_flavor表的delete操作 50 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); 51 | queryWrapper.eq(DishFlavor::getDishId,dishDto.getId()); 52 | 53 | dishFlavorService.remove(queryWrapper); 54 | 55 | //添加当前提交过来的口味数据---dish_flavor表的insert操作 56 | List flavors = dishDto.getFlavors(); 57 | 58 | flavors = flavors.stream().map((item) -> { 59 | item.setDishId(dishDto.getId()); 60 | return item; 61 | }).collect(Collectors.toList()); 62 | } 63 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/EmployeeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.wm.entity.Employee; 5 | import com.wm.mapper.EmployeeMapper; 6 | import com.wm.service.EmployeeService; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.stereotype.Service; 9 | @Slf4j 10 | @Service 11 | public class EmployeeServiceImpl extends ServiceImpl implements EmployeeService{ 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/OrderDetailServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.wm.entity.OrderDetail; 5 | import com.wm.mapper.OrderDetailMapper; 6 | import com.wm.service.OrderDetailService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class OrderDetailServiceImpl extends ServiceImpl implements OrderDetailService { 11 | 12 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.core.toolkit.IdWorker; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.wm.common.BaseContext; 7 | import com.wm.common.CustomException; 8 | import com.wm.entity.*; 9 | import com.wm.mapper.OrderMapper; 10 | import com.wm.service.*; 11 | import lombok.extern.slf4j.Slf4j; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Service; 14 | import org.springframework.transaction.annotation.Transactional; 15 | 16 | import java.math.BigDecimal; 17 | import java.time.LocalDateTime; 18 | import java.util.List; 19 | import java.util.concurrent.atomic.AtomicInteger; 20 | import java.util.stream.Collectors; 21 | 22 | @Service 23 | @Slf4j 24 | public class OrderServiceImpl extends ServiceImpl implements OrderService { 25 | 26 | @Autowired 27 | private ShoppingCartService shoppingCartService; 28 | 29 | @Autowired 30 | private UserService userService; 31 | 32 | @Autowired 33 | private AddressBookService addressBookService; 34 | 35 | @Autowired 36 | private OrderDetailService orderDetailService; 37 | 38 | /** 39 | * 用户下单 40 | * @param orders 41 | */ 42 | @Transactional 43 | public void submit(Orders orders) { 44 | //获得当前用户id 45 | Long userId = BaseContext.getCurrentId(); 46 | 47 | //查询当前用户的购物车数据 48 | LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); 49 | wrapper.eq(ShoppingCart::getUserId,userId); 50 | List shoppingCarts = shoppingCartService.list(wrapper); 51 | 52 | if(shoppingCarts == null || shoppingCarts.size() == 0){ 53 | throw new CustomException("购物车为空,不能下单"); 54 | } 55 | 56 | //查询用户数据 57 | User user = userService.getById(userId); 58 | 59 | //查询地址数据 60 | Long addressBookId = orders.getAddressBookId(); 61 | AddressBook addressBook = addressBookService.getById(addressBookId); 62 | if(addressBook == null){ 63 | throw new CustomException("用户地址信息有误,不能下单"); 64 | } 65 | 66 | long orderId = IdWorker.getId();//订单号 67 | 68 | AtomicInteger amount = new AtomicInteger(0); 69 | 70 | List orderDetails = shoppingCarts.stream().map((item) -> { 71 | OrderDetail orderDetail = new OrderDetail(); 72 | orderDetail.setOrderId(orderId); 73 | orderDetail.setNumber(item.getNumber()); 74 | orderDetail.setDishFlavor(item.getDishFlavor()); 75 | orderDetail.setDishId(item.getDishId()); 76 | orderDetail.setSetmealId(item.getSetmealId()); 77 | orderDetail.setName(item.getName()); 78 | orderDetail.setImage(item.getImage()); 79 | orderDetail.setAmount(item.getAmount()); 80 | amount.addAndGet(item.getAmount().multiply(new BigDecimal(item.getNumber())).intValue()); 81 | return orderDetail; 82 | }).collect(Collectors.toList()); 83 | 84 | 85 | orders.setId(orderId); 86 | orders.setOrderTime(LocalDateTime.now()); 87 | orders.setCheckoutTime(LocalDateTime.now()); 88 | orders.setStatus(2); 89 | orders.setAmount(new BigDecimal(amount.get()));//总金额 90 | orders.setUserId(userId); 91 | orders.setNumber(String.valueOf(orderId)); 92 | orders.setUserName(user.getName()); 93 | orders.setConsignee(addressBook.getConsignee()); 94 | orders.setPhone(addressBook.getPhone()); 95 | orders.setAddress((addressBook.getProvinceName() == null ? "" : addressBook.getProvinceName()) 96 | + (addressBook.getCityName() == null ? "" : addressBook.getCityName()) 97 | + (addressBook.getDistrictName() == null ? "" : addressBook.getDistrictName()) 98 | + (addressBook.getDetail() == null ? "" : addressBook.getDetail())); 99 | //向订单表插入数据,一条数据 100 | this.save(orders); 101 | 102 | //向订单明细表插入数据,多条数据 103 | orderDetailService.saveBatch(orderDetails); 104 | 105 | //清空购物车数据 106 | shoppingCartService.remove(wrapper); 107 | } 108 | } -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/SetmealDishServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.wm.entity.SetmealDish; 5 | import com.wm.mapper.SetmealDishMapper; 6 | import com.wm.service.SetmealDishService; 7 | import com.wm.service.SetmealService; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class SetmealDishServiceImpl extends ServiceImpl implements SetmealDishService { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/SetmealServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 | import com.wm.common.CustomException; 7 | import com.wm.dto.SetmealDto; 8 | import com.wm.entity.Setmeal; 9 | import com.wm.entity.SetmealDish; 10 | import com.wm.mapper.SetmealMapper; 11 | import com.wm.service.SetmealDishService; 12 | import com.wm.service.SetmealService; 13 | import lombok.extern.slf4j.Slf4j; 14 | import org.springframework.stereotype.Service; 15 | import org.springframework.transaction.annotation.Transactional; 16 | 17 | import java.util.List; 18 | import java.util.stream.Collectors; 19 | 20 | @Service 21 | @Slf4j 22 | public class SetmealServiceImpl extends ServiceImpl implements SetmealService { 23 | private SetmealDishService setmealDishService; 24 | 25 | @Transactional 26 | public void saveWithDish(SetmealDto setmealDto) { 27 | //保存套餐的基本信息,操作setmeal,执行insert操作 28 | this.save(setmealDto); 29 | List setmealDishes = setmealDto.getSetmealDishes(); 30 | setmealDishes.stream().map((item) -> { 31 | item.setSetmealId(setmealDto.getId()); 32 | return item; 33 | }).collect(Collectors.toList()); 34 | //保存套餐和菜品的关联信息,操作setmeal_dish,执行insert操作 35 | setmealDishService.saveBatch(setmealDishes); 36 | } 37 | 38 | @Override 39 | @Transactional 40 | public void removeWithDish(List ids) { 41 | //select count(*) from setmeal where id in (1,2,3) and status = 1 42 | //查询套餐状态,确定是否可用删除 43 | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); 44 | queryWrapper.in(Setmeal::getId,ids); 45 | queryWrapper.eq(Setmeal::getStatus,1); 46 | 47 | int count = this.count(queryWrapper); 48 | if(count > 0){ 49 | //如果不能删除,抛出一个业务异常 50 | throw new CustomException("套餐正在售卖中,不能删除"); 51 | } 52 | 53 | //如果可以删除,先删除套餐表中的数据---setmeal 54 | this.removeByIds(ids); 55 | 56 | //delete from setmeal_dish where setmeal_id in (1,2,3) 57 | LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); 58 | lambdaQueryWrapper.in(SetmealDish::getSetmealId,ids); 59 | //删除关系表中的数据----setmeal_dish 60 | setmealDishService.remove(lambdaQueryWrapper); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/ShoppingCartServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.wm.entity.ShoppingCart; 5 | import com.wm.mapper.ShoppingCartMapper; 6 | import com.wm.service.ShoppingCartService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class ShoppingCartServiceImpl extends ServiceImpl implements ShoppingCartService { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/wm/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wm.service.impl; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.wm.entity.User; 5 | import com.wm.mapper.UserMapper; 6 | import com.wm.service.UserService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class UserServiceImpl extends ServiceImpl implements UserService{ 11 | } 12 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 80 3 | spring: 4 | datasource: 5 | druid: 6 | driver-class-name: com.mysql.cj.jdbc.Driver 7 | url: jdbc:mysql://localhost:3306/wm?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true 8 | username: root 9 | password: 123 10 | mybatis-plus: 11 | configuration: 12 | #在映射实体或者属性时,将数据库中表名和字段名中的下划线去掉,按照驼峰命名法映射 13 | map-underscore-to-camel-case: true 14 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 15 | global-config: 16 | db-config: 17 | id-type: ASSIGN_ID 18 | 19 | wm: 20 | path: H:\img\ 21 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/api/category.js: -------------------------------------------------------------------------------- 1 | // 查询列表接口 2 | const getCategoryPage = (params) => { 3 | return $axios({ 4 | url: '/category/page', 5 | method: 'get', 6 | params 7 | }) 8 | } 9 | 10 | // 编辑页面反查详情接口 11 | const queryCategoryById = (id) => { 12 | return $axios({ 13 | url: `/category/${id}`, 14 | method: 'get' 15 | }) 16 | } 17 | 18 | // 删除当前列的接口 19 | const deleCategory = (id) => { 20 | return $axios({ 21 | url: '/category', 22 | method: 'delete', 23 | params: { id } 24 | }) 25 | } 26 | 27 | // 修改接口 28 | const editCategory = (params) => { 29 | return $axios({ 30 | url: '/category', 31 | method: 'put', 32 | data: { ...params } 33 | }) 34 | } 35 | 36 | // 新增接口 37 | const addCategory = (params) => { 38 | return $axios({ 39 | url: '/category', 40 | method: 'post', 41 | data: { ...params } 42 | }) 43 | } -------------------------------------------------------------------------------- /src/main/resources/static/backend/api/combo.js: -------------------------------------------------------------------------------- 1 | // 查询列表数据 2 | const getSetmealPage = (params) => { 3 | return $axios({ 4 | url: '/setmeal/page', 5 | method: 'get', 6 | params 7 | }) 8 | } 9 | 10 | // 删除数据接口 11 | const deleteSetmeal = (ids) => { 12 | return $axios({ 13 | url: '/setmeal', 14 | method: 'delete', 15 | params: { ids } 16 | }) 17 | } 18 | 19 | // 修改数据接口 20 | const editSetmeal = (params) => { 21 | return $axios({ 22 | url: '/setmeal', 23 | method: 'put', 24 | data: { ...params } 25 | }) 26 | } 27 | 28 | // 新增数据接口 29 | const addSetmeal = (params) => { 30 | return $axios({ 31 | url: '/setmeal', 32 | method: 'post', 33 | data: { ...params } 34 | }) 35 | } 36 | 37 | // 查询详情接口 38 | const querySetmealById = (id) => { 39 | return $axios({ 40 | url: `/setmeal/${id}`, 41 | method: 'get' 42 | }) 43 | } 44 | 45 | // 批量起售禁售 46 | const setmealStatusByStatus = (params) => { 47 | return $axios({ 48 | url: `/setmeal/status/${params.status}`, 49 | method: 'post', 50 | params: { ids: params.ids } 51 | }) 52 | } 53 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/api/food.js: -------------------------------------------------------------------------------- 1 | // 查询列表接口 2 | const getDishPage = (params) => { 3 | return $axios({ 4 | url: '/dish/page', 5 | method: 'get', 6 | params 7 | }) 8 | } 9 | 10 | // 删除接口 11 | const deleteDish = (ids) => { 12 | return $axios({ 13 | url: '/dish', 14 | method: 'delete', 15 | params: { ids } 16 | }) 17 | } 18 | 19 | // 修改接口 20 | const editDish = (params) => { 21 | return $axios({ 22 | url: '/dish', 23 | method: 'put', 24 | data: { ...params } 25 | }) 26 | } 27 | 28 | // 新增接口 29 | const addDish = (params) => { 30 | return $axios({ 31 | url: '/dish', 32 | method: 'post', 33 | data: { ...params } 34 | }) 35 | } 36 | 37 | // 查询详情 38 | const queryDishById = (id) => { 39 | return $axios({ 40 | url: `/dish/${id}`, 41 | method: 'get' 42 | }) 43 | } 44 | 45 | // 获取菜品分类列表 46 | const getCategoryList = (params) => { 47 | return $axios({ 48 | url: '/category/list', 49 | method: 'get', 50 | params 51 | }) 52 | } 53 | 54 | // 查菜品列表的接口 55 | const queryDishList = (params) => { 56 | return $axios({ 57 | url: '/dish/list', 58 | method: 'get', 59 | params 60 | }) 61 | } 62 | 63 | // 文件down预览 64 | const commonDownload = (params) => { 65 | return $axios({ 66 | headers: { 67 | 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' 68 | }, 69 | url: '/common/download', 70 | method: 'get', 71 | params 72 | }) 73 | } 74 | 75 | // 起售停售---批量起售停售接口 76 | const dishStatusByStatus = (params) => { 77 | return $axios({ 78 | url: `/dish/status/${params.status}`, 79 | method: 'post', 80 | params: { ids: params.id } 81 | }) 82 | } -------------------------------------------------------------------------------- /src/main/resources/static/backend/api/login.js: -------------------------------------------------------------------------------- 1 | function loginApi(data) { 2 | return $axios({ 3 | 'url': '/employee/login', 4 | 'method': 'post', 5 | data 6 | }) 7 | } 8 | 9 | function logoutApi(){ 10 | return $axios({ 11 | 'url': '/employee/logout', 12 | 'method': 'post', 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/api/member.js: -------------------------------------------------------------------------------- 1 | function getMemberList (params) { 2 | return $axios({ 3 | url: '/employee/page', 4 | method: 'get', 5 | params 6 | }) 7 | } 8 | 9 | // 修改---启用禁用接口 10 | function enableOrDisableEmployee (params) { 11 | return $axios({ 12 | url: '/employee', 13 | method: 'put', 14 | data: { ...params } 15 | }) 16 | } 17 | 18 | // 新增---添加员工 19 | function addEmployee (params) { 20 | return $axios({ 21 | url: '/employee', 22 | method: 'post', 23 | data: { ...params } 24 | }) 25 | } 26 | 27 | // 修改---添加员工 28 | function editEmployee (params) { 29 | return $axios({ 30 | url: '/employee', 31 | method: 'put', 32 | data: { ...params } 33 | }) 34 | } 35 | 36 | // 修改页面反查详情接口 37 | function queryEmployeeById (id) { 38 | return $axios({ 39 | url: `/employee/${id}`, 40 | method: 'get' 41 | }) 42 | } -------------------------------------------------------------------------------- /src/main/resources/static/backend/api/order.js: -------------------------------------------------------------------------------- 1 | // 查询列表页接口 2 | const getOrderDetailPage = (params) => { 3 | return $axios({ 4 | url: '/order/page', 5 | method: 'get', 6 | params 7 | }) 8 | } 9 | 10 | // 查看接口 11 | const queryOrderDetailById = (id) => { 12 | return $axios({ 13 | url: `/orderDetail/${id}`, 14 | method: 'get' 15 | }) 16 | } 17 | 18 | // 取消,派送,完成接口 19 | const editOrderDetail = (params) => { 20 | return $axios({ 21 | url: '/order', 22 | method: 'put', 23 | data: { ...params } 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/favicon.ico -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/404-images/404-cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/404-images/404-cloud.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/404-images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/404-images/404.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/btn_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/btn_back@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/btn_clean@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/btn_clean@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/btn_close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/btn_close@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/icon_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/icon_index.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/icon_upload@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/icon_upload@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/jine_m-2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/jine_m-2@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/renshu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/renshu@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/icons/xiangmujine@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/icons/xiangmujine@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/img_brand01@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/img_brand01@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/img_denglu_bj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/img_denglu_bj.jpg -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/login/login-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/login/login-l.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/login/login-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/login/login-logo.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/login/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/login/logo.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/logo.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/images/noImg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/images/noImg.png -------------------------------------------------------------------------------- /src/main/resources/static/backend/js/common.js: -------------------------------------------------------------------------------- 1 | var web_prefix = '/backend' -------------------------------------------------------------------------------- /src/main/resources/static/backend/js/index.js: -------------------------------------------------------------------------------- 1 | /* 自定义trim */ 2 | function trim (str) { //删除左右两端的空格,自定义的trim()方法 3 | return str == undefined ? "" : str.replace(/(^\s*)|(\s*$)/g, "") 4 | } 5 | 6 | //获取url地址上面的参数 7 | function requestUrlParam(argname){ 8 | var url = location.href //获取完整的请求url路径 9 | var arrStr = url.substring(url.indexOf("?")+1).split("&") 10 | for(var i =0;i { 12 | // 是否需要设置 token 13 | // const isToken = (config.headers || {}).isToken === false 14 | // if (getToken() && !isToken) { 15 | // config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 16 | // } 17 | // get请求映射params参数 18 | if (config.method === 'get' && config.params) { 19 | let url = config.url + '?'; 20 | for (const propName of Object.keys(config.params)) { 21 | const value = config.params[propName]; 22 | var part = encodeURIComponent(propName) + "="; 23 | if (value !== null && typeof(value) !== "undefined") { 24 | if (typeof value === 'object') { 25 | for (const key of Object.keys(value)) { 26 | let params = propName + '[' + key + ']'; 27 | var subPart = encodeURIComponent(params) + "="; 28 | url += subPart + encodeURIComponent(value[key]) + "&"; 29 | } 30 | } else { 31 | url += part + encodeURIComponent(value) + "&"; 32 | } 33 | } 34 | } 35 | url = url.slice(0, -1); 36 | config.params = {}; 37 | config.url = url; 38 | } 39 | return config 40 | }, error => { 41 | console.log(error) 42 | Promise.reject(error) 43 | }) 44 | 45 | // 响应拦截器 46 | service.interceptors.response.use(res => { 47 | console.log('---响应拦截器---',res) 48 | // 未设置状态码则默认成功状态 49 | const code = res.data.code; 50 | // 获取错误信息 51 | const msg = res.data.msg 52 | console.log('---code---',code) 53 | if (res.data.code === 0 && res.data.msg === 'NOTLOGIN') {// 返回登录页面 54 | console.log('---/backend/page/login/login.html---',code) 55 | localStorage.removeItem('userInfo') 56 | window.top.location.href = '/backend/page/login/login.html' 57 | } else { 58 | return res.data 59 | } 60 | }, 61 | error => { 62 | console.log('err' + error) 63 | let { message } = error; 64 | if (message == "Network Error") { 65 | message = "后端接口连接异常"; 66 | } 67 | else if (message.includes("timeout")) { 68 | message = "系统接口请求超时"; 69 | } 70 | else if (message.includes("Request failed with status code")) { 71 | message = "系统接口" + message.substr(message.length - 3) + "异常"; 72 | } 73 | window.ELEMENT.Message({ 74 | message: message, 75 | type: 'error', 76 | duration: 5 * 1000 77 | }) 78 | return Promise.reject(error) 79 | } 80 | ) 81 |  win.$axios = service 82 | })(window); 83 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/js/validate.js: -------------------------------------------------------------------------------- 1 | 2 | function isValidUsername (str) { 3 | return ['admin', 'editor'].indexOf(str.trim()) >= 0; 4 | } 5 | 6 | function isExternal (path) { 7 | return /^(https?:|mailto:|tel:)/.test(path); 8 | } 9 | 10 | function isCellPhone (val) { 11 | if (!/^1(3|4|5|6|7|8)\d{9}$/.test(val)) { 12 | return false 13 | } else { 14 | return true 15 | } 16 | } 17 | 18 | //校验账号 19 | function checkUserName (rule, value, callback){ 20 | if (value == "") { 21 | callback(new Error("请输入账号")) 22 | } else if (value.length > 20 || value.length <3) { 23 | callback(new Error("账号长度应是3-20")) 24 | } else { 25 | callback() 26 | } 27 | } 28 | 29 | //校验姓名 30 | function checkName (rule, value, callback){ 31 | if (value == "") { 32 | callback(new Error("请输入姓名")) 33 | } else if (value.length > 12) { 34 | callback(new Error("账号长度应是1-12")) 35 | } else { 36 | callback() 37 | } 38 | } 39 | 40 | function checkPhone (rule, value, callback){ 41 | // let phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/; 42 | if (value == "") { 43 | callback(new Error("请输入手机号")) 44 | } else if (!isCellPhone(value)) {//引入methods中封装的检查手机格式的方法 45 | callback(new Error("请输入正确的手机号!")) 46 | } else { 47 | callback() 48 | } 49 | } 50 | 51 | 52 | function validID (rule,value,callback) { 53 | // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X 54 | let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ 55 | if(value == '') { 56 | callback(new Error('请输入身份证号码')) 57 | } else if (reg.test(value)) { 58 | callback() 59 | } else { 60 | callback(new Error('身份证号码不正确')) 61 | } 62 | } -------------------------------------------------------------------------------- /src/main/resources/static/backend/page/demo/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 文件上传 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 65 | 66 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/page/login/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 瑞吉外卖管理端 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/page/member/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 24 | 25 | 26 | 27 | 31 | 36 | 37 | 38 | 42 | 47 | 48 | 52 | 53 | 54 | 55 | 56 | 57 | 61 | 66 | 67 |
68 | 69 | 70 | 取消 71 | 72 | 76 | 保存 77 | 78 | 84 | 保存并继续添加 85 | 86 | 87 |
88 |
89 |
90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 218 | 219 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/page/member/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 |
21 |
22 |
23 | 30 | 36 | 37 | 41 | + 添加员工 42 | 43 |
44 | 49 | 53 | 57 | 61 | 62 | 65 | 66 | 71 | 91 | 92 | 93 | 103 |
104 |
105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 204 | 205 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/plugins/element-ui/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/plugins/element-ui/fonts/element-icons.ttf -------------------------------------------------------------------------------- /src/main/resources/static/backend/plugins/element-ui/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/plugins/element-ui/fonts/element-icons.woff -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/styles/fonts/element-icons.ttf -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/styles/fonts/element-icons.woff -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/icon/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; /* Project id 2552591 */ 3 | src: url('iconfont.woff2?t=1621231825060') format('woff2'), 4 | url('iconfont.woff?t=1621231825060') format('woff'), 5 | url('iconfont.ttf?t=1621231825060') format('truetype'); 6 | } 7 | 8 | .iconfont { 9 | font-family: "iconfont" !important; 10 | font-size: 16px; 11 | font-style: normal; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | .icon-category:before { 17 | content: "\e606"; 18 | } 19 | 20 | .icon-member:before { 21 | content: "\e607"; 22 | } 23 | 24 | .icon-user:before { 25 | content: "\e608"; 26 | } 27 | 28 | .icon-order:before { 29 | content: "\e609"; 30 | } 31 | 32 | .icon-combo:before { 33 | content: "\e60a"; 34 | } 35 | 36 | .icon-lock:before { 37 | content: "\e60b"; 38 | } 39 | 40 | .icon-food:before { 41 | content: "\e60c"; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/icon/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "2552591", 3 | "name": "rjwm", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "21641541", 10 | "name": "category", 11 | "font_class": "category", 12 | "unicode": "e606", 13 | "unicode_decimal": 58886 14 | }, 15 | { 16 | "icon_id": "21641542", 17 | "name": "member", 18 | "font_class": "member", 19 | "unicode": "e607", 20 | "unicode_decimal": 58887 21 | }, 22 | { 23 | "icon_id": "21641545", 24 | "name": "user", 25 | "font_class": "user", 26 | "unicode": "e608", 27 | "unicode_decimal": 58888 28 | }, 29 | { 30 | "icon_id": "21641546", 31 | "name": "order", 32 | "font_class": "order", 33 | "unicode": "e609", 34 | "unicode_decimal": 58889 35 | }, 36 | { 37 | "icon_id": "21641547", 38 | "name": "combo", 39 | "font_class": "combo", 40 | "unicode": "e60a", 41 | "unicode_decimal": 58890 42 | }, 43 | { 44 | "icon_id": "21641548", 45 | "name": "lock", 46 | "font_class": "lock", 47 | "unicode": "e60b", 48 | "unicode_decimal": 58891 49 | }, 50 | { 51 | "icon_id": "21641611", 52 | "name": "food", 53 | "font_class": "food", 54 | "unicode": "e60c", 55 | "unicode_decimal": 58892 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/icon/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/styles/icon/iconfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/icon/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/styles/icon/iconfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/icon/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/backend/styles/icon/iconfont.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/login.css: -------------------------------------------------------------------------------- 1 | .login { 2 | display: flex; 3 | justify-content: center; 4 | align-items: center; 5 | height: 100%; 6 | background-color: #333; 7 | } 8 | .login-box { 9 | width: 1000px; 10 | height: 474.38px; 11 | border-radius: 8px; 12 | display: flex; 13 | } 14 | 15 | .login-box img { 16 | width: 60%; 17 | height: auto; 18 | } 19 | 20 | .title { 21 | margin: 0px auto 30px auto; 22 | text-align: center; 23 | color: #707070; 24 | } 25 | .login-form { 26 | background: #ffffff; 27 | width: 40%; 28 | border-radius: 0px 8px 8px 0px; 29 | display: flex; 30 | justify-content: center; 31 | align-items: center; 32 | } 33 | .login-form .el-form { 34 | width: 214px; 35 | height: 307px; 36 | } 37 | .login-form .el-form-item { 38 | margin-bottom: 30px; 39 | } 40 | .login-form .el-form-item.is-error .el-input__inner { 41 | border: 0 !important; 42 | border-bottom: 1px solid #fd7065 !important; 43 | background: #fff !important; 44 | } 45 | .login-form .input-icon { 46 | height: 32px; 47 | width: 18px; 48 | margin-left: -2px; 49 | } 50 | .login-form .el-input__inner { 51 | border: 0; 52 | border-bottom: 1px solid #e9e9e8; 53 | border-radius: 0; 54 | font-size: 14px; 55 | font-weight: 400; 56 | color: #333333; 57 | height: 32px; 58 | line-height: 32px; 59 | } 60 | .login-form .el-input__prefix { 61 | left: 0; 62 | } 63 | .login-form .el-input--prefix .el-input__inner { 64 | padding-left: 26px; 65 | } 66 | .login-form .el-input__inner::placeholder { 67 | color: #aeb5c4; 68 | } 69 | .login-form .el-form-item--medium .el-form-item__content { 70 | line-height: 32px; 71 | } 72 | .login-form .el-input--medium .el-input__icon { 73 | line-height: 32px; 74 | } 75 | .login-btn { 76 | border-radius: 17px; 77 | padding: 11px 20px !important; 78 | margin-top: 10px; 79 | font-weight: 500; 80 | font-size: 14px; 81 | border: 0; 82 | background-color: #ffc200; 83 | } 84 | .login-btn:hover, 85 | .login-btn:focus { 86 | /* background: #FFC200; */ 87 | /* color: #ffffff; */ 88 | } 89 | .login-form-title { 90 | height: 36px; 91 | display: flex; 92 | justify-content: center; 93 | align-items: center; 94 | margin-bottom: 40px; 95 | } 96 | .login-form-title .title-label { 97 | font-weight: 500; 98 | font-size: 20px; 99 | color: #333333; 100 | margin-left: 10px; 101 | } 102 | -------------------------------------------------------------------------------- /src/main/resources/static/backend/styles/page.css: -------------------------------------------------------------------------------- 1 | .dashboard-container { 2 | padding: 20px; 3 | } 4 | .dashboard-container .container { 5 | background: #fff; 6 | position: relative; 7 | z-index: 1; 8 | padding: 30px 28px; 9 | border-radius: 4px; 10 | } 11 | .dashboard-container .container .tableBar { 12 | display: flex; 13 | margin-bottom: 20px; 14 | justify-content: space-between; 15 | } 16 | .dashboard-container .container .tableBox { 17 | width: 100%; 18 | border: solid 2px #f3f4f7; 19 | border-radius: 2px; 20 | } 21 | 22 | .dashboard-container .container .tableBox .el-image img { 23 | width: 40px; 24 | border-radius: 5px; 25 | } 26 | 27 | .dashboard-container .container .pageList { 28 | text-align: center; 29 | margin-top: 30px; 30 | } 31 | 32 | .dashboard-container .container .tableLab .span-btn { 33 | cursor: pointer; 34 | display: inline-block; 35 | font-size: 14px; 36 | padding: 0 20px; 37 | color: #818693; 38 | border-right: solid 1px #d8dde3; 39 | } 40 | 41 | .dashboard-container .container .tableLab .el-button { 42 | margin-left: 10px; 43 | } 44 | 45 | .el-table-column--selection .cell { 46 | padding-left: 10px; 47 | } 48 | 49 | /* 添加 */ 50 | .addBrand-container .avatar-uploader .el-upload { 51 | border: 1px dashed #d9d9d9; 52 | border-radius: 6px; 53 | cursor: pointer; 54 | position: relative; 55 | overflow: hidden; 56 | } 57 | .addBrand-container .avatar-uploader .el-upload:hover { 58 | border-color: #409eff; 59 | } 60 | .addBrand-container .avatar-uploader-icon { 61 | font-size: 28px; 62 | color: #8c939d; 63 | width: 200px; 64 | height: 160px; 65 | line-height: 160px; 66 | text-align: center; 67 | } 68 | .addBrand-container .avatar { 69 | width: 160px; 70 | height: 160px; 71 | display: block; 72 | } 73 | .addBrand-container .el-form--inline .el-form-item__content { 74 | width: 293px; 75 | } 76 | .addBrand-container .el-input { 77 | width: 293px; 78 | } 79 | 80 | .addBrand-container { 81 | margin: 30px; 82 | } 83 | .addBrand-container .container { 84 | position: relative; 85 | z-index: 1; 86 | background: #fff; 87 | padding: 30px; 88 | border-radius: 4px; 89 | min-height: 500px; 90 | } 91 | .addBrand-container .container .subBox { 92 | padding-top: 30px; 93 | text-align: center; 94 | border-top: solid 1px #f3f4f7; 95 | } 96 | 97 | .flavorBox { 98 | width: 777px; 99 | } 100 | .flavorBox .addBut { 101 | background: #ffc200; 102 | display: inline-block; 103 | padding: 0px 20px; 104 | border-radius: 3px; 105 | line-height: 40px; 106 | cursor: pointer; 107 | border-radius: 4px; 108 | color: #333333; 109 | font-weight: 500; 110 | } 111 | .flavorBox .flavor { 112 | border: solid 1px #dfe2e8; 113 | border-radius: 3px; 114 | padding: 15px; 115 | background: #fafafb; 116 | } 117 | .flavorBox .flavor .title { 118 | color: #606168; 119 | } 120 | .flavorBox .flavor .cont .items { 121 | display: flex; 122 | margin: 10px 0; 123 | } 124 | .flavorBox .flavor .cont .items .itTit { 125 | width: 150px; 126 | margin-right: 15px; 127 | } 128 | .flavorBox .flavor .cont .items .itTit input { 129 | width: 100%; 130 | line-height: 40px; 131 | border-radius: 3px; 132 | padding: 0 10px; 133 | } 134 | .flavorBox .flavor .cont .items .labItems { 135 | flex: 1; 136 | display: flex; 137 | flex-wrap: wrap; 138 | border-radius: 3px; 139 | min-height: 39px; 140 | border: solid 1px #d8dde3; 141 | background: #fff; 142 | padding: 0 5px; 143 | } 144 | .flavorBox .flavor .cont .items .labItems span { 145 | display: inline-block; 146 | color: #f19c59; 147 | margin: 5px; 148 | line-height: 26px; 149 | height: 26px; 150 | padding: 0 10px; 151 | background: #fdf4eb; 152 | border-radius: 3px; 153 | border: solid 1px #fae2cd; 154 | } 155 | .flavorBox .flavor .cont .items .labItems span i { 156 | cursor: pointer; 157 | font-style: normal; 158 | } 159 | .flavorBox .flavor .cont .items .labItems .inputBox { 160 | display: inline-block; 161 | width: 100%; 162 | height: 36px; 163 | line-height: 36px; 164 | overflow: hidden; 165 | } 166 | .flavorBox .flavor .cont .items .delFlavor { 167 | display: inline-block; 168 | padding: 0 10px; 169 | color: #f19c59; 170 | cursor: pointer; 171 | } 172 | 173 | .addBrand-container .address .el-form-item__content { 174 | width: 777px !important; 175 | } 176 | 177 | .el-button--text { 178 | font-weight: 400 !important; 179 | font-size: 13px !important; 180 | } 181 | 182 | .el-table td { 183 | font-size: 13px !important; 184 | } 185 | 186 | .el-table .cell, 187 | .el-table th div, 188 | .el-table--border td:first-child .cell, 189 | .el-table--border th:first-child .cell { 190 | padding-left: 12px; 191 | } 192 | -------------------------------------------------------------------------------- /src/main/resources/static/front/api/address.js: -------------------------------------------------------------------------------- 1 | //获取所有地址 2 | function addressListApi() { 3 | return $axios({ 4 | 'url': '/addressBook/list', 5 | 'method': 'get', 6 | }) 7 | } 8 | 9 | //获取最新地址 10 | function addressLastUpdateApi() { 11 | return $axios({ 12 | 'url': '/addressBook/lastUpdate', 13 | 'method': 'get', 14 | }) 15 | } 16 | 17 | //新增地址 18 | function addAddressApi(data){ 19 | return $axios({ 20 | 'url': '/addressBook', 21 | 'method': 'post', 22 | data 23 | }) 24 | } 25 | 26 | //修改地址 27 | function updateAddressApi(data){ 28 | return $axios({ 29 | 'url': '/addressBook', 30 | 'method': 'put', 31 | data 32 | }) 33 | } 34 | 35 | //删除地址 36 | function deleteAddressApi(params) { 37 | return $axios({ 38 | 'url': '/addressBook', 39 | 'method': 'delete', 40 | params 41 | }) 42 | } 43 | 44 | //查询单个地址 45 | function addressFindOneApi(id) { 46 | return $axios({ 47 | 'url': `/addressBook/${id}`, 48 | 'method': 'get', 49 | }) 50 | } 51 | 52 | //设置默认地址 53 | function setDefaultAddressApi(data){ 54 | return $axios({ 55 | 'url': '/addressBook/default', 56 | 'method': 'put', 57 | data 58 | }) 59 | } 60 | 61 | //获取默认地址 62 | function getDefaultAddressApi() { 63 | return $axios({ 64 | 'url': `/addressBook/default`, 65 | 'method': 'get', 66 | }) 67 | } -------------------------------------------------------------------------------- /src/main/resources/static/front/api/login.js: -------------------------------------------------------------------------------- 1 | function loginApi(data) { 2 | return $axios({ 3 | 'url': '/user/login', 4 | 'method': 'post', 5 | data 6 | }) 7 | } 8 | 9 | function sendMsgApi(data) { 10 | return $axios({ 11 | 'url': '/user/sendMsg', 12 | 'method': 'post', 13 | data 14 | }) 15 | } 16 | 17 | function loginoutApi() { 18 | return $axios({ 19 | 'url': '/user/loginout', 20 | 'method': 'post', 21 | }) 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/static/front/api/main.js: -------------------------------------------------------------------------------- 1 | //获取所有的菜品分类 2 | function categoryListApi() { 3 | return $axios({ 4 | 'url': '/category/list', 5 | 'method': 'get', 6 | }) 7 | } 8 | 9 | //获取菜品分类对应的菜品 10 | function dishListApi(data) { 11 | return $axios({ 12 | 'url': '/dish/list', 13 | 'method': 'get', 14 | params:{...data} 15 | }) 16 | } 17 | 18 | //获取菜品分类对应的套餐 19 | function setmealListApi(data) { 20 | return $axios({ 21 | 'url': '/setmeal/list', 22 | 'method': 'get', 23 | params:{...data} 24 | }) 25 | } 26 | 27 | //获取购物车内商品的集合 28 | function cartListApi(data) { 29 | return $axios({ 30 | 'url': '/shoppingCart/list', 31 | //'url': '/front/cartData.json', 32 | 'method': 'get', 33 | params:{...data} 34 | }) 35 | } 36 | 37 | //购物车中添加商品 38 | function addCartApi(data){ 39 | return $axios({ 40 | 'url': '/shoppingCart/add', 41 | 'method': 'post', 42 | data 43 | }) 44 | } 45 | 46 | //购物车中修改商品 47 | function updateCartApi(data){ 48 | return $axios({ 49 | 'url': '/shoppingCart/sub', 50 | 'method': 'post', 51 | data 52 | }) 53 | } 54 | 55 | //删除购物车的商品 56 | function clearCartApi() { 57 | return $axios({ 58 | 'url': '/shoppingCart/clean', 59 | 'method': 'delete', 60 | }) 61 | } 62 | 63 | //获取套餐的全部菜品 64 | function setMealDishDetailsApi(id) { 65 | return $axios({ 66 | 'url': `/setmeal/dish/${id}`, 67 | 'method': 'get', 68 | }) 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/resources/static/front/api/order.js: -------------------------------------------------------------------------------- 1 | //提交订单 2 | function addOrderApi(data){ 3 | return $axios({ 4 | 'url': '/order/submit', 5 | 'method': 'post', 6 | data 7 | }) 8 | } 9 | 10 | //查询所有订单 11 | function orderListApi() { 12 | return $axios({ 13 | 'url': '/order/list', 14 | 'method': 'get', 15 | }) 16 | } 17 | 18 | //分页查询订单 19 | function orderPagingApi(data) { 20 | return $axios({ 21 | 'url': '/order/userPage', 22 | 'method': 'get', 23 | params:{...data} 24 | }) 25 | } 26 | 27 | //再来一单 28 | function orderAgainApi(data) { 29 | return $axios({ 30 | 'url': '/order/again', 31 | 'method': 'post', 32 | data 33 | }) 34 | } -------------------------------------------------------------------------------- /src/main/resources/static/front/cartData.json: -------------------------------------------------------------------------------- 1 | {"code":1,"msg":null,"data":[],"map":{}} -------------------------------------------------------------------------------- /src/main/resources/static/front/fonts/DIN-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/fonts/DIN-Bold.otf -------------------------------------------------------------------------------- /src/main/resources/static/front/fonts/DIN-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/fonts/DIN-Medium.otf -------------------------------------------------------------------------------- /src/main/resources/static/front/fonts/PingFangSC-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/fonts/PingFangSC-Medium.ttf -------------------------------------------------------------------------------- /src/main/resources/static/front/fonts/PingFangSC-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/fonts/PingFangSC-Regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/front/fonts/PingFangSC-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/fonts/PingFangSC-Semibold.ttf -------------------------------------------------------------------------------- /src/main/resources/static/front/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/add.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/cart.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/cart_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/cart_active.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/checked_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/checked_false.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/checked_true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/checked_true.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/close.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/demo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/demo1.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/demo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/demo2.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/demo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/demo3.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/demo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/demo4.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/edit.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/favico.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/favico.ico -------------------------------------------------------------------------------- /src/main/resources/static/front/images/headPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/headPage.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/home.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/location.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/locations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/locations.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/logo.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/mainBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/mainBg.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/money.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/noImg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/noImg.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/no_order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/no_order.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/no_wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/no_wifi.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/orders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/orders.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/subtract.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/success.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/time.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/user.png -------------------------------------------------------------------------------- /src/main/resources/static/front/images/women.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icemomo-hgy/Wm/0c8717321438613ca2c15e98da1ca4f0079ca4ff/src/main/resources/static/front/images/women.png -------------------------------------------------------------------------------- /src/main/resources/static/front/js/base.js: -------------------------------------------------------------------------------- 1 | (function (doc, win) { 2 | var docEl = doc.documentElement, 3 | resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', 4 | recalc = function () { 5 | var clientWidth = docEl.clientWidth; 6 | if (!clientWidth) return; 7 | if (clientWidth > 750) { 8 | docEl.style.fontSize = '28px'; 9 | } else { 10 | docEl.style.fontSize = (clientWidth / 375) + 'px'; 11 | } 12 | }; 13 | 14 | if (!doc.addEventListener) return; 15 | win.addEventListener(resizeEvt, recalc, false); 16 | doc.addEventListener('DOMContentLoaded', recalc, false); 17 | })(document, window); -------------------------------------------------------------------------------- /src/main/resources/static/front/js/common.js: -------------------------------------------------------------------------------- 1 | var web_prefix = '/front' 2 | 3 | function imgPath(path){ 4 | return '/common/download?name=' + path 5 | } 6 | 7 | //将url传参转换为数组 8 | function parseUrl(url) { 9 | // 找到url中的第一个?号 10 | var parse = url.substring(url.indexOf("?") + 1), 11 | params = parse.split("&"), 12 | len = params.length, 13 | item = [], 14 | param = {}; 15 | 16 | for (var i = 0; i < len; i++) { 17 | item = params[i].split("="); 18 | param[item[0]] = item[1]; 19 | } 20 | 21 | return param; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/static/front/js/request.js: -------------------------------------------------------------------------------- 1 | (function (win) { 2 | axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' 3 | // 创建axios实例 4 | const service = axios.create({ 5 | // axios中请求配置有baseURL选项,表示请求URL公共部分 6 | baseURL: '/', 7 | // 超时 8 | timeout: 1000000 9 | }) 10 | // request拦截器 11 | service.interceptors.request.use(config => { 12 | // 是否需要设置 token 13 | // const isToken = (config.headers || {}).isToken === false 14 | // if (getToken() && !isToken) { 15 | // config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 16 | // } 17 | // get请求映射params参数 18 | if (config.method === 'get' && config.params) { 19 | let url = config.url + '?'; 20 | for (const propName of Object.keys(config.params)) { 21 | const value = config.params[propName]; 22 | var part = encodeURIComponent(propName) + "="; 23 | if (value !== null && typeof(value) !== "undefined") { 24 | if (typeof value === 'object') { 25 | for (const key of Object.keys(value)) { 26 | let params = propName + '[' + key + ']'; 27 | var subPart = encodeURIComponent(params) + "="; 28 | url += subPart + encodeURIComponent(value[key]) + "&"; 29 | } 30 | } else { 31 | url += part + encodeURIComponent(value) + "&"; 32 | } 33 | } 34 | } 35 | url = url.slice(0, -1); 36 | config.params = {}; 37 | config.url = url; 38 | } 39 | return config 40 | }, error => { 41 | Promise.reject(error) 42 | }) 43 | 44 | // 响应拦截器 45 | service.interceptors.response.use(res => { 46 | console.log('---响应拦截器---',res) 47 | if (res.data.code === 0 && res.data.msg === 'NOTLOGIN') {// 返回登录页面 48 | window.top.location.href = '/front/page/login.html' 49 | } else { 50 | return res.data 51 | } 52 | }, 53 | error => { 54 | let { message } = error; 55 | if (message == "Network Error") { 56 | message = "后端接口连接异常"; 57 | } 58 | else if (message.includes("timeout")) { 59 | message = "系统接口请求超时"; 60 | } 61 | else if (message.includes("Request failed with status code")) { 62 | message = "系统接口" + message.substr(message.length - 3) + "异常"; 63 | } 64 | window.vant.Notify({ 65 | message: message, 66 | type: 'warning', 67 | duration: 5 * 1000 68 | }) 69 | //window.top.location.href = '/front/page/no-wify.html' 70 | return Promise.reject(error) 71 | } 72 | ) 73 |  win.$axios = service 74 | })(window); 75 | -------------------------------------------------------------------------------- /src/main/resources/static/front/page/address-edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 菩提阁 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 |
24 | {{title}} 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 | {{item}} 51 |
52 |
保存地址
53 |
删除地址
54 |
55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /src/main/resources/static/front/page/address.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 菩提阁 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 |
24 | 地址管理 25 |
26 |
27 |
28 |
29 |
30 | {{item.label}} 31 | {{item.detail}} 32 |
33 |
34 | {{item.consignee}} 35 | {{item.sex === '0' ? '女士' : '先生'}} 36 | {{item.phone}} 37 |
38 | 39 |
40 |
41 | 42 | 设为默认地址 43 |
44 |
45 |
46 |
+ 添加收货地址
47 |
48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 158 | 159 | -------------------------------------------------------------------------------- /src/main/resources/static/front/page/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 菩提阁 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
登录
24 |
25 | 26 |
27 | 28 | 获取验证码 29 |
30 |
手机号输入不正确,请重新输入
31 | 登录 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 92 | -------------------------------------------------------------------------------- /src/main/resources/static/front/page/no-wify.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 菩提阁 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 | 菩提阁 23 |
24 |
25 |
26 | 27 |
网络连接异常
28 |
点击刷新
29 |
30 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 60 | 61 | -------------------------------------------------------------------------------- /src/main/resources/static/front/page/order.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 菩提阁 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 |
24 | 菩提阁 25 |
26 |
27 |
28 | 34 | 35 |
36 | {{order.orderTime}} 37 | {{getStatus(order.status)}} 38 | 39 |
40 |
41 |
42 | {{item.name}} 43 | x{{item.number}} 44 |
45 |
46 |
47 | 共{{order.sumNum}} 件商品,实付¥{{order.amount}} 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 | 168 | 169 | -------------------------------------------------------------------------------- /src/main/resources/static/front/page/pay-success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 菩提阁 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 | 23 | 菩提阁 24 | 25 |
26 |
27 |
28 | 29 |
下单成功
30 |
预计{{finishTime}}到达
31 |
后厨正在加紧制作中,请耐心等待~
32 |
查看订单
33 |
34 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 88 | 89 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/address-edit.css: -------------------------------------------------------------------------------- 1 | #address_edit { 2 | height: 100%; 3 | } 4 | #address_edit .divHead { 5 | width: 100%; 6 | height: 88rem; 7 | opacity: 1; 8 | background: #333333; 9 | position: relative; 10 | } 11 | 12 | #address_edit .divHead .divTitle { 13 | font-size: 18rem; 14 | font-family: PingFangSC, PingFangSC-Regular; 15 | font-weight: 500; 16 | text-align: center; 17 | color: #ffffff; 18 | line-height: 25rem; 19 | letter-spacing: 0; 20 | position: absolute; 21 | bottom: 13rem; 22 | width: 100%; 23 | } 24 | 25 | #address_edit .divHead .divTitle i { 26 | position: absolute; 27 | left: 16rem; 28 | top: 50%; 29 | transform: translate(0, -50%); 30 | } 31 | 32 | #address_edit .divContent { 33 | height: 100%; 34 | opacity: 1; 35 | background: #ffffff; 36 | padding-left: 9rem; 37 | padding-right: 9rem; 38 | } 39 | 40 | #address_edit .divContent .divItem { 41 | height: 55rem; 42 | line-height: 55rem; 43 | font-size: 14rem; 44 | font-family: PingFangSC, PingFangSC-Regular; 45 | font-weight: 500; 46 | text-align: left; 47 | color: #333333; 48 | line-height: 20rem; 49 | letter-spacing: 0rem; 50 | border-bottom: 1px solid #efefef; 51 | display: flex; 52 | align-items: center; 53 | } 54 | 55 | #address_edit .divContent .divItem .el-input { 56 | width: auto; 57 | } 58 | 59 | #address_edit .divContent .divItem input { 60 | border: 0; 61 | padding: 0; 62 | } 63 | 64 | #address_edit .divContent .divItem .inputUser { 65 | width: 150rem; 66 | } 67 | 68 | #address_edit .divContent .divItem span { 69 | display: block; 70 | } 71 | 72 | #address_edit .divContent .divItem span:first-child { 73 | margin-right: 12rem; 74 | white-space: nowrap; 75 | width: 69rem; 76 | } 77 | 78 | #address_edit .divContent .divItem .spanChecked { 79 | width: 50rem; 80 | } 81 | 82 | #address_edit .divContent .divItem span i { 83 | width: 16rem; 84 | height: 16rem; 85 | background: url(./../images/checked_false.png); 86 | display: inline-block; 87 | background-size: cover; 88 | vertical-align: sub; 89 | } 90 | 91 | #address_edit .divContent .divItem span .iActive { 92 | background: url(./../images/checked_true.png); 93 | background-size: cover; 94 | } 95 | 96 | #address_edit .divContent .divItem .spanItem { 97 | width: 34rem; 98 | height: 20rem; 99 | opacity: 1; 100 | border: 1px solid #e5e4e4; 101 | border-radius: 3rem; 102 | text-align: center; 103 | margin-right: 10rem; 104 | border-radius: 2px; 105 | font-family: PingFangSC, PingFangSC-Regular; 106 | font-weight: 400; 107 | color: #333333; 108 | } 109 | 110 | #address_edit .divContent .divItem .spanActiveCompany { 111 | background: #e1f1fe; 112 | } 113 | 114 | #address_edit .divContent .divItem .spanActiveHome { 115 | background: #fef8e7; 116 | } 117 | 118 | #address_edit .divContent .divItem .spanActiveSchool { 119 | background: #e7fef8; 120 | } 121 | 122 | #address_edit .divContent .divItem .el-input__inner { 123 | font-size: 13px; 124 | font-family: PingFangSC, PingFangSC-Regular; 125 | font-weight: 400; 126 | text-align: left; 127 | color: #333333; 128 | } 129 | 130 | #address_edit .divContent .divSave { 131 | height: 36rem; 132 | opacity: 1; 133 | background: #ffc200; 134 | border-radius: 18rem; 135 | font-size: 15rem; 136 | font-family: PingFangSC, PingFangSC-Regular; 137 | font-weight: 500; 138 | text-align: center; 139 | color: #333333; 140 | line-height: 36rem; 141 | margin-top: 20rem; 142 | } 143 | 144 | #address_edit .divContent .divDelete { 145 | height: 36rem; 146 | opacity: 1; 147 | background: #f6f6f6; 148 | border-radius: 18rem; 149 | font-size: 15rem; 150 | font-family: PingFangSC, PingFangSC-Regular; 151 | font-weight: 500; 152 | text-align: center; 153 | color: #333333; 154 | line-height: 36rem; 155 | margin-top: 20rem; 156 | } 157 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/address.css: -------------------------------------------------------------------------------- 1 | #address .divHead { 2 | width: 100%; 3 | height: 88rem; 4 | opacity: 1; 5 | background: #333333; 6 | position: relative; 7 | } 8 | 9 | #address .divHead .divTitle { 10 | font-size: 18rem; 11 | font-family: PingFangSC, PingFangSC-Regular; 12 | font-weight: 500; 13 | text-align: center; 14 | color: #ffffff; 15 | line-height: 25rem; 16 | letter-spacing: 0; 17 | position: absolute; 18 | bottom: 13rem; 19 | width: 100%; 20 | } 21 | 22 | #address .divHead .divTitle i { 23 | position: absolute; 24 | left: 16rem; 25 | top: 50%; 26 | transform: translate(0, -50%); 27 | } 28 | 29 | #address .divContent { 30 | height: calc(100vh - 157rem); 31 | overflow: auto; 32 | } 33 | 34 | #address .divContent .divItem { 35 | height: 128rem; 36 | opacity: 1; 37 | background: #ffffff; 38 | border-radius: 6rem; 39 | margin-top: 10rem; 40 | margin-left: 10rem; 41 | margin-right: 9rem; 42 | padding-left: 12rem; 43 | position: relative; 44 | } 45 | 46 | #address .divContent .divItem > img { 47 | width: 16rem; 48 | height: 16rem; 49 | position: absolute; 50 | top: 40rem; 51 | right: 24rem; 52 | } 53 | 54 | #address .divContent .divItem .divDefault img { 55 | width: 16rem; 56 | height: 16rem; 57 | opacity: 1; 58 | } 59 | 60 | #address .divContent .divItem .divAddress { 61 | font-size: 14rem; 62 | font-family: PingFangSC, PingFangSC-Regular; 63 | font-weight: 400; 64 | text-align: left; 65 | color: #333333; 66 | line-height: 20rem; 67 | letter-spacing: 0; 68 | padding-top: 21rem; 69 | overflow: hidden; 70 | text-overflow: ellipsis; 71 | white-space: nowrap; 72 | width: 280rem; 73 | } 74 | 75 | #address .divContent .divItem .divAddress span { 76 | width: 34rem; 77 | height: 20rem; 78 | opacity: 1; 79 | font-size: 12rem; 80 | display: inline-block; 81 | text-align: center; 82 | margin-right: 4rem; 83 | margin-bottom: 10rem; 84 | } 85 | 86 | #address .divContent .divItem .divUserPhone span { 87 | height: 20rem; 88 | opacity: 1; 89 | font-size: 14rem; 90 | font-family: PingFangSC, PingFangSC-Regular; 91 | font-weight: 400; 92 | text-align: left; 93 | color: #999999; 94 | line-height: 20rem; 95 | letter-spacing: 0; 96 | margin-right: 10rem; 97 | } 98 | 99 | #address .divContent .divItem .divUserPhone span:first-child { 100 | margin-right: 2rem; 101 | } 102 | 103 | #address .divContent .divItem .divAddress .spanCompany { 104 | background-color: #e1f1fe; 105 | } 106 | 107 | #address .divContent .divItem .divAddress .spanHome { 108 | background: #fef8e7; 109 | } 110 | 111 | #address .divContent .divItem .divAddress .spanSchool { 112 | background: #e7fef8; 113 | } 114 | 115 | #address .divContent .divItem .divSplit { 116 | height: 1px; 117 | opacity: 1; 118 | background: #efefef; 119 | border: 0; 120 | margin-top: 16rem; 121 | margin-bottom: 10rem; 122 | margin-right: 10rem; 123 | } 124 | 125 | #address .divContent .divItem .divDefault { 126 | height: 18rem; 127 | opacity: 1; 128 | font-size: 13rem; 129 | font-family: PingFangSC, PingFangSC-Regular; 130 | font-weight: 400; 131 | text-align: left; 132 | color: #333333; 133 | line-height: 18rem; 134 | letter-spacing: 0; 135 | } 136 | 137 | #address .divContent .divItem .divDefault img { 138 | height: 18rem; 139 | width: 18rem; 140 | margin-right: 5rem; 141 | vertical-align: bottom; 142 | } 143 | 144 | #address .divBottom { 145 | height: 36rem; 146 | opacity: 1; 147 | background: #ffc200; 148 | border-radius: 18rem; 149 | opacity: 1; 150 | font-size: 15rem; 151 | font-family: PingFangSC, PingFangSC-Regular; 152 | font-weight: 500; 153 | text-align: center; 154 | color: #333333; 155 | line-height: 36rem; 156 | letter-spacing: 0; 157 | position: absolute; 158 | bottom: 23rem; 159 | left: 50%; 160 | transform: translate(-50%, 0); 161 | width: 334rem; 162 | } 163 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/index.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | max-width: 750px; 4 | height: 100%; 5 | background: #f3f2f7; 6 | font-family: Helvetica; 7 | overflow: hidden; 8 | } 9 | 10 | html, 11 | body, 12 | h1, 13 | h2, 14 | h3, 15 | h4, 16 | h5, 17 | h6, 18 | p, 19 | ul, 20 | li { 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | ul, 26 | li { 27 | list-style: none; 28 | } 29 | 30 | h1, 31 | h2, 32 | h3, 33 | h4, 34 | h5, 35 | h6 { 36 | font-weight: normal; 37 | } 38 | 39 | h3 { 40 | font-size: 16px; 41 | } 42 | 43 | h4 { 44 | font-size: 14px; 45 | } 46 | 47 | p { 48 | font-size: 12px; 49 | } 50 | 51 | em, 52 | i { 53 | font-style: normal; 54 | } 55 | 56 | @font-face { 57 | font-family: "DIN-Medium"; 58 | src: url("../fonts/DIN-Medium.otf"); 59 | font-weight: normal; 60 | font-style: normal; 61 | } 62 | 63 | @font-face { 64 | font-family: "DIN"; 65 | src: url("../fonts/DIN-Bold.otf"); 66 | font-weight: normal; 67 | font-style: normal; 68 | } 69 | 70 | @font-face { 71 | font-family: "PingFangSC-Regular"; 72 | src: url("../fonts/PingFangSC-Regular.ttf"); 73 | font-weight: normal; 74 | font-style: normal; 75 | } 76 | 77 | @font-face { 78 | font-family: "PingFangSC-Regular"; 79 | src: url("../fonts/PingFangSC-Regular.ttf"); 80 | font-weight: normal; 81 | font-style: normal; 82 | } 83 | 84 | @font-face { 85 | font-family: "PingFangSC-Semibold"; 86 | src: url("../fonts/PingFangSC-Semibold.ttf"); 87 | font-weight: normal; 88 | font-style: normal; 89 | } 90 | 91 | .app { 92 | height: 100%; 93 | } 94 | 95 | .van-overlay { 96 | background-color: rgba(0, 0, 0, 0.3); 97 | } 98 | 99 | .van-dialog { 100 | overflow: inherit; 101 | } 102 | 103 | ::-webkit-input-placeholder { 104 | font-size: 13rem; 105 | font-family: PingFangSC, PingFangSC-Regular; 106 | font-weight: 400; 107 | text-align: left; 108 | color: #999999; 109 | } 110 | 111 | :-moz-placeholder { 112 | /* Firefox 18- */ 113 | font-size: 13rem; 114 | font-family: PingFangSC, PingFangSC-Regular; 115 | font-weight: 400; 116 | text-align: left; 117 | color: #999999; 118 | } 119 | ::-moz-placeholder { 120 | /* Firefox 19+ */ 121 | font-size: 13rem; 122 | font-family: PingFangSC, PingFangSC-Regular; 123 | font-weight: 400; 124 | text-align: left; 125 | color: #999999; 126 | } 127 | 128 | :-ms-input-placeholder { 129 | font-size: 13rem; 130 | font-family: PingFangSC, PingFangSC-Regular; 131 | font-weight: 400; 132 | text-align: left; 133 | color: #999999; 134 | } 135 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/login.css: -------------------------------------------------------------------------------- 1 | #login .divHead { 2 | opacity: 1; 3 | background: #333333; 4 | height: 88rem; 5 | width: 100%; 6 | font-size: 18rem; 7 | font-family: PingFangSC, PingFangSC-Regular; 8 | font-weight: 500; 9 | text-align: center; 10 | color: #ffffff; 11 | line-height: 88rem; 12 | } 13 | 14 | #login .divContainer { 15 | width: 356rem; 16 | height: 128rem; 17 | opacity: 1; 18 | background: #ffffff; 19 | border-radius: 6rem; 20 | margin: 0 auto; 21 | margin-top: 10rem; 22 | position: relative; 23 | } 24 | 25 | #login .divContainer input { 26 | border: 0; 27 | height: 63rem; 28 | } 29 | 30 | #login .divContainer .divSplit { 31 | height: 1px; 32 | background-color: #efefef; 33 | border: 0; 34 | margin-left: 10rem; 35 | margin-right: 10rem; 36 | } 37 | 38 | #login .divContainer span { 39 | position: absolute; 40 | right: 20rem; 41 | top: 20rem; 42 | cursor: pointer; 43 | opacity: 1; 44 | font-size: 12rem; 45 | font-family: PingFangSC, PingFangSC-Regular; 46 | font-weight: 400; 47 | text-align: left; 48 | color: #ffc200; 49 | letter-spacing: 0px; 50 | } 51 | 52 | #login .divMsg { 53 | width: 168px; 54 | height: 17px; 55 | opacity: 1; 56 | font-size: 12px; 57 | font-family: PingFangSC, PingFangSC-Regular; 58 | font-weight: 400; 59 | text-align: center; 60 | color: #e94e3c; 61 | line-height: 17px; 62 | margin-left: 26rem; 63 | margin-top: 10rem; 64 | } 65 | 66 | #login .btnSubmit { 67 | width: 356rem; 68 | height: 40rem; 69 | margin: 20rem 10rem 0 10rem; 70 | border-radius: 20px; 71 | border: 0; 72 | 73 | font-size: 15rem; 74 | font-family: PingFangSC, PingFangSC-Regular; 75 | font-weight: 500; 76 | text-align: center; 77 | } 78 | 79 | #login .btnNoPhone { 80 | color: #666666; 81 | background: #d8d8d8; 82 | } 83 | 84 | #login .btnNoPhone:active { 85 | background: #afafaf; 86 | } 87 | 88 | #login .btnPhone { 89 | background: #ffc200; 90 | color: #333333; 91 | } 92 | 93 | #login .btnPhone:active { 94 | background: rgba(255, 142, 0, 1); 95 | color: #333333; 96 | } 97 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/no-wify.css: -------------------------------------------------------------------------------- 1 | #no_wifi .divHead { 2 | width: 100%; 3 | height: 88rem; 4 | opacity: 1; 5 | background: #333333; 6 | position: relative; 7 | } 8 | 9 | #no_wifi .divHead .divTitle { 10 | font-size: 18rem; 11 | font-family: PingFangSC, PingFangSC-Regular; 12 | font-weight: 500; 13 | text-align: center; 14 | color: #ffffff; 15 | line-height: 25rem; 16 | letter-spacing: 0; 17 | position: absolute; 18 | bottom: 13rem; 19 | width: 100%; 20 | } 21 | 22 | #no_wifi .divHead .divTitle i { 23 | position: absolute; 24 | left: 16rem; 25 | top: 50%; 26 | transform: translate(0, -50%); 27 | } 28 | 29 | #no_wifi .divContent { 30 | height: calc(100vh - 88rem); 31 | width: 100%; 32 | background: #ffffff; 33 | display: flex; 34 | flex-direction: column; 35 | text-align: center; 36 | align-items: center; 37 | } 38 | 39 | #no_wifi .divContent img { 40 | width: 239rem; 41 | height: 130rem; 42 | margin-top: 104rem; 43 | margin-bottom: 19rem; 44 | } 45 | 46 | #no_wifi .divContent .divDesc { 47 | height: 33rem; 48 | opacity: 1; 49 | font-size: 24rem; 50 | font-family: PingFangSC, PingFangSC-Regular; 51 | font-weight: 500; 52 | text-align: center; 53 | color: #333333; 54 | line-height: 33rem; 55 | letter-spacing: 0; 56 | margin-bottom: 20rem; 57 | } 58 | 59 | #no_wifi .divContent .btnRefresh { 60 | width: 124rem; 61 | height: 36rem; 62 | opacity: 1; 63 | background: #ffc200; 64 | border-radius: 18px; 65 | opacity: 1; 66 | font-size: 15rem; 67 | font-family: PingFangSC, PingFangSC-Regular; 68 | font-weight: 500; 69 | text-align: center; 70 | color: #333333; 71 | line-height: 21rem; 72 | letter-spacing: 0; 73 | line-height: 36rem; 74 | } 75 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/order.css: -------------------------------------------------------------------------------- 1 | #order { 2 | height: 100%; 3 | } 4 | 5 | #order .divHead { 6 | width: 100%; 7 | height: 88rem; 8 | opacity: 1; 9 | background: #333333; 10 | position: relative; 11 | } 12 | 13 | #order .divHead .divTitle { 14 | font-size: 18rem; 15 | font-family: PingFangSC, PingFangSC-Regular; 16 | font-weight: 500; 17 | text-align: center; 18 | color: #ffffff; 19 | line-height: 25rem; 20 | letter-spacing: 0; 21 | position: absolute; 22 | bottom: 13rem; 23 | width: 100%; 24 | } 25 | 26 | #order .divHead .divTitle i { 27 | position: absolute; 28 | left: 16rem; 29 | top: 50%; 30 | transform: translate(0, -50%); 31 | } 32 | 33 | #order .divBody { 34 | margin: 10rem 12rem 10rem 12rem; 35 | background: #ffffff; 36 | border-radius: 6rem; 37 | padding-left: 10rem; 38 | padding-right: 10rem; 39 | height: calc(100% - 108rem); 40 | overflow-y: auto; 41 | } 42 | 43 | #order .divBody .van-list .van-cell::after { 44 | border: 0; 45 | } 46 | 47 | #order .divBody .item .timeStatus { 48 | height: 46rem; 49 | line-height: 16rem; 50 | font-size: 14rem; 51 | font-family: PingFangSC, PingFangSC-Regular; 52 | font-weight: 400; 53 | text-align: left; 54 | color: #666666; 55 | line-height: 20rem; 56 | letter-spacing: 0; 57 | display: flex; 58 | justify-content: space-between; 59 | align-items: center; 60 | border-bottom: 2rem dashed #efefef; 61 | border-top: 1px solid #efefef; 62 | } 63 | 64 | #order .divBody .item .timeStatus span:first-child { 65 | color: #333333; 66 | } 67 | 68 | #order .divBody .item .dishList { 69 | padding-top: 10rem; 70 | padding-bottom: 11rem; 71 | } 72 | 73 | #order .divBody .item .dishList .item { 74 | padding-top: 5rem; 75 | padding-bottom: 5rem; 76 | display: flex; 77 | justify-content: space-between; 78 | height: 20rem; 79 | opacity: 1; 80 | font-size: 14rem; 81 | font-family: PingFangSC, PingFangSC-Regular; 82 | font-weight: 400; 83 | text-align: left; 84 | color: #666666; 85 | line-height: 20rem; 86 | letter-spacing: 0; 87 | } 88 | 89 | #order .divBody .item .result { 90 | display: flex; 91 | justify-content: flex-end; 92 | height: 20rem; 93 | opacity: 1; 94 | font-size: 14rem; 95 | font-family: PingFangSC, PingFangSC-Regular; 96 | font-weight: 400; 97 | text-align: left; 98 | color: #666666; 99 | line-height: 20rem; 100 | } 101 | 102 | #order .divBody .item .result .price { 103 | color: #343434; 104 | } 105 | 106 | #order .divBody .item .btn { 107 | display: flex; 108 | justify-content: flex-end; 109 | margin-bottom: 17rem; 110 | margin-top: 20rem; 111 | } 112 | 113 | #order .divBody .btn .btnAgain { 114 | width: 124rem; 115 | height: 36rem; 116 | opacity: 1; 117 | border: 1px solid #e5e4e4; 118 | border-radius: 19rem; 119 | opacity: 1; 120 | font-size: 14rem; 121 | font-family: PingFangSC, PingFangSC-Regular; 122 | font-weight: 500; 123 | text-align: center; 124 | color: #333333; 125 | line-height: 36rem; 126 | letter-spacing: 0; 127 | position: relative; 128 | } 129 | 130 | #order .divNoData { 131 | width: 100%; 132 | height: calc(100% - 88rem); 133 | display: flex; 134 | flex-direction: column; 135 | align-items: center; 136 | justify-content: center; 137 | } 138 | 139 | #order .divNoData .divContainer img { 140 | width: 240rem; 141 | height: 129rem; 142 | } 143 | 144 | #order .divNoData .divContainer div { 145 | font-size: 24rem; 146 | font-family: PingFangSC, PingFangSC-Medium; 147 | font-weight: 500; 148 | text-align: center; 149 | color: #333333; 150 | line-height: 33rem; 151 | height: 33rem; 152 | margin-top: 20rem; 153 | } 154 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/pay-success.css: -------------------------------------------------------------------------------- 1 | #pay_success .divHead { 2 | width: 100%; 3 | height: 88rem; 4 | opacity: 1; 5 | background: #333333; 6 | position: relative; 7 | } 8 | 9 | #pay_success .divHead .divTitle { 10 | font-size: 18rem; 11 | font-family: PingFangSC, PingFangSC-Regular; 12 | font-weight: 500; 13 | text-align: center; 14 | color: #ffffff; 15 | line-height: 25rem; 16 | letter-spacing: 0; 17 | position: absolute; 18 | bottom: 13rem; 19 | width: 100%; 20 | display: flex; 21 | justify-content: space-between; 22 | align-items: center; 23 | } 24 | 25 | #pay_success .divHead .divTitle i { 26 | margin-left: 16rem; 27 | } 28 | 29 | #pay_success .divHead .divTitle img { 30 | width: 18rem; 31 | height: 18rem; 32 | margin-right: 19rem; 33 | } 34 | 35 | #pay_success .divContent { 36 | height: calc(100vh - 88rem); 37 | width: 100%; 38 | background: #ffffff; 39 | display: flex; 40 | flex-direction: column; 41 | text-align: center; 42 | align-items: center; 43 | } 44 | 45 | #pay_success .divContent img { 46 | margin-top: 148rem; 47 | margin-bottom: 19rem; 48 | width: 90rem; 49 | height: 86rem; 50 | } 51 | 52 | #pay_success .divContent .divSuccess { 53 | height: 33rem; 54 | opacity: 1; 55 | font-size: 24rem; 56 | font-family: PingFangSC, PingFangSC-Regular; 57 | font-weight: 500; 58 | text-align: center; 59 | color: #333333; 60 | line-height: 33rem; 61 | margin-top: 19rem; 62 | margin-bottom: 10rem; 63 | } 64 | 65 | #pay_success .divContent .divDesc, 66 | .divDesc1 { 67 | height: 22rem; 68 | opacity: 1; 69 | font-size: 16rem; 70 | font-family: PingFangSC, PingFangSC-Regular; 71 | font-weight: 400; 72 | text-align: center; 73 | color: #666666; 74 | line-height: 22rem; 75 | } 76 | 77 | #pay_success .divContent .divDesc1 { 78 | margin-top: 7rem; 79 | margin-bottom: 20rem; 80 | } 81 | 82 | #pay_success .divContent .btnView { 83 | width: 124rem; 84 | height: 36rem; 85 | opacity: 1; 86 | background: #ffc200; 87 | border-radius: 18px; 88 | opacity: 1; 89 | font-size: 15rem; 90 | font-family: PingFangSC, PingFangSC-Regular; 91 | font-weight: 500; 92 | text-align: center; 93 | color: #333333; 94 | line-height: 21rem; 95 | letter-spacing: 0; 96 | line-height: 36rem; 97 | } 98 | -------------------------------------------------------------------------------- /src/main/resources/static/front/styles/user.css: -------------------------------------------------------------------------------- 1 | #user { 2 | height: 100%; 3 | } 4 | 5 | #user .divHead { 6 | width: 100%; 7 | height: 164rem; 8 | opacity: 1; 9 | background: #ffc200; 10 | box-sizing: border-box; 11 | padding-left: 12rem; 12 | padding-right: 12rem; 13 | } 14 | 15 | #user .divHead .divTitle { 16 | height: 25rem; 17 | opacity: 1; 18 | font-size: 18rem; 19 | font-family: PingFangSC, PingFangSC-Regular; 20 | font-weight: 500; 21 | text-align: center; 22 | color: #333333; 23 | line-height: 25rem; 24 | letter-spacing: 0; 25 | padding-top: 50rem; 26 | margin-bottom: 18rem; 27 | position: relative; 28 | } 29 | 30 | #user .divHead .divTitle i { 31 | position: absolute; 32 | left: 0; 33 | margin-top: 5rem; 34 | } 35 | 36 | #user .divHead .divUser { 37 | display: flex; 38 | } 39 | 40 | #user .divHead .divUser > img { 41 | width: 58rem; 42 | height: 58rem; 43 | border-radius: 50%; 44 | margin-right: 16rem; 45 | } 46 | 47 | #user .divHead .divUser .desc { 48 | display: flex; 49 | flex-direction: column; 50 | justify-content: center; 51 | } 52 | 53 | #user .divHead .divUser .desc .divName { 54 | opacity: 1; 55 | font-size: 16rem; 56 | font-family: PingFangSC, PingFangSC-Regular; 57 | font-weight: 500; 58 | text-align: left; 59 | color: #333333; 60 | margin-right: 6rem; 61 | margin-bottom: 5rem; 62 | display: flex; 63 | align-items: center; 64 | } 65 | 66 | #user .divHead .divUser .desc .divName img { 67 | width: 16rem; 68 | height: 16rem; 69 | opacity: 1; 70 | margin-left: 6rem; 71 | } 72 | 73 | #user .divHead .divUser .desc .divPhone { 74 | font-size: 14px; 75 | font-family: PingFangSC, PingFangSC-Regular; 76 | font-weight: 400; 77 | text-align: left; 78 | color: #333333; 79 | } 80 | 81 | #user .divContent { 82 | height: calc(100% - 174rem); 83 | overflow-y: auto; 84 | } 85 | 86 | #user .divLinks { 87 | height: 104rem; 88 | opacity: 1; 89 | background: #ffffff; 90 | border-radius: 6rem; 91 | padding-left: 17rem; 92 | padding-right: 11rem; 93 | margin: 10rem; 94 | } 95 | 96 | #user .divLinks .item { 97 | height: 51rem; 98 | line-height: 51rem; 99 | position: relative; 100 | display: flex; 101 | align-items: center; 102 | } 103 | 104 | #user .divLinks .divSplit { 105 | height: 1rem; 106 | opacity: 1; 107 | background-color: #ebebeb; 108 | border: 0; 109 | } 110 | 111 | #user .divLinks .item img { 112 | width: 18rem; 113 | height: 18rem; 114 | margin-right: 5rem; 115 | } 116 | 117 | #user .divLinks .item i { 118 | position: absolute; 119 | right: 0; 120 | top: 50%; 121 | transform: translate(0, -50%); 122 | } 123 | 124 | #user .divOrders { 125 | margin: 0 10rem 10rem 10rem; 126 | background: #ffffff; 127 | border-radius: 6rem; 128 | padding-left: 10rem; 129 | padding-right: 10rem; 130 | padding-bottom: 17rem; 131 | } 132 | 133 | #user .divOrders .title { 134 | height: 60rem; 135 | line-height: 60rem; 136 | opacity: 1; 137 | font-size: 16rem; 138 | font-family: PingFangSC, PingFangSC-Regular; 139 | font-weight: 500; 140 | text-align: left; 141 | color: #333333; 142 | letter-spacing: 0; 143 | border-bottom: 2px solid #efefef; 144 | } 145 | 146 | #user .divOrders .timeStatus { 147 | height: 46rem; 148 | line-height: 16rem; 149 | font-size: 14rem; 150 | font-family: PingFangSC, PingFangSC-Regular; 151 | font-weight: 400; 152 | text-align: left; 153 | color: #666666; 154 | line-height: 20rem; 155 | letter-spacing: 0; 156 | display: flex; 157 | justify-content: space-between; 158 | align-items: center; 159 | border-bottom: 2rem dashed #efefef; 160 | } 161 | 162 | #user .divOrders .timeStatus span:first-child { 163 | color: #333333; 164 | } 165 | 166 | #user .divOrders .dishList { 167 | padding-top: 10rem; 168 | padding-bottom: 11rem; 169 | } 170 | 171 | #user .divOrders .dishList .item { 172 | padding-top: 5rem; 173 | padding-bottom: 5rem; 174 | display: flex; 175 | justify-content: space-between; 176 | height: 20rem; 177 | opacity: 1; 178 | font-size: 14rem; 179 | font-family: PingFangSC, PingFangSC-Regular; 180 | font-weight: 400; 181 | text-align: left; 182 | color: #666666; 183 | line-height: 20rem; 184 | letter-spacing: 0; 185 | } 186 | 187 | #user .divOrders .result { 188 | display: flex; 189 | justify-content: flex-end; 190 | height: 20rem; 191 | opacity: 1; 192 | font-size: 14rem; 193 | font-family: PingFangSC, PingFangSC-Regular; 194 | font-weight: 400; 195 | text-align: left; 196 | color: #666666; 197 | line-height: 20rem; 198 | } 199 | 200 | #user .divOrders .result .price { 201 | color: black; 202 | } 203 | 204 | #user .divOrders .btn { 205 | margin-top: 20rem; 206 | display: flex; 207 | justify-content: flex-end; 208 | } 209 | 210 | #user .divOrders .btn .btnAgain { 211 | width: 124rem; 212 | height: 36rem; 213 | opacity: 1; 214 | border: 1px solid #e5e4e4; 215 | border-radius: 19rem; 216 | opacity: 1; 217 | font-size: 14rem; 218 | font-family: PingFangSC, PingFangSC-Regular; 219 | font-weight: 500; 220 | text-align: center; 221 | color: #333333; 222 | line-height: 36rem; 223 | letter-spacing: 0; 224 | position: relative; 225 | } 226 | 227 | #user .quitLogin { 228 | margin: 0 10rem 10rem 10rem; 229 | height: 50rem; 230 | opacity: 1; 231 | background: #ffffff; 232 | border-radius: 6rem; 233 | opacity: 1; 234 | font-size: 15rem; 235 | font-family: PingFangSC, PingFangSC-Regular; 236 | font-weight: 500; 237 | text-align: center; 238 | color: #333333; 239 | line-height: 50rem; 240 | } 241 | -------------------------------------------------------------------------------- /src/test/java/com/wm/WmApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wm; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class WmApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | --------------------------------------------------------------------------------