├── .gitattributes ├── README.md ├── coffee-sales-employee ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── coffee │ │ └── sales │ │ └── employee │ │ ├── CoffeeSalesApplication.java │ │ ├── bean │ │ ├── Contact.java │ │ ├── Order.java │ │ ├── Permission.java │ │ ├── Role.java │ │ ├── User.java │ │ └── UserMonitoring.java │ │ ├── config │ │ └── SpringMvcConfig.java │ │ ├── controller │ │ ├── ContactController.java │ │ ├── OrderController.java │ │ ├── RoleController.java │ │ ├── UserController.java │ │ ├── UserMonitoringController.java │ │ └── UserRoleController.java │ │ ├── dao │ │ ├── ContactMapper.java │ │ ├── OrderMapper.java │ │ ├── PermissionMapper.java │ │ ├── RoleMapper.java │ │ ├── UserMapper.java │ │ └── UserMonitoringMapper.java │ │ ├── security │ │ ├── MyAccessDecisionManager.java │ │ ├── MyAuthenticationProvider.java │ │ ├── MyFilterSecurityInterceptor.java │ │ ├── MyInvocationSecurityMetadataSourceService.java │ │ ├── SpringSecurityConfig.java │ │ └── UserDetailServiceImpl.java │ │ └── service │ │ ├── ContactService.java │ │ ├── OrderService.java │ │ ├── RoleService.java │ │ ├── UserMonitoringService.java │ │ ├── UserService.java │ │ └── impl │ │ ├── ContactServiceImpl.java │ │ ├── OrderServiceImpl.java │ │ ├── RoleServiceImpl.java │ │ ├── UserMonitoringServiceImpl.java │ │ └── UserServiceImpl.java │ └── resources │ ├── application.yml │ ├── mappers │ ├── Contact.xml │ ├── Order.xml │ ├── Permission.xml │ ├── Role.xml │ ├── User.xml │ └── UserMonitoring.xml │ ├── static │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ ├── css │ │ ├── carousel.css │ │ ├── doc.min.css │ │ ├── element.css │ │ ├── font-awesome.min.css │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ ├── login.css │ │ ├── main.css │ │ └── theme.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome4.2 │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ ├── jquery │ │ ├── bootstrap-paginator.js │ │ ├── jquery-1.9.1.min.js │ │ ├── jquery-2.1.1.min.js │ │ ├── jquery-3.1.0.min.js │ │ └── jquery-3.4.1.js │ ├── script │ │ ├── axios.js │ │ ├── back-to-top.js │ │ ├── dataParse.js │ │ ├── docs.min.js │ │ ├── echarts.js │ │ ├── element.js │ │ └── vue.js │ └── ztree │ │ ├── img │ │ ├── diy │ │ │ ├── 1_close.png │ │ │ ├── 1_open.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ └── 9.png │ │ ├── line_conn.gif │ │ ├── loading.gif │ │ ├── zTreeStandard.gif │ │ └── zTreeStandard.png │ │ ├── jquery.ztree.all-3.5.min.js │ │ └── zTreeStyle.css │ └── templates │ ├── error │ ├── 404.html │ ├── 4xx.html │ └── 5xx.html │ ├── login.html │ ├── user-head.html │ ├── user-left.html │ └── user │ ├── assignPermission.html │ ├── assignRole.html │ ├── condition_monitoring.html │ ├── feedback_monitoring.html │ ├── order_monitoring.html │ ├── role.html │ └── user.html ├── coffee-sales-user ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── coffee │ │ └── sales │ │ └── user │ │ ├── CoffeeSalesUserApplication.java │ │ ├── bean │ │ ├── Address.java │ │ ├── Car.java │ │ ├── Commodity.java │ │ ├── CommodityType.java │ │ ├── Contact.java │ │ ├── Order.java │ │ └── User.java │ │ ├── config │ │ └── SpringMvcConfig.java │ │ ├── controller │ │ ├── AddressController.java │ │ ├── CarController.java │ │ ├── CommodityController.java │ │ ├── CommodityTypeController.java │ │ ├── ContactController.java │ │ ├── OrderController.java │ │ ├── Router.java │ │ └── UserController.java │ │ ├── dao │ │ ├── AddressMapper.java │ │ ├── CarMapper.java │ │ ├── CommodityMapper.java │ │ ├── CommodityTypeMapper.java │ │ ├── ContactMapper.java │ │ ├── OrderMapper.java │ │ └── UserMapper.java │ │ ├── handler │ │ └── UserLoginHandler.java │ │ └── service │ │ ├── AddressService.java │ │ ├── CarService.java │ │ ├── CommodityService.java │ │ ├── CommodityTypeService.java │ │ ├── ContactService.java │ │ ├── OrderService.java │ │ ├── UserService.java │ │ └── impl │ │ ├── AddressServiceImpl.java │ │ ├── CarServiceImpl.java │ │ ├── CommodityServiceImpl.java │ │ ├── CommodityTypeServiceImpl.java │ │ ├── ContactServiceImpl.java │ │ ├── OrderServiceImpl.java │ │ └── UserServiceImpl.java │ └── resources │ ├── application.yml │ ├── mappers │ ├── AddressMapper.xml │ ├── CarMapper.xml │ ├── CommodityMapper.xml │ ├── CommodityTypeMapper.xml │ ├── ContactMapper.xml │ ├── OrderMapper.xml │ └── UserMapper.xml │ ├── static │ ├── css │ │ ├── animate.css │ │ ├── bootstrap.css │ │ ├── element.css │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ ├── poi-shopping.css │ │ ├── popuo-box.css │ │ ├── style.css │ │ └── swipebox.css │ ├── fonts │ │ ├── Aladin-Fonts.css │ │ ├── ZgNSjPJFPrvJV5fF4C35lGQ.woff2 │ │ ├── ZgNSjPJFPrvJV5fF7i35.woff2 │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── images │ │ ├── a.png │ │ ├── afqd.jpg │ │ ├── bg.jpg │ │ ├── byhmhjlc.jpg │ │ ├── bymghcc.jpg │ │ ├── cbmsblb.jpg │ │ ├── ccnrfg.jpg │ │ ├── chgtlmppzmb.jpg │ │ ├── hcnt.jpg │ │ ├── icon1.png │ │ ├── icon2.png │ │ ├── icons.svg │ │ ├── img1.png │ │ ├── img2.jpg │ │ ├── img3.jpg │ │ ├── img4.jpg │ │ ├── img5.jpg │ │ ├── img6.jpg │ │ ├── img7.jpg │ │ ├── img8.jpg │ │ ├── img9.jpg │ │ ├── jrzxpnn.jpg │ │ ├── jslogosp.jpg │ │ ├── jtmqd.jpg │ │ ├── jtnskf.jpg │ │ ├── kbqn.jpg │ │ ├── ksjrj.jpg │ │ ├── lcbkf.jpg │ │ ├── lcfld.jpg │ │ ├── lmmf.jpg │ │ ├── lmqqfqrldg.jpg │ │ ├── meiskf.jpg │ │ ├── menu-icon.png │ │ ├── mk.jpg │ │ ├── move-up.png │ │ ├── mzpgdj.jpg │ │ ├── nrzsks.jpg │ │ ├── nt.jpg │ │ ├── nygjrpg.jpg │ │ ├── pgdksb.jpg │ │ ├── social-icons.png │ │ ├── tjppbsmkb.jpg │ │ ├── tjpphsmkb.jpg │ │ ├── xbjppbxgzmb.jpg │ │ ├── xfygs.jpg │ │ ├── xnqklmf.jpg │ │ ├── yg.jpg │ │ ├── ymhslsbxgbwb.jpg │ │ ├── ysbslmppzmb.jpg │ │ ├── zxblb.jpg │ │ ├── zxbshsshbxgsxb.jpg │ │ └── zxbshsshbxgzmb.jpg │ └── js │ │ ├── address.js │ │ ├── axios.js │ │ ├── bootstrap.js │ │ ├── country-level3-data.js │ │ ├── createOrder.js │ │ ├── dataParse.js │ │ ├── element.js │ │ ├── homes.js │ │ ├── information.js │ │ ├── jquery-3.4.1.js │ │ ├── jquery.swipebox.min.js │ │ ├── login.js │ │ ├── orderInFo.js │ │ ├── register.js │ │ ├── retrieve.js │ │ ├── shopping.js │ │ ├── shoppingCar.js │ │ └── vue.js │ └── templates │ ├── address.html │ ├── contact.html │ ├── createOrder.html │ ├── fotter-all.html │ ├── index.html │ ├── information.html │ ├── login.html │ ├── orderInFo.html │ ├── register.html │ ├── retrieve.html │ ├── shopping.html │ ├── shoppingCar.html │ └── top-list.html └── coffee.sql /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Coffee 2 | 毕业设计项目,网上商城类型(SpringBoot) 3 | 4 | 如果本项目对你有用请点个Star,感激不尽。 5 | 6 | 如果遇到无法解决的问题,请加我QQ:614750226,备注明来意,我会尽量帮助你解决。 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /coffee-sales-employee/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 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 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /coffee-sales-employee/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /coffee-sales-employee/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /coffee-sales-employee/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.2.1.RELEASE 9 | 10 | 11 | com.coffee 12 | coffee-sales-employee 13 | 0.0.1-SNAPSHOT 14 | 15 | 16 | 11 17 | 18 | 19 | 20 | 21 | org.thymeleaf.extras 22 | thymeleaf-extras-springsecurity5 23 | 3.0.3.RELEASE 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-cache 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-security 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-thymeleaf 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-web 40 | 41 | 42 | org.mybatis.spring.boot 43 | mybatis-spring-boot-starter 44 | 2.1.1 45 | 46 | 47 | 48 | com.github.pagehelper 49 | pagehelper-spring-boot-starter 50 | 1.2.3 51 | 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-devtools 56 | runtime 57 | true 58 | 59 | 60 | mysql 61 | mysql-connector-java 62 | runtime 63 | 64 | 65 | org.projectlombok 66 | lombok 67 | true 68 | 69 | 70 | org.springframework.boot 71 | spring-boot-starter-test 72 | test 73 | 74 | 75 | org.junit.vintage 76 | junit-vintage-engine 77 | 78 | 79 | 80 | 81 | org.springframework.security 82 | spring-security-test 83 | test 84 | 85 | 86 | javax.servlet 87 | javax.servlet-api 88 | 89 | 90 | 91 | 92 | 93 | 94 | org.springframework.boot 95 | spring-boot-maven-plugin 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/CoffeeSalesApplication.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cache.annotation.EnableCaching; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | @SpringBootApplication 10 | @MapperScan("com.coffee.sales.employee.dao") 11 | @EnableTransactionManagement(proxyTargetClass = true) 12 | @EnableCaching 13 | public class CoffeeSalesApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(CoffeeSalesApplication.class, args); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/bean/Contact.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("contact") 12 | public class Contact { 13 | private Integer conId; 14 | private String conName; 15 | private String conEmail; 16 | private String conPhone; 17 | private String conMessage; 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/bean/Order.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Alias("order") 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class Order { 13 | private String orderNumber; 14 | private String orderCreateTime; 15 | private String orderGold; 16 | private String orderConsignee; 17 | private String orderArea; 18 | private String orderUserName; 19 | } 20 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/bean/Permission.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Alias("permission") 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class Permission { 13 | private Integer id; 14 | private Integer pid; 15 | private String name; 16 | private String icon; 17 | private String url; 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/bean/Role.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.bean; 2 | 3 | import java.util.List; 4 | 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import org.apache.ibatis.type.Alias; 9 | 10 | @Alias("role") 11 | @Data 12 | @AllArgsConstructor 13 | @NoArgsConstructor 14 | public class Role { 15 | private Integer id; 16 | private String name; 17 | private List permissionList; 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import java.util.List; 5 | 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | import org.apache.ibatis.type.Alias; 10 | import org.springframework.format.annotation.DateTimeFormat; 11 | 12 | @Alias("user") 13 | @Data 14 | @AllArgsConstructor 15 | @NoArgsConstructor 16 | public class User { 17 | private Integer id; 18 | private String loginAcct; 19 | private String userPassword; 20 | private String userName; 21 | private String email; 22 | @DateTimeFormat( 23 | pattern = "yyyy-MM-dd" 24 | ) 25 | @JsonFormat( 26 | pattern = "yyyy-MM-dd" 27 | ) 28 | private String createTime; 29 | private List roleList; 30 | } 31 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/bean/UserMonitoring.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("userMonitoring") 12 | public class UserMonitoring { 13 | private Integer uId; 14 | private String uName; 15 | private String uPwd; 16 | private String uEmail; 17 | private String uPhone; 18 | private Integer uState; 19 | } 20 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/config/SpringMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 5 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 7 | 8 | @Configuration 9 | public class SpringMvcConfig implements WebMvcConfigurer { 10 | public void addViewControllers(ViewControllerRegistry registry) { 11 | registry.addViewController("/login.html").setViewName("login"); 12 | registry.addViewController("/").setViewName("login"); 13 | } 14 | 15 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 16 | registry.addResourceHandler("/img/**").addResourceLocations("classpath:static/img/"); 17 | registry.addResourceHandler("/static/**").addResourceLocations("/static/"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/controller/ContactController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.controller; 2 | 3 | import com.coffee.sales.employee.bean.Contact; 4 | import com.coffee.sales.employee.service.ContactService; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | @RestController 13 | public class ContactController { 14 | 15 | private final ContactService contactService; 16 | 17 | @Autowired 18 | public ContactController(ContactService contactService) { 19 | this.contactService = contactService; 20 | } 21 | 22 | @PostMapping("contactAllInFo") 23 | public PageInfo contactAllInFo(@RequestParam(defaultValue = "1", name = "pageNumber") Integer pageNumber) { 24 | PageHelper.startPage(pageNumber, 6); 25 | return new PageInfo<>(contactService.contactAllInFo()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.controller; 2 | 3 | import com.coffee.sales.employee.bean.Order; 4 | import com.coffee.sales.employee.service.OrderService; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | 13 | @RestController 14 | public class OrderController { 15 | 16 | private final OrderService orderService; 17 | 18 | @Autowired 19 | public OrderController(OrderService orderService) { 20 | this.orderService = orderService; 21 | } 22 | 23 | @PostMapping("orderAllInFo") 24 | public PageInfo orderAllInFo(@RequestParam(defaultValue = "1", name = "pageNumber") Integer pageNumber) { 25 | PageHelper.startPage(pageNumber, 6); 26 | return new PageInfo<>(orderService.orderAllInFo()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/controller/RoleController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.controller; 2 | 3 | import com.coffee.sales.employee.bean.Permission; 4 | import com.coffee.sales.employee.bean.Role; 5 | import com.coffee.sales.employee.service.impl.RoleServiceImpl; 6 | import com.github.pagehelper.PageHelper; 7 | import com.github.pagehelper.PageInfo; 8 | import java.sql.SQLException; 9 | import java.util.Arrays; 10 | import java.util.List; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.ui.Model; 14 | import org.springframework.web.bind.annotation.GetMapping; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RequestParam; 17 | import org.springframework.web.bind.annotation.ResponseBody; 18 | 19 | @Controller 20 | @RequestMapping({"rolecont"}) 21 | public class RoleController { 22 | @Autowired 23 | private RoleServiceImpl service; 24 | 25 | @GetMapping({"getPage"}) 26 | @ResponseBody 27 | public PageInfo getRoles(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum) throws SQLException { 28 | PageHelper.startPage(pageNum, 5); 29 | List list = this.service.getAllRoles(); 30 | PageInfo page = new PageInfo(list); 31 | return page; 32 | } 33 | 34 | @RequestMapping({"saveRole"}) 35 | @ResponseBody 36 | public String saveRole(String name) throws SQLException { 37 | this.service.saveRole(name); 38 | return "success"; 39 | } 40 | 41 | @RequestMapping({"updateRole"}) 42 | @ResponseBody 43 | public String updateRole(Role role) throws SQLException { 44 | this.service.updateRole(role); 45 | return "update success"; 46 | } 47 | 48 | @RequestMapping({"deleteRole"}) 49 | @ResponseBody 50 | public String deleteRole(@RequestParam("ids[]") Integer[] ids) throws SQLException { 51 | this.service.deleteRole(ids); 52 | return "delete success"; 53 | } 54 | 55 | @GetMapping({"permission"}) 56 | public String toPermission(Integer id, Model model) throws SQLException { 57 | List allPermissions = this.service.getAllPermission(); 58 | List permissionids = this.service.getPermission(id); 59 | model.addAttribute("allPermissions", allPermissions); 60 | model.addAttribute("permissionids", permissionids); 61 | model.addAttribute("id", id); 62 | return "user/assignPermission"; 63 | } 64 | 65 | @GetMapping({"updatePermission"}) 66 | @ResponseBody 67 | public String updateRolePermission(Integer roleid, @RequestParam("savepermissionid[]") Integer[] saveid, @RequestParam("deletepermissionid[]") Integer[] deleteid) throws SQLException { 68 | Integer[] save = (Integer[])Arrays.copyOf(saveid, saveid.length - 1); 69 | Integer[] delete = (Integer[])Arrays.copyOf(deleteid, deleteid.length - 1); 70 | if (save.length != 0) { 71 | this.service.saveRoleAndePermission(roleid, save); 72 | } 73 | 74 | if (delete.length != 0) { 75 | this.service.deleteRolePermission(roleid, delete); 76 | } 77 | 78 | return "update success"; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.controller; 2 | 3 | import com.coffee.sales.employee.bean.Role; 4 | import com.coffee.sales.employee.bean.User; 5 | import com.coffee.sales.employee.service.UserService; 6 | import com.github.pagehelper.PageHelper; 7 | import com.github.pagehelper.PageInfo; 8 | import java.sql.SQLException; 9 | import java.util.Arrays; 10 | import java.util.List; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.ui.Model; 15 | import org.springframework.web.bind.annotation.GetMapping; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestMapping; 18 | import org.springframework.web.bind.annotation.RequestParam; 19 | import org.springframework.web.bind.annotation.ResponseBody; 20 | 21 | @Controller 22 | @RequestMapping({"user"}) 23 | public class UserController { 24 | @Autowired 25 | private UserService service; 26 | @Autowired 27 | private BCryptPasswordEncoder bCryptPasswordEncoder; 28 | 29 | @RequestMapping({"get"}) 30 | public String getUser(Model model) throws SQLException { 31 | PageHelper.startPage(1, 5); 32 | List users = this.service.queryUser(); 33 | PageInfo page = new PageInfo(users); 34 | model.addAttribute("page", page); 35 | return "user/user"; 36 | } 37 | 38 | @RequestMapping({"getPage"}) 39 | @ResponseBody 40 | public PageInfo getPageUser(@RequestParam(defaultValue = "1") Integer pageNum) throws SQLException { 41 | PageHelper.startPage(pageNum, 5); 42 | List users = this.service.queryUser(); 43 | PageInfo page = new PageInfo(users); 44 | return page; 45 | } 46 | 47 | @RequestMapping({"save"}) 48 | @ResponseBody 49 | public String saveUser(User user) throws SQLException { 50 | String encode = this.bCryptPasswordEncoder.encode(user.getUserPassword()); 51 | user.setUserPassword(encode); 52 | this.service.saveUser(user); 53 | return "success"; 54 | } 55 | 56 | @RequestMapping({"updateUser"}) 57 | @ResponseBody 58 | public String updateUser(User user) throws SQLException { 59 | this.service.updateUser(user); 60 | return "update success"; 61 | } 62 | 63 | @RequestMapping({"delete"}) 64 | @ResponseBody 65 | public String deleteUser(@RequestParam("ids[]") int[] ids) throws SQLException { 66 | this.service.delete(ids); 67 | return "Delete Success"; 68 | } 69 | 70 | @GetMapping({"role"}) 71 | public String getRole(int userid, Model model) throws SQLException { 72 | List roles = this.service.queryRole(userid); 73 | List allRoles = this.service.queryAllRole(); 74 | allRoles.removeAll(roles); 75 | model.addAttribute("roles", roles); 76 | model.addAttribute("allRoles", allRoles); 77 | model.addAttribute("userid", userid); 78 | return "user/assignRole"; 79 | } 80 | 81 | @PostMapping({"updateRole"}) 82 | @ResponseBody 83 | public String updateUserAndRole(int userid, @RequestParam(value = "leftparam[]",defaultValue = "") Integer[] leftparam, @RequestParam(value = "rightparam[]",defaultValue = "") Integer[] rightparam) throws SQLException { 84 | Integer[] delete = (Integer[])Arrays.copyOf(leftparam, leftparam.length - 1); 85 | Integer[] insert = (Integer[])Arrays.copyOf(rightparam, rightparam.length - 1); 86 | if (delete.length != 0) { 87 | this.service.deleteUserAndRole(userid, delete); 88 | } 89 | 90 | if (insert.length != 0) { 91 | this.service.saveUserAndRole(userid, insert); 92 | } 93 | 94 | return "success"; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/controller/UserMonitoringController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.controller; 2 | 3 | import com.coffee.sales.employee.bean.UserMonitoring; 4 | import com.coffee.sales.employee.service.UserMonitoringService; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | @RestController 13 | public class UserMonitoringController { 14 | 15 | private final UserMonitoringService userMonitoringService; 16 | 17 | @Autowired 18 | public UserMonitoringController(UserMonitoringService userMonitoringService) { 19 | this.userMonitoringService = userMonitoringService; 20 | } 21 | 22 | @PostMapping("userMonitoringAllInFo") 23 | public PageInfo userMonitoringAllInFo(@RequestParam(defaultValue = "1", name = "pageNumber") Integer pageNumber) { 24 | PageHelper.startPage(pageNumber, 6); 25 | return new PageInfo<>(userMonitoringService.userMonitoringAllInFo()); 26 | } 27 | 28 | @PostMapping("updateUserMonitoringTypeToFrozen") 29 | public Boolean updateUserMonitoringTypeToFrozen(Integer id) { 30 | return userMonitoringService.updateUserMonitoringTypeToFrozen(id) > 0; 31 | } 32 | 33 | @PostMapping("updateUserMonitoringTypeToThaw") 34 | public Boolean updateUserMonitoringTypeToThaw(Integer id) { 35 | return userMonitoringService.updateUserMonitoringTypeToThaw(id) > 0; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/controller/UserRoleController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | @Controller 7 | public class UserRoleController { 8 | private static final String PREFIX = "user/"; 9 | 10 | @GetMapping({"assignPermission"}) 11 | public String assignPermission() { 12 | return "user/assignPermission"; 13 | } 14 | 15 | @GetMapping({"assignRole"}) 16 | public String assignRole() { 17 | return "user/assignRole"; 18 | } 19 | 20 | @GetMapping({"role"}) 21 | public String role() { 22 | return "user/role"; 23 | } 24 | 25 | @GetMapping({"user"}) 26 | public String user() { 27 | return "user/user"; 28 | } 29 | 30 | @GetMapping({"order_monitoring"}) 31 | public String authCert() { 32 | return "user/order_monitoring"; 33 | } 34 | 35 | @GetMapping({"condition_monitoring"}) 36 | public String authProject() { 37 | return "user/condition_monitoring"; 38 | } 39 | 40 | @GetMapping({"feedback_monitoring"}) 41 | public String projectType() { 42 | return "user/feedback_monitoring"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/dao/ContactMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.dao; 2 | 3 | import com.coffee.sales.employee.bean.Contact; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface ContactMapper { 12 | /** 13 | * 获取所有用户反馈的信息 14 | * 15 | * @return 用户反馈信息 16 | */ 17 | List contactAllInFo(); 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/dao/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.dao; 2 | 3 | import com.coffee.sales.employee.bean.Order; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface OrderMapper { 12 | /** 13 | * 获取订单信息 14 | * 15 | * @return 订单信息 16 | */ 17 | List orderAllInFo(); 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/dao/PermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.coffee.sales.employee.bean.Permission; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Select; 8 | import org.springframework.stereotype.Repository; 9 | 10 | @Mapper 11 | @Repository 12 | public interface PermissionMapper { 13 | @Select({"SELECT * FROM t_permission tp WHERE tp.url = #{url}"}) 14 | Permission findPermissionByUrl(String url); 15 | 16 | @Select({"select * from t_permission where url is not null and length(url) > 0"}) 17 | List findPermissionURL(); 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/dao/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.dao; 2 | 3 | import java.sql.SQLException; 4 | import java.util.List; 5 | 6 | import com.coffee.sales.employee.bean.Permission; 7 | import com.coffee.sales.employee.bean.Role; 8 | import org.apache.ibatis.annotations.Delete; 9 | import org.apache.ibatis.annotations.Insert; 10 | import org.apache.ibatis.annotations.Mapper; 11 | import org.apache.ibatis.annotations.Param; 12 | import org.apache.ibatis.annotations.Select; 13 | import org.apache.ibatis.annotations.Update; 14 | import org.springframework.stereotype.Repository; 15 | 16 | @Mapper 17 | @Repository 18 | public interface RoleMapper { 19 | Role findRolePermissionById(Integer id); 20 | 21 | @Select({"select id,name from t_role where id in (select roleid from t_user_role where userid = #{userId})"}) 22 | List queryRole(int userId) throws SQLException; 23 | 24 | @Select({"select id,name from t_role"}) 25 | List queryAllRole() throws SQLException; 26 | 27 | @Select({"select id,pid,name,icon,url from t_permission where not isnull(url)"}) 28 | List queryAllPermission() throws SQLException; 29 | 30 | @Select({"select id from t_permission where id in(select permissionid from t_role_permission where roleid = #{id})"}) 31 | List queryPermission(int id) throws SQLException; 32 | 33 | @Insert({""}) 34 | void saveRoleAndPermission(Integer roleid, Integer[] permissionid) throws SQLException; 35 | 36 | @Delete({""}) 37 | void deleteRolePermission(Integer roleid, Integer[] permissionid) throws SQLException; 38 | 39 | @Insert({"insert into t_role(name) values(#{name})"}) 40 | void saveRole(String name) throws SQLException; 41 | 42 | @Update({"update t_role set name=#{name} where id=#{id}"}) 43 | void updateRole(Role role) throws SQLException; 44 | 45 | @Delete({""}) 46 | void deleteRole(@Param("ids") Integer[] ids) throws SQLException; 47 | } 48 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.dao; 2 | 3 | import java.sql.SQLException; 4 | import java.util.List; 5 | 6 | import com.coffee.sales.employee.bean.User; 7 | import org.apache.ibatis.annotations.Delete; 8 | import org.apache.ibatis.annotations.Insert; 9 | import org.apache.ibatis.annotations.Mapper; 10 | import org.apache.ibatis.annotations.Param; 11 | import org.apache.ibatis.annotations.Select; 12 | import org.apache.ibatis.annotations.Update; 13 | import org.springframework.stereotype.Repository; 14 | 15 | @Mapper 16 | @Repository 17 | public interface UserMapper { 18 | User findUserRoleByLoginAcct(String loginAcct); 19 | 20 | @Select({"select id,loginacct,userpassword,username,email,createtime from t_user "}) 21 | List queryAllUser() throws SQLException; 22 | 23 | @Insert({"insert into t_user(loginacct,userpassword,username,email) values(#{loginAcct},#{userPassword},#{userName},#{email})"}) 24 | void saveUser(User user) throws SQLException; 25 | 26 | @Update({"update t_user set loginacct=#{loginAcct},username=#{userName},email=#{email} where id=#{id}"}) 27 | void updateUser(User user) throws SQLException; 28 | 29 | @Delete({""}) 30 | void deleteUser(@Param("ids") int[] ids) throws SQLException; 31 | 32 | @Insert({""}) 33 | void saveUserRole(int userid, Integer[] roleids) throws SQLException; 34 | 35 | @Delete({""}) 36 | void deleteUserRole(int userid, Integer[] roleids) throws SQLException; 37 | } 38 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/dao/UserMonitoringMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.dao; 2 | 3 | import com.coffee.sales.employee.bean.UserMonitoring; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface UserMonitoringMapper { 12 | 13 | /** 14 | * 获取所有的用户信息 15 | * 16 | * @return 用户信息 17 | */ 18 | List userMonitoringAllInFo(); 19 | 20 | /** 21 | * 冻结用户 22 | * 23 | * @param id 用户ID 24 | * @return 影响的行数 25 | */ 26 | Integer updateUserMonitoringTypeToFrozen(Integer id); 27 | 28 | /** 29 | * 解冻用户 30 | * 31 | * @param id 用户ID 32 | * @return 影响的行数 33 | */ 34 | Integer updateUserMonitoringTypeToThaw(Integer id); 35 | } 36 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/security/MyAccessDecisionManager.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.security; 2 | 3 | import org.springframework.security.access.AccessDecisionManager; 4 | import org.springframework.security.access.AccessDeniedException; 5 | import org.springframework.security.access.ConfigAttribute; 6 | import org.springframework.security.authentication.InsufficientAuthenticationException; 7 | import org.springframework.security.core.Authentication; 8 | import org.springframework.security.core.GrantedAuthority; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.util.Collection; 12 | import java.util.Iterator; 13 | 14 | @Component 15 | public class MyAccessDecisionManager implements AccessDecisionManager { 16 | 17 | @Override 18 | public void decide(Authentication authentication, Object object, Collection configAttributes) throws AccessDeniedException, InsufficientAuthenticationException { 19 | if (null == configAttributes || configAttributes.size() <= 0) { 20 | return; 21 | } 22 | ConfigAttribute c; 23 | String needRole; 24 | 25 | for (Iterator iter = configAttributes.iterator(); iter.hasNext(); ) { 26 | c = iter.next(); 27 | needRole = c.getAttribute(); 28 | for (GrantedAuthority ga : authentication.getAuthorities()) { 29 | if (needRole.trim().equals(ga.getAuthority())) { 30 | return; 31 | } 32 | } 33 | } 34 | throw new AccessDeniedException("no right"); 35 | } 36 | 37 | @Override 38 | public boolean supports(ConfigAttribute attribute) { 39 | return true; 40 | } 41 | 42 | @Override 43 | public boolean supports(Class> clazz) { 44 | return true; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/security/MyAuthenticationProvider.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.security; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.authentication.AuthenticationProvider; 5 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 6 | import org.springframework.security.core.Authentication; 7 | import org.springframework.security.core.AuthenticationException; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 10 | import org.springframework.stereotype.Component; 11 | 12 | @Component 13 | public class MyAuthenticationProvider implements AuthenticationProvider { 14 | private final UserDetailServiceImpl userDetailService; 15 | 16 | @Autowired 17 | public MyAuthenticationProvider(UserDetailServiceImpl userDetailService) { 18 | this.userDetailService = userDetailService; 19 | } 20 | 21 | @Override 22 | public Authentication authenticate(Authentication authentication) throws AuthenticationException { 23 | String username = authentication.getName(); 24 | String password = authentication.getCredentials().toString(); 25 | UserDetails userDetails = userDetailService.loadUserByUsername(username); 26 | BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(); 27 | boolean flag = bCryptPasswordEncoder.matches(password, userDetails.getPassword()); 28 | if (flag){ 29 | return new UsernamePasswordAuthenticationToken(userDetails,password,userDetails.getAuthorities()); 30 | } 31 | return null; 32 | } 33 | 34 | @Override 35 | public boolean supports(Class> aClass) { 36 | return true; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/security/MyFilterSecurityInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.security; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.access.SecurityMetadataSource; 5 | import org.springframework.security.access.intercept.AbstractSecurityInterceptor; 6 | import org.springframework.security.access.intercept.InterceptorStatusToken; 7 | import org.springframework.security.core.context.SecurityContextHolder; 8 | import org.springframework.security.web.FilterInvocation; 9 | import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; 10 | import org.springframework.stereotype.Component; 11 | 12 | import javax.servlet.*; 13 | import java.io.IOException; 14 | 15 | @Component 16 | public class MyFilterSecurityInterceptor extends AbstractSecurityInterceptor implements Filter { 17 | 18 | 19 | private final FilterInvocationSecurityMetadataSource securityMetadataSource; 20 | 21 | @Autowired 22 | public MyFilterSecurityInterceptor(FilterInvocationSecurityMetadataSource securityMetadataSource) { 23 | this.securityMetadataSource = securityMetadataSource; 24 | } 25 | 26 | @Autowired 27 | private void setMyAccessDecisionManager(MyAccessDecisionManager myAccessDecisionManager) { 28 | super.setAccessDecisionManager(myAccessDecisionManager); 29 | } 30 | 31 | 32 | @Override 33 | public void init(FilterConfig filterConfig) throws ServletException { 34 | 35 | } 36 | 37 | 38 | @Override 39 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { 40 | FilterInvocation fi = new FilterInvocation(servletRequest, servletResponse, filterChain); 41 | invoke(fi); 42 | } 43 | 44 | public void invoke(FilterInvocation fi) throws IOException, ServletException { 45 | //fi里面有一个被拦截的url 46 | //里面调用MyInvocationSecurityMetadataSource的getAttributes(Object object)这个方法获取fi对应的所有权限 47 | //再调用MyAccessDecisionManager的decide方法来校验用户的权限是否足够 48 | InterceptorStatusToken token = super.beforeInvocation(fi); 49 | try { 50 | //执行下一个拦截器 51 | fi.getChain().doFilter(fi.getRequest(), fi.getResponse()); 52 | } finally { 53 | super.afterInvocation(token, null); 54 | SecurityContextHolder.clearContext(); 55 | } 56 | } 57 | 58 | @Override 59 | public void destroy() { 60 | 61 | } 62 | 63 | @Override 64 | public Class> getSecureObjectClass() { 65 | return FilterInvocation.class; 66 | } 67 | 68 | @Override 69 | public SecurityMetadataSource obtainSecurityMetadataSource() { 70 | return this.securityMetadataSource; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/security/MyInvocationSecurityMetadataSourceService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.security; 2 | 3 | import com.coffee.sales.employee.bean.Permission; 4 | import com.coffee.sales.employee.dao.PermissionMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.access.ConfigAttribute; 7 | import org.springframework.security.access.SecurityConfig; 8 | import org.springframework.security.web.FilterInvocation; 9 | import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; 10 | import org.springframework.security.web.util.matcher.AntPathRequestMatcher; 11 | import org.springframework.stereotype.Service; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import java.util.*; 15 | 16 | /** 17 | * @author 863 18 | */ 19 | @Service 20 | public class MyInvocationSecurityMetadataSourceService implements FilterInvocationSecurityMetadataSource { 21 | 22 | private HashMap> map = null; 23 | 24 | private final PermissionMapper permissionMapper; 25 | 26 | @Autowired 27 | public MyInvocationSecurityMetadataSourceService(PermissionMapper permissionMapper) { 28 | this.permissionMapper = permissionMapper; 29 | } 30 | 31 | /** 32 | * 加载需要拦截的路径 33 | */ 34 | private void loadResourceDefine() { 35 | map = new HashMap<>(15); 36 | Collection array; 37 | ConfigAttribute cfg; 38 | List permissionURL = permissionMapper.findPermissionURL(); 39 | for (Permission permission : permissionURL) { 40 | array = new ArrayList<>(); 41 | cfg = new SecurityConfig(permission.getName()); 42 | 43 | array.add(cfg); 44 | map.put(permission.getUrl(), array); 45 | } 46 | 47 | } 48 | 49 | 50 | @Override 51 | public Collection getAttributes(Object object) throws IllegalArgumentException { 52 | FilterInvocation filterInvocation = (FilterInvocation) object; 53 | String fullRequestUrl = filterInvocation.getFullRequestUrl(); 54 | if (isMatcherAllowedRequest(filterInvocation)) { 55 | return null; 56 | } 57 | if (map == null) { 58 | loadResourceDefine(); 59 | } 60 | HttpServletRequest request = filterInvocation.getHttpRequest(); 61 | AntPathRequestMatcher matcher; 62 | String resUrl; 63 | for (Iterator iter = map.keySet().iterator(); iter.hasNext(); ) { 64 | resUrl = iter.next(); 65 | matcher = new AntPathRequestMatcher(resUrl); 66 | if (matcher.matches(request)) { 67 | return map.get(resUrl); 68 | } 69 | } 70 | return null; 71 | } 72 | 73 | /** 74 | * 判断当前请求是否在允许请求的范围内 75 | * 76 | * @param fi 当前请求 77 | * @return 是否在范围中 78 | */ 79 | private boolean isMatcherAllowedRequest(FilterInvocation fi) { 80 | return allowedRequest().stream().map(AntPathRequestMatcher::new) 81 | .filter(requestMatcher -> requestMatcher.matches(fi.getHttpRequest())) 82 | .toArray().length > 0; 83 | } 84 | 85 | /** 86 | * 不需要拦截的静态资源 87 | * 88 | * @return 定义允许请求的列表 89 | */ 90 | private List allowedRequest() { 91 | return Arrays.asList("/login", "/css/**", "/fonts/**", "/js/**", "/scss/**", "/img/**"); 92 | } 93 | 94 | @Override 95 | public Collection getAllConfigAttributes() { 96 | return null; 97 | } 98 | 99 | @Override 100 | public boolean supports(Class> clazz) { 101 | return true; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/security/SpringSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.security; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 6 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 7 | import org.springframework.security.config.annotation.web.builders.WebSecurity; 8 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 9 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 10 | import org.springframework.security.core.userdetails.UserDetailsService; 11 | import org.springframework.security.web.access.intercept.FilterSecurityInterceptor; 12 | 13 | /** 14 | * @author 863 15 | */ 16 | @EnableWebSecurity 17 | public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { 18 | 19 | @Autowired 20 | private MyFilterSecurityInterceptor myFilterSecurityInterceptor; 21 | 22 | @Bean 23 | UserDetailsService customUserService() { //注册UserDetailsService 的bean 24 | return new UserDetailServiceImpl(); 25 | } 26 | 27 | @Override 28 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 29 | auth.userDetailsService(customUserService()); 30 | } 31 | 32 | @Override 33 | protected void configure(HttpSecurity http) throws Exception { 34 | http.authorizeRequests() 35 | .antMatchers("/css/**").permitAll() 36 | .antMatchers("/img/**").permitAll() 37 | .antMatchers("/css/fonts/*.woff").permitAll() 38 | .antMatchers("/css/fonts/*.tff").permitAll() 39 | .antMatchers("/login.html").permitAll() 40 | .and() 41 | .formLogin() 42 | .loginPage("/login.html") 43 | .loginProcessingUrl("/login") 44 | .successForwardUrl("/user/get") 45 | .permitAll(); 46 | http.sessionManagement().maximumSessions(1).expiredUrl("/login"); 47 | http.addFilterBefore(myFilterSecurityInterceptor, FilterSecurityInterceptor.class); 48 | } 49 | 50 | @Override 51 | public void configure(WebSecurity web) { 52 | web.ignoring().antMatchers("/static/**", "/css/fonts/*.woff", "/css/fonts/*.tff"); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/security/UserDetailServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.security; 2 | 3 | import com.coffee.sales.employee.bean.Permission; 4 | import com.coffee.sales.employee.bean.Role; 5 | import com.coffee.sales.employee.bean.User; 6 | import com.coffee.sales.employee.service.impl.UserServiceImpl; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.security.core.GrantedAuthority; 10 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 11 | import org.springframework.security.core.userdetails.UserDetails; 12 | import org.springframework.security.core.userdetails.UserDetailsService; 13 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 14 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 15 | import org.springframework.stereotype.Component; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | @Component 21 | public class UserDetailServiceImpl implements UserDetailsService { 22 | @Autowired 23 | private UserServiceImpl userService; 24 | 25 | @Override 26 | public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { 27 | User userRoleInfo = userService.getUserRoleInfo(s); 28 | org.springframework.security.core.userdetails.User user; 29 | if (userRoleInfo == null) { 30 | throw new UsernameNotFoundException("用户不存在"); 31 | } else { 32 | List authorities = new ArrayList<>(); 33 | for (Role role : userRoleInfo.getRoleList()) { 34 | for (Permission permission : userService.findRolePermissionById(role.getId()).getPermissionList()) { 35 | authorities.add(new SimpleGrantedAuthority(permission.getName())); 36 | } 37 | } 38 | user = new org.springframework.security.core.userdetails.User(userRoleInfo.getLoginAcct(), userRoleInfo.getUserPassword(), authorities); 39 | } 40 | return user; 41 | } 42 | 43 | @Bean 44 | public BCryptPasswordEncoder bCryptPasswordEncoder() { 45 | return new BCryptPasswordEncoder(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/ContactService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service; 2 | 3 | import com.coffee.sales.employee.bean.Contact; 4 | 5 | import java.util.List; 6 | 7 | public interface ContactService { 8 | List contactAllInFo(); 9 | } 10 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service; 2 | 3 | import com.coffee.sales.employee.bean.Order; 4 | 5 | import java.util.List; 6 | 7 | public interface OrderService { 8 | List orderAllInFo(); 9 | } 10 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service; 2 | 3 | 4 | import com.coffee.sales.employee.bean.Permission; 5 | import com.coffee.sales.employee.bean.Role; 6 | 7 | import java.sql.SQLException; 8 | import java.util.List; 9 | 10 | public interface RoleService { 11 | List getAllRoles() throws SQLException; 12 | 13 | List getAllPermission() throws SQLException; 14 | 15 | List getPermission(int id) throws SQLException; 16 | 17 | void saveRoleAndePermission(Integer roleid, Integer[] permission) throws SQLException; 18 | 19 | void deleteRolePermission(Integer roleid, Integer[] permission) throws SQLException; 20 | 21 | void saveRole(String name) throws SQLException; 22 | 23 | void updateRole(Role role) throws SQLException; 24 | 25 | void deleteRole(Integer[] ids) throws SQLException; 26 | } 27 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/UserMonitoringService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service; 2 | 3 | 4 | import com.coffee.sales.employee.bean.UserMonitoring; 5 | 6 | import java.util.List; 7 | 8 | public interface UserMonitoringService { 9 | 10 | List userMonitoringAllInFo(); 11 | 12 | Integer updateUserMonitoringTypeToFrozen(Integer id); 13 | 14 | Integer updateUserMonitoringTypeToThaw(Integer id); 15 | } 16 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service; 2 | 3 | 4 | import com.coffee.sales.employee.bean.Role; 5 | import com.coffee.sales.employee.bean.User; 6 | 7 | import java.sql.SQLException; 8 | import java.util.List; 9 | 10 | public interface UserService { 11 | User getUserRoleInfo(String loginAcct); 12 | 13 | Role findRolePermissionById(Integer id); 14 | 15 | List queryUser() throws SQLException; 16 | 17 | void saveUser(User user) throws SQLException; 18 | 19 | void updateUser(User user) throws SQLException; 20 | 21 | void delete(int[] ids) throws SQLException; 22 | 23 | List queryRole(int userId) throws SQLException; 24 | 25 | List queryAllRole() throws SQLException; 26 | 27 | void saveUserAndRole(int userid, Integer[] roleids) throws SQLException; 28 | 29 | void deleteUserAndRole(int userid, Integer[] roleids) throws SQLException; 30 | } 31 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/impl/ContactServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service.impl; 2 | 3 | import com.coffee.sales.employee.bean.Contact; 4 | import com.coffee.sales.employee.dao.ContactMapper; 5 | import com.coffee.sales.employee.service.ContactService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class ContactServiceImpl implements ContactService { 13 | 14 | private final ContactMapper contactMapper; 15 | 16 | @Autowired 17 | public ContactServiceImpl(ContactMapper contactMapper) { 18 | this.contactMapper = contactMapper; 19 | } 20 | 21 | @Override 22 | public List contactAllInFo() { 23 | return contactMapper.contactAllInFo(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service.impl; 2 | 3 | import com.coffee.sales.employee.bean.Order; 4 | import com.coffee.sales.employee.dao.OrderMapper; 5 | import com.coffee.sales.employee.service.OrderService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class OrderServiceImpl implements OrderService { 13 | 14 | private final OrderMapper orderMapper; 15 | 16 | @Autowired 17 | public OrderServiceImpl(OrderMapper orderMapper) { 18 | this.orderMapper = orderMapper; 19 | } 20 | 21 | @Override 22 | public List orderAllInFo() { 23 | return orderMapper.orderAllInFo(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/impl/RoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service.impl; 2 | 3 | import java.sql.SQLException; 4 | import java.util.List; 5 | 6 | import com.coffee.sales.employee.bean.Permission; 7 | import com.coffee.sales.employee.bean.Role; 8 | import com.coffee.sales.employee.dao.RoleMapper; 9 | import com.coffee.sales.employee.service.RoleService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | @Service 15 | @Transactional( 16 | rollbackFor = {Exception.class} 17 | ) 18 | public class RoleServiceImpl implements RoleService { 19 | private final RoleMapper mapper; 20 | 21 | @Autowired 22 | public RoleServiceImpl(RoleMapper mapper) { 23 | this.mapper = mapper; 24 | } 25 | 26 | public List getAllRoles() throws SQLException { 27 | return mapper.queryAllRole(); 28 | } 29 | 30 | public List getAllPermission() throws SQLException { 31 | return mapper.queryAllPermission(); 32 | } 33 | 34 | public List getPermission(int id) throws SQLException { 35 | return mapper.queryPermission(id); 36 | } 37 | 38 | public void saveRoleAndePermission(Integer roleid, Integer[] permission) throws SQLException { 39 | mapper.saveRoleAndPermission(roleid, permission); 40 | } 41 | 42 | public void deleteRolePermission(Integer roleid, Integer[] permission) throws SQLException { 43 | mapper.deleteRolePermission(roleid, permission); 44 | } 45 | 46 | public void saveRole(String name) throws SQLException { 47 | mapper.saveRole(name); 48 | } 49 | 50 | public void updateRole(Role role) throws SQLException { 51 | mapper.updateRole(role); 52 | } 53 | 54 | public void deleteRole(Integer[] ids) throws SQLException { 55 | mapper.deleteRole(ids); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/impl/UserMonitoringServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service.impl; 2 | 3 | import com.coffee.sales.employee.bean.UserMonitoring; 4 | import com.coffee.sales.employee.dao.UserMonitoringMapper; 5 | import com.coffee.sales.employee.service.UserMonitoringService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class UserMonitoringServiceImpl implements UserMonitoringService { 13 | 14 | private final UserMonitoringMapper userMonitoringMapper; 15 | 16 | @Autowired 17 | public UserMonitoringServiceImpl(UserMonitoringMapper userMonitoringMapper) { 18 | this.userMonitoringMapper = userMonitoringMapper; 19 | } 20 | 21 | @Override 22 | public List userMonitoringAllInFo() { 23 | return userMonitoringMapper.userMonitoringAllInFo(); 24 | } 25 | 26 | @Override 27 | public Integer updateUserMonitoringTypeToFrozen(Integer id) { 28 | return userMonitoringMapper.updateUserMonitoringTypeToFrozen(id); 29 | } 30 | 31 | @Override 32 | public Integer updateUserMonitoringTypeToThaw(Integer id) { 33 | return userMonitoringMapper.updateUserMonitoringTypeToThaw(id); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/java/com/coffee/sales/employee/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.employee.service.impl; 2 | 3 | import java.sql.SQLException; 4 | import java.util.List; 5 | 6 | import com.coffee.sales.employee.bean.Role; 7 | import com.coffee.sales.employee.bean.User; 8 | import com.coffee.sales.employee.dao.RoleMapper; 9 | import com.coffee.sales.employee.dao.UserMapper; 10 | import com.coffee.sales.employee.service.UserService; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | @Service 16 | @Transactional( 17 | rollbackFor = {Exception.class} 18 | ) 19 | public class UserServiceImpl implements UserService { 20 | private final UserMapper userMapper; 21 | private final RoleMapper roleMapper; 22 | 23 | @Autowired 24 | public UserServiceImpl(UserMapper userMapper, RoleMapper roleMapper) { 25 | this.userMapper = userMapper; 26 | this.roleMapper = roleMapper; 27 | } 28 | 29 | public User getUserRoleInfo(String loginAcct) { 30 | return userMapper.findUserRoleByLoginAcct(loginAcct); 31 | } 32 | 33 | public Role findRolePermissionById(Integer id) { 34 | return roleMapper.findRolePermissionById(id); 35 | } 36 | 37 | public List queryUser() throws SQLException { 38 | return userMapper.queryAllUser(); 39 | } 40 | 41 | public void saveUser(User user) throws SQLException { 42 | userMapper.saveUser(user); 43 | } 44 | 45 | public void updateUser(User user) throws SQLException { 46 | userMapper.updateUser(user); 47 | } 48 | 49 | public void delete(int[] ids) throws SQLException { 50 | userMapper.deleteUser(ids); 51 | } 52 | 53 | public List queryRole(int userId) throws SQLException { 54 | return roleMapper.queryRole(userId); 55 | } 56 | 57 | public List queryAllRole() throws SQLException { 58 | return roleMapper.queryAllRole(); 59 | } 60 | 61 | public void saveUserAndRole(int userid, Integer[] roleids) throws SQLException { 62 | userMapper.saveUserRole(userid, roleids); 63 | } 64 | 65 | public void deleteUserAndRole(int userid, Integer[] roleids) throws SQLException { 66 | userMapper.deleteUserRole(userid, roleids); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | username: root 4 | password: 614750226 5 | driver-class-name: com.mysql.cj.jdbc.Driver 6 | url: jdbc:mysql://127.0.0.1:3306/coffee?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC&allowPublicKeyRetrieval=true 7 | thymeleaf: 8 | prefix: classpath:/templates/ 9 | mybatis: 10 | type-aliases-package: "com.coffee.sales.employee.bean" 11 | mapper-locations: 12 | - classpath*:mappers/*.xml 13 | configuration: 14 | use-actual-param-name: true 15 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 16 | pagehelper: 17 | helperDialect: mysql 18 | reasonable: true 19 | supportMethodsArguments: true 20 | arams: count=countSql 21 | server: 22 | port: 8080 23 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/mappers/Contact.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | SELECT 8 | cf_contact.conid, 9 | cf_contact.conname, 10 | cf_contact.conemail, 11 | cf_contact.conphone, 12 | cf_contact.conmessage 13 | FROM 14 | cf_contact 15 | 16 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/mappers/Order.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | SELECT 17 | cf_order.onumber orderNumber, 18 | cf_order.ocratetime orderCreateTime, 19 | cf_order.ogold orderGold, 20 | cf_address.consignee orderConsignee, 21 | cf_address.area orderArea, 22 | cf_user.uname orderUserName 23 | FROM 24 | cf_order LEFT JOIN 25 | cf_address ON cf_order.aid = cf_address.aid 26 | LEFT JOIN cf_user ON cf_order.uid = cf_user.uid 27 | 28 | 29 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/mappers/Permission.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/mappers/Role.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | SELECT r.*,p.id ids,p.pid,p.`name` pname,p.icon,p.url FROM t_role r 24 | LEFT JOIN t_role_permission rp ON r.id = rp.roleid 25 | LEFT JOIN t_permission p ON rp.permissionid = p.id 26 | WHERE r.id = #{arg0} 27 | 28 | 29 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/mappers/User.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | SELECT u.id,u.loginacct,u.userpassword,u.username,u.email,u.createtime,tr.id ids,tr.`name` FROM t_user u 24 | LEFT JOIN t_user_role ur ON u.id = ur.userid 25 | LEFT JOIN t_role tr ON ur.roleid = tr.id 26 | WHERE u.loginacct = #{arg0} 27 | 28 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/mappers/UserMonitoring.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | SELECT 9 | cf_user.uid, 10 | cf_user.uname, 11 | cf_user.upwd, 12 | cf_user.uemail, 13 | cf_user.uphone, 14 | cf_user.ustate 15 | FROM 16 | cf_user 17 | 18 | 19 | 20 | UPDATE `coffee`.`cf_user` 21 | SET `ustate` = 0 WHERE `uid` = #{id} 22 | 23 | 24 | 25 | UPDATE `coffee`.`cf_user` 26 | SET `ustate` = 1 WHERE `uid` = #{id} 27 | 28 | 29 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/css/carousel.css: -------------------------------------------------------------------------------- 1 | /* GLOBAL STYLES 2 | -------------------------------------------------- */ 3 | /* Padding below the footer and lighter body text */ 4 | 5 | body { 6 | padding-bottom: 40px; 7 | color: #5a5a5a; 8 | } 9 | 10 | 11 | /* CUSTOMIZE THE NAVBAR 12 | -------------------------------------------------- */ 13 | 14 | /* Special class on .container surrounding .navbar, used for positioning it into place. */ 15 | .navbar-wrapper { 16 | position: absolute; 17 | top: 0; 18 | right: 0; 19 | left: 0; 20 | z-index: 20; 21 | } 22 | 23 | /* Flip around the padding for proper display in narrow viewports */ 24 | .navbar-wrapper > .container { 25 | padding-right: 0; 26 | padding-left: 0; 27 | } 28 | .navbar-wrapper .navbar { 29 | padding-right: 15px; 30 | padding-left: 15px; 31 | } 32 | .navbar-wrapper .navbar .container { 33 | width: auto; 34 | } 35 | 36 | 37 | /* CUSTOMIZE THE CAROUSEL 38 | -------------------------------------------------- */ 39 | 40 | /* Carousel base class */ 41 | .carousel { 42 | height: 500px; 43 | margin-bottom: 60px; 44 | } 45 | /* Since positioning the image, we need to help out the caption */ 46 | .carousel-caption { 47 | z-index: 10; 48 | } 49 | 50 | /* Declare heights because of positioning of img element */ 51 | .carousel .item { 52 | height: 500px; 53 | background-color: #777; 54 | } 55 | .carousel-inner > .item > img { 56 | position: absolute; 57 | top: 0; 58 | left: 0; 59 | min-width: 100%; 60 | height: 500px; 61 | } 62 | 63 | 64 | /* MARKETING CONTENT 65 | -------------------------------------------------- */ 66 | 67 | /* Center align the text within the three columns below the carousel */ 68 | .marketing .col-lg-4 { 69 | margin-bottom: 20px; 70 | text-align: center; 71 | } 72 | .marketing h2 { 73 | font-weight: normal; 74 | } 75 | .marketing .col-lg-4 p { 76 | margin-right: 10px; 77 | margin-left: 10px; 78 | } 79 | 80 | 81 | /* Featurettes 82 | ------------------------- */ 83 | 84 | .featurette-divider { 85 | margin: 80px 0; /* Space out the Bootstrap more */ 86 | } 87 | 88 | /* Thin out the marketing headings */ 89 | .featurette-heading { 90 | font-weight: 300; 91 | line-height: 1; 92 | letter-spacing: -1px; 93 | } 94 | 95 | 96 | /* RESPONSIVE CSS 97 | -------------------------------------------------- */ 98 | 99 | @media (min-width: 768px) { 100 | /* Navbar positioning foo */ 101 | .navbar-wrapper { 102 | margin-top: 20px; 103 | } 104 | .navbar-wrapper .container { 105 | padding-right: 15px; 106 | padding-left: 15px; 107 | } 108 | .navbar-wrapper .navbar { 109 | padding-right: 0; 110 | padding-left: 0; 111 | } 112 | 113 | /* The navbar becomes detached from the top, so we round the corners */ 114 | .navbar-wrapper .navbar { 115 | border-radius: 4px; 116 | } 117 | 118 | /* Bump up size of carousel content */ 119 | .carousel-caption p { 120 | margin-bottom: 20px; 121 | font-size: 21px; 122 | line-height: 1.4; 123 | } 124 | 125 | .featurette-heading { 126 | font-size: 50px; 127 | } 128 | } 129 | 130 | @media (min-width: 992px) { 131 | .featurette-heading { 132 | margin-top: 120px; 133 | } 134 | } -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/css/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/css/fonts/element-icons.ttf -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/css/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/css/fonts/element-icons.woff -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/css/login.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 40px; 3 | padding-bottom: 40px; 4 | background-color: #eee; 5 | } 6 | 7 | .form-signin { 8 | max-width: 330px; 9 | padding: 15px; 10 | margin: 0 auto; 11 | } 12 | .form-signin .form-signin-heading, 13 | .form-signin .checkbox { 14 | margin-bottom: 10px; 15 | } 16 | .form-signin .checkbox { 17 | font-weight: normal; 18 | } 19 | .form-signin .form-control { 20 | position: relative; 21 | height: auto; 22 | -webkit-box-sizing: border-box; 23 | -moz-box-sizing: border-box; 24 | box-sizing: border-box; 25 | padding: 10px; 26 | font-size: 16px; 27 | } 28 | .form-signin .form-control:focus { 29 | z-index: 2; 30 | } 31 | .form-signin input[type="email"] { 32 | margin-bottom: -1px; 33 | border-bottom-right-radius: 0; 34 | border-bottom-left-radius: 0; 35 | } 36 | .form-signin input[type="password"] { 37 | margin-bottom: 10px; 38 | border-top-left-radius: 0; 39 | border-top-right-radius: 0; 40 | } -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/css/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | 11 | /* 12 | * Global add-ons 13 | */ 14 | 15 | .sub-header { 16 | padding-bottom: 10px; 17 | border-bottom: 1px solid #eee; 18 | } 19 | 20 | /* 21 | * Top navigation 22 | * Hide default border to remove 1px line. 23 | */ 24 | .navbar-fixed-top { 25 | border: 0; 26 | } 27 | 28 | /* 29 | * Sidebar 30 | */ 31 | 32 | /* Hide for mobile, show later */ 33 | .sidebar { 34 | display: none; 35 | } 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | .nav-sidebar > li > a { 59 | padding-right: 20px; 60 | padding-left: 20px; 61 | } 62 | .nav-sidebar > .active > a, 63 | .nav-sidebar > .active > a:hover, 64 | .nav-sidebar > .active > a:focus { 65 | color: #fff; 66 | background-color: #428bca; 67 | } 68 | 69 | 70 | /* 71 | * Main content 72 | */ 73 | 74 | .main { 75 | padding: 20px; 76 | } 77 | @media (min-width: 768px) { 78 | .main { 79 | padding-right: 40px; 80 | padding-left: 40px; 81 | } 82 | } 83 | .main .page-header { 84 | margin-top: 0; 85 | } 86 | 87 | 88 | /* 89 | * Placeholder dashboard ideas 90 | */ 91 | 92 | .placeholders { 93 | margin-bottom: 30px; 94 | text-align: center; 95 | } 96 | .placeholders h4 { 97 | margin-bottom: 0; 98 | } 99 | .placeholder { 100 | margin-bottom: 20px; 101 | } 102 | .placeholder img { 103 | display: inline-block; 104 | border-radius: 50%; 105 | } -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/css/theme.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 70px; 3 | padding-bottom: 30px; 4 | } 5 | 6 | .theme-dropdown .dropdown-menu { 7 | position: static; 8 | display: block; 9 | margin-bottom: 20px; 10 | } 11 | 12 | .theme-showcase > p > .btn { 13 | margin: 5px 0; 14 | } 15 | 16 | .theme-showcase .navbar .container { 17 | width: auto; 18 | } -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/FontAwesome.otf -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/fontawesome-webfont.eot -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/fontawesome4.2/fontawesome-webfont.woff -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/script/back-to-top.js: -------------------------------------------------------------------------------- 1 | //** jQuery Scroll to Top Control script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com. 2 | //** Available/ usage terms at http://www.dynamicdrive.com (March 30th, 09') 3 | //** v1.1 (April 7th, 09'): 4 | //** 1) Adds ability to scroll to an absolute position (from top of page) or specific element on the page instead. 5 | //** 2) Fixes scroll animation not working in Opera. 6 | 7 | 8 | var scrolltotop={ 9 | //startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control 10 | //scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top). 11 | setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]}, 12 | controlHTML: '', //'' //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol" 13 | controlattrs: {offsetx:5, offsety:5}, //offset of control relative to right/ bottom of window corner 14 | anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links 15 | 16 | state: {isvisible:false, shouldvisible:false}, 17 | 18 | scrollup:function(){ 19 | if (!this.cssfixedsupport) //if control is positioned using JavaScript 20 | this.$control.css({opacity:0}) //hide control immediately after clicking it 21 | var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto) 22 | if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists 23 | dest=jQuery('#'+dest).offset().top 24 | else 25 | dest=0 26 | this.$body.animate({scrollTop: dest}, this.setting.scrollduration); 27 | }, 28 | 29 | keepfixed:function(){ 30 | var $window=jQuery(window) 31 | var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx 32 | var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety 33 | this.$control.css({left:controlx+'px', top:controly+'px'}) 34 | }, 35 | 36 | togglecontrol:function(){ 37 | var scrolltop=jQuery(window).scrollTop() 38 | if (!this.cssfixedsupport) 39 | this.keepfixed() 40 | this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false 41 | if (this.state.shouldvisible && !this.state.isvisible){ 42 | this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0]) 43 | this.state.isvisible=true 44 | } 45 | else if (this.state.shouldvisible==false && this.state.isvisible){ 46 | this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1]) 47 | this.state.isvisible=false 48 | } 49 | }, 50 | 51 | init:function(){ 52 | jQuery(document).ready(function($){ 53 | var mainobj=scrolltotop 54 | var iebrws=document.all 55 | mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode 56 | mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body') 57 | mainobj.$control=$(''+mainobj.controlHTML+'') 58 | .css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'}) 59 | .attr({title:''}) 60 | .click(function(){mainobj.scrollup(); return false}) 61 | .appendTo('body') 62 | if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text 63 | mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text 64 | mainobj.togglecontrol() 65 | $('a[href="' + mainobj.anchorkeyword +'"]').click(function(){ 66 | mainobj.scrollup() 67 | return false 68 | }) 69 | $(window).bind('scroll resize', function(e){ 70 | mainobj.togglecontrol() 71 | }) 72 | }) 73 | } 74 | } 75 | 76 | scrolltotop.init() -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/script/dataParse.js: -------------------------------------------------------------------------------- 1 | function parseParams(data) { 2 | try { 3 | let tempArr = []; 4 | for (let i in data) { 5 | let key = encodeURIComponent(i); 6 | let value = encodeURIComponent(data[i]); 7 | tempArr.push(key + '=' + value); 8 | } 9 | return tempArr.join('&'); 10 | } catch (err) { 11 | return ''; 12 | } 13 | } -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/1_close.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/1_open.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/2.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/3.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/4.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/5.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/6.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/7.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/8.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/diy/9.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/line_conn.gif -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/loading.gif -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/zTreeStandard.gif -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/static/ztree/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-employee/src/main/resources/static/ztree/img/zTreeStandard.png -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/templates/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 404-Not Found 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 出错啦! 46 | 状态码:[[${status}]] 47 | 错误时间:[[${timestamp}]] 48 | 请求路径:[[${path}]] 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/templates/error/4xx.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 出错啦! 46 | 状态码:[[${status}]] 47 | 错误时间:[[${timestamp}]] 48 | 请求路径:[[${path}]] 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/templates/error/5xx.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 出错啦! 46 | 状态码:[[${status}]] 47 | 错误时间:[[${timestamp}]] 48 | 请求路径:[[${path}]] 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | POI-COFFEE 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 用户登录 33 | 34 | 35 | 36 | 37 | 38 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/templates/user-head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /coffee-sales-employee/src/main/resources/templates/user-left.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 | -------------------------------------------------------------------------------- /coffee-sales-user/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 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 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /coffee-sales-user/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /coffee-sales-user/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /coffee-sales-user/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.2.1.RELEASE 9 | 10 | 11 | com.coffee 12 | coffee-sales-user 13 | 0.0.1-SNAPSHOT 14 | 15 | 16 | 11 17 | 18 | 19 | 20 | 21 | 22 | com.alibaba 23 | fastjson 24 | 1.2.62 25 | 26 | 27 | 28 | net.sf.json-lib 29 | json-lib 30 | 2.4 31 | jdk15 32 | 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-cache 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-thymeleaf 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-starter-web 45 | 46 | 47 | org.mybatis.spring.boot 48 | mybatis-spring-boot-starter 49 | 2.1.1 50 | 51 | 52 | 53 | com.github.pagehelper 54 | pagehelper-spring-boot-starter 55 | 1.2.3 56 | 57 | 58 | 59 | org.springframework.boot 60 | spring-boot-devtools 61 | runtime 62 | true 63 | 64 | 65 | mysql 66 | mysql-connector-java 67 | runtime 68 | 69 | 70 | org.projectlombok 71 | lombok 72 | true 73 | 74 | 75 | org.springframework.boot 76 | spring-boot-starter-test 77 | test 78 | 79 | 80 | org.junit.vintage 81 | junit-vintage-engine 82 | 83 | 84 | 85 | 86 | org.springframework.security 87 | spring-security-test 88 | test 89 | 90 | 91 | javax.servlet 92 | javax.servlet-api 93 | 94 | 95 | 96 | 97 | 98 | 99 | org.springframework.boot 100 | spring-boot-maven-plugin 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/CoffeeSalesUserApplication.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.transaction.annotation.EnableTransactionManagement; 7 | 8 | @SpringBootApplication 9 | @MapperScan("com.coffee.sales.user.dao") 10 | @EnableTransactionManagement 11 | public class CoffeeSalesUserApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(CoffeeSalesUserApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/bean/Address.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("address") 12 | public class Address { 13 | private Integer aId; 14 | private Integer uId; 15 | private String area; 16 | private String detailedArea; 17 | private String postalCode; 18 | private String consignee; 19 | private String consigneePhone; 20 | } 21 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/bean/Car.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("car") 12 | public class Car { 13 | private Integer cId; 14 | private Integer uId; 15 | private Integer yId; 16 | private Integer cNum; 17 | private Commodity commodity; 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/bean/Commodity.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("commodity") 12 | public class Commodity { 13 | private Integer yId; 14 | private String yName; 15 | private Integer yPrice; 16 | private Integer yGrounding; 17 | private Integer yNum; 18 | private Integer yTId; 19 | private String yimage; 20 | } 21 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/bean/CommodityType.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("commodityType") 12 | public class CommodityType { 13 | private Integer yTId; 14 | private String yType; 15 | } 16 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/bean/Contact.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("contact") 12 | public class Contact { 13 | private Integer conId; 14 | private String conName; 15 | private String conEmail; 16 | private String conPhone; 17 | private String conMessage; 18 | } 19 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/bean/Order.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | import org.apache.ibatis.type.Alias; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.util.Date; 11 | 12 | @Data 13 | @AllArgsConstructor 14 | @NoArgsConstructor 15 | @Alias("order") 16 | public class Order { 17 | private Integer oId; 18 | private Integer uId; 19 | private String oNumber; 20 | private String oCrateTime; 21 | private Integer oGold; 22 | private Integer oTransaction; 23 | private Integer aId; 24 | private String oName; 25 | private Integer oPrice; 26 | private Integer oNUm; 27 | private Address address; 28 | 29 | public Order(Integer uId, String oNumber, String oCrateTime, Integer oGold, Integer oTransaction, Integer aId, String oName, Integer oPrice, Integer oNUm) { 30 | this.uId = uId; 31 | this.oNumber = oNumber; 32 | this.oCrateTime = oCrateTime; 33 | this.oGold = oGold; 34 | this.oTransaction = oTransaction; 35 | this.aId = aId; 36 | this.oName = oName; 37 | this.oPrice = oPrice; 38 | this.oNUm = oNUm; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.bean; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.apache.ibatis.type.Alias; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Alias("user") 12 | public class User { 13 | private Integer uId; 14 | private String uName; 15 | private String uPwd; 16 | private String uEmail; 17 | private String uPhone; 18 | private Integer uState; 19 | } 20 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/config/SpringMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.config; 2 | 3 | import com.coffee.sales.user.handler.UserLoginHandler; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 8 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 9 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 10 | 11 | @Configuration 12 | public class SpringMvcConfig implements WebMvcConfigurer { 13 | 14 | private final UserLoginHandler userLoginHandler; 15 | 16 | @Autowired 17 | public SpringMvcConfig(UserLoginHandler userLoginHandler) { 18 | this.userLoginHandler = userLoginHandler; 19 | } 20 | 21 | @Override 22 | public void addViewControllers(ViewControllerRegistry registry) { 23 | registry.addViewController("/index.html").setViewName("index"); 24 | } 25 | 26 | @Override 27 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 28 | registry.addResourceHandler("/static/**").addResourceLocations("/static/"); 29 | } 30 | 31 | @Override 32 | public void addInterceptors(InterceptorRegistry registry) { 33 | //registry.addInterceptor(userLoginHandler).addPathPatterns("/*").excludePathPatterns("/login", "/index", "/userLogin", "/contact", "/contactInFo"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/AddressController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import com.coffee.sales.user.bean.Address; 4 | import com.coffee.sales.user.service.AddressService; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.util.List; 14 | 15 | @RestController 16 | public class AddressController { 17 | private final AddressService addressService; 18 | 19 | @Autowired 20 | public AddressController(AddressService addressService) { 21 | this.addressService = addressService; 22 | } 23 | 24 | @PostMapping("addNewAddress") 25 | public Boolean addNewAddress(Address address, HttpServletRequest request) { 26 | address.setUId((Integer) request.getSession().getAttribute("userId")); 27 | return addressService.addNewAddress(address) > 0; 28 | } 29 | 30 | @PostMapping("addressPageInfo") 31 | public PageInfo addressPageInfo(@RequestParam(defaultValue = "1", name = "pageNumber") Integer pageNumber, HttpServletRequest request) { 32 | PageHelper.startPage(pageNumber, 8); 33 | List userId = addressService.addressList((Integer) request.getSession().getAttribute("userId")); 34 | return new PageInfo<>(userId); 35 | } 36 | 37 | @PostMapping("deleteAddress") 38 | public Boolean deleteAddress(Integer id) { 39 | return addressService.deleteAddress(id) > 0; 40 | } 41 | 42 | @PostMapping("updateAddress") 43 | public Boolean updateAddress(Address address) { 44 | return addressService.updateAddress(address) > 0; 45 | } 46 | 47 | @PostMapping("addressList") 48 | public List addressList(HttpServletRequest request) { 49 | return addressService.addressList((Integer) request.getSession().getAttribute("userId")); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/CarController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import com.coffee.sales.user.bean.Car; 4 | import com.coffee.sales.user.service.CarService; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 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.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import java.util.List; 15 | 16 | @RestController 17 | @Slf4j 18 | public class CarController { 19 | private final CarService carService; 20 | 21 | @Autowired 22 | public CarController(CarService carService) { 23 | this.carService = carService; 24 | } 25 | 26 | @PostMapping("addCar") 27 | public Boolean addCar(Car car, HttpServletRequest request) { 28 | car.setUId((Integer) request.getSession().getAttribute("userId")); 29 | if (carService.addCarCount(car) == 0) { 30 | return carService.addCar(car) > 0; 31 | } else { 32 | Car car1 = carService.carId(car); 33 | car1.setCNum(car1.getCNum() + 1); 34 | return carService.updateCar(car1) > 0; 35 | } 36 | } 37 | 38 | @PostMapping("updateCar") 39 | public Boolean updateCar(Car car) { 40 | return carService.updateCar(car) > 0; 41 | } 42 | 43 | @PostMapping("carPageInfo") 44 | public PageInfo carPageInfo(@RequestParam(defaultValue = "1", name = "pageNumber") Integer pageNumber, HttpServletRequest request) { 45 | PageHelper.startPage(pageNumber, 10); 46 | List cars = carService.carForUid((Integer) request.getSession().getAttribute("userId")); 47 | return new PageInfo<>(cars); 48 | } 49 | 50 | @PostMapping("deleteCarForCId") 51 | public Boolean deleteCarForCId(Integer id) { 52 | return carService.deleteCarForCId(id) > 0; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/CommodityController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import com.coffee.sales.user.bean.Commodity; 4 | import com.coffee.sales.user.service.CommodityService; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestParam; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import java.util.List; 12 | 13 | @RestController 14 | public class CommodityController { 15 | private final CommodityService commodityService; 16 | 17 | public CommodityController(CommodityService commodityService) { 18 | this.commodityService = commodityService; 19 | } 20 | 21 | @PostMapping("/commodityList") 22 | public PageInfo commodityList(@RequestParam(defaultValue = "1", name = "pageNumber") Integer pageNumber, Integer Id) { 23 | PageHelper.startPage(pageNumber, 4); 24 | List commodities = commodityService.commodityList(Id); 25 | return new PageInfo<>(commodities); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/CommodityTypeController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import com.coffee.sales.user.bean.CommodityType; 4 | import com.coffee.sales.user.service.CommodityTypeService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import java.util.List; 10 | 11 | @RestController 12 | public class CommodityTypeController { 13 | private final CommodityTypeService commodityTypeService; 14 | 15 | @Autowired 16 | public CommodityTypeController(CommodityTypeService commodityTypeService) { 17 | this.commodityTypeService = commodityTypeService; 18 | } 19 | 20 | @GetMapping("commodityTypeList") 21 | public List commodityTypeList() { 22 | return commodityTypeService.commodityTypeList(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/ContactController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import com.coffee.sales.user.bean.Contact; 4 | import com.coffee.sales.user.service.ContactService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class ContactController { 11 | 12 | private final ContactService contactService; 13 | 14 | @Autowired 15 | public ContactController(ContactService contactService) { 16 | this.contactService = contactService; 17 | } 18 | 19 | @PostMapping("contactInFo") 20 | public Boolean contactInFo(Contact contact) { 21 | return contactService.insertInFo(contact) > 0; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import com.coffee.sales.user.bean.Order; 4 | import com.coffee.sales.user.service.OrderService; 5 | import com.github.pagehelper.PageHelper; 6 | import com.github.pagehelper.PageInfo; 7 | import net.sf.json.JSONArray; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import java.text.SimpleDateFormat; 15 | import java.util.*; 16 | 17 | @RestController 18 | public class OrderController { 19 | 20 | private final OrderService orderService; 21 | 22 | @Autowired 23 | public OrderController(OrderService orderService) { 24 | this.orderService = orderService; 25 | } 26 | 27 | @PostMapping("addOrderInFos") 28 | public Boolean addOrderInFo(HttpServletRequest request) { 29 | String order = request.getParameter("order"); 30 | List> collection = (List>) net.sf.json.JSONArray.toCollection(JSONArray.fromObject(order), Map.class); 31 | Integer userId = (Integer) request.getSession().getAttribute("userId"); 32 | List orders = new ArrayList<>(); 33 | List carId = new ArrayList<>(); 34 | for (Map stringObjectMap : collection) { 35 | carId.add(Integer.parseInt(String.valueOf(stringObjectMap.get("cId")))); 36 | orders.add(new Order( 37 | userId, 38 | String.valueOf(stringObjectMap.get("oNumber")), 39 | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()), 40 | Integer.parseInt(String.valueOf(stringObjectMap.get("oGold"))), 41 | Integer.parseInt(String.valueOf(stringObjectMap.get("oTransaction"))), 42 | Integer.parseInt(String.valueOf(stringObjectMap.get("aId"))), 43 | String.valueOf(stringObjectMap.get("oName")), 44 | Integer.parseInt(String.valueOf(stringObjectMap.get("oPrice"))), 45 | Integer.parseInt(String.valueOf(stringObjectMap.get("oNUm"))) 46 | )); 47 | } 48 | 49 | if (orderService.insertInFo(orders) > 0) { 50 | orderService.deleteCarForIdIsListId(carId); 51 | return true; 52 | } else { 53 | return false; 54 | } 55 | 56 | } 57 | 58 | @PostMapping("orderPageInFo") 59 | public PageInfo getOrderInFo(@RequestParam(defaultValue = "1", name = "pageNumber") Integer pageNumber, HttpServletRequest request) { 60 | PageHelper.startPage(pageNumber, 10); 61 | List orders = orderService.orderInFo((Integer) request.getSession().getAttribute("userId")); 62 | return new PageInfo<>(orders); 63 | } 64 | 65 | @PostMapping("deleteOrderInFo") 66 | public Boolean deleteOrderInFo(Integer id) { 67 | return orderService.deleteOrderInFo(id) > 0; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/Router.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class Router { 8 | @RequestMapping("login") 9 | public String login() { 10 | return "login"; 11 | } 12 | 13 | @RequestMapping("index") 14 | public String index() { 15 | return "index"; 16 | } 17 | 18 | @RequestMapping("register") 19 | public String register() { 20 | return "register"; 21 | } 22 | 23 | @RequestMapping("retrieve") 24 | public String retrieve() { 25 | return "retrieve"; 26 | } 27 | 28 | @RequestMapping("information") 29 | public String information() { 30 | return "information"; 31 | } 32 | 33 | @RequestMapping("shopping") 34 | public String shopping() { 35 | return "shopping"; 36 | } 37 | 38 | @RequestMapping("shoppingCar") 39 | public String shoppingCar() { 40 | return "shoppingCar"; 41 | } 42 | 43 | @RequestMapping("address") 44 | public String address() { 45 | return "address"; 46 | } 47 | 48 | @RequestMapping("createOrder") 49 | public String createOrder() { 50 | return "createOrder"; 51 | } 52 | 53 | @RequestMapping("orderInFo") 54 | public String orderInFo() { 55 | return "orderInFo"; 56 | } 57 | 58 | @RequestMapping("contact") 59 | public String contact() { 60 | return "contact"; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.controller; 2 | 3 | import com.coffee.sales.user.bean.User; 4 | import com.coffee.sales.user.service.UserService; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | 13 | @Slf4j 14 | @Controller 15 | public class UserController { 16 | 17 | private final UserService userService; 18 | 19 | @Autowired 20 | public UserController(UserService userService) { 21 | this.userService = userService; 22 | } 23 | 24 | @PostMapping("userLogin") 25 | @ResponseBody 26 | public Boolean userLogin(User user, HttpServletRequest request) { 27 | if (userService.userLogin(user) != null && userService.userLogin(user)) { 28 | request.getSession().setAttribute("userId", userService.userInformation(user).getUId()); 29 | request.getSession().setAttribute("userName", user.getUName()); 30 | return true; 31 | } else { 32 | return false; 33 | } 34 | } 35 | 36 | @PostMapping("userRegister") 37 | @ResponseBody 38 | public Boolean userRegister(User user) { 39 | return userService.userRegister(user) > 0; 40 | } 41 | 42 | @RequestMapping("userLogout") 43 | public String userLogout(HttpServletRequest request) { 44 | request.getSession().removeAttribute("userName"); 45 | request.getSession().removeAttribute("userId"); 46 | return "index"; 47 | } 48 | 49 | @PostMapping("userRetrieve") 50 | @ResponseBody 51 | public Boolean userRetrieve(User user) { 52 | return userService.userRetrieve(user); 53 | } 54 | 55 | @PostMapping("userRetrievePassword") 56 | @ResponseBody 57 | public Boolean userRetrievePassword(User user) { 58 | return userService.userRetrievePassword(user) > 0; 59 | } 60 | 61 | @PostMapping("userInformation") 62 | @ResponseBody 63 | public User userInformation(HttpServletRequest request) { 64 | User user = new User(); 65 | user.setUId((Integer) request.getSession().getAttribute("userId")); 66 | return userService.userInformation(user); 67 | } 68 | 69 | @PostMapping("userUpdateInformation") 70 | @ResponseBody 71 | public Boolean userUpdateInformation(User user) { 72 | if (userService.userCountPhone(user) == 0) { 73 | return userService.userUpdateInformation(user) > 0; 74 | } else { 75 | return false; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/dao/AddressMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.dao; 2 | 3 | import com.coffee.sales.user.bean.Address; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface AddressMapper { 12 | /** 13 | * 添加新的地址 14 | * 15 | * @param address 地址信息 16 | * @return 是否添加成功 17 | */ 18 | Integer addNewAddress(Address address); 19 | 20 | /** 21 | * 地址集合 22 | * 23 | * @param id 用户ID 24 | * @return 地址集合 25 | */ 26 | List addressList(Integer id); 27 | 28 | /** 29 | * 删除地址 30 | * 31 | * @param id 地址ID 32 | * @return 是否删除成功 33 | */ 34 | Integer deleteAddress(Integer id); 35 | 36 | /** 37 | * 更新地址信息 38 | * 39 | * @param address 信息 40 | * @return 是否更新成功 41 | */ 42 | Integer updateAddress(Address address); 43 | } 44 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/dao/CarMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.dao; 2 | 3 | import com.coffee.sales.user.bean.Car; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface CarMapper { 12 | /** 13 | * 给购物车添加商品 14 | * 15 | * @param car 购物车信息 16 | * @return 主键ID 17 | */ 18 | Integer addCar(Car car); 19 | 20 | /** 21 | * 检查购物车是否已经有了这个商品 22 | * 23 | * @param car 购物车信息 24 | * @return 是否已经有了这件商品 25 | */ 26 | Integer addCarCount(Car car); 27 | 28 | /** 29 | * 根据用户id和商品id查询购物车id 30 | * 31 | * @param car 购物车信息 32 | * @return 购物车ID 33 | */ 34 | Car carId(Car car); 35 | 36 | /** 37 | * 根据购物车ID修改购物车商品数量 38 | * 39 | * @param car 购物车信息 40 | * @return 是否修改成功 41 | */ 42 | Integer updateCar(Car car); 43 | 44 | /** 45 | * 根据用户ID获取用户购物车信息 46 | * 47 | * @param id 用户ID 48 | * @return 购物车信息 49 | */ 50 | List carForUid(Integer id); 51 | 52 | /** 53 | * 根据购物车ID删除购物车信息 54 | * 55 | * @param id 购物车ID 56 | * @return 是否删除 57 | */ 58 | Integer deleteCarForCId(Integer id); 59 | 60 | /** 61 | * 根据购物车ID删除购物车信息 62 | * 63 | * @param id 购物车ID 64 | * @return 成功删除的条数 65 | */ 66 | Integer deleteCarForIdIsListId(List id); 67 | } 68 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/dao/CommodityMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.dao; 2 | 3 | import com.coffee.sales.user.bean.Commodity; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface CommodityMapper { 12 | 13 | /** 14 | * 根据商品类型ID获取商品 15 | * 16 | * @param Id 商品类型ID 17 | * @return 商品信息 18 | */ 19 | List commodityList(Integer Id); 20 | 21 | /** 22 | * 根据商品类型ID获取商品总数 23 | * 24 | * @param Id 商品类型ID 25 | * @return 商品总数 26 | */ 27 | Integer commodityListCount(Integer Id); 28 | } 29 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/dao/CommodityTypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.dao; 2 | 3 | import com.coffee.sales.user.bean.CommodityType; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface CommodityTypeMapper { 12 | 13 | /** 14 | * 获取商品种类列表 15 | * 16 | * @return list 商品种类列表 17 | */ 18 | List commodityTypeList(); 19 | } 20 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/dao/ContactMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.dao; 2 | 3 | import com.coffee.sales.user.bean.Contact; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | @Mapper 9 | public interface ContactMapper { 10 | 11 | /** 12 | * 用户意见 13 | * 14 | * @param contact 用户意见信息 15 | * @return 是否插入成功 16 | */ 17 | Integer insertInFo(Contact contact); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/dao/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.dao; 2 | 3 | import com.coffee.sales.user.bean.Order; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | @Mapper 11 | public interface OrderMapper { 12 | 13 | /** 14 | * 在订单中插入信息 15 | * 16 | * @param orderList 订单信息 17 | * @return 主键ID 18 | */ 19 | Integer insertInFo(List orderList); 20 | 21 | /** 22 | * 根据用户ID查询用户订单信息 23 | * 24 | * @param id 用户ID 25 | * @return 订单信息 26 | */ 27 | List orderInFo(Integer id); 28 | 29 | /** 30 | * 根据订单ID删除订单信息 31 | * 32 | * @param id 订单ID 33 | * @return 是否成功 34 | */ 35 | Integer deleteOrderInFo(Integer id); 36 | } 37 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.dao; 2 | 3 | import com.coffee.sales.user.bean.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Mapper 8 | @Repository 9 | public interface UserMapper { 10 | /** 11 | * 用户登录 12 | * 13 | * @param user 用户信息 14 | * @return 是否有这个用户 15 | */ 16 | Boolean userLogin(User user); 17 | 18 | /** 19 | * 用户注册 20 | * 21 | * @param user 用户信息 22 | * @return 是否注册成功 23 | */ 24 | Integer userRegister(User user); 25 | 26 | /** 27 | * 用户申诉 28 | * 29 | * @param user 用户信息 30 | * @return 是否申诉成功 31 | */ 32 | Boolean userRetrieve(User user); 33 | 34 | /** 35 | * 用户通过申诉修改密码 36 | * 37 | * @param user 用户信息 38 | * @return 是否修改成功 39 | */ 40 | Integer userRetrievePassword(User user); 41 | 42 | /** 43 | * 查询用户所有信息 44 | * 45 | * @param user 用户名与密码 46 | * @return 用户信息 47 | */ 48 | User userInformation(User user); 49 | 50 | /** 51 | * 查询用户手机号码是否重复 52 | * 53 | * @param user 用户手机号码 54 | * @return 是否重复 55 | */ 56 | Integer userCountPhone(User user); 57 | 58 | /** 59 | * 用户修改信息 60 | * 61 | * @param user 用户信息 62 | * @return 是否更新成功 63 | */ 64 | Integer userUpdateInformation(User user); 65 | } 66 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/handler/UserLoginHandler.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.handler; 2 | 3 | 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.springframework.stereotype.Component; 6 | import org.springframework.web.servlet.HandlerInterceptor; 7 | import org.springframework.web.servlet.ModelAndView; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | @Slf4j 13 | @Component 14 | public class UserLoginHandler implements HandlerInterceptor { 15 | 16 | @Override 17 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 18 | Object userId = request.getSession().getAttribute("userId"); 19 | if (userId == null) { 20 | response.sendRedirect("/login"); 21 | return false; 22 | } else { 23 | return true; 24 | } 25 | } 26 | 27 | @Override 28 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 29 | 30 | } 31 | 32 | @Override 33 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/AddressService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service; 2 | 3 | import com.coffee.sales.user.bean.Address; 4 | 5 | import java.util.List; 6 | 7 | public interface AddressService { 8 | Integer addNewAddress(Address address); 9 | 10 | List addressList(Integer id); 11 | 12 | Integer deleteAddress(Integer id); 13 | 14 | Integer updateAddress(Address address); 15 | } 16 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/CarService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service; 2 | 3 | 4 | import com.coffee.sales.user.bean.Car; 5 | 6 | import java.util.List; 7 | 8 | public interface CarService { 9 | Integer addCar(Car car); 10 | 11 | Integer addCarCount(Car car); 12 | 13 | Car carId(Car car); 14 | 15 | Integer updateCar(Car car); 16 | 17 | List carForUid(Integer id); 18 | 19 | Integer deleteCarForCId(Integer id); 20 | } 21 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/CommodityService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service; 2 | 3 | 4 | import com.coffee.sales.user.bean.Commodity; 5 | 6 | import java.util.List; 7 | 8 | public interface CommodityService { 9 | 10 | List commodityList(Integer Id); 11 | 12 | Integer commodityListCount(Integer Id); 13 | } 14 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/CommodityTypeService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service; 2 | 3 | import com.coffee.sales.user.bean.CommodityType; 4 | 5 | import java.util.List; 6 | 7 | public interface CommodityTypeService { 8 | List commodityTypeList(); 9 | } 10 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/ContactService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service; 2 | 3 | import com.coffee.sales.user.bean.Contact; 4 | 5 | public interface ContactService { 6 | Integer insertInFo(Contact contact); 7 | } 8 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service; 2 | 3 | import com.coffee.sales.user.bean.Order; 4 | 5 | import java.util.List; 6 | 7 | public interface OrderService { 8 | Integer insertInFo(List orderList); 9 | 10 | Integer deleteCarForIdIsListId(List id); 11 | 12 | List orderInFo(Integer id); 13 | 14 | Integer deleteOrderInFo(Integer id); 15 | } 16 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service; 2 | 3 | import com.coffee.sales.user.bean.User; 4 | 5 | 6 | public interface UserService { 7 | Boolean userLogin(User user); 8 | 9 | Integer userRegister(User user); 10 | 11 | Boolean userRetrieve(User user); 12 | 13 | Integer userRetrievePassword(User user); 14 | 15 | User userInformation(User user); 16 | 17 | Integer userCountPhone(User user); 18 | 19 | Integer userUpdateInformation(User user); 20 | } 21 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/impl/AddressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service.impl; 2 | 3 | import com.coffee.sales.user.bean.Address; 4 | import com.coffee.sales.user.dao.AddressMapper; 5 | import com.coffee.sales.user.service.AddressService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | @Transactional(rollbackFor = Exception.class) 14 | public class AddressServiceImpl implements AddressService { 15 | 16 | private final AddressMapper addressMapper; 17 | 18 | @Autowired 19 | public AddressServiceImpl(AddressMapper addressMapper) { 20 | this.addressMapper = addressMapper; 21 | } 22 | 23 | @Override 24 | public Integer addNewAddress(Address address) { 25 | return addressMapper.addNewAddress(address); 26 | } 27 | 28 | @Override 29 | public List addressList(Integer id) { 30 | return addressMapper.addressList(id); 31 | } 32 | 33 | @Override 34 | public Integer deleteAddress(Integer id) { 35 | return addressMapper.deleteAddress(id); 36 | } 37 | 38 | @Override 39 | public Integer updateAddress(Address address) { 40 | return addressMapper.updateAddress(address); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/impl/CarServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service.impl; 2 | 3 | import com.coffee.sales.user.bean.Car; 4 | import com.coffee.sales.user.dao.CarMapper; 5 | import com.coffee.sales.user.service.CarService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | @Transactional(rollbackFor = Exception.class) 14 | public class CarServiceImpl implements CarService { 15 | private final CarMapper carMapper; 16 | 17 | @Autowired 18 | public CarServiceImpl(CarMapper carMapper) { 19 | this.carMapper = carMapper; 20 | } 21 | 22 | @Override 23 | public Integer addCar(Car car) { 24 | return carMapper.addCar(car); 25 | } 26 | 27 | @Override 28 | public Integer addCarCount(Car car) { 29 | return carMapper.addCarCount(car); 30 | } 31 | 32 | @Override 33 | public Car carId(Car car) { 34 | return carMapper.carId(car); 35 | } 36 | 37 | @Override 38 | public Integer updateCar(Car car) { 39 | return carMapper.updateCar(car); 40 | } 41 | 42 | @Override 43 | public List carForUid(Integer id) { 44 | return carMapper.carForUid(id); 45 | } 46 | 47 | @Override 48 | public Integer deleteCarForCId(Integer id) { 49 | return carMapper.deleteCarForCId(id); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/impl/CommodityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service.impl; 2 | 3 | import com.coffee.sales.user.bean.Commodity; 4 | import com.coffee.sales.user.dao.CommodityMapper; 5 | import com.coffee.sales.user.service.CommodityService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | @Transactional(rollbackFor=Exception.class) 14 | public class CommodityServiceImpl implements CommodityService { 15 | 16 | private final CommodityMapper commodityMapper; 17 | 18 | @Autowired 19 | public CommodityServiceImpl(CommodityMapper commodityMapper) { 20 | this.commodityMapper = commodityMapper; 21 | } 22 | 23 | @Override 24 | public List commodityList(Integer Id) { 25 | return commodityMapper.commodityList(Id); 26 | } 27 | 28 | @Override 29 | public Integer commodityListCount(Integer Id) { 30 | return commodityMapper.commodityListCount(Id); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/impl/CommodityTypeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service.impl; 2 | 3 | import com.coffee.sales.user.bean.CommodityType; 4 | import com.coffee.sales.user.dao.CommodityTypeMapper; 5 | import com.coffee.sales.user.service.CommodityTypeService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | @Transactional(rollbackFor=Exception.class) 14 | public class CommodityTypeServiceImpl implements CommodityTypeService { 15 | 16 | private final CommodityTypeMapper commodityTypeMapper; 17 | 18 | @Autowired 19 | public CommodityTypeServiceImpl(CommodityTypeMapper commodityTypeMapper) { 20 | this.commodityTypeMapper = commodityTypeMapper; 21 | } 22 | 23 | @Override 24 | public List commodityTypeList() { 25 | return commodityTypeMapper.commodityTypeList(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/impl/ContactServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service.impl; 2 | 3 | import com.coffee.sales.user.bean.Contact; 4 | import com.coffee.sales.user.dao.ContactMapper; 5 | import com.coffee.sales.user.service.ContactService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class ContactServiceImpl implements ContactService { 11 | private final ContactMapper contactMapper; 12 | 13 | @Autowired 14 | public ContactServiceImpl(ContactMapper contactMapper) { 15 | this.contactMapper = contactMapper; 16 | } 17 | 18 | @Override 19 | public Integer insertInFo(Contact contact) { 20 | return contactMapper.insertInFo(contact); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service.impl; 2 | 3 | import com.coffee.sales.user.bean.Order; 4 | import com.coffee.sales.user.dao.CarMapper; 5 | import com.coffee.sales.user.dao.OrderMapper; 6 | import com.coffee.sales.user.service.OrderService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | @Transactional(rollbackFor = Exception.class) 15 | public class OrderServiceImpl implements OrderService { 16 | 17 | private final OrderMapper orderMapper; 18 | 19 | private final CarMapper carMapper; 20 | 21 | @Autowired 22 | public OrderServiceImpl(OrderMapper orderMapper, CarMapper carMapper) { 23 | this.orderMapper = orderMapper; 24 | this.carMapper = carMapper; 25 | } 26 | 27 | @Override 28 | public Integer insertInFo(List orderList) { 29 | return orderMapper.insertInFo(orderList); 30 | } 31 | 32 | @Override 33 | public Integer deleteCarForIdIsListId(List id) { 34 | return carMapper.deleteCarForIdIsListId(id); 35 | } 36 | 37 | @Override 38 | public List orderInFo(Integer id) { 39 | return orderMapper.orderInFo(id); 40 | } 41 | 42 | @Override 43 | public Integer deleteOrderInFo(Integer id) { 44 | return orderMapper.deleteOrderInFo(id); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/java/com/coffee/sales/user/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.coffee.sales.user.service.impl; 2 | 3 | import com.coffee.sales.user.bean.User; 4 | import com.coffee.sales.user.dao.UserMapper; 5 | import com.coffee.sales.user.service.UserService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | @Service 11 | @Transactional(rollbackFor = Exception.class) 12 | public class UserServiceImpl implements UserService { 13 | 14 | private final UserMapper userMapper; 15 | 16 | @Autowired 17 | public UserServiceImpl(UserMapper userMapper) { 18 | this.userMapper = userMapper; 19 | } 20 | 21 | @Override 22 | public Boolean userLogin(User user) { 23 | return userMapper.userLogin(user); 24 | } 25 | 26 | @Override 27 | public Integer userRegister(User user) { 28 | return userMapper.userRegister(user); 29 | } 30 | 31 | @Override 32 | public Boolean userRetrieve(User user) { 33 | return userMapper.userRetrieve(user); 34 | } 35 | 36 | @Override 37 | public Integer userRetrievePassword(User user) { 38 | return userMapper.userRetrievePassword(user); 39 | } 40 | 41 | @Override 42 | public User userInformation(User user) { 43 | return userMapper.userInformation(user); 44 | } 45 | 46 | @Override 47 | public Integer userCountPhone(User user) { 48 | return userMapper.userCountPhone(user); 49 | } 50 | 51 | @Override 52 | public Integer userUpdateInformation(User user) { 53 | return userMapper.userUpdateInformation(user); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | username: root 4 | password: 614750226 5 | driver-class-name: com.mysql.cj.jdbc.Driver 6 | url: jdbc:mysql://127.0.0.1:3306/coffee?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true 7 | mybatis: 8 | type-aliases-package: "com.coffee.sales.user.bean" 9 | mapper-locations: 10 | - classpath*:mappers/*.xml 11 | configuration: 12 | use-actual-param-name: true 13 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 14 | pagehelper: 15 | helperDialect: mysql 16 | reasonable: true 17 | supportMethodsArguments: true 18 | arams: count=countSql 19 | server: 20 | port: 80 -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/mappers/AddressMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | INSERT INTO `coffee`.`cf_address` ( `uid`, `area`, `detailedarea`, `postalcode`, `consignee`, `consigneephone` ) 19 | VALUES 20 | ( #{uId}, #{area}, #{detailedArea}, #{postalCode}, #{consignee}, #{consigneePhone} ) 21 | 22 | 23 | 24 | SELECT 25 | cf_address.aid, 26 | cf_address.uid, 27 | cf_address.area, 28 | cf_address.detailedarea, 29 | cf_address.postalcode, 30 | cf_address.consignee, 31 | cf_address.consigneephone 32 | FROM 33 | cf_address 34 | WHERE cf_address.uid = #{id} 35 | 36 | 37 | 38 | DELETE FROM cf_address WHERE cf_address.aid = #{id} 39 | 40 | 41 | 42 | UPDATE `coffee`.`cf_address` SET 43 | `area` = #{area}, 44 | `detailedarea` = #{detailedArea}, 45 | `postalcode` = #{postalCode}, 46 | `consignee` = #{consignee}, 47 | `consigneephone` = #{consigneePhone} 48 | WHERE 49 | `aid` = #{aId} 50 | 51 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/mappers/CarMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | INSERT INTO `coffee`.`cf_car`(`uid`, `yid`, `cnum`) VALUES ( #{uId}, #{yId}, #{cNum}) 28 | 29 | 30 | 31 | SELECT COUNT(*) FROM cf_car WHERE cf_car.uid = #{uId} AND cf_car.yid = #{yId} 32 | 33 | 34 | 35 | SELECT * FROM cf_car WHERE cf_car.uid = #{uId} AND cf_car.yid = #{yId} 36 | 37 | 38 | 39 | UPDATE `coffee`.`cf_car` 40 | SET `cnum`= #{cNum} WHERE `cid`= #{cId} 41 | 42 | 43 | 44 | SELECT 45 | cf_car.cid, 46 | cf_car.uid, 47 | cf_car.yid AS cyid, 48 | cf_car.cnum, 49 | cf_commodity.yid, 50 | cf_commodity.yname, 51 | cf_commodity.yprice, 52 | cf_commodity.ygrounding, 53 | cf_commodity.ynum, 54 | cf_commodity.ytid, 55 | cf_commodity.yimage 56 | FROM 57 | cf_car LEFT JOIN 58 | cf_commodity 59 | ON cf_car.yid = cf_commodity.yid 60 | WHERE cf_car.uid = #{id} 61 | 62 | 63 | 64 | DELETE FROM cf_car WHERE cf_car.cid = #{id} 65 | 66 | 67 | 68 | DELETE FROM cf_car WHERE cf_car.cid IN 69 | 70 | #{item} 71 | 72 | 73 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/mappers/CommodityMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | SELECT 8 | cf_commodity.yid, 9 | cf_commodity.yname, 10 | cf_commodity.yprice, 11 | cf_commodity.ynum, 12 | cf_commodity.ytid, 13 | cf_commodity.yimage 14 | FROM 15 | cf_commodity 16 | WHERE 17 | cf_commodity.ytid = #{Id} and cf_commodity.ygrounding = 1 18 | 19 | 20 | SELECT 21 | COUNT(*) 22 | FROM 23 | cf_commodity 24 | WHERE 25 | cf_commodity.ytid = #{Id} 26 | 27 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/mappers/CommodityTypeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | SELECT 8 | cf_commoditytype.ytid, 9 | cf_commoditytype.ytype 10 | FROM 11 | cf_commoditytype 12 | 13 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/mappers/ContactMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | INSERT INTO `coffee`.`cf_contact`(`conname`, `conemail`, `conphone`, `conmessage`) 8 | VALUES (#{conName}, #{conEmail}, #{conPhone}, #{conMessage}) 9 | 10 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/mappers/OrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 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 | INSERT INTO `coffee`.`cf_order`( `uid`, `onumber`, `ocratetime`, `ogold`, `otransaction`, `aid`, `oname`, 31 | `oprice`, `onum`) 32 | VALUES 33 | 34 | ( 35 | #{item.uId}, 36 | #{item.oNumber}, 37 | #{item.oCrateTime}, 38 | #{item.oGold}, 39 | #{item.oTransaction}, 40 | #{item.aId}, 41 | #{item.oName}, 42 | #{item.oPrice}, 43 | #{item.oNUm} 44 | ) 45 | 46 | 47 | 48 | 49 | SELECT 50 | cf_order.oid, 51 | cf_order.uid, 52 | cf_order.onumber, 53 | cf_order.ocratetime, 54 | cf_order.ogold, 55 | cf_order.otransaction, 56 | cf_order.aid, 57 | cf_order.oname, 58 | cf_order.oprice, 59 | cf_order.onum, 60 | cf_address.aid aids, 61 | cf_address.uid uids, 62 | cf_address.area, 63 | cf_address.detailedarea, 64 | cf_address.postalcode, 65 | cf_address.consignee, 66 | cf_address.consigneephone 67 | FROM 68 | cf_order 69 | LEFT JOIN cf_address ON cf_order.aid = cf_address.aid 70 | WHERE 71 | cf_order.uid = #{id} 72 | 73 | 74 | 75 | DELETE FROM cf_order WHERE cf_order.oid = #{id} 76 | 77 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/mappers/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | SELECT * FROM `cf_user` WHERE uname = #{uName} AND upwd = #{uPwd} 8 | 9 | 10 | 11 | INSERT INTO `coffee`.`cf_user`(`uname`, `upwd`, `uemail`, `ustate`) 12 | VALUES (#{uName}, #{uPwd}, #{uEmail}, 1); 13 | 14 | 15 | 16 | SELECT * FROM `cf_user` 17 | 18 | AND uname = #{uName} 19 | 20 | AND uphone = #{uPhone} 21 | 22 | 23 | AND uEmail = #{uEmail} 24 | 25 | 26 | 27 | 28 | 29 | UPDATE `coffee`.`cf_user` SET `upwd` = #{uPwd} 30 | WHERE `uname` = #{uName} AND `uemail` = #{uEmail} 31 | 32 | 33 | 34 | SELECT * FROM `cf_user` 35 | 36 | 37 | AND uname = #{uName} 38 | 39 | 40 | AND uid = #{uId} 41 | 42 | 43 | 44 | 45 | 46 | SELECT COUNT(*) FROM `cf_user` WHERE uphone = #{uPhone} 47 | 48 | 49 | 50 | UPDATE `coffee`.`cf_user` 51 | 52 | `uname` = #{uName}, 53 | `upwd` = #{uPwd}, 54 | `uemail` = #{uEmail}, 55 | `uphone` = #{uPhone}, 56 | 57 | WHERE `uid` = #{uId} 58 | 59 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/css/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/css/fonts/element-icons.ttf -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/css/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/css/fonts/element-icons.woff -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/fonts/Aladin-Fonts.css: -------------------------------------------------------------------------------- 1 | /* latin-ext */ 2 | @font-face { 3 | font-family: 'Aladin'; 4 | font-style: normal; 5 | font-weight: 400; 6 | src: local('Aladin Regular'), local('Aladin-Regular'), url(ZgNSjPJFPrvJV5fF4C35lGQ.woff2) format('woff2'); 7 | unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; 8 | } 9 | /* latin */ 10 | @font-face { 11 | font-family: 'Aladin'; 12 | font-style: normal; 13 | font-weight: 400; 14 | src: local('Aladin Regular'), local('Aladin-Regular'), url(ZgNSjPJFPrvJV5fF7i35.woff2) format('woff2'); 15 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; 16 | } -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/fonts/ZgNSjPJFPrvJV5fF4C35lGQ.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/fonts/ZgNSjPJFPrvJV5fF4C35lGQ.woff2 -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/fonts/ZgNSjPJFPrvJV5fF7i35.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/fonts/ZgNSjPJFPrvJV5fF7i35.woff2 -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/a.png -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/afqd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/afqd.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/bg.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/byhmhjlc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/byhmhjlc.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/bymghcc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/bymghcc.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/cbmsblb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/cbmsblb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/ccnrfg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/ccnrfg.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/chgtlmppzmb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/chgtlmppzmb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/hcnt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/hcnt.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/icon1.png -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/icon2.png -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/icons.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img1.png -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img2.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img3.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img4.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img5.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img6.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img7.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img8.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/img9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/img9.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/jrzxpnn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/jrzxpnn.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/jslogosp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/jslogosp.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/jtmqd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/jtmqd.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/jtnskf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/jtnskf.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/kbqn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/kbqn.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/ksjrj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/ksjrj.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/lcbkf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/lcbkf.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/lcfld.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/lcfld.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/lmmf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/lmmf.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/lmqqfqrldg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/lmqqfqrldg.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/meiskf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/meiskf.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/menu-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/menu-icon.png -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/mk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/mk.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/move-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/move-up.png -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/mzpgdj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/mzpgdj.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/nrzsks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/nrzsks.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/nt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/nt.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/nygjrpg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/nygjrpg.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/pgdksb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/pgdksb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/social-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/social-icons.png -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/tjppbsmkb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/tjppbsmkb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/tjpphsmkb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/tjpphsmkb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/xbjppbxgzmb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/xbjppbxgzmb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/xfygs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/xfygs.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/xnqklmf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/xnqklmf.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/yg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/yg.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/ymhslsbxgbwb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/ymhslsbxgbwb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/ysbslmppzmb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/ysbslmppzmb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/zxblb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/zxblb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/zxbshsshbxgsxb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/zxbshsshbxgsxb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/images/zxbshsshbxgzmb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/images/zxbshsshbxgzmb.jpg -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/country-level3-data.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mourirs/Coffee/9d60cf35a034fd72d45765d15dbb187e3d959658/coffee-sales-user/src/main/resources/static/js/country-level3-data.js -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/createOrder.js: -------------------------------------------------------------------------------- 1 | const corder = { 2 | template: "#corder", 3 | data() { 4 | return { 5 | value: '', 6 | address: {}, 7 | orderInFo: [], 8 | orderInFoArray: [] 9 | } 10 | }, 11 | methods: { 12 | addressAllInFo() { 13 | axios.post("/addressList").then((response) => { 14 | this.address = response.data; 15 | }) 16 | }, 17 | addressHandle(value) { 18 | return "收件人:" + value.consignee + " " + 19 | "电话:" + value.consigneePhone + " " + 20 | "住址:" + value.area + " " + 21 | "详细住址:" + value.detailedArea; 22 | }, 23 | createOrder() { 24 | let order = JSON.stringify(this.orderInFoArrayCopy()); 25 | axios({ 26 | method: "post", 27 | url: "/addOrderInFos", 28 | transformRequest: [ 29 | function (data) { 30 | return parseParams(data); 31 | } 32 | ], 33 | data: { 34 | order: order 35 | } 36 | }).then((response) => { 37 | if (response.data) { 38 | sessionStorage.removeItem("shoppingCar"); 39 | window.location.replace("http://localhost/orderInFo") 40 | } else { 41 | this.$notify({ 42 | title: '订单创建失败', 43 | message: '请稍后重试!', 44 | position: 'bottom-right' 45 | }); 46 | } 47 | }); 48 | }, 49 | orderInFoArrayCopy() { 50 | let orderArray = []; 51 | for (let i = 0; i < this.orderInFo.length; i++) { 52 | let order = { 53 | cId: '', 54 | oNumber: '', 55 | oGold: '', 56 | oTransaction: 1, 57 | aId: '', 58 | oName: '', 59 | oPrice: '', 60 | oNUm: '' 61 | }; 62 | order.cId = this.orderInFo[i].cid; 63 | order.oNumber = this.orderNumber(); 64 | order.oGold = this.orderInFo[i].cnum * this.orderInFo[i].commodity.yprice; 65 | order.aId = this.value; 66 | order.oName = this.orderInFo[i].commodity.yname; 67 | order.oPrice = this.orderInFo[i].commodity.yprice; 68 | order.oNUm = this.orderInFo[i].cnum; 69 | orderArray.push(order); 70 | } 71 | return orderArray; 72 | }, 73 | orderNumber() { 74 | let now = new Date(); 75 | let year = now.getFullYear(); //年 76 | let month = now.getMonth() + 1; //月 77 | let day = now.getDate(); //日 78 | let hh = now.getHours(); //时 79 | let mm = now.getMinutes(); //分 80 | let ss = now.getSeconds(); //秒 81 | let clock = year + ""; 82 | if (month < 10) 83 | clock += "0"; 84 | 85 | clock += month + ""; 86 | 87 | if (day < 10) 88 | clock += "0"; 89 | 90 | clock += day + ""; 91 | 92 | if (hh < 10) 93 | clock += "0"; 94 | 95 | clock += hh + ""; 96 | if (mm < 10) clock += '0'; 97 | clock += mm + ""; 98 | 99 | if (ss < 10) clock += '0'; 100 | clock += ss; 101 | return (clock); 102 | }, 103 | }, mounted() { 104 | this.addressAllInFo(); 105 | this.orderInFo = JSON.parse(sessionStorage.getItem('shoppingCar')); 106 | console.log(this.orderInFo) 107 | }, 108 | filters: { 109 | showPrice(price) { 110 | return "¥" + price.toFixed(2) 111 | } 112 | }, 113 | }; 114 | const app = new Vue({ 115 | el: "#app", 116 | components: { 117 | corder 118 | } 119 | }); -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/dataParse.js: -------------------------------------------------------------------------------- 1 | function parseParams(data) { 2 | try { 3 | let tempArr = []; 4 | for (let i in data) { 5 | let key = encodeURIComponent(i); 6 | let value = encodeURIComponent(data[i]); 7 | tempArr.push(key + '=' + value); 8 | } 9 | return tempArr.join('&'); 10 | } catch (err) { 11 | return ''; 12 | } 13 | } -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/homes.js: -------------------------------------------------------------------------------- 1 | const app = new Vue({ 2 | el:"#app", 3 | methods:{ 4 | shoppingCar(){ 5 | window.location.replace("http://localhost/shoppingCar") 6 | }, 7 | order(){ 8 | window.location.replace("http://localhost/orderInFo") 9 | }, 10 | shopping(){ 11 | window.location.replace("http://localhost/shopping") 12 | } 13 | } 14 | }) -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/login.js: -------------------------------------------------------------------------------- 1 | const app = new Vue({ 2 | el: "#app", 3 | data() { 4 | return { 5 | uName: "", 6 | uPwd: "", 7 | } 8 | }, 9 | methods: { 10 | login() { 11 | let regName = /^[A-Za-z0-9]{4,15}$/; 12 | let regPwd = /((?=.*\d)(?=.*\D)|(?=.*[a-zA-Z])(?=.*[^a-zA-Z]))^.{8,16}$/; 13 | if (regName.test(this.uName) && regPwd.test(this.uPwd)) { 14 | axios( 15 | { 16 | method: "post", 17 | url: "/userLogin", 18 | transformRequest: [ 19 | function (data) { 20 | return parseParams(data); 21 | } 22 | ], 23 | data: { 24 | uName: this.uName, 25 | uPwd: this.uPwd 26 | } 27 | }).then((response) => { 28 | if (response.data) { 29 | this.loginSuccess(); 30 | } else { 31 | this.loginError(); 32 | } 33 | } 34 | ) 35 | } else { 36 | this.inputNoData(); 37 | } 38 | }, 39 | register() { 40 | window.location.replace("http://localhost/register") 41 | 42 | }, 43 | retrieve() { 44 | window.location.replace("http://localhost/retrieve") 45 | } 46 | , 47 | loginSuccess() { 48 | window.location.replace("http://localhost/index") 49 | }, 50 | loginError() { 51 | this.$notify.error({ 52 | title: '登录失败', 53 | message: '请检查账号名和密码是否正确', 54 | position: 'bottom-right' 55 | }); 56 | }, 57 | inputNoData() { 58 | this.$alert('请输入完整的用户名或密码;用户名只能包括数字字母的组合,长度为4-15位;' + 59 | '密码长度在6~18之间,只能包含字母、数字和下划线', '用户名或密码格式错误', { 60 | confirmButtonText: '确定' 61 | }); 62 | } 63 | } 64 | }); 65 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/orderInFo.js: -------------------------------------------------------------------------------- 1 | const dingdan = { 2 | template: "#dingdan", 3 | data() { 4 | return { 5 | currentPage: 1,// 当前页码 6 | pageSize: 10,// 每页大小 7 | total: 1, 8 | orderPageList: {} 9 | } 10 | }, 11 | methods: { 12 | handleSizeChange(val) { 13 | this.orderPageInFo(val); 14 | }, 15 | handleCurrentChange(val) { 16 | this.orderPageInFo(val); 17 | }, 18 | handleDelete(index, row) { 19 | axios({ 20 | method: "post", 21 | url: "/deleteOrderInFo", 22 | transformRequest: [ 23 | function (data) { 24 | return parseParams(data); 25 | } 26 | ], 27 | data: { 28 | id: row.oid, 29 | } 30 | }).then((response) => { 31 | if (response.data) { 32 | this.orderPageInFo(this.currentPage); 33 | } else { 34 | this.$notify({ 35 | title: '删除失败', 36 | message: '订单删除失败,请稍后重试!', 37 | position: 'bottom-right' 38 | }); 39 | } 40 | }) 41 | }, 42 | orderPageInFo(pageNumber) { 43 | axios({ 44 | method: "post", 45 | url: "/orderPageInFo", 46 | transformRequest: [ 47 | function (data) { 48 | return parseParams(data); 49 | } 50 | ], 51 | data: { 52 | pageNumber: pageNumber, 53 | } 54 | }).then((response) => { 55 | this.orderPageList = response.data.list; 56 | this.currentPage = response.data.pageNum; 57 | this.pageSize = response.data.pageSize; 58 | this.total = response.data.total; 59 | console.log(this.orderPageList) 60 | }) 61 | 62 | } 63 | }, 64 | mounted() { 65 | this.orderPageInFo(1); 66 | } 67 | }; 68 | const app = new Vue({ 69 | el: "#app", 70 | components: { 71 | dingdan 72 | } 73 | }); -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/register.js: -------------------------------------------------------------------------------- 1 | const app = new Vue({ 2 | el: "#app", 3 | data() { 4 | return { 5 | uName: "", 6 | uPwd: "", 7 | uEmail: "" 8 | } 9 | }, 10 | methods: { 11 | register() { 12 | let regName = /^[A-Za-z0-9]{4,15}$/; 13 | let regPwd = /((?=.*\d)(?=.*\D)|(?=.*[a-zA-Z])(?=.*[^a-zA-Z]))^.{8,16}$/; 14 | let regEmail = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/; 15 | if (regName.test(this.uName) && regPwd.test(this.uPwd) && regEmail.test(this.uEmail)) { 16 | axios({ 17 | method: "post", 18 | url: "/userRegister", 19 | transformRequest: [ 20 | function (data) { 21 | return parseParams(data); 22 | } 23 | ], 24 | data: { 25 | uName: this.uName, 26 | uPwd: this.uPwd, 27 | uEmail: this.uEmail 28 | } 29 | }).then((response) => { 30 | if (response.data) { 31 | this.registerSuccess(); 32 | } else { 33 | this.registerError(); 34 | } 35 | }) 36 | } else { 37 | this.inputNoData(); 38 | } 39 | }, 40 | inputNoData() { 41 | this.$alert('请输入完整的用户名、密码和邮箱;用户名只能包括数字字母的组合,长度为4-15位;' + 42 | '密码长度在6~18之间,只能包含字母、数字和下划线', '用户名、密码或邮箱格式错误', { 43 | confirmButtonText: '确定' 44 | }); 45 | }, 46 | registerError() { 47 | this.$alert('请检查用户名、密码、邮箱是否错误', '注册失败', { 48 | confirmButtonText: '确定' 49 | }); 50 | }, 51 | registerSuccess() { 52 | this.$confirm('是否跳转到登录界面?', '注册成功', { 53 | confirmButtonText: '确定', 54 | cancelButtonText: '取消', 55 | type: 'success' 56 | }).then(() => { 57 | window.location.replace("http://localhost/login") 58 | }).catch(() => { 59 | this.$message({ 60 | type: 'info', 61 | message: '已取消跳转' 62 | }); 63 | }); 64 | } 65 | } 66 | }); -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/retrieve.js: -------------------------------------------------------------------------------- 1 | const app = new Vue({ 2 | el: "#app", 3 | data() { 4 | return { 5 | active: 1, 6 | uName: "", 7 | uPwd: "", 8 | uEmail: "", 9 | uPhone: "", 10 | dialogFormVisible: false, 11 | innerVisible: false, 12 | form: { 13 | newPwd: "", 14 | aNewPwd: "" 15 | }, 16 | formLabelWidth: '120px' 17 | }; 18 | }, 19 | methods: { 20 | next() { 21 | if (this.active++ >= 3) { 22 | this.active = 3 23 | } 24 | }, 25 | previous() { 26 | if (this.active-- <= 1) { 27 | this.active = 1 28 | } 29 | }, 30 | success() { 31 | axios( 32 | { 33 | method: "post", 34 | url: "/userRetrieve", 35 | transformRequest: [ 36 | function (data) { 37 | return parseParams(data); 38 | } 39 | ], 40 | data: { 41 | uName: this.uName, 42 | uPwd: this.uPwd, 43 | uEmail: this.uEmail, 44 | uPhone: this.uPhone 45 | } 46 | } 47 | ).then((response) => { 48 | if (response.data) { 49 | this.retrieveSuccess() 50 | } else { 51 | this.retrieveError(); 52 | } 53 | }) 54 | }, 55 | retrieveError() { 56 | this.$alert('请检查用户名、密码、邮箱、手机号是否错误', '找回失败', { 57 | confirmButtonText: '确定' 58 | }); 59 | }, 60 | retrieveSuccess() { 61 | this.dialogFormVisible = true; 62 | }, 63 | retrievePwd() { 64 | let regPwd = /((?=.*\d)(?=.*\D)|(?=.*[a-zA-Z])(?=.*[^a-zA-Z]))^.{8,16}$/; 65 | if (this.form.newPwd === this.form.aNewPwd && regPwd.test(this.form.newPwd)) { 66 | axios( 67 | { 68 | method: "post", 69 | url: "/userRetrievePassword", 70 | transformRequest: [ 71 | function (data) { 72 | return parseParams(data); 73 | } 74 | ], 75 | data: { 76 | uName: this.uName, 77 | uPwd: this.form.newPwd, 78 | uEmail: this.uEmail 79 | } 80 | } 81 | ).then((response) => { 82 | if (response.data) { 83 | this.dialogFormVisible = false; 84 | this.retrievePwdSuccess(); 85 | } else { 86 | this.innerVisible = true; 87 | } 88 | }) 89 | } else { 90 | this.innerVisible = true; 91 | } 92 | }, 93 | retrievePwdSuccess() { 94 | this.$confirm('是否跳转到登录界面?', '重置密码成功', { 95 | confirmButtonText: '确定', 96 | cancelButtonText: '取消', 97 | type: 'success' 98 | }).then(() => { 99 | window.location.replace("http://localhost/login") 100 | }).catch(() => { 101 | this.$message({ 102 | type: 'info', 103 | message: '已取消跳转' 104 | }); 105 | }); 106 | } 107 | } 108 | }) -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/static/js/shopping.js: -------------------------------------------------------------------------------- 1 | const show = { 2 | template: "#show", 3 | props: { 4 | ytid: {} 5 | }, 6 | data() { 7 | return { 8 | commodity: {}, 9 | tid: this.ytid, 10 | currentPage: 1,// 当前页码 11 | pageSize: 4,// 每页大小 12 | total: 12 13 | } 14 | }, 15 | filters: { 16 | showPrice(price) { 17 | return "¥" + price.toFixed(2) 18 | } 19 | }, 20 | methods: { 21 | getAllCommodity(pageNumber, value) { 22 | axios({ 23 | method: "post", 24 | url: "/commodityList", 25 | transformRequest: [ 26 | function (data) { 27 | return parseParams(data); 28 | } 29 | ], 30 | data: { 31 | pageNumber: pageNumber, 32 | Id: value 33 | } 34 | }).then((response) => { 35 | this.commodity = response.data.list; 36 | this.currentPage = response.data.pageNum; 37 | this.pageSize = response.data.pageSize; 38 | this.total = response.data.total; 39 | }) 40 | }, 41 | handleSizeChange(val) { 42 | this.getAllCommodity(val, this.tid); 43 | }, 44 | handleCurrentChange(val) { 45 | this.getAllCommodity(val, this.tid); 46 | }, 47 | addToCart(index) { 48 | axios({ 49 | method: "post", 50 | url: "/addCar", 51 | transformRequest: [ 52 | function (data) { 53 | return parseParams(data); 54 | } 55 | ], 56 | data: { 57 | yId: this.commodity[index].yid, 58 | cNum: 1 59 | } 60 | }).then((response) => { 61 | if (response.data) { 62 | this.$notify({ 63 | title: '添加成功', 64 | message: '宝贝正在购物车等你!', 65 | position: 'bottom-right' 66 | }); 67 | } else { 68 | this.$notify({ 69 | title: '添加失败', 70 | message: '宝贝添加失败,请稍后重试!', 71 | position: 'bottom-right' 72 | }); 73 | } 74 | }) 75 | } 76 | }, 77 | mounted() { 78 | this.getAllCommodity(1, this.tid); 79 | } 80 | }; 81 | const app = new Vue({ 82 | el: "#app", 83 | data() { 84 | return { 85 | activeNames: ['0', '1'], 86 | collapseTitle: [] 87 | }; 88 | }, 89 | methods: { 90 | getCommodityTypeListTitle() { 91 | axios.get("/commodityTypeList").then((response) => { 92 | this.collapseTitle = response.data 93 | }); 94 | } 95 | }, 96 | mounted() { 97 | this.getCommodityTypeListTitle(); 98 | }, 99 | components: { 100 | show 101 | } 102 | }); -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/templates/createOrder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Create Order 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | POI - Coffee 50 | 主页 / 创建订单 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | CREATE-ORDER 59 | START YOURCOFFEE JOURNEY 60 | 61 | 62 | 63 | 64 | 65 | 66 | 71 | 72 | 73 | 77 | 81 | 82 | 86 | 87 | 90 | 91 | 92 | 93 | {{scope.row.commodity.yprice * scope.row.cnum | showPrice}} 94 | 95 | 96 | 98 | 99 | 提 交 订 单 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/templates/fotter-all.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Book Your Coffee Now 10 | Call NOW to our toll free number 11 | 12 | 13 | +88888888888 14 | 15 | 16 | 17 | B 18 | 19 | 20 | 21 | 22 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Login 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | POI - Coffee 32 | 主页 / 登录 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | LOGIN 41 | START YOURCOFFEE JOURNEY 42 | 43 | 44 | 用户名: 45 | 48 | 49 | 50 | 密 码: 51 | 54 | 55 | 56 | 57 | 58 | 59 | 登录 60 | 注册 61 | 忘记密码 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/templates/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Register 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | POI - Coffee 32 | 主页 / 注册 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | REGISTER 41 | START YOURCOFFEE JOURNEY 42 | 43 | 44 | 用户名: 45 | 48 | 49 | 50 | 密 码: 51 | 54 | 55 | 56 | 邮 箱: 57 | 59 | 60 | 61 | 62 | 注册 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /coffee-sales-user/src/main/resources/templates/top-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 主页 8 | 9 | 登录 10 | 注销 11 | 12 | 我的信息 13 | 购物 14 | 购物车 15 | 地址管理 16 | 订单信息 17 | 18 | 19 | 20 | 27 | 28 | 29 | --------------------------------------------------------------------------------
Call NOW to our toll free number