diff --git a/.gitignore b/.gitignore index 549e00a..675b9c7 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ build/ ### VS Code ### .vscode/ +/src/main/webapp/WEB-INF/classes/ diff --git a/db/db1.sql b/db/db1.sql new file mode 100644 index 0000000..a59409b --- /dev/null +++ b/db/db1.sql @@ -0,0 +1,86 @@ +-- MySQL dump 10.13 Distrib 8.0.20, for Linux (x86_64) +-- +-- Host: localhost Database: dmmdb +-- ------------------------------------------------------ +-- Server version 8.0.20 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `m_menu` +-- + +DROP TABLE IF EXISTS `m_menu`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `m_menu` ( + `ID` char(3) NOT NULL, + `FENLEI` varchar(20) NOT NULL, + `PINMU` varchar(20) NOT NULL, + `CAILIAO` varchar(20) NOT NULL, + `JIAGE` int NOT NULL, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_menu` +-- + +LOCK TABLES `m_menu` WRITE; +/*!40000 ALTER TABLE `m_menu` DISABLE KEYS */; +INSERT INTO `m_menu` VALUES ('001','正菜','肉类','牛肉',50),('002','正菜','肉类','猪肉',30),('003','正菜','肉类','鸡肉',20),('004','正菜','蔬菜','白菜',10),('005','正菜','蔬菜','黄瓜',10),('006','正菜','海鲜','大虾',40),('007','正菜','海鲜','黄鱼',40),('008','主食','米饭','白饭',3),('009','主食','米饭','炒饭',10),('010','主食','面条','凉拌',12),('011','主食','面条','打卤',15),('012','主食','水饺','素馅',15),('013','主食','水饺','肉馅',20),('014','酒水','白酒','茅台',1000),('015','酒水','白酒','郎酒',500),('016','酒水','啤酒','雪花',5),('017','酒水','啤酒','哈啤',6),('018','酒水','饮料','可乐',3),('019','酒水','饮料','雪碧',3); +/*!40000 ALTER TABLE `m_menu` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `tbl_diancan` +-- + +DROP TABLE IF EXISTS `tbl_diancan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `tbl_diancan` ( + `ZHUOHAO` char(11) NOT NULL, + `XINGMING` varchar(15) NOT NULL, + `YUDING` tinyint(1) NOT NULL, + `BIRTHDAY` datetime NOT NULL, + `RENSHU` int DEFAULT NULL, + `TEL` varchar(20) DEFAULT NULL, + `CAIPIN` varchar(100) DEFAULT NULL, + `ZHUSHI` varchar(100) DEFAULT NULL, + `JIUSHUI` varchar(100) DEFAULT NULL, + `JINE` int DEFAULT NULL, + `BEIZHU` varchar(200) DEFAULT NULL, + PRIMARY KEY (`ZHUOHAO`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `tbl_diancan` +-- + +LOCK TABLES `tbl_diancan` WRITE; +/*!40000 ALTER TABLE `tbl_diancan` DISABLE KEYS */; +/*!40000 ALTER TABLE `tbl_diancan` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-07-14 22:58:56 diff --git a/pom.xml b/pom.xml index 632ac6f..a8d456e 100644 --- a/pom.xml +++ b/pom.xml @@ -15,15 +15,34 @@ Demo project for Spring Boot + UTF-8 + UTF-8 1.8 + + + aliyunmaven + https://maven.aliyun.com/repository/public + + + org.springframework.boot spring-boot-starter-web + + org.springframework.boot + spring-boot-starter-thymeleaf + + + + org.springframework.boot + spring-boot-starter-data-jpa + + mysql mysql-connector-java @@ -47,6 +66,9 @@ org.springframework.boot spring-boot-maven-plugin + + false + diff --git a/src/main/java/com/example/demo/Constants.java b/src/main/java/com/example/demo/Constants.java new file mode 100644 index 0000000..a018030 --- /dev/null +++ b/src/main/java/com/example/demo/Constants.java @@ -0,0 +1,8 @@ +package com.example.demo; + +public class Constants { + public static final String SPAN_NAME = "span_name"; + public static final String LIST = "list"; + public static final String QUERY = "query"; + public static final String FENLEI = "fenlei"; +} diff --git a/src/main/java/com/example/demo/controller/WebController.java b/src/main/java/com/example/demo/controller/WebController.java index a9376e4..cff1b03 100644 --- a/src/main/java/com/example/demo/controller/WebController.java +++ b/src/main/java/com/example/demo/controller/WebController.java @@ -1,17 +1,128 @@ package com.example.demo.controller; -import com.example.demo.model.JsonResponse; -import com.example.demo.model.Result; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.example.demo.Constants; +import com.example.demo.model.Diancan; +import com.example.demo.model.DiancanForm; +import com.example.demo.model.Menu; +import com.example.demo.repository.DiancanRespository; +import com.example.demo.repository.MenuRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; -@RestController +import javax.persistence.criteria.Predicate; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +@Controller @RequestMapping("/api") public class WebController { - @GetMapping("/hello") - public JsonResponse result(){ - return new JsonResponse<>(Result.OK, "hello"); + @Autowired + private MenuRepository menuRepository; + + @Autowired + private DiancanRespository diancanRespository; + + @RequestMapping("/index") + public String index(Model model,Diancan diancan){ + List diancans= diancanRespository.findAll((root,query,cb)->{ + List predicates = new ArrayList<>(); + if(!StringUtils.isEmpty(diancan.getZhuohao())){ + predicates.add(cb.like(root.get("zhuohao"),"%"+diancan.getZhuohao()+"%")); + } + if(!StringUtils.isEmpty(diancan.getXingming())){ + predicates.add(cb.like(root.get("xingming"),"%"+diancan.getXingming()+"%")); + } + if(!StringUtils.isEmpty(diancan.getTel())){ + predicates.add(cb.equal(root.get("tel"),diancan.getTel())); + } + if(diancan.getYuding()!=null){ + predicates.add(cb.equal(root.get("yuding"),diancan.getYuding())); + } + return query.where(predicates.toArray(new Predicate[0])).getRestriction(); + }); + model.addAttribute(Constants.LIST,diancans); + if(diancan.getYuding()==null){ + diancan.setYuding(true); + } + model.addAttribute(Constants.QUERY,diancan); + return "index"; + } + + @RequestMapping("/order/del/{id}") + public void del(Model model, @PathVariable String id, HttpServletResponse response) throws IOException { + diancanRespository.deleteById(id); + response.sendRedirect("/api/index"); + } + + @GetMapping("/order") + public String getOrder(Model model){ + model.addAttribute(Constants.SPAN_NAME,"点餐画面"); + model.addAttribute(Constants.FENLEI,menuRepository.getFenlei()); + return "order"; + } + + @PostMapping("/order") + public void postOrder(Model model, HttpServletResponse response, DiancanForm diancanForm) throws IOException { + response.sendRedirect("/api/index"); + } + + @GetMapping("/order/{id}") + public String getEditOrder(Model model,@PathVariable String id){ + model.addAttribute(Constants.SPAN_NAME,"修改画面"); + return "order"; + } + + @PostMapping("/order/{id}") + public void postEditOrder(Model model,@PathVariable String id,HttpServletResponse response) throws IOException { + response.sendRedirect("/api/index"); + } + + @GetMapping("/order/detail/{id}") + public String getDetailOrder(Model model,@PathVariable String id){ + model.addAttribute(Constants.SPAN_NAME,"详细画面"); + return "order"; + } + + @GetMapping("/order/pay/{id}") + public String getPayOrder(Model model,@PathVariable String id){ + model.addAttribute(Constants.SPAN_NAME,"支付画面"); + return "order"; + } + + @GetMapping(path = "/getPinMu",produces = {"application/json;charset=UTF-8"}) + @ResponseBody + public List getPinMu(Menu menu){ + if( !StringUtils.isEmpty(menu.getFenlei())){ + return menuRepository.getPinmuByFenlei(menu.getFenlei()); + }else{ + return new ArrayList<>(); + } + } + + @GetMapping(path = "/getMenu",produces = {"application/json;charset=UTF-8"}) + @ResponseBody + public List getMenu(Menu menu){ + if( !StringUtils.isEmpty(menu.getFenlei())&&!StringUtils.isEmpty(menu.getPinmu())){ + return menuRepository.findByFenleiAndPinmu(menu.getFenlei(),menu.getPinmu()); + }else{ + return new ArrayList<>(); + } } + + @GetMapping(path = "/hasYuding",produces = {"application/json;charset=UTF-8"}) + @ResponseBody + public Boolean hasYuding(Diancan diancan){ + if(!StringUtils.isEmpty(diancan.getZhuohao())){ + return diancanRespository.countByZhuohao(diancan.getZhuohao())==1; + }else{ + return false; + } + } + } diff --git a/src/main/java/com/example/demo/model/CaiDan.java b/src/main/java/com/example/demo/model/CaiDan.java new file mode 100644 index 0000000..17fe5b1 --- /dev/null +++ b/src/main/java/com/example/demo/model/CaiDan.java @@ -0,0 +1,23 @@ +package com.example.demo.model; + +public class CaiDan { + private String cailiao; + + private String sum; + + public String getCailiao() { + return cailiao; + } + + public void setCailiao(String cailiao) { + this.cailiao = cailiao; + } + + public String getSum() { + return sum; + } + + public void setSum(String sum) { + this.sum = sum; + } +} diff --git a/src/main/java/com/example/demo/model/Diancan.java b/src/main/java/com/example/demo/model/Diancan.java new file mode 100644 index 0000000..7f1c288 --- /dev/null +++ b/src/main/java/com/example/demo/model/Diancan.java @@ -0,0 +1,124 @@ +package com.example.demo.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import java.util.Date; + +@Entity(name = "tbl_diancan") +public class Diancan { + + @Id + private String zhuohao; + + @Column(nullable = false) + private String xingming; + + @Column(nullable = false) + private Boolean yuding; + + @Column(nullable = false) + private Date birthday; + + private Integer renshu; + + private String tel; + + private String caipin; + + private String zhushi; + + private String jiushui; + + private Integer jine; + + private String beizhu; + + public String getZhuohao() { + return zhuohao; + } + + public void setZhuohao(String zhuohao) { + this.zhuohao = zhuohao; + } + + public String getXingming() { + return xingming; + } + + public void setXingming(String xingming) { + this.xingming = xingming; + } + + public Boolean getYuding() { + return yuding; + } + + public void setYuding(Boolean yuding) { + this.yuding = yuding; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + + public Integer getRenshu() { + return renshu; + } + + public void setRenshu(Integer renshu) { + this.renshu = renshu; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public String getCaipin() { + return caipin; + } + + public void setCaipin(String caipin) { + this.caipin = caipin; + } + + public String getZhushi() { + return zhushi; + } + + public void setZhushi(String zhushi) { + this.zhushi = zhushi; + } + + public String getJiushui() { + return jiushui; + } + + public void setJiushui(String jiushui) { + this.jiushui = jiushui; + } + + public Integer getJine() { + return jine; + } + + public void setJine(Integer jine) { + this.jine = jine; + } + + public String getBeizhu() { + return beizhu; + } + + public void setBeizhu(String beizhu) { + this.beizhu = beizhu; + } +} diff --git a/src/main/java/com/example/demo/model/DiancanForm.java b/src/main/java/com/example/demo/model/DiancanForm.java new file mode 100644 index 0000000..589da32 --- /dev/null +++ b/src/main/java/com/example/demo/model/DiancanForm.java @@ -0,0 +1,96 @@ +package com.example.demo.model; + +import java.util.ArrayList; +import java.util.List; + +public class DiancanForm { + private String zhuohao; + + private String xingming; + + private String birthday; + + private String shijian; + + private String tel; + + private Integer jine; + + private String beizhu; + + private Integer renshu; + + List diancans=new ArrayList<>(); + + public String getZhuohao() { + return zhuohao; + } + + public void setZhuohao(String zhuohao) { + this.zhuohao = zhuohao; + } + + public String getXingming() { + return xingming; + } + + public void setXingming(String xingming) { + this.xingming = xingming; + } + + public String getBirthday() { + return birthday; + } + + public void setBirthday(String birthday) { + this.birthday = birthday; + } + + public String getShijian() { + return shijian; + } + + public void setShijian(String shijian) { + this.shijian = shijian; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public Integer getJine() { + return jine; + } + + public void setJine(Integer jine) { + this.jine = jine; + } + + public String getBeizhu() { + return beizhu; + } + + public void setBeizhu(String beizhu) { + this.beizhu = beizhu; + } + + public List getDiancans() { + return diancans; + } + + public void setDiancans(List diancans) { + this.diancans = diancans; + } + + public Integer getRenshu() { + return renshu; + } + + public void setRenshu(Integer renshu) { + this.renshu = renshu; + } +} diff --git a/src/main/java/com/example/demo/model/Menu.java b/src/main/java/com/example/demo/model/Menu.java new file mode 100644 index 0000000..ae40c6d --- /dev/null +++ b/src/main/java/com/example/demo/model/Menu.java @@ -0,0 +1,61 @@ +package com.example.demo.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +@Entity(name = "m_menu") +public class Menu { + + @Id + private String id; + + @Column(nullable = false) + private String fenlei; + @Column(nullable = false) + private String pinmu; + @Column(nullable = false) + private String cailiao; + @Column(nullable = false) + private Integer jiage; + + public void setId(String id) { + this.id = id; + } + + public void setFenlei(String fenlei) { + this.fenlei = fenlei; + } + + public void setPinmu(String pinmu) { + this.pinmu = pinmu; + } + + public void setCailiao(String cailiao) { + this.cailiao = cailiao; + } + + public void setJiage(Integer jiage) { + this.jiage = jiage; + } + + public String getId() { + return id; + } + + public String getFenlei() { + return fenlei; + } + + public String getPinmu() { + return pinmu; + } + + public String getCailiao() { + return cailiao; + } + + public Integer getJiage() { + return jiage; + } +} diff --git a/src/main/java/com/example/demo/repository/DiancanRespository.java b/src/main/java/com/example/demo/repository/DiancanRespository.java new file mode 100644 index 0000000..0965de1 --- /dev/null +++ b/src/main/java/com/example/demo/repository/DiancanRespository.java @@ -0,0 +1,9 @@ +package com.example.demo.repository; + +import com.example.demo.model.Diancan; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +public interface DiancanRespository extends JpaRepository, JpaSpecificationExecutor { + Integer countByZhuohao(String zhuohao); +} diff --git a/src/main/java/com/example/demo/repository/MenuRepository.java b/src/main/java/com/example/demo/repository/MenuRepository.java new file mode 100644 index 0000000..f9f3fc7 --- /dev/null +++ b/src/main/java/com/example/demo/repository/MenuRepository.java @@ -0,0 +1,18 @@ +package com.example.demo.repository; + +import com.example.demo.model.Menu; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + +public interface MenuRepository extends JpaRepository, JpaSpecificationExecutor { + List findByFenleiAndPinmu(String fenlei, String pinmu); + + @Query("select distinct fenlei from com.example.demo.model.Menu") + List getFenlei(); + + @Query("select distinct pinmu from com.example.demo.model.Menu m where m.fenlei=?1") + List getPinmuByFenlei(String fenlei); +} diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index e69de29..3321b1f 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -0,0 +1,16 @@ +spring: + thymeleaf: + prefix: classpath:/templates/ + cache: false + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/dmmdb + username: sukura + password: 123456 + jpa: + properties: + hibernate: + dialect: org.hibernate.dialect.MySQL8Dialect + format_sql: true + show-sql: true + diff --git a/src/main/webapp/bootstrap.min.css b/src/main/resources/static/css/bootstrap.min.css similarity index 100% rename from src/main/webapp/bootstrap.min.css rename to src/main/resources/static/css/bootstrap.min.css diff --git a/src/main/resources/static/css/index.css b/src/main/resources/static/css/index.css new file mode 100644 index 0000000..54c2f65 --- /dev/null +++ b/src/main/resources/static/css/index.css @@ -0,0 +1,18 @@ +.container { + margin: 0 auto; + min-height: 100vh; + display: flex; + justify-content: center; + align-items: center; +} +.frame { + border: 1px solid black; + padding: 30px; +} +.border-black { + border: 1px solid black; +} +.icon{ + width: 20px; + height: 20px; +} \ No newline at end of file diff --git a/src/main/webapp/minus.svg b/src/main/resources/static/icon/minus.svg similarity index 100% rename from src/main/webapp/minus.svg rename to src/main/resources/static/icon/minus.svg diff --git a/src/main/webapp/plus.svg b/src/main/resources/static/icon/plus.svg similarity index 100% rename from src/main/webapp/plus.svg rename to src/main/resources/static/icon/plus.svg diff --git a/src/main/resources/static/icon/radio.svg b/src/main/resources/static/icon/radio.svg new file mode 100644 index 0000000..7c82cdb --- /dev/null +++ b/src/main/resources/static/icon/radio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/resources/static/icon/radioactive.svg b/src/main/resources/static/icon/radioactive.svg new file mode 100644 index 0000000..54a3717 --- /dev/null +++ b/src/main/resources/static/icon/radioactive.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html new file mode 100644 index 0000000..97dd2aa --- /dev/null +++ b/src/main/resources/templates/index.html @@ -0,0 +1,109 @@ + + + + + 简易点菜系统 + + + + + +
+
+ 检索条件 +
+
+
+ 桌号 +
+ +
+
+
+ 客人姓名 +
+ +
+ 联系方式 +
+ +
+
+
+ 预定 +
+
+ + +
+
+ + +
+
+ +
+ 点餐 + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
桌号客人姓名预定联系方式用餐时间人数
桌号人数
${item.zhuohao}${item.xingming} + + ${item.tel}${item.birthday}${item.renshu} + 修改 + + 删除 +
${item.zhuohao}${item.renshu} + 点餐 +
+
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/order.html b/src/main/resources/templates/order.html new file mode 100644 index 0000000..47a1c61 --- /dev/null +++ b/src/main/resources/templates/order.html @@ -0,0 +1,238 @@ + + + + + 简易点菜系统 + + + + + + +
+
+ +
+
+
+ 桌号 +
+ +
+ 客人姓名 +
+ +
+ +
+
+ 用餐时间 +
+
+ + +
+
+ + +
+ + +
+ +
+
+ 用餐人数 +
+ + +
+ +
+
+ 联系方式(手机) +
+ + +
+ +
+
+ 点餐区 +
+
+ +
+
+
+ +
+
+
+
+ + +
+
+
+ +
+
+ 预结金额 +
+ +
+ +
+
+ 备注 +
+ +
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/META-INF/MANIFEST.MF b/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..3bb1f28 --- /dev/null +++ b/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Created-By: IntelliJ IDEA +Built-By: pan +Build-Jdk: 13.0.2 +Implementation-Title: demo +Implementation-Version: 0.0.1-SNAPSHOT +Implementation-Vendor-Id: com.example +Main-Class: ${start-class} + diff --git a/src/main/webapp/edit.html b/src/main/webapp/edit.html deleted file mode 100644 index 566549b..0000000 --- a/src/main/webapp/edit.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Title - - - - - \ No newline at end of file diff --git a/src/main/webapp/index.css b/src/main/webapp/index.css deleted file mode 100644 index 047f61f..0000000 --- a/src/main/webapp/index.css +++ /dev/null @@ -1,7 +0,0 @@ -.container { - margin: 0 auto; - min-height: 100vh; - display: flex; - justify-content: center; - align-items: center; -} \ No newline at end of file diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index 2a7bd29..41620a2 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -2,130 +2,12 @@ - 简易点菜系统 - - + Title - -
-
- 检索条件 -
-
-
- 桌号 -
- -
-
-
- 客人姓名 -
- -
- 联系方式 -
- -
-
-
- 预定 -
-
- - -
-
- - -
-
- -
- 点餐 - 检索 -
-
- - -
- - 检索结果(已定) - - - - - - - - - - - - - - - - - - - - - - - - -
桌号客人姓名预定用餐时间人数
大堂-10003张三 -
- - -
-
及时单3 - - - -
- - - - - - - - - - - - - - - -
桌号人数
大堂-100036 - -
-
-
\ No newline at end of file diff --git a/src/main/webapp/order.html b/src/main/webapp/order.html deleted file mode 100644 index 6a0a4df..0000000 --- a/src/main/webapp/order.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - 简易点菜系统 - - - - - -
-
- 点餐画面 -
-
-
- 桌号 -
- -
- 客人姓名 -
- -
- -
-
- 预定 -
-
- - -
-
- - -
- - -
- -
-
- 联系方式(手机) -
- - -
- -
-
- 点餐区 -
- - - - - - - - -
- -
-
- - -
- - - - - - - - -
- -
-
- - -
- - - - - - - - -
- -
-
- 预结金额 -
- - - -
- -
-
- 备注 -
- -
-
- -
-
-
-
- - \ No newline at end of file diff --git a/src/test/java/com/example/demo/DemoApplicationTests.java b/src/test/java/com/example/demo/DemoApplicationTests.java index 2778a6a..f30cf9e 100644 --- a/src/test/java/com/example/demo/DemoApplicationTests.java +++ b/src/test/java/com/example/demo/DemoApplicationTests.java @@ -1,13 +1,36 @@ package com.example.demo; +import com.example.demo.repository.DiancanRespository; +import com.example.demo.repository.MenuRepository; import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import java.util.List; + @SpringBootTest class DemoApplicationTests { + @Autowired + private MenuRepository menuRepository; + + @Autowired + private DiancanRespository diancanRespository; + @Test void contextLoads() { } + @Test + void testGetMenu(){ + List l= menuRepository.getPinmuByFenlei("正菜"); + + l=menuRepository.getFenlei(); + } + + @Test + void testcheckZhuoHao(){ + int a=diancanRespository.countByZhuohao("2"); + } + }