orderDetailList;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/config/WebSocketConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.sky.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.socket.server.standard.ServerEndpointExporter;
6 |
7 | /**
8 | * WebSocket配置类,用于注册WebSocket的Bean
9 | */
10 | @Configuration
11 | public class WebSocketConfiguration {
12 |
13 | @Bean
14 | public ServerEndpointExporter serverEndpointExporter() {
15 | return new ServerEndpointExporter();
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/DishItemVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | @Data
11 | @Builder
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | public class DishItemVO implements Serializable {
15 |
16 | //菜品名称
17 | private String name;
18 |
19 | //份数
20 | private Integer copies;
21 |
22 | //菜品图片
23 | private String image;
24 |
25 | //菜品描述
26 | private String description;
27 | }
28 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/50x.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Error
5 |
12 |
13 |
14 | An error occurred.
15 | Sorry, the page you are looking for is currently unavailable.
16 | Please try again later.
17 | If you are the system administrator of this resource then you should check
18 | the error log for details.
19 | Faithfully yours, nginx.
20 |
21 |
22 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/UserReportVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | @Data
11 | @Builder
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | public class UserReportVO implements Serializable {
15 |
16 | //日期,以逗号分隔,例如:2022-10-01,2022-10-02,2022-10-03
17 | private String dateList;
18 |
19 | //用户总量,以逗号分隔,例如:200,210,220
20 | private String totalUserList;
21 |
22 | //新增用户,以逗号分隔,例如:20,21,10
23 | private String newUserList;
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/nginx-1.20.2/contrib/README:
--------------------------------------------------------------------------------
1 |
2 | geo2nginx.pl by Andrei Nigmatulin
3 |
4 | The perl script to convert CSV geoip database ( free download
5 | at http://www.maxmind.com/app/geoip_country ) to format, suitable
6 | for use by the ngx_http_geo_module.
7 |
8 |
9 | unicode2nginx by Maxim Dounin
10 |
11 | The perl script to convert unicode mappings ( available
12 | at http://www.unicode.org/Public/MAPPINGS/ ) to the nginx
13 | configuration file format.
14 | Two generated full maps for windows-1251 and koi8-r.
15 |
16 |
17 | vim by Evan Miller
18 |
19 | Syntax highlighting of nginx configuration for vim, to be
20 | placed into ~/.vim/.
21 |
22 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/OrderPaymentVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.time.LocalDateTime;
10 |
11 | @Data
12 | @Builder
13 | @NoArgsConstructor
14 | @AllArgsConstructor
15 | public class OrderPaymentVO implements Serializable {
16 |
17 | private String nonceStr; //随机字符串
18 | private String paySign; //签名
19 | private String timeStamp; //时间戳
20 | private String signType; //签名算法
21 | private String packageStr; //统一下单接口返回的 prepay_id 参数值
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/OrderSubmitVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.math.BigDecimal;
10 | import java.time.LocalDateTime;
11 |
12 | @Data
13 | @Builder
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | public class OrderSubmitVO implements Serializable {
17 | //订单id
18 | private Long id;
19 | //订单号
20 | private String orderNumber;
21 | //订单金额
22 | private BigDecimal orderAmount;
23 | //下单时间
24 | private LocalDateTime orderTime;
25 | }
26 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/DishFlavor.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | * 菜品口味
12 | */
13 | @Data
14 | @Builder
15 | @NoArgsConstructor
16 | @AllArgsConstructor
17 | public class DishFlavor implements Serializable {
18 |
19 | private static final long serialVersionUID = 1L;
20 |
21 | private Long id;
22 | //菜品id
23 | private Long dishId;
24 |
25 | //口味名称
26 | private String name;
27 |
28 | //口味数据list
29 | private String value;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/BusinessDataVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | * 数据概览
12 | */
13 | @Data
14 | @Builder
15 | @NoArgsConstructor
16 | @AllArgsConstructor
17 | public class BusinessDataVO implements Serializable {
18 |
19 | private Double turnover;//营业额
20 |
21 | private Integer validOrderCount;//有效订单数
22 |
23 | private Double orderCompletionRate;//订单完成率
24 |
25 | private Double unitPrice;//平均客单价
26 |
27 | private Integer newUsers;//新增用户数
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/OrderDetailMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | insert into order_detail (name, order_id, dish_id, setmeal_id, dish_flavor, number, amount, image)
6 | values
7 | (#{od.name},#{od.orderId},#{od.dishId},#{od.setmealId},#{od.dishFlavor},#{od.number},#{od.amount},#{od.image})
8 |
9 |
10 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/SkyApplication.java:
--------------------------------------------------------------------------------
1 | package com.sky;
2 |
3 | import lombok.extern.slf4j.Slf4j;
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 | @EnableTransactionManagement //开启注解方式的事务管理
11 | @EnableCaching
12 | @Slf4j
13 | public class SkyApplication {
14 | public static void main(String[] args) {
15 | SpringApplication.run(SkyApplication.class, args);
16 | log.info("server started");
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/sky-common/src/main/java/com/sky/properties/JwtProperties.java:
--------------------------------------------------------------------------------
1 | package com.sky.properties;
2 |
3 | import lombok.Data;
4 | import org.springframework.boot.context.properties.ConfigurationProperties;
5 | import org.springframework.stereotype.Component;
6 |
7 | @Component
8 | @ConfigurationProperties(prefix = "sky.jwt")
9 | @Data
10 | public class JwtProperties {
11 |
12 | /**
13 | * 管理端员工生成jwt令牌相关配置
14 | */
15 | private String adminSecretKey;
16 | private long adminTtl;
17 | private String adminTokenName;
18 |
19 | /**
20 | * 用户端微信用户生成jwt令牌相关配置
21 | */
22 | private String userSecretKey;
23 | private long userTtl;
24 | private String userTokenName;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/OrderOverViewVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | * 订单概览数据
12 | */
13 | @Data
14 | @Builder
15 | @NoArgsConstructor
16 | @AllArgsConstructor
17 | public class OrderOverViewVO implements Serializable {
18 | //待接单数量
19 | private Integer waitingOrders;
20 |
21 | //待派送数量
22 | private Integer deliveredOrders;
23 |
24 | //已完成数量
25 | private Integer completedOrders;
26 |
27 | //已取消数量
28 | private Integer cancelledOrders;
29 |
30 | //全部订单
31 | private Integer allOrders;
32 | }
33 |
--------------------------------------------------------------------------------
/nginx-1.20.2/conf/scgi_params:
--------------------------------------------------------------------------------
1 |
2 | scgi_param REQUEST_METHOD $request_method;
3 | scgi_param REQUEST_URI $request_uri;
4 | scgi_param QUERY_STRING $query_string;
5 | scgi_param CONTENT_TYPE $content_type;
6 |
7 | scgi_param DOCUMENT_URI $document_uri;
8 | scgi_param DOCUMENT_ROOT $document_root;
9 | scgi_param SCGI 1;
10 | scgi_param SERVER_PROTOCOL $server_protocol;
11 | scgi_param REQUEST_SCHEME $scheme;
12 | scgi_param HTTPS $https if_not_empty;
13 |
14 | scgi_param REMOTE_ADDR $remote_addr;
15 | scgi_param REMOTE_PORT $remote_port;
16 | scgi_param SERVER_PORT $server_port;
17 | scgi_param SERVER_NAME $server_name;
18 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Welcome to nginx!
5 |
12 |
13 |
14 | Welcome to nginx!
15 | If you see this page, the nginx web server is successfully installed and
16 | working. Further configuration is required.
17 |
18 | For online documentation and support please refer to
19 | nginx.org.
20 | Commercial support is available at
21 | nginx.com.
22 |
23 | Thank you for using nginx.
24 |
25 |
26 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/dto/DishDTO.java:
--------------------------------------------------------------------------------
1 | package com.sky.dto;
2 |
3 | import com.sky.entity.DishFlavor;
4 | import lombok.Data;
5 | import java.io.Serializable;
6 | import java.math.BigDecimal;
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | @Data
11 | public class DishDTO implements Serializable {
12 |
13 | private Long id;
14 | //菜品名称
15 | private String name;
16 | //菜品分类id
17 | private Long categoryId;
18 | //菜品价格
19 | private BigDecimal price;
20 | //图片
21 | private String image;
22 | //描述信息
23 | private String description;
24 | //0 停售 1 起售
25 | private Integer status;
26 | //口味
27 | private List flavors = new ArrayList<>();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/nginx-1.20.2/conf/uwsgi_params:
--------------------------------------------------------------------------------
1 |
2 | uwsgi_param QUERY_STRING $query_string;
3 | uwsgi_param REQUEST_METHOD $request_method;
4 | uwsgi_param CONTENT_TYPE $content_type;
5 | uwsgi_param CONTENT_LENGTH $content_length;
6 |
7 | uwsgi_param REQUEST_URI $request_uri;
8 | uwsgi_param PATH_INFO $document_uri;
9 | uwsgi_param DOCUMENT_ROOT $document_root;
10 | uwsgi_param SERVER_PROTOCOL $server_protocol;
11 | uwsgi_param REQUEST_SCHEME $scheme;
12 | uwsgi_param HTTPS $https if_not_empty;
13 |
14 | uwsgi_param REMOTE_ADDR $remote_addr;
15 | uwsgi_param REMOTE_PORT $remote_port;
16 | uwsgi_param SERVER_PORT $server_port;
17 | uwsgi_param SERVER_NAME $server_name;
18 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/dto/OrdersPageQueryDTO.java:
--------------------------------------------------------------------------------
1 | package com.sky.dto;
2 |
3 | import lombok.Data;
4 | import org.springframework.format.annotation.DateTimeFormat;
5 |
6 | import java.io.Serializable;
7 | import java.time.LocalDateTime;
8 |
9 | @Data
10 | public class OrdersPageQueryDTO implements Serializable {
11 |
12 | private int page;
13 |
14 | private int pageSize;
15 |
16 | private String number;
17 |
18 | private String phone;
19 |
20 | private Integer status;
21 |
22 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
23 | private LocalDateTime beginTime;
24 |
25 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
26 | private LocalDateTime endTime;
27 |
28 | private Long userId;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/OrderDetailMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.sky.entity.OrderDetail;
4 | import org.apache.ibatis.annotations.Mapper;
5 | import org.apache.ibatis.annotations.Select;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author Mark
11 | * @date 2024/2/17
12 | */
13 |
14 | @Mapper
15 | public interface OrderDetailMapper {
16 | /**
17 | * 批量插入
18 | * @param orderDetailList
19 | */
20 | void insertBatch(List orderDetailList);
21 |
22 | /**
23 | * 根据订单id查询订单明细
24 | * @param orderId
25 | * @return
26 | */
27 | @Select("select * from order_detail where order_id = #{orderId};")
28 | List getByOrderId(Long orderId);
29 | }
30 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/dto/SetmealDTO.java:
--------------------------------------------------------------------------------
1 | package com.sky.dto;
2 |
3 | import com.sky.entity.SetmealDish;
4 | import lombok.Data;
5 | import java.io.Serializable;
6 | import java.math.BigDecimal;
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | @Data
11 | public class SetmealDTO implements Serializable {
12 |
13 | private Long id;
14 |
15 | //分类id
16 | private Long categoryId;
17 |
18 | //套餐名称
19 | private String name;
20 |
21 | //套餐价格
22 | private BigDecimal price;
23 |
24 | //状态 0:停用 1:启用
25 | private Integer status;
26 |
27 | //描述信息
28 | private String description;
29 |
30 | //图片
31 | private String image;
32 |
33 | //套餐菜品关系
34 | private List setmealDishes = new ArrayList<>();
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/EmployeeLoginVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.AllArgsConstructor;
6 | import lombok.Builder;
7 | import lombok.Data;
8 | import lombok.NoArgsConstructor;
9 |
10 | import java.io.Serializable;
11 |
12 | @Data
13 | @Builder
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | @ApiModel(description = "员工登录返回的数据格式")
17 | public class EmployeeLoginVO implements Serializable {
18 |
19 | @ApiModelProperty("主键值")
20 | private Long id;
21 |
22 | @ApiModelProperty("用户名")
23 | private String userName;
24 |
25 | @ApiModelProperty("姓名")
26 | private String name;
27 |
28 | @ApiModelProperty("jwt令牌")
29 | private String token;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/SetmealDish.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.math.BigDecimal;
10 |
11 | /**
12 | * 套餐菜品关系
13 | */
14 | @Data
15 | @Builder
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class SetmealDish implements Serializable {
19 |
20 | private static final long serialVersionUID = 1L;
21 |
22 | private Long id;
23 |
24 | //套餐id
25 | private Long setmealId;
26 |
27 | //菜品id
28 | private Long dishId;
29 |
30 | //菜品名称 (冗余字段)
31 | private String name;
32 |
33 | //菜品原价
34 | private BigDecimal price;
35 |
36 | //份数
37 | private Integer copies;
38 | }
39 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/ShoppingCartService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.dto.ShoppingCartDTO;
4 | import com.sky.entity.ShoppingCart;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * @author Mark
10 | * @date 2024/2/16
11 | */
12 | public interface ShoppingCartService {
13 | /**
14 | * 添加购物车
15 | * @param shoppingCartDTO
16 | */
17 | void addShoppingCart(ShoppingCartDTO shoppingCartDTO);
18 |
19 | /**
20 | * 查看购物车
21 | * @return
22 | */
23 | List showShoppingCart();
24 |
25 | /**
26 | * 清空购物车
27 | */
28 | void cleanShoppingCart();
29 |
30 | /**
31 | * 清空购物车中的一个商品
32 | * @param shoppingCartDTO
33 | */
34 | void subShoppingCart(ShoppingCartDTO shoppingCartDTO);
35 | }
36 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/task/WebSocketTask.java:
--------------------------------------------------------------------------------
1 | package com.sky.task;
2 |
3 | import com.sky.websocket.WebSocketServer;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.scheduling.annotation.Scheduled;
6 | import org.springframework.stereotype.Component;
7 | import java.time.LocalDateTime;
8 | import java.time.format.DateTimeFormatter;
9 |
10 | @Component
11 | public class WebSocketTask {
12 | @Autowired
13 | private WebSocketServer webSocketServer;
14 |
15 | /**
16 | * 通过WebSocket每隔5秒向客户端发送消息
17 | */
18 | @Scheduled(cron = "0/5 * * * * ?")
19 | public void sendMessageToClient() {
20 | webSocketServer.sendToAllClient("这是来自服务端的消息:" + DateTimeFormatter.ofPattern("HH:mm:ss").format(LocalDateTime.now()));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/OrderReportVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | @Data
11 | @Builder
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | public class OrderReportVO implements Serializable {
15 |
16 | //日期,以逗号分隔,例如:2022-10-01,2022-10-02,2022-10-03
17 | private String dateList;
18 |
19 | //每日订单数,以逗号分隔,例如:260,210,215
20 | private String orderCountList;
21 |
22 | //每日有效订单数,以逗号分隔,例如:20,21,10
23 | private String validOrderCountList;
24 |
25 | //订单总数
26 | private Integer totalOrderCount;
27 |
28 | //有效订单数
29 | private Integer validOrderCount;
30 |
31 | //订单完成率
32 | private Double orderCompletionRate;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/config/OssConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.sky.config;
2 |
3 | /**
4 | * @author Mark
5 | * @date 2024/2/10
6 | */
7 |
8 | import com.sky.properties.AliOssProperties;
9 | import com.sky.utils.AliOssUtil;
10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
11 | import org.springframework.context.annotation.Bean;
12 | import org.springframework.context.annotation.Configuration;
13 |
14 | /**
15 | * 阿里云oss图片上传配置类
16 | */
17 | @Configuration
18 | public class OssConfiguration {
19 |
20 | @Bean
21 | @ConditionalOnMissingBean
22 | public AliOssUtil aliOssUtil(AliOssProperties properties){
23 | return new AliOssUtil(properties.getEndpoint(), properties.getAccessKeyId(),
24 | properties.getAccessKeySecret(), properties.getBucketName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/sky-common/src/main/java/com/sky/properties/WeChatProperties.java:
--------------------------------------------------------------------------------
1 | package com.sky.properties;
2 |
3 | import lombok.Data;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.boot.context.properties.ConfigurationProperties;
6 | import org.springframework.stereotype.Component;
7 |
8 | @Component
9 | @ConfigurationProperties(prefix = "sky.wechat")
10 | @Data
11 | public class WeChatProperties {
12 |
13 | private String appid; //小程序的appid
14 | private String secret; //小程序的秘钥
15 | private String mchid; //商户号
16 | private String mchSerialNo; //商户API证书的证书序列号
17 | private String privateKeyFilePath; //商户私钥文件
18 | private String apiV3Key; //证书解密的密钥
19 | private String weChatPayCertFilePath; //平台证书
20 | private String notifyUrl; //支付成功的回调地址
21 | private String refundNotifyUrl; //退款成功的回调地址
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/WorkspaceService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.vo.BusinessDataVO;
4 | import com.sky.vo.DishOverViewVO;
5 | import com.sky.vo.OrderOverViewVO;
6 | import com.sky.vo.SetmealOverViewVO;
7 | import java.time.LocalDateTime;
8 |
9 | public interface WorkspaceService {
10 |
11 | /**
12 | * 根据时间段统计营业数据
13 | * @param begin
14 | * @param end
15 | * @return
16 | */
17 | BusinessDataVO getBusinessData(LocalDateTime begin, LocalDateTime end);
18 |
19 | /**
20 | * 查询订单管理数据
21 | * @return
22 | */
23 | OrderOverViewVO getOrderOverView();
24 |
25 | /**
26 | * 查询菜品总览
27 | * @return
28 | */
29 | DishOverViewVO getDishOverView();
30 |
31 | /**
32 | * 查询套餐总览
33 | * @return
34 | */
35 | SetmealOverViewVO getSetmealOverView();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.sky.entity.User;
4 | import org.apache.ibatis.annotations.Mapper;
5 | import org.apache.ibatis.annotations.Select;
6 |
7 | import java.util.Map;
8 |
9 | /**
10 | * @author Mark
11 | * @date 2024/2/15
12 | */
13 |
14 | @Mapper
15 | public interface UserMapper {
16 | /**
17 | * 根据openid查找用户
18 | * @param openId
19 | * @return
20 | */
21 | @Select("select * from user where openid = #{openId}")
22 | User getByOpenId(String openId);
23 |
24 | /**
25 | * 插入用户
26 | * @param user
27 | */
28 | void insert(User user);
29 |
30 |
31 | @Select("select * from user where id = #{id}")
32 | User getById(Long userId);
33 |
34 | /**
35 | * 获取用户数量数据
36 | * @param map
37 | */
38 | Integer getUserByMap(Map map);
39 | }
40 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/User.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.time.LocalDate;
10 | import java.time.LocalDateTime;
11 |
12 | @Data
13 | @Builder
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | public class User implements Serializable {
17 |
18 | private static final long serialVersionUID = 1L;
19 |
20 | private Long id;
21 |
22 | //微信用户唯一标识
23 | private String openid;
24 |
25 | //姓名
26 | private String name;
27 |
28 | //手机号
29 | private String phone;
30 |
31 | //性别 0 女 1 男
32 | private String sex;
33 |
34 | //身份证号
35 | private String idNumber;
36 |
37 | //头像
38 | private String avatar;
39 |
40 | //注册时间
41 | private LocalDateTime createTime;
42 | }
43 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/config/RedisConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.sky.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.data.redis.connection.RedisConnectionFactory;
6 | import org.springframework.data.redis.core.RedisTemplate;
7 | import org.springframework.data.redis.serializer.StringRedisSerializer;
8 |
9 | /**
10 | * @author Mark
11 | * @date 2024/2/12
12 | */
13 |
14 | @Configuration
15 | public class RedisConfiguration {
16 |
17 | @Bean
18 | public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory){
19 | RedisTemplate redisTemplate = new RedisTemplate();
20 | redisTemplate.setKeySerializer(new StringRedisSerializer());
21 | redisTemplate.setConnectionFactory(redisConnectionFactory);
22 | return redisTemplate;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/UserMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | insert into user(openid,name,phone,sex,id_number,avatar,create_time)
6 | values(#{openid},#{name},#{phone},#{sex},#{idNumber},#{avatar},#{createTime})
7 |
8 |
19 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/dto/OrdersSubmitDTO.java:
--------------------------------------------------------------------------------
1 | package com.sky.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import lombok.Data;
5 |
6 | import java.io.Serializable;
7 | import java.math.BigDecimal;
8 | import java.time.LocalDateTime;
9 |
10 | @Data
11 | public class OrdersSubmitDTO implements Serializable {
12 | //地址簿id
13 | private Long addressBookId;
14 | //付款方式
15 | private int payMethod;
16 | //备注
17 | private String remark;
18 | //预计送达时间
19 | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
20 | private LocalDateTime estimatedDeliveryTime;
21 | //配送状态 1立即送出 0选择具体时间
22 | private Integer deliveryStatus;
23 | //餐具数量
24 | private Integer tablewareNumber;
25 | //餐具数量状态 1按餐量提供 0选择具体数量
26 | private Integer tablewareStatus;
27 | //打包费
28 | private Integer packAmount;
29 | //总金额
30 | private BigDecimal amount;
31 | }
32 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/OrderDetail.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.math.BigDecimal;
10 |
11 | /**
12 | * 订单明细
13 | */
14 | @Data
15 | @Builder
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class OrderDetail implements Serializable {
19 |
20 | private static final long serialVersionUID = 1L;
21 |
22 | private Long id;
23 |
24 | //名称
25 | private String name;
26 |
27 | //订单id
28 | private Long orderId;
29 |
30 | //菜品id
31 | private Long dishId;
32 |
33 | //套餐id
34 | private Long setmealId;
35 |
36 | //口味
37 | private String dishFlavor;
38 |
39 | //数量
40 | private Integer number;
41 |
42 | //金额
43 | private BigDecimal amount;
44 |
45 | //图片
46 | private String image;
47 | }
48 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/Category.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 | import java.io.Serializable;
8 | import java.time.LocalDateTime;
9 |
10 | @Data
11 | @Builder
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | public class Category implements Serializable {
15 |
16 | private static final long serialVersionUID = 1L;
17 |
18 | private Long id;
19 |
20 | //类型: 1菜品分类 2套餐分类
21 | private Integer type;
22 |
23 | //分类名称
24 | private String name;
25 |
26 | //顺序
27 | private Integer sort;
28 |
29 | //分类状态 0标识禁用 1表示启用
30 | private Integer status;
31 |
32 | //创建时间
33 | private LocalDateTime createTime;
34 |
35 | //更新时间
36 | private LocalDateTime updateTime;
37 |
38 | //创建人
39 | private Long createUser;
40 |
41 | //修改人
42 | private Long updateUser;
43 | }
44 |
--------------------------------------------------------------------------------
/sky-common/src/main/java/com/sky/result/Result.java:
--------------------------------------------------------------------------------
1 | package com.sky.result;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * 后端统一返回结果
9 | * @param
10 | */
11 | @Data
12 | public class Result implements Serializable {
13 |
14 | private Integer code; //编码:1成功,0和其它数字为失败
15 | private String msg; //错误信息
16 | private T data; //数据
17 |
18 | public static Result success() {
19 | Result result = new Result();
20 | result.code = 1;
21 | return result;
22 | }
23 |
24 | public static Result success(T object) {
25 | Result result = new Result();
26 | result.data = object;
27 | result.code = 1;
28 | return result;
29 | }
30 |
31 | public static Result error(String msg) {
32 | Result result = new Result();
33 | result.msg = msg;
34 | result.code = 0;
35 | return result;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/ShoppingCart.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.math.BigDecimal;
10 | import java.time.LocalDateTime;
11 |
12 | /**
13 | * 购物车
14 | */
15 | @Data
16 | @Builder
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | public class ShoppingCart implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 | private Long id;
24 |
25 | //名称
26 | private String name;
27 |
28 | //用户id
29 | private Long userId;
30 |
31 | //菜品id
32 | private Long dishId;
33 |
34 | //套餐id
35 | private Long setmealId;
36 |
37 | //口味
38 | private String dishFlavor;
39 |
40 | //数量
41 | private Integer number;
42 |
43 | //金额
44 | private BigDecimal amount;
45 |
46 | //图片
47 | private String image;
48 |
49 | private LocalDateTime createTime;
50 | }
51 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/ShopController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.result.Result;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.data.redis.core.RedisTemplate;
6 | import org.springframework.web.bind.annotation.GetMapping;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RestController;
9 |
10 | /**
11 | * @author Mark
12 | * @date 2024/2/12
13 | */
14 |
15 | @RestController("userShopController")
16 | @RequestMapping("/user/shop")
17 | public class ShopController {
18 | public static final String KEY = "SHOP_STATUS";
19 |
20 | @Autowired
21 | private RedisTemplate redisTemplate;
22 |
23 | /**
24 | * 获取店铺营业状态
25 | * @return
26 | */
27 | @GetMapping("/status")
28 | public Result getStatus(){
29 | Integer status = (Integer) redisTemplate.opsForValue().get(KEY);
30 | return Result.success(status);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/Employee.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.time.LocalDateTime;
10 |
11 | @Data
12 | @Builder
13 | @NoArgsConstructor
14 | @AllArgsConstructor
15 | public class Employee implements Serializable {
16 |
17 | private static final long serialVersionUID = 1L;
18 |
19 | private Long id;
20 |
21 | private String username;
22 |
23 | private String name;
24 |
25 | private String password;
26 |
27 | private String phone;
28 |
29 | private String sex;
30 |
31 | private String idNumber;
32 |
33 | private Integer status;
34 |
35 | //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
36 | private LocalDateTime createTime;
37 |
38 | //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
39 | private LocalDateTime updateTime;
40 |
41 | private Long createUser;
42 |
43 | private Long updateUser;
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/Dish.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 | import java.io.Serializable;
8 | import java.math.BigDecimal;
9 | import java.time.LocalDateTime;
10 |
11 | /**
12 | * 菜品
13 | */
14 | @Data
15 | @Builder
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class Dish implements Serializable {
19 |
20 | private static final long serialVersionUID = 1L;
21 |
22 | private Long id;
23 |
24 | //菜品名称
25 | private String name;
26 |
27 | //菜品分类id
28 | private Long categoryId;
29 |
30 | //菜品价格
31 | private BigDecimal price;
32 |
33 | //图片
34 | private String image;
35 |
36 | //描述信息
37 | private String description;
38 |
39 | //0 停售 1 起售
40 | private Integer status;
41 |
42 | private LocalDateTime createTime;
43 |
44 | private LocalDateTime updateTime;
45 |
46 | private Long createUser;
47 |
48 | private Long updateUser;
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/Setmeal.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 | import java.io.Serializable;
8 | import java.math.BigDecimal;
9 | import java.time.LocalDateTime;
10 |
11 | /**
12 | * 套餐
13 | */
14 | @Data
15 | @Builder
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class Setmeal implements Serializable {
19 |
20 | private static final long serialVersionUID = 1L;
21 |
22 | private Long id;
23 |
24 | //分类id
25 | private Long categoryId;
26 |
27 | //套餐名称
28 | private String name;
29 |
30 | //套餐价格
31 | private BigDecimal price;
32 |
33 | //状态 0:停用 1:启用
34 | private Integer status;
35 |
36 | //描述信息
37 | private String description;
38 |
39 | //图片
40 | private String image;
41 |
42 | private LocalDateTime createTime;
43 |
44 | private LocalDateTime updateTime;
45 |
46 | private Long createUser;
47 |
48 | private Long updateUser;
49 | }
50 |
--------------------------------------------------------------------------------
/nginx-1.20.2/docs/zlib.LICENSE:
--------------------------------------------------------------------------------
1 | (C) 1995-2017 Jean-loup Gailly and Mark Adler
2 |
3 | This software is provided 'as-is', without any express or implied
4 | warranty. In no event will the authors be held liable for any damages
5 | arising from the use of this software.
6 |
7 | Permission is granted to anyone to use this software for any purpose,
8 | including commercial applications, and to alter it and redistribute it
9 | freely, subject to the following restrictions:
10 |
11 | 1. The origin of this software must not be misrepresented; you must not
12 | claim that you wrote the original software. If you use this software
13 | in a product, an acknowledgment in the product documentation would be
14 | appreciated but is not required.
15 | 2. Altered source versions must be plainly marked as such, and must not be
16 | misrepresented as being the original software.
17 | 3. This notice may not be removed or altered from any source distribution.
18 |
19 | Jean-loup Gailly Mark Adler
20 | jloup@gzip.org madler@alumni.caltech.edu
21 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/DishVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import com.sky.entity.DishFlavor;
4 | import lombok.AllArgsConstructor;
5 | import lombok.Builder;
6 | import lombok.Data;
7 | import lombok.NoArgsConstructor;
8 | import java.io.Serializable;
9 | import java.math.BigDecimal;
10 | import java.time.LocalDateTime;
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | @Data
15 | @Builder
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class DishVO implements Serializable {
19 |
20 | private Long id;
21 | //菜品名称
22 | private String name;
23 | //菜品分类id
24 | private Long categoryId;
25 | //菜品价格
26 | private BigDecimal price;
27 | //图片
28 | private String image;
29 | //描述信息
30 | private String description;
31 | //0 停售 1 起售
32 | private Integer status;
33 | //更新时间
34 | private LocalDateTime updateTime;
35 | //分类名称
36 | private String categoryName;
37 | //菜品关联的口味
38 | private List flavors = new ArrayList<>();
39 |
40 | //private Integer copies;
41 | }
42 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/vo/SetmealVO.java:
--------------------------------------------------------------------------------
1 | package com.sky.vo;
2 |
3 | import com.sky.entity.SetmealDish;
4 | import lombok.AllArgsConstructor;
5 | import lombok.Builder;
6 | import lombok.Data;
7 | import lombok.NoArgsConstructor;
8 | import java.io.Serializable;
9 | import java.math.BigDecimal;
10 | import java.time.LocalDateTime;
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | @Data
15 | @Builder
16 | @NoArgsConstructor
17 | @AllArgsConstructor
18 | public class SetmealVO implements Serializable {
19 |
20 | private Long id;
21 |
22 | //分类id
23 | private Long categoryId;
24 |
25 | //套餐名称
26 | private String name;
27 |
28 | //套餐价格
29 | private BigDecimal price;
30 |
31 | //状态 0:停用 1:启用
32 | private Integer status;
33 |
34 | //描述信息
35 | private String description;
36 |
37 | //图片
38 | private String image;
39 |
40 | //更新时间
41 | private LocalDateTime updateTime;
42 |
43 | //分类名称
44 | private String categoryName;
45 |
46 | //套餐和菜品的关联关系
47 | private List setmealDishes = new ArrayList<>();
48 | }
49 |
--------------------------------------------------------------------------------
/nginx-1.20.2/conf/fastcgi_params:
--------------------------------------------------------------------------------
1 |
2 | fastcgi_param QUERY_STRING $query_string;
3 | fastcgi_param REQUEST_METHOD $request_method;
4 | fastcgi_param CONTENT_TYPE $content_type;
5 | fastcgi_param CONTENT_LENGTH $content_length;
6 |
7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name;
8 | fastcgi_param REQUEST_URI $request_uri;
9 | fastcgi_param DOCUMENT_URI $document_uri;
10 | fastcgi_param DOCUMENT_ROOT $document_root;
11 | fastcgi_param SERVER_PROTOCOL $server_protocol;
12 | fastcgi_param REQUEST_SCHEME $scheme;
13 | fastcgi_param HTTPS $https if_not_empty;
14 |
15 | fastcgi_param GATEWAY_INTERFACE CGI/1.1;
16 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
17 |
18 | fastcgi_param REMOTE_ADDR $remote_addr;
19 | fastcgi_param REMOTE_PORT $remote_port;
20 | fastcgi_param SERVER_ADDR $server_addr;
21 | fastcgi_param SERVER_PORT $server_port;
22 | fastcgi_param SERVER_NAME $server_name;
23 |
24 | # PHP only, required if PHP was built with --enable-force-cgi-redirect
25 | fastcgi_param REDIRECT_STATUS 200;
26 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/sky/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Welcome to your Workbox-powered service worker!
3 | *
4 | * You'll need to register this file in your web app and you should
5 | * disable HTTP caching for this file too.
6 | * See https://goo.gl/nhQhGp
7 | *
8 | * The rest of the code is auto-generated. Please don't update this file
9 | * directly; instead, make changes to your Workbox build configuration
10 | * and re-run your build process.
11 | * See https://goo.gl/2aRDsh
12 | */
13 |
14 | importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
15 |
16 | importScripts(
17 | "precache-manifest.5e430aca4979062ff3bb5d045cb4a7aa.js"
18 | );
19 |
20 | workbox.core.setCacheNameDetails({prefix: "vue-typescript-admin-template"});
21 |
22 | /**
23 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to
24 | * requests for URLs in the manifest.
25 | * See https://goo.gl/S9QRab
26 | */
27 | self.__precacheManifest = [].concat(self.__precacheManifest || []);
28 | workbox.precaching.suppressWarnings();
29 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
30 |
--------------------------------------------------------------------------------
/sky-pojo/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | sky-take-out
7 | com.sky
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 | sky-pojo
12 |
13 |
14 | org.projectlombok
15 | lombok
16 |
17 |
18 | com.fasterxml.jackson.core
19 | jackson-databind
20 | 2.9.2
21 |
22 |
23 | com.github.xiaoymin
24 | knife4j-spring-boot-starter
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/CategoryService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.dto.CategoryDTO;
4 | import com.sky.dto.CategoryPageQueryDTO;
5 | import com.sky.entity.Category;
6 | import com.sky.result.PageResult;
7 | import java.util.List;
8 |
9 | public interface CategoryService {
10 |
11 | /**
12 | * 新增分类
13 | * @param categoryDTO
14 | */
15 | void save(CategoryDTO categoryDTO);
16 |
17 | /**
18 | * 分页查询
19 | * @param categoryPageQueryDTO
20 | * @return
21 | */
22 | PageResult pageQuery(CategoryPageQueryDTO categoryPageQueryDTO);
23 |
24 | /**
25 | * 根据id删除分类
26 | * @param id
27 | */
28 | void deleteById(Long id);
29 |
30 | /**
31 | * 修改分类
32 | * @param categoryDTO
33 | */
34 | void update(CategoryDTO categoryDTO);
35 |
36 | /**
37 | * 启用、禁用分类
38 | * @param status
39 | * @param id
40 | */
41 | void startOrStop(Integer status, Long id);
42 |
43 | /**
44 | * 根据类型查询分类
45 | * @param type
46 | * @return
47 | */
48 | List list(Integer type);
49 | }
50 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/DishFlavorMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.sky.entity.DishFlavor;
4 | import org.apache.ibatis.annotations.Delete;
5 | import org.apache.ibatis.annotations.Mapper;
6 | import org.apache.ibatis.annotations.Select;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author Mark
12 | * @date 2024/2/11
13 | */
14 |
15 | @Mapper
16 | public interface DishFlavorMapper {
17 | /**
18 | * 批量删除
19 | * @param dishIds
20 | */
21 | void deleteBatch(List dishIds);
22 |
23 | /**
24 | * 根据菜品id查询口味
25 | * @param id
26 | * @return
27 | */
28 | @Select("select * from dish_flavor where dish_id = #{id}")
29 | List getDishId(Long id);
30 |
31 | /**
32 | * 根据id删除口味
33 | * @param id
34 | */
35 | @Delete("delete from dish_flavor where id = #{id}")
36 | void deleteById(Long id);
37 |
38 | /**
39 | * 根据菜品id查询对应的口味数据
40 | * @param dishId
41 | * @return
42 | */
43 | @Select("select * from dish_flavor where dish_id = #{dishId}")
44 | List getByDishId(Long dishId);
45 | }
46 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/CategoryController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.entity.Category;
4 | import com.sky.result.Result;
5 | import com.sky.service.CategoryService;
6 | import io.swagger.annotations.Api;
7 | import io.swagger.annotations.ApiOperation;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.GetMapping;
10 | import org.springframework.web.bind.annotation.RequestMapping;
11 | import org.springframework.web.bind.annotation.RestController;
12 | import java.util.List;
13 |
14 | @RestController("userCategoryController")
15 | @RequestMapping("/user/category")
16 | @Api(tags = "C端-分类接口")
17 | public class CategoryController {
18 |
19 | @Autowired
20 | private CategoryService categoryService;
21 |
22 | /**
23 | * 查询分类
24 | * @param type
25 | * @return
26 | */
27 | @GetMapping("/list")
28 | @ApiOperation("查询分类")
29 | public Result> list(Integer type) {
30 | List list = categoryService.list(type);
31 | return Result.success(list);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/SetMealDishMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | delete from setmeal_dish where id =
8 |
9 | #{id}
10 |
11 |
12 |
18 |
19 |
20 |
21 | insert into setmeal_dish
22 | (setmeal_id,dish_id,name,price,copies)
23 | values
24 |
25 | (#{sd.setmealId},#{sd.dishId},#{sd.name},#{sd.price},#{sd.copies})
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/dto/OrdersDTO.java:
--------------------------------------------------------------------------------
1 | package com.sky.dto;
2 |
3 | import com.sky.entity.OrderDetail;
4 | import lombok.Data;
5 | import java.io.Serializable;
6 | import java.math.BigDecimal;
7 | import java.time.LocalDateTime;
8 | import java.util.List;
9 |
10 | @Data
11 | public class OrdersDTO implements Serializable {
12 |
13 | private Long id;
14 |
15 | //订单号
16 | private String number;
17 |
18 | //订单状态 1待付款,2待派送,3已派送,4已完成,5已取消
19 | private Integer status;
20 |
21 | //下单用户id
22 | private Long userId;
23 |
24 | //地址id
25 | private Long addressBookId;
26 |
27 | //下单时间
28 | private LocalDateTime orderTime;
29 |
30 | //结账时间
31 | private LocalDateTime checkoutTime;
32 |
33 | //支付方式 1微信,2支付宝
34 | private Integer payMethod;
35 |
36 | //实收金额
37 | private BigDecimal amount;
38 |
39 | //备注
40 | private String remark;
41 |
42 | //用户名
43 | private String userName;
44 |
45 | //手机号
46 | private String phone;
47 |
48 | //地址
49 | private String address;
50 |
51 | //收货人
52 | private String consignee;
53 |
54 | private List orderDetails;
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/EmployeeService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.dto.EmployeeDTO;
4 | import com.sky.dto.EmployeeLoginDTO;
5 | import com.sky.dto.EmployeePageQueryDTO;
6 | import com.sky.entity.Employee;
7 | import com.sky.result.PageResult;
8 |
9 | public interface EmployeeService {
10 |
11 | /**
12 | * 员工登录
13 | * @param employeeLoginDTO
14 | * @return
15 | */
16 | Employee login(EmployeeLoginDTO employeeLoginDTO);
17 |
18 | /**
19 | * 新增员工
20 | * @param employeeDTO
21 | */
22 | void save(EmployeeDTO employeeDTO);
23 |
24 | /**
25 | * 员工分页查询
26 | * @param pageQueryDTO
27 | * @return
28 | */
29 | PageResult page(EmployeePageQueryDTO pageQueryDTO);
30 |
31 | /**
32 | * 启用禁用员工账号
33 | * @param status
34 | * @param id
35 | */
36 | void startOrStop(Integer status, Long id);
37 |
38 | /**
39 | * 根据id查询员工
40 | * @param id
41 | * @return
42 | */
43 | Employee getById(Long id);
44 |
45 | /**
46 | * 编辑员工信息
47 | * @param employee
48 | */
49 | void updateEmployeeData(Employee employee);
50 | }
51 |
--------------------------------------------------------------------------------
/nginx-1.20.2/conf/fastcgi.conf:
--------------------------------------------------------------------------------
1 |
2 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3 | fastcgi_param QUERY_STRING $query_string;
4 | fastcgi_param REQUEST_METHOD $request_method;
5 | fastcgi_param CONTENT_TYPE $content_type;
6 | fastcgi_param CONTENT_LENGTH $content_length;
7 |
8 | fastcgi_param SCRIPT_NAME $fastcgi_script_name;
9 | fastcgi_param REQUEST_URI $request_uri;
10 | fastcgi_param DOCUMENT_URI $document_uri;
11 | fastcgi_param DOCUMENT_ROOT $document_root;
12 | fastcgi_param SERVER_PROTOCOL $server_protocol;
13 | fastcgi_param REQUEST_SCHEME $scheme;
14 | fastcgi_param HTTPS $https if_not_empty;
15 |
16 | fastcgi_param GATEWAY_INTERFACE CGI/1.1;
17 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
18 |
19 | fastcgi_param REMOTE_ADDR $remote_addr;
20 | fastcgi_param REMOTE_PORT $remote_port;
21 | fastcgi_param SERVER_ADDR $server_addr;
22 | fastcgi_param SERVER_PORT $server_port;
23 | fastcgi_param SERVER_NAME $server_name;
24 |
25 | # PHP only, required if PHP was built with --enable-force-cgi-redirect
26 | fastcgi_param REDIRECT_STATUS 200;
27 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/AddressBook.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | * 地址簿
12 | */
13 | @Data
14 | @Builder
15 | @NoArgsConstructor
16 | @AllArgsConstructor
17 | public class AddressBook implements Serializable {
18 |
19 | private static final long serialVersionUID = 1L;
20 |
21 | private Long id;
22 |
23 | //用户id
24 | private Long userId;
25 |
26 | //收货人
27 | private String consignee;
28 |
29 | //手机号
30 | private String phone;
31 |
32 | //性别 0 女 1 男
33 | private String sex;
34 |
35 | //省级区划编号
36 | private String provinceCode;
37 |
38 | //省级名称
39 | private String provinceName;
40 |
41 | //市级区划编号
42 | private String cityCode;
43 |
44 | //市级名称
45 | private String cityName;
46 |
47 | //区级区划编号
48 | private String districtCode;
49 |
50 | //区级名称
51 | private String districtName;
52 |
53 | //详细地址
54 | private String detail;
55 |
56 | //标签
57 | private String label;
58 |
59 | //是否默认 0否 1是
60 | private Integer isDefault;
61 | }
62 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/admin/ShopController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.admin;
2 |
3 | import com.sky.result.Result;
4 | import io.swagger.annotations.ApiOperation;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.data.redis.core.RedisTemplate;
7 | import org.springframework.web.bind.annotation.*;
8 |
9 | /**
10 | * @author Mark
11 | * @date 2024/2/12
12 | */
13 |
14 | @RestController("adminShopController")
15 | @RequestMapping("/admin/shop")
16 | @ApiOperation("店铺操作相关接口")
17 | public class ShopController {
18 | public static final String KEY = "SHOP_STATUS";
19 |
20 | @Autowired
21 | private RedisTemplate redisTemplate;
22 |
23 | /**
24 | * 获取店铺营业状态
25 | * @return
26 | */
27 | @GetMapping("/status")
28 | public Result getStatus(){
29 | Integer status = (Integer) redisTemplate.opsForValue().get(KEY);
30 | return Result.success(status);
31 | }
32 |
33 | /**
34 | * 设置店铺营业状态
35 | * @param status
36 | * @return
37 | */
38 | @PutMapping("/{status}")
39 | public Result setStatus(@PathVariable Integer status){
40 | redisTemplate.opsForValue().set(KEY, status);
41 | return Result.success();
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/SetmealDishMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.sky.entity.SetmealDish;
4 | import org.apache.ibatis.annotations.Delete;
5 | import org.apache.ibatis.annotations.Mapper;
6 | import org.apache.ibatis.annotations.Select;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author Mark
12 | * @date 2024/2/11
13 | */
14 | @Mapper
15 | public interface SetmealDishMapper {
16 | /**
17 | * 根据菜品id查询套餐
18 | * @param dishIds
19 | * @return
20 | */
21 | List getSetmealsByDishIds(List dishIds);
22 |
23 | /**
24 | * 根据套餐id删除套餐和菜品的关联关系
25 | * @param ids
26 | */
27 | void deleteBatch(List ids);
28 |
29 | /**
30 | * 根据套餐id删除
31 | * @param setmealId
32 | */
33 | @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
34 | void deleteBySetmealId(Long setmealId);
35 |
36 | /**
37 | * 根据套餐id查询套餐和菜品的关联关系
38 | * @param setmealId
39 | * @return
40 | */
41 | @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
42 | List getBySetmealId(Long setmealId);
43 |
44 | /**
45 | * 批量插入
46 | * @param setmealDishes
47 | */
48 | void insertBatch(List setmealDishes);
49 | }
50 |
--------------------------------------------------------------------------------
/nginx-1.20.2/contrib/unicode2nginx/unicode-to-nginx.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl -w
2 |
3 | # Convert unicode mappings to nginx configuration file format.
4 |
5 | # You may find useful mappings in various places, including
6 | # unicode.org official site:
7 | #
8 | # http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT
9 | # http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
10 |
11 | # Needs perl 5.6 or later.
12 |
13 | # Written by Maxim Dounin, mdounin@mdounin.ru
14 |
15 | ###############################################################################
16 |
17 | require 5.006;
18 |
19 | while (<>) {
20 | # Skip comments and empty lines
21 |
22 | next if /^#/;
23 | next if /^\s*$/;
24 | chomp;
25 |
26 | # Convert mappings
27 |
28 | if (/^\s*0x(..)\s*0x(....)\s*(#.*)/) {
29 | # Mapping "#"
30 | my $cs_code = $1;
31 | my $un_code = $2;
32 | my $un_name = $3;
33 |
34 | # Produce UTF-8 sequence from character code;
35 |
36 | my $un_utf8 = join('',
37 | map { sprintf("%02X", $_) }
38 | unpack("U0C*", pack("U", hex($un_code)))
39 | );
40 |
41 | print " $cs_code $un_utf8 ; $un_name\n";
42 |
43 | } else {
44 | warn "Unrecognized line: '$_'";
45 | }
46 | }
47 |
48 | ###############################################################################
49 |
--------------------------------------------------------------------------------
/sky-common/src/main/java/com/sky/constant/MessageConstant.java:
--------------------------------------------------------------------------------
1 | package com.sky.constant;
2 |
3 | /**
4 | * 信息提示常量类
5 | */
6 | public class MessageConstant {
7 |
8 | public static final String PASSWORD_ERROR = "密码错误";
9 | public static final String ACCOUNT_NOT_FOUND = "账号不存在";
10 | public static final String ACCOUNT_LOCKED = "账号被锁定";
11 | public static final String UNKNOWN_ERROR = "未知错误";
12 | public static final String USER_NOT_LOGIN = "用户未登录";
13 | public static final String CATEGORY_BE_RELATED_BY_SETMEAL = "当前分类关联了套餐,不能删除";
14 | public static final String CATEGORY_BE_RELATED_BY_DISH = "当前分类关联了菜品,不能删除";
15 | public static final String SHOPPING_CART_IS_NULL = "购物车数据为空,不能下单";
16 | public static final String ADDRESS_BOOK_IS_NULL = "用户地址为空,不能下单";
17 | public static final String LOGIN_FAILED = "登录失败";
18 | public static final String UPLOAD_FAILED = "文件上传失败";
19 | public static final String SETMEAL_ENABLE_FAILED = "套餐内包含未启售菜品,无法启售";
20 | public static final String PASSWORD_EDIT_FAILED = "密码修改失败";
21 | public static final String DISH_ON_SALE = "起售中的菜品不能删除";
22 | public static final String SETMEAL_ON_SALE = "起售中的套餐不能删除";
23 | public static final String DISH_BE_RELATED_BY_SETMEAL = "当前菜品关联了套餐,不能删除";
24 | public static final String ORDER_STATUS_ERROR = "订单状态错误";
25 | public static final String ORDER_NOT_FOUND = "订单不存在";
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/ReportService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.vo.OrderReportVO;
4 | import com.sky.vo.SalesTop10ReportVO;
5 | import com.sky.vo.TurnoverReportVO;
6 | import com.sky.vo.UserReportVO;
7 |
8 | import javax.servlet.http.HttpServletResponse;
9 | import java.io.IOException;
10 | import java.time.LocalDate;
11 | import java.time.LocalDateTime;
12 |
13 | /**
14 | * @author Mark
15 | * @date 2024/2/25
16 | */
17 | public interface ReportService {
18 |
19 | /**
20 | * 获取统计营业额
21 | * @param begin
22 | * @param end
23 | * @return
24 | */
25 | TurnoverReportVO getTurnoverStatistics(LocalDate begin, LocalDate end);
26 |
27 | /**
28 | * 用户数量统计
29 | * @param begin
30 | * @param end
31 | * @return
32 | */
33 | UserReportVO getUserSratistics(LocalDate begin, LocalDate end);
34 |
35 | /**
36 | * 订单统计
37 | * @param begin
38 | * @param end
39 | * @return
40 | */
41 | OrderReportVO getOrderStatistics(LocalDate begin, LocalDate end);
42 |
43 | /**
44 | * 获取销量前十的菜品
45 | * @param begin
46 | * @param end
47 | * @return
48 | */
49 | SalesTop10ReportVO getSalesTop10(LocalDate begin, LocalDate end);
50 |
51 | /**
52 | * 导出数据
53 | * @param response
54 | */
55 | void exportData(HttpServletResponse response) throws Exception;
56 | }
57 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/EmployeeMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
16 |
17 |
18 |
19 | update employee
20 |
21 | name = #{name},
22 | username = #{username},
23 | password = #{password},
24 | phone = #{phone},
25 | id_number = #{idNumber},
26 | update_time = #{updateTime},
27 | update_user = #{updateUser},
28 | status = #{status},
29 |
30 | where id = #{id}
31 |
32 |
33 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/handler/GlobalExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.sky.handler;
2 |
3 | import com.sky.exception.BaseException;
4 | import com.sky.result.Result;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.web.bind.annotation.ExceptionHandler;
7 | import org.springframework.web.bind.annotation.RestControllerAdvice;
8 |
9 | import java.sql.SQLIntegrityConstraintViolationException;
10 |
11 | /**
12 | * 全局异常处理器,处理项目中抛出的业务异常
13 | */
14 | @RestControllerAdvice
15 | @Slf4j
16 | public class GlobalExceptionHandler {
17 |
18 | /**
19 | * 捕获业务异常
20 | * @param ex
21 | * @return
22 | */
23 | @ExceptionHandler
24 | public Result exceptionHandler(BaseException ex){
25 | log.error("异常信息:{}", ex.getMessage());
26 | return Result.error(ex.getMessage());
27 | }
28 |
29 | /**
30 | * 处理因为重复而爆出的错误
31 | * @param ex
32 | * @return
33 | */
34 | @ExceptionHandler()
35 | public Result SQLIntegrityConstraintViolationException(SQLIntegrityConstraintViolationException ex){
36 | String message = ex.getMessage();
37 | if (message.contains("Duplicate entry")){
38 | String[] s = message.split(" ");
39 | String username = s[2];
40 | String msg = username + "已存在";
41 | return Result.error(msg);
42 | }else {
43 | return Result.error("未知错误");
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/ShoppingCartMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
22 |
23 |
24 | insert into shopping_cart
25 | (name, image, user_id, dish_id, setmeal_id, dish_flavor, number, amount, create_time)
26 | values
27 |
28 | (#{sc.name},#{sc.image},#{sc.userId},#{sc.dishId},#{sc.setmealId},#{sc.dishFlavor},#{sc.number},#{sc.amount},#{sc.createTime})
29 |
30 |
31 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/DishService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.dto.DishDTO;
4 | import com.sky.dto.DishPageQueryDTO;
5 | import com.sky.entity.Dish;
6 | import com.sky.result.PageResult;
7 | import com.sky.vo.DishVO;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author Mark
13 | * @date 2024/2/10
14 | */
15 | public interface DishService {
16 | /**
17 | * 新增菜品
18 | * @param dishDTO
19 | */
20 | void saveWithFlavor(DishDTO dishDTO);
21 |
22 | /**
23 | * 菜品分页功能
24 | * @param queryDTO
25 | * @return
26 | */
27 | PageResult page(DishPageQueryDTO queryDTO);
28 |
29 | /**
30 | * 菜品批量删除
31 | * @param ids
32 | */
33 | void deleteBatch(List ids);
34 |
35 | /**
36 | * 对菜品进行起售禁售
37 | * @param status
38 | * @param id
39 | */
40 | void startOrStop(Integer status, Long id);
41 |
42 | /**
43 | * 根据id查询菜品和关联的口味数据
44 | * @param id
45 | * @return
46 | */
47 | DishVO getByIdWithFlavor(Long id);
48 |
49 | /**
50 | * 修改菜品信息
51 | * @param dishDTO
52 | */
53 | void updateWithFlavor(DishDTO dishDTO);
54 |
55 | /**
56 | * 根据分类id查询菜品
57 | * @param categoryId
58 | * @return
59 | */
60 | List list(Long categoryId);
61 |
62 | /**
63 | * 条件查询菜品和口味
64 | * @param dish
65 | * @return
66 | */
67 | List listWithFlavor(Dish dish);
68 | }
69 |
--------------------------------------------------------------------------------
/nginx-1.20.2/contrib/geo2nginx.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl -w
2 |
3 | # (c) Andrei Nigmatulin, 2005
4 | #
5 | # this script provided "as is", without any warranties. use it at your own risk.
6 | #
7 | # special thanx to Andrew Sitnikov for perl port
8 | #
9 | # this script converts CSV geoip database (free download at http://www.maxmind.com/app/geoip_country)
10 | # to format, suitable for use with nginx_http_geo module (http://sysoev.ru/nginx)
11 | #
12 | # for example, line with ip range
13 | #
14 | # "62.16.68.0","62.16.127.255","1041253376","1041268735","RU","Russian Federation"
15 | #
16 | # will be converted to four subnetworks:
17 | #
18 | # 62.16.68.0/22 RU;
19 | # 62.16.72.0/21 RU;
20 | # 62.16.80.0/20 RU;
21 | # 62.16.96.0/19 RU;
22 |
23 |
24 | use warnings;
25 | use strict;
26 |
27 | while( ){
28 | if (/"[^"]+","[^"]+","([^"]+)","([^"]+)","([^"]+)"/){
29 | print_subnets($1, $2, $3);
30 | }
31 | }
32 |
33 | sub print_subnets {
34 | my ($a1, $a2, $c) = @_;
35 | my $l;
36 | while ($a1 <= $a2) {
37 | for ($l = 0; ($a1 & (1 << $l)) == 0 && ($a1 + ((1 << ($l + 1)) - 1)) <= $a2; $l++){};
38 | print long2ip($a1) . "/" . (32 - $l) . " " . $c . ";\n";
39 | $a1 += (1 << $l);
40 | }
41 | }
42 |
43 | sub long2ip {
44 | my $ip = shift;
45 |
46 | my $str = 0;
47 |
48 | $str = ($ip & 255);
49 |
50 | $ip >>= 8;
51 | $str = ($ip & 255).".$str";
52 |
53 | $ip >>= 8;
54 | $str = ($ip & 255).".$str";
55 |
56 | $ip >>= 8;
57 | $str = ($ip & 255).".$str";
58 | }
59 |
--------------------------------------------------------------------------------
/nginx-1.20.2/docs/LICENSE:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2002-2021 Igor Sysoev
3 | * Copyright (C) 2011-2021 Nginx, Inc.
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * 2. Redistributions in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in the
13 | * documentation and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 | * SUCH DAMAGE.
26 | */
27 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/SetmealService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.dto.SetmealDTO;
4 | import com.sky.dto.SetmealPageQueryDTO;
5 | import com.sky.entity.Setmeal;
6 | import com.sky.result.PageResult;
7 | import com.sky.vo.DishItemVO;
8 | import com.sky.vo.SetmealVO;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * @author Mark
14 | * @date 2024/2/12
15 | */
16 | public interface SetmealService {
17 | /**
18 | * 套餐分页查询
19 | * @param setmealPageQueryDTO
20 | * @return
21 | */
22 | PageResult pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);
23 |
24 | /**
25 | * 新增套餐
26 | * @param setmealDTO
27 | */
28 | void saveWithDish(SetmealDTO setmealDTO);
29 |
30 | /**
31 | * 套餐起售、停售
32 | * @param status
33 | * @param id
34 | */
35 | void startOrStop(Integer status, Long id);
36 |
37 | /**
38 | * 批量删除套餐
39 | * @param ids
40 | */
41 | void deleteBatch(List ids);
42 |
43 | /**
44 | * 根据id查询套餐
45 | * @param id
46 | * @return
47 | */
48 | SetmealVO getByIdWithDish(Long id);
49 |
50 | /**
51 | * 修改菜品
52 | * @param setmealDTO
53 | */
54 | void update(SetmealDTO setmealDTO);
55 |
56 | /**
57 | * 条件查询
58 | * @param setmeal
59 | * @return
60 | */
61 | List list(Setmeal setmeal);
62 |
63 | /**
64 | * 根据id查询菜品选项
65 | * @param id
66 | * @return
67 | */
68 | List getDishItemById(Long id);
69 | }
70 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/CategoryMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.github.pagehelper.Page;
4 | import com.sky.anotation.AutoFill;
5 | import com.sky.enumeration.OperationType;
6 | import com.sky.dto.CategoryPageQueryDTO;
7 | import com.sky.entity.Category;
8 | import org.apache.ibatis.annotations.Delete;
9 | import org.apache.ibatis.annotations.Insert;
10 | import org.apache.ibatis.annotations.Mapper;
11 | import java.util.List;
12 |
13 | @Mapper
14 | public interface CategoryMapper {
15 |
16 | /**
17 | * 插入数据
18 | * @param category
19 | */
20 | @Insert("insert into category(type, name, sort, status, create_time, update_time, create_user, update_user)" +
21 | " VALUES" +
22 | " (#{type}, #{name}, #{sort}, #{status}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})")
23 | @AutoFill(OperationType.INSERT)
24 | void insert(Category category);
25 |
26 | /**
27 | * 分页查询
28 | * @param categoryPageQueryDTO
29 | * @return
30 | */
31 | Page pageQuery(CategoryPageQueryDTO categoryPageQueryDTO);
32 |
33 | /**
34 | * 根据id删除分类
35 | * @param id
36 | */
37 | @Delete("delete from category where id = #{id}")
38 | void deleteById(Long id);
39 |
40 | /**
41 | * 根据id修改分类
42 | * @param category
43 | */
44 | @AutoFill(OperationType.UPDATE)
45 | void update(Category category);
46 |
47 | /**
48 | * 根据类型查询分类
49 | * @param type
50 | * @return
51 | */
52 | List list(Integer type);
53 | }
54 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/AddressBookMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
19 |
20 |
21 | update address_book
22 |
23 |
24 | consignee = #{consignee},
25 |
26 |
27 | sex = #{sex},
28 |
29 |
30 | phone = #{phone},
31 |
32 |
33 | detail = #{detail},
34 |
35 |
36 | label = #{label},
37 |
38 |
39 | is_default = #{isDefault},
40 |
41 |
42 | where id = #{id}
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/EmployeeMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.github.pagehelper.Page;
4 | import com.sky.anotation.AutoFill;
5 | import com.sky.dto.EmployeePageQueryDTO;
6 | import com.sky.entity.Employee;
7 | import com.sky.enumeration.OperationType;
8 | import org.apache.ibatis.annotations.Insert;
9 | import org.apache.ibatis.annotations.Mapper;
10 | import org.apache.ibatis.annotations.Select;
11 |
12 | @Mapper
13 | public interface EmployeeMapper {
14 |
15 | /**
16 | * 根据用户名查询员工
17 | * @param username
18 | * @return
19 | */
20 | @Select("select * from employee where username = #{username}")
21 | Employee getByUsername(String username);
22 |
23 | /**
24 | * 新增员工
25 | * @param employee
26 | */
27 | @Insert("insert into employee (name, username, password, phone, sex, id_number, status, create_time, " +
28 | "update_time, create_user, update_user) values (#{name}, #{username}, #{password}, #{phone}, " +
29 | "#{sex}, #{idNumber}, #{status}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})")
30 | @AutoFill(OperationType.INSERT)
31 | void insert(Employee employee);
32 |
33 | /**
34 | * 员工分页查询
35 | * @param pageQueryDTO
36 | * @return
37 | */
38 | Page pageQuery(EmployeePageQueryDTO pageQueryDTO);
39 |
40 | /**
41 | * 员工状态修改
42 | * @param employee
43 | */
44 | @AutoFill(OperationType.UPDATE)
45 | void update(Employee employee);
46 |
47 | /**
48 | * 根据id查询员工
49 | * @param id
50 | * @return
51 | */
52 | @Select("select * from employee where id = #{id}")
53 | Employee getById(Long id);
54 | }
55 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8080
3 |
4 | spring:
5 | profiles:
6 | active: dev
7 | main:
8 | allow-circular-references: true
9 | datasource:
10 | druid:
11 | driver-class-name: ${sky.datasource.driver-class-name}
12 | url: jdbc:mysql://${sky.datasource.host}:${sky.datasource.port}/${sky.datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
13 | username: ${sky.datasource.username}
14 | password: ${sky.datasource.password}
15 | redis:
16 | port: ${spring.redis.port}
17 | password: ${spring.redis.password}
18 | host: ${spring.redis.host}
19 | database: ${spring.redis.database}
20 |
21 |
22 | mybatis:
23 | #mapper配置文件
24 | mapper-locations: classpath:mapper/*.xml
25 | type-aliases-package: com.sky.entity
26 | configuration:
27 | #开启驼峰命名
28 | map-underscore-to-camel-case: true
29 |
30 | logging:
31 | level:
32 | com:
33 | sky:
34 | mapper: debug
35 | service: info
36 | controller: info
37 |
38 | sky:
39 | jwt:
40 | # 设置jwt签名加密时使用的秘钥
41 | admin-secret-key: itcast
42 | # 设置jwt过期时间
43 | admin-ttl: 7200000
44 | # 设置前端传递过来的令牌名称
45 | admin-token-name: token
46 | # 小程序端密钥,过期时间,令牌名称
47 | user-secret-key: itheima
48 | user-ttl: 7200000
49 | user-token-name: authentication
50 | alioss:
51 | endpoint: ${sky.alioss.endpoint}
52 | access-key-id: ${sky.alioss.access-key-id}
53 | access-key-secret: ${sky.alioss.access-key-secret}
54 | bucket-name: ${sky.alioss.bucket-name}
55 | wechat:
56 | appid: ${sky.wechat.appid}
57 | secret: ${sky.wechat.secret}
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/AddressBookMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.sky.entity.AddressBook;
4 | import org.apache.ibatis.annotations.*;
5 | import java.util.List;
6 |
7 | @Mapper
8 | public interface AddressBookMapper {
9 |
10 | /**
11 | * 条件查询
12 | * @param addressBook
13 | * @return
14 | */
15 | List list(AddressBook addressBook);
16 |
17 | /**
18 | * 新增
19 | * @param addressBook
20 | */
21 | @Insert("insert into address_book" +
22 | " (user_id, consignee, phone, sex, province_code, province_name, city_code, city_name, district_code," +
23 | " district_name, detail, label, is_default)" +
24 | " values (#{userId}, #{consignee}, #{phone}, #{sex}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName}," +
25 | " #{districtCode}, #{districtName}, #{detail}, #{label}, #{isDefault})")
26 | void insert(AddressBook addressBook);
27 |
28 | /**
29 | * 根据id查询
30 | * @param id
31 | * @return
32 | */
33 | @Select("select * from address_book where id = #{id}")
34 | AddressBook getById(Long id);
35 |
36 | /**
37 | * 根据id修改
38 | * @param addressBook
39 | */
40 | void update(AddressBook addressBook);
41 |
42 | /**
43 | * 根据 用户id修改 是否默认地址
44 | * @param addressBook
45 | */
46 | @Update("update address_book set is_default = #{isDefault} where user_id = #{userId}")
47 | void updateIsDefaultByUserId(AddressBook addressBook);
48 |
49 | /**
50 | * 根据id删除地址
51 | * @param id
52 | */
53 | @Delete("delete from address_book where id = #{id}")
54 | void deleteById(Long id);
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/CategoryMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
18 |
19 |
20 | update category
21 |
22 |
23 | type = #{type},
24 |
25 |
26 | name = #{name},
27 |
28 |
29 | sort = #{sort},
30 |
31 |
32 | status = #{status},
33 |
34 |
35 | update_time = #{updateTime},
36 |
37 |
38 | update_user = #{updateUser}
39 |
40 |
41 | where id = #{id}
42 |
43 |
44 |
52 |
53 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/ShoppingCartMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.sky.anotation.AutoFill;
4 | import com.sky.entity.ShoppingCart;
5 | import com.sky.enumeration.OperationType;
6 | import org.apache.ibatis.annotations.Delete;
7 | import org.apache.ibatis.annotations.Insert;
8 | import org.apache.ibatis.annotations.Mapper;
9 | import org.apache.ibatis.annotations.Update;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * @author Mark
15 | * @date 2024/2/16
16 | */
17 |
18 | @Mapper
19 | public interface ShoppingCartMapper {
20 | /**
21 | * 条件查询
22 | * @param shoppingCart
23 | * @return
24 | */
25 | List list(ShoppingCart shoppingCart);
26 |
27 | /**
28 | * 根据id修改菜品数量
29 | * @param shoppingCart
30 | */
31 | @Update("update shopping_cart set number = #{number} where id = #{id}")
32 | void updateNumberById(ShoppingCart shoppingCart);
33 |
34 | /**
35 | * 插入购物车数据
36 | * @param shoppingCart
37 | */
38 | @Insert("insert into shopping_cart (name, user_id, dish_id, setmeal_id, dish_flavor, number, amount, image, create_time) " +
39 | " values (#{name},#{userId},#{dishId},#{setmealId},#{dishFlavor},#{number},#{amount},#{image},#{createTime})")
40 | void insert(ShoppingCart shoppingCart);
41 |
42 | /**
43 | * 清空购物车
44 | * @param userId
45 | */
46 | @Delete("delete from shopping_cart where user_id = #{userId}")
47 | void deleteByUserId(Long userId);
48 |
49 | /**
50 | * 清空购物车中的一个商品
51 | * @param id
52 | */
53 | @Delete("delete from shopping_cart where id = #{id}")
54 | void deleteById(Long id);
55 |
56 |
57 | /**
58 | * 批量插入商品
59 | * @param shoppingCartList
60 | */
61 | void insertBatch(List shoppingCartList);
62 | }
63 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/DishController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.constant.StatusConstant;
4 | import com.sky.entity.Dish;
5 | import com.sky.result.Result;
6 | import com.sky.service.DishService;
7 | import com.sky.vo.DishVO;
8 | import io.swagger.annotations.Api;
9 | import io.swagger.annotations.ApiOperation;
10 | import lombok.extern.slf4j.Slf4j;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.data.redis.core.RedisTemplate;
13 | import org.springframework.web.bind.annotation.GetMapping;
14 | import org.springframework.web.bind.annotation.RequestMapping;
15 | import org.springframework.web.bind.annotation.RestController;
16 | import java.util.List;
17 |
18 | @RestController("userDishController")
19 | @RequestMapping("/user/dish")
20 | @Slf4j
21 | @Api(tags = "C端-菜品浏览接口")
22 | public class DishController {
23 | @Autowired
24 | private DishService dishService;
25 |
26 | @Autowired
27 | private RedisTemplate redisTemplate;
28 |
29 | /**
30 | * 根据分类id查询菜品
31 | *
32 | * @param categoryId
33 | * @return
34 | */
35 | @GetMapping("/list")
36 | @ApiOperation("根据分类id查询菜品")
37 | public Result> list(Long categoryId) {
38 | String keys = "dish_" + categoryId;
39 | List list = (List) redisTemplate.opsForValue().get(keys);
40 | if (list != null && list.size() > 0){
41 | return Result.success(list);
42 | }
43 | Dish dish = new Dish();
44 | dish.setCategoryId(categoryId);
45 | dish.setStatus(StatusConstant.ENABLE);//查询起售中的菜品
46 |
47 | list = dishService.listWithFlavor(dish);
48 |
49 | redisTemplate.opsForValue().set(keys, list);
50 |
51 | return Result.success(list);
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/UserController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.constant.JwtClaimsConstant;
4 | import com.sky.dto.UserLoginDTO;
5 | import com.sky.entity.User;
6 | import com.sky.properties.JwtProperties;
7 | import com.sky.result.Result;
8 | import com.sky.service.UserService;
9 | import com.sky.utils.JwtUtil;
10 | import com.sky.vo.UserLoginVO;
11 | import io.swagger.annotations.ApiOperation;
12 | import org.springframework.beans.factory.annotation.Autowired;
13 | import org.springframework.web.bind.annotation.PostMapping;
14 | import org.springframework.web.bind.annotation.RequestBody;
15 | import org.springframework.web.bind.annotation.RequestMapping;
16 | import org.springframework.web.bind.annotation.RestController;
17 |
18 | import java.util.HashMap;
19 | import java.util.Map;
20 |
21 | /**
22 | * @author Mark
23 | * @date 2024/2/15
24 | */
25 |
26 | @RestController
27 | @RequestMapping("/user/user")
28 | public class UserController {
29 | @Autowired
30 | private UserService userService;
31 |
32 | @Autowired
33 | private JwtProperties jwtProperties;
34 |
35 | /**
36 | * 微信登录
37 | * @param userLoginDTO
38 | * @return
39 | */
40 | @PostMapping("/login")
41 | @ApiOperation("微信登录")
42 | public Result login(@RequestBody UserLoginDTO userLoginDTO){
43 | User user = userService.wxLogin(userLoginDTO);
44 |
45 | Map claims = new HashMap<>();
46 | claims.put(JwtClaimsConstant.USER_ID, user.getId());
47 | String token = JwtUtil.createJWT(jwtProperties.getUserSecretKey(), jwtProperties.getUserTtl(), claims);
48 |
49 | UserLoginVO userLoginVO = UserLoginVO.builder().id(user.getId()).openid(user.getOpenid()).token(token).build();
50 |
51 | return Result.success(userLoginVO);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/admin/CommonController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.admin;
2 |
3 | import com.sky.constant.MessageConstant;
4 | import com.sky.result.Result;
5 | import com.sky.utils.AliOssUtil;
6 | import io.swagger.annotations.Api;
7 | import io.swagger.annotations.ApiOperation;
8 | import lombok.extern.slf4j.Slf4j;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.web.bind.annotation.PostMapping;
11 | import org.springframework.web.bind.annotation.RequestBody;
12 | import org.springframework.web.bind.annotation.RequestMapping;
13 | import org.springframework.web.bind.annotation.RestController;
14 | import org.springframework.web.multipart.MultipartFile;
15 |
16 | import java.io.IOException;
17 | import java.util.UUID;
18 |
19 | import static org.apache.xmlbeans.impl.common.XBeanDebug.log;
20 |
21 | /**
22 | * @author Mark
23 | * @date 2024/2/10
24 | */
25 |
26 | @RestController
27 | @RequestMapping("/admin/common")
28 | @Api(tags = "通用接口")
29 | @Slf4j
30 | public class CommonController {
31 | @Autowired
32 | private AliOssUtil aliOssUtil;
33 |
34 | /**
35 | * 文件上传
36 | * @param file
37 | * @return
38 | */
39 | @PostMapping("/upload")
40 | @ApiOperation("文件上传")
41 | public Result upload(MultipartFile file){
42 | String originalFilename = file.getOriginalFilename();
43 | String substring = originalFilename.substring(originalFilename.lastIndexOf("."));
44 | String name = UUID.randomUUID().toString() + substring;
45 |
46 | try {
47 | String upload = aliOssUtil.upload(file.getBytes(), name);
48 | return Result.success(upload);
49 | } catch (IOException e) {
50 | log("文件上传失败: {}" + e.getMessage());
51 | }
52 | return Result.error(MessageConstant.UPLOAD_FAILED);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 苍穹外卖
2 |
3 | ## 一.项目介绍
4 |
5 | 本项目(苍穹外卖)是专门为餐饮企业(餐厅、饭店)定制的一款软件产品,包括 系统管理后台 和 小程序端应用 两部分。其中系统管理后台主要提供给餐饮企业内部员工使用,可以对餐厅的分类、菜品、套餐、订单、员工等进行管理维护,对餐厅的各类数据进行统计,同时也可进行来单语音播报功能。小程序端主要提供给消费者使用,可以在线浏览菜品、添加购物车、下单、支付、催单等。
6 |
7 | ## 二.功能架构图
8 |
9 |
10 |
11 | 
12 |
13 | ### (1).管理端功能
14 |
15 | 员工登录/退出 , 员工信息管理 , 分类管理 , 菜品管理 , 套餐管理 , 菜品口味管理 , 订单管理 ,数据统计,来单提醒。
16 |
17 | ### (2).用户端功能
18 |
19 | 微信登录 , 收件人地址管理 , 用户历史订单查询 , 菜品规格查询 , 购物车功能 , 下单 , 支付、分类及菜品浏览。
20 |
21 | ## 三.技术选型
22 |
23 | 
24 |
25 | ### (1). 用户层
26 |
27 | 本项目中在构建系统管理后台的前端页面,我们会用到H5、Vue.js、ElementUI、apache echarts(展示图表)等技术。而在构建移动端应用时,我们会使用到微信小程序。
28 |
29 | ### (2). 网关层
30 |
31 | Nginx是一个服务器,主要用来作为Http服务器,部署静态资源,访问性能高。在Nginx中还有两个比较重要的作用: 反向代理和负载均衡, 在进行项目部署时,要实现Tomcat的负载均衡,就可以通过Nginx来实现。
32 |
33 | ### (3). 应用层
34 |
35 | SpringBoot: 快速构建Spring项目, 采用 "约定优于配置" 的思想, 简化Spring项目的配置开发。 SpringMVC:SpringMVC是spring框架的一个模块,springmvc和spring无需通过中间整合层进行整合,可以无缝集成。 Spring Task: 由Spring提供的定时任务框架。 httpclient: 主要实现了对http请求的发送。 Spring Cache: 由Spring提供的数据缓存框架 JWT: 用于对应用程序上的用户进行身份验证的标记。 阿里云OSS: 对象存储服务,在项目中主要存储文件,如图片等。 Swagger: 可以自动的帮助开发人员生成接口文档,并对接口进行测试。 POI: 封装了对Excel表格的常用操作。 WebSocket: 一种通信网络协议,使客户端和服务器之间的数据交换更加简单,用于项目的来单、催单功能实现。
36 |
37 | ### (4). 数据层
38 |
39 | MySQL: 关系型数据库, 本项目的核心业务数据都会采用MySQL进行存储。 Redis: 基于key-value格式存储的内存数据库, 访问速度快, 经常使用它做缓存。 Mybatis: 本项目持久层将会使用Mybatis开发。 pagehelper: 分页插件。 spring data redis: 简化java代码操作Redis的API。
40 |
41 | ### (5). 工具
42 |
43 | git: 版本控制工具, 在团队协作中, 使用该工具对项目中的代码进行管理。 maven: 项目构建工具。 junit:单元测试工具,开发人员功能实现完毕后,需要通过junit对功能进行单元测试。 postman: 接口测工具,模拟用户发起的各类HTTP请求,获取对应的响应结果。
44 |
45 | ## 四.开发环境
46 |
47 | 
48 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/sky/index.html:
--------------------------------------------------------------------------------
1 | 瑞吉外卖
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/SetmealController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.constant.StatusConstant;
4 | import com.sky.entity.Setmeal;
5 | import com.sky.result.Result;
6 | import com.sky.service.SetmealService;
7 | import com.sky.vo.DishItemVO;
8 | import io.swagger.annotations.Api;
9 | import io.swagger.annotations.ApiOperation;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.cache.annotation.Cacheable;
12 | import org.springframework.web.bind.annotation.GetMapping;
13 | import org.springframework.web.bind.annotation.PathVariable;
14 | import org.springframework.web.bind.annotation.RequestMapping;
15 | import org.springframework.web.bind.annotation.RestController;
16 | import java.util.List;
17 |
18 | @RestController("userSetmealController")
19 | @RequestMapping("/user/setmeal")
20 | @Api(tags = "C端-套餐浏览接口")
21 | public class SetmealController {
22 | @Autowired
23 | private SetmealService setmealService;
24 |
25 | /**
26 | * 条件查询
27 | *
28 | * @param categoryId
29 | * @return
30 | */
31 | @GetMapping("/list")
32 | @Cacheable(cacheNames = "setmealCache", key = "#categoryId")
33 | @ApiOperation("根据分类id查询套餐")
34 | public Result> list(Long categoryId) {
35 | Setmeal setmeal = new Setmeal();
36 | setmeal.setCategoryId(categoryId);
37 | setmeal.setStatus(StatusConstant.ENABLE);
38 |
39 | List list = setmealService.list(setmeal);
40 | return Result.success(list);
41 | }
42 |
43 | /**
44 | * 根据套餐id查询包含的菜品列表
45 | *
46 | * @param id
47 | * @return
48 | */
49 | @GetMapping("/dish/{id}")
50 | @ApiOperation("根据套餐id查询包含的菜品列表")
51 | public Result> dishList(@PathVariable("id") Long id) {
52 | List list = setmealService.getDishItemById(id);
53 | return Result.success(list);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/task/OrderTask.java:
--------------------------------------------------------------------------------
1 | package com.sky.task;
2 |
3 | import com.sky.entity.Orders;
4 | import com.sky.mapper.OrdersMapper;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.scheduling.annotation.Scheduled;
8 | import org.springframework.stereotype.Component;
9 |
10 | import java.time.LocalDateTime;
11 | import java.util.List;
12 |
13 | /**
14 | * @author Mark
15 | * @date 2024/2/24
16 | */
17 |
18 | /**
19 | * 定时任务触发
20 | */
21 | @Component
22 | @Slf4j
23 | public class OrderTask {
24 | @Autowired
25 | private OrdersMapper ordersMapper;
26 |
27 | /**
28 | * 处理超时订单(每分钟触发一次)
29 | */
30 | @Scheduled(cron = "0 * * * * ? ")
31 | public void processTimeoutOrder(){
32 |
33 | LocalDateTime time = LocalDateTime.now().plusMinutes(-15);
34 |
35 | List orders = ordersMapper.getByStatusAndOrderTimeLT(Orders.PENDING_PAYMENT, time);
36 |
37 | if(orders != null && orders.size() > 0){
38 | for (Orders order : orders) {
39 | order.setStatus(Orders.CANCELLED);
40 | order.setCancelReason("订单超时未支付,已取消");
41 | order.setCancelTime(LocalDateTime.now());
42 | ordersMapper.update(order);
43 | }
44 | }
45 | }
46 |
47 |
48 | /**
49 | * 处理一直处于派送中状态的订单(每天凌晨一点触发)
50 | */
51 | @Scheduled(cron = "0 0 1 * * ?")
52 | public void processDeliveryOrder(){
53 | LocalDateTime time = LocalDateTime.now().plusMinutes(-60);
54 |
55 | List ordersList = ordersMapper.getByStatusAndOrderTimeLT(Orders.DELIVERY_IN_PROGRESS, time);
56 |
57 | if(ordersList != null && ordersList.size() > 0){
58 | for (Orders orders : ordersList) {
59 | orders.setStatus(Orders.COMPLETED);
60 | ordersMapper.update(orders);
61 | }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/websocket/WebSocketServer.java:
--------------------------------------------------------------------------------
1 | package com.sky.websocket;
2 |
3 | import org.springframework.stereotype.Component;
4 | import javax.websocket.OnClose;
5 | import javax.websocket.OnMessage;
6 | import javax.websocket.OnOpen;
7 | import javax.websocket.Session;
8 | import javax.websocket.server.PathParam;
9 | import javax.websocket.server.ServerEndpoint;
10 | import java.util.Collection;
11 | import java.util.HashMap;
12 | import java.util.Map;
13 |
14 | /**
15 | * WebSocket服务
16 | */
17 | @Component
18 | @ServerEndpoint("/ws/{sid}")
19 | public class WebSocketServer {
20 |
21 | //存放会话对象
22 | private static Map sessionMap = new HashMap();
23 |
24 | /**
25 | * 连接建立成功调用的方法
26 | */
27 | @OnOpen
28 | public void onOpen(Session session, @PathParam("sid") String sid) {
29 | System.out.println("客户端:" + sid + "建立连接");
30 | sessionMap.put(sid, session);
31 | }
32 |
33 | /**
34 | * 收到客户端消息后调用的方法
35 | *
36 | * @param message 客户端发送过来的消息
37 | */
38 | @OnMessage
39 | public void onMessage(String message, @PathParam("sid") String sid) {
40 | System.out.println("收到来自客户端:" + sid + "的信息:" + message);
41 | }
42 |
43 | /**
44 | * 连接关闭调用的方法
45 | *
46 | * @param sid
47 | */
48 | @OnClose
49 | public void onClose(@PathParam("sid") String sid) {
50 | System.out.println("连接断开:" + sid);
51 | sessionMap.remove(sid);
52 | }
53 |
54 | /**
55 | * 群发
56 | *
57 | * @param message
58 | */
59 | public void sendToAllClient(String message) {
60 | Collection sessions = sessionMap.values();
61 | for (Session session : sessions) {
62 | try {
63 | //服务器向客户端发送消息
64 | session.getBasicRemote().sendText(message);
65 | } catch (Exception e) {
66 | e.printStackTrace();
67 | }
68 | }
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/DishMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.github.pagehelper.Page;
4 | import com.sky.anotation.AutoFill;
5 | import com.sky.dto.DishPageQueryDTO;
6 | import com.sky.entity.Dish;
7 | import com.sky.entity.DishFlavor;
8 | import com.sky.enumeration.OperationType;
9 | import com.sky.vo.DishVO;
10 | import org.apache.ibatis.annotations.Mapper;
11 | import org.apache.ibatis.annotations.Select;
12 |
13 | import java.util.List;
14 | import java.util.Map;
15 |
16 | @Mapper
17 | public interface DishMapper {
18 |
19 | /**
20 | * 根据分类id查询菜品数量
21 | * @param categoryId
22 | * @return
23 | */
24 | @Select("select count(id) from dish where category_id = #{categoryId}")
25 | Integer countByCategoryId(Long categoryId);
26 |
27 | @AutoFill(OperationType.INSERT)
28 | void insert(Dish dish);
29 |
30 | void insertBatch(List flavors);
31 |
32 | /**
33 | * 菜品分页功能
34 | * @param queryDTO
35 | * @return
36 | */
37 | Page pageQuery(DishPageQueryDTO queryDTO);
38 |
39 | /**
40 | * 通过id找菜品
41 | * @param id
42 | * @return
43 | */
44 | @Select("select * from dish where id = #{id};")
45 | Dish getById(Long id);
46 |
47 | /**
48 | * 批量删除
49 | * @param dishIds
50 | */
51 | void deleteBatch(List dishIds);
52 |
53 | @AutoFill(OperationType.UPDATE)
54 | void update(Dish dish);
55 |
56 | /**
57 | * 根据分类id查询菜品
58 | * @param dish
59 | * @return
60 | */
61 | List list(Dish dish);
62 |
63 | /**
64 | * 根据套餐id查询菜品
65 | * @param setmealId
66 | * @return
67 | */
68 | @Select("select a.* from dish a left join setmeal_dish b on a.id = b.dish_id where b.setmeal_id = #{setmealId}")
69 | List getBySetmealId(Long setmealId);
70 |
71 | /**
72 | * 根据条件统计菜品数量
73 | * @param map
74 | * @return
75 | */
76 | Integer countByMap(Map map);
77 | }
78 |
--------------------------------------------------------------------------------
/sky-common/src/main/java/com/sky/utils/JwtUtil.java:
--------------------------------------------------------------------------------
1 | package com.sky.utils;
2 |
3 | import io.jsonwebtoken.Claims;
4 | import io.jsonwebtoken.JwtBuilder;
5 | import io.jsonwebtoken.Jwts;
6 | import io.jsonwebtoken.SignatureAlgorithm;
7 | import java.nio.charset.StandardCharsets;
8 | import java.util.Date;
9 | import java.util.Map;
10 |
11 | public class JwtUtil {
12 | /**
13 | * 生成jwt
14 | * 使用Hs256算法, 私匙使用固定秘钥
15 | *
16 | * @param secretKey jwt秘钥
17 | * @param ttlMillis jwt过期时间(毫秒)
18 | * @param claims 设置的信息
19 | * @return
20 | */
21 | public static String createJWT(String secretKey, long ttlMillis, Map claims) {
22 | // 指定签名的时候使用的签名算法,也就是header那部分
23 | SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
24 |
25 | // 生成JWT的时间
26 | long expMillis = System.currentTimeMillis() + ttlMillis;
27 | Date exp = new Date(expMillis);
28 |
29 | // 设置jwt的body
30 | JwtBuilder builder = Jwts.builder()
31 | // 如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
32 | .setClaims(claims)
33 | // 设置签名使用的签名算法和签名使用的秘钥
34 | .signWith(signatureAlgorithm, secretKey.getBytes(StandardCharsets.UTF_8))
35 | // 设置过期时间
36 | .setExpiration(exp);
37 |
38 | return builder.compact();
39 | }
40 |
41 | /**
42 | * Token解密
43 | *
44 | * @param secretKey jwt秘钥 此秘钥一定要保留好在服务端, 不能暴露出去, 否则sign就可以被伪造, 如果对接多个客户端建议改造成多个
45 | * @param token 加密后的token
46 | * @return
47 | */
48 | public static Claims parseJWT(String secretKey, String token) {
49 | // 得到DefaultJwtParser
50 | Claims claims = Jwts.parser()
51 | // 设置签名的秘钥
52 | .setSigningKey(secretKey.getBytes(StandardCharsets.UTF_8))
53 | // 设置需要解析的jwt
54 | .parseClaimsJws(token).getBody();
55 | return claims;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/ShoppingCartController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.dto.ShoppingCartDTO;
4 | import com.sky.entity.ShoppingCart;
5 | import com.sky.result.Result;
6 | import com.sky.service.ShoppingCartService;
7 | import io.swagger.annotations.ApiOperation;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.web.bind.annotation.*;
10 |
11 | import java.util.List;
12 |
13 | /**
14 | * @author Mark
15 | * @date 2024/2/16
16 | */
17 |
18 | @RestController
19 | @RequestMapping("/user/shoppingCart")
20 | @ApiOperation("购物车接口")
21 | public class ShoppingCartController {
22 | @Autowired
23 | private ShoppingCartService shoppingCartService;
24 |
25 | /**
26 | * 添加购物车
27 | * @param shoppingCartDTO
28 | * @return
29 | */
30 | @PostMapping("/add")
31 | @ApiOperation("添加购物车")
32 | public Result add(@RequestBody ShoppingCartDTO shoppingCartDTO){
33 | shoppingCartService.addShoppingCart(shoppingCartDTO);
34 | return Result.success();
35 | }
36 |
37 | /**
38 | * 查看购物车
39 | * @return
40 | */
41 | @GetMapping("/list")
42 | @ApiOperation("查看购物车")
43 | public Result> list(){
44 | List shoppingCartList = shoppingCartService.showShoppingCart();
45 | return Result.success(shoppingCartList);
46 | }
47 |
48 | /**
49 | * 清空购物车
50 | * @return
51 | */
52 | @DeleteMapping("/clean")
53 | @ApiOperation("清空购物车")
54 | public Result clean(){
55 | shoppingCartService.cleanShoppingCart();
56 | return Result.success();
57 | }
58 |
59 | /**
60 | * 清空购物车中的一个商品
61 | * @param shoppingCartDTO
62 | * @return
63 | */
64 | @PostMapping("/sub")
65 | @ApiOperation("清空购物车中的一个商品")
66 | public Result sub(@RequestBody ShoppingCartDTO shoppingCartDTO){
67 | shoppingCartService.subShoppingCart(shoppingCartDTO);
68 | return Result.success();
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/interceptor/JwtTokenAdminInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.sky.interceptor;
2 |
3 | import com.sky.constant.JwtClaimsConstant;
4 | import com.sky.context.BaseContext;
5 | import com.sky.properties.JwtProperties;
6 | import com.sky.utils.JwtUtil;
7 | import io.jsonwebtoken.Claims;
8 | import lombok.extern.slf4j.Slf4j;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Component;
11 | import org.springframework.web.method.HandlerMethod;
12 | import org.springframework.web.servlet.HandlerInterceptor;
13 | import javax.servlet.http.HttpServletRequest;
14 | import javax.servlet.http.HttpServletResponse;
15 |
16 | /**
17 | * jwt令牌校验的拦截器
18 | */
19 | @Component
20 | @Slf4j
21 | public class JwtTokenAdminInterceptor implements HandlerInterceptor {
22 |
23 | @Autowired
24 | private JwtProperties jwtProperties;
25 |
26 | /**
27 | * 校验jwt
28 | *
29 | * @param request
30 | * @param response
31 | * @param handler
32 | * @return
33 | * @throws Exception
34 | */
35 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
36 | //判断当前拦截到的是Controller的方法还是其他资源
37 | if (!(handler instanceof HandlerMethod)) {
38 | //当前拦截到的不是动态方法,直接放行
39 | return true;
40 | }
41 |
42 | //1、从请求头中获取令牌
43 | String token = request.getHeader(jwtProperties.getAdminTokenName());
44 |
45 | //2、校验令牌
46 | try {
47 | log.info("jwt校验:{}", token);
48 | Claims claims = JwtUtil.parseJWT(jwtProperties.getAdminSecretKey(), token);
49 | Long empId = Long.valueOf(claims.get(JwtClaimsConstant.EMP_ID).toString());
50 | BaseContext.setCurrentId(empId);
51 | log.info("当前员工id:", empId);
52 | //3、通过,放行
53 | return true;
54 | } catch (Exception ex) {
55 | //4、不通过,响应401状态码
56 | response.setStatus(401);
57 | return false;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/interceptor/JwtTokenUserInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.sky.interceptor;
2 |
3 | import com.sky.constant.JwtClaimsConstant;
4 | import com.sky.context.BaseContext;
5 | import com.sky.properties.JwtProperties;
6 | import com.sky.utils.JwtUtil;
7 | import io.jsonwebtoken.Claims;
8 | import lombok.extern.slf4j.Slf4j;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Component;
11 | import org.springframework.web.method.HandlerMethod;
12 | import org.springframework.web.servlet.HandlerInterceptor;
13 |
14 | import javax.servlet.http.HttpServletRequest;
15 | import javax.servlet.http.HttpServletResponse;
16 |
17 | /**
18 | * jwt令牌校验的拦截器
19 | */
20 | @Component
21 | @Slf4j
22 | public class JwtTokenUserInterceptor implements HandlerInterceptor {
23 |
24 | @Autowired
25 | private JwtProperties jwtProperties;
26 |
27 | /**
28 | * 校验jwt
29 | *
30 | * @param request
31 | * @param response
32 | * @param handler
33 | * @return
34 | * @throws Exception
35 | */
36 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
37 | //判断当前拦截到的是Controller的方法还是其他资源
38 | if (!(handler instanceof HandlerMethod)) {
39 | //当前拦截到的不是动态方法,直接放行
40 | return true;
41 | }
42 |
43 | //1、从请求头中获取令牌
44 | String token = request.getHeader(jwtProperties.getUserTokenName());
45 |
46 | //2、校验令牌
47 | try {
48 | log.info("jwt校验:{}", token);
49 | Claims claims = JwtUtil.parseJWT(jwtProperties.getUserSecretKey(), token);
50 | Long userId = Long.valueOf(claims.get(JwtClaimsConstant.USER_ID).toString());
51 | BaseContext.setCurrentId(userId);
52 | log.info("当前员工id:", userId);
53 | //3、通过,放行
54 | return true;
55 | } catch (Exception ex) {
56 | //4、不通过,响应401状态码
57 | response.setStatus(401);
58 | return false;
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/sky/js/404.c61770cf.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["404"],{"0b60":function(t,s,e){t.exports=e.p+"img/404-cloud.0f4bc32b.png"},"39d4":function(t,s,e){"use strict";var a=e("5fb4"),c=e.n(a);c.a},"4f29":function(t,s,e){t.exports=e.p+"img/404.a57b6f31.png"},"5fb4":function(t,s,e){},"8cdb":function(t,s,e){"use strict";e.r(s);var a=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"wscn-http404-container"},[e("div",{staticClass:"wscn-http404"},[t._m(0),e("div",{staticClass:"text-404"},[e("div",{staticClass:"text-404__oops"},[t._v("\n OOPS!\n ")]),t._m(1),e("div",{staticClass:"text-404__headline"},[t._v("\n "+t._s(t.message)+"\n ")]),e("div",{staticClass:"text-404__info"},[t._v("\n Please check that the URL you entered is correct, or click the button below to return to the homepage.\n ")]),e("a",{staticClass:"text-404__return-home",attrs:{href:""}},[t._v("Back to home")])])])])},c=[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"pic-404"},[a("img",{staticClass:"pic-404__parent",attrs:{src:e("4f29"),alt:"404"}}),a("img",{staticClass:"pic-404__child left",attrs:{src:e("0b60"),alt:"404"}}),a("img",{staticClass:"pic-404__child mid",attrs:{src:e("0b60"),alt:"404"}}),a("img",{staticClass:"pic-404__child right",attrs:{src:e("0b60"),alt:"404"}})])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"text-404__info"},[t._v("\n All rights reserved\n "),e("a",{staticStyle:{color:"#20a0ff"},attrs:{href:"https://wallstreetcn.com",target:"_blank"}},[t._v("wallstreetcn")])])}],i=e("d225"),n=e("308d"),r=e("6bb5"),l=e("4e2b"),o=e("9ab4"),_=e("60a3"),f=function(t){function s(){var t;return Object(i["a"])(this,s),t=Object(n["a"])(this,Object(r["a"])(s).apply(this,arguments)),t.message="404 Page Not Found",t}return Object(l["a"])(s,t),s}(_["c"]);f=Object(o["a"])([Object(_["a"])({name:"Page404"})],f);var u=f,b=u,h=(e("39d4"),e("2877")),d=Object(h["a"])(b,a,c,!1,null,"5c412c96",null);s["default"]=d.exports}}]);
2 | //# sourceMappingURL=404.c61770cf.js.map
--------------------------------------------------------------------------------
/sky-common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | sky-take-out
7 | com.sky
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 | sky-common
12 |
13 |
14 | org.projectlombok
15 | lombok
16 |
17 |
18 | com.alibaba
19 | fastjson
20 |
21 |
22 | commons-lang
23 | commons-lang
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter-json
28 |
29 |
30 | io.jsonwebtoken
31 | jjwt
32 |
33 |
34 |
35 | org.springframework.boot
36 | spring-boot-configuration-processor
37 | true
38 |
39 |
40 | com.aliyun.oss
41 | aliyun-sdk-oss
42 |
43 |
44 | javax.xml.bind
45 | jaxb-api
46 |
47 |
48 |
49 | com.github.wechatpay-apiv3
50 | wechatpay-apache-httpclient
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/impl/UserServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.sky.service.impl;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.alibaba.fastjson.JSONObject;
5 | import com.google.gson.JsonObject;
6 | import com.sky.constant.MessageConstant;
7 | import com.sky.dto.UserLoginDTO;
8 | import com.sky.entity.User;
9 | import com.sky.exception.LoginFailedException;
10 | import com.sky.mapper.UserMapper;
11 | import com.sky.properties.WeChatProperties;
12 | import com.sky.service.UserService;
13 | import com.sky.utils.HttpClientUtil;
14 | import org.springframework.beans.factory.annotation.Autowired;
15 | import org.springframework.stereotype.Service;
16 |
17 | import java.time.LocalDateTime;
18 | import java.util.HashMap;
19 | import java.util.Map;
20 |
21 | /**
22 | * @author Mark
23 | * @date 2024/2/15
24 | */
25 |
26 | @Service
27 | public class UserServiceImpl implements UserService {
28 | public static final String WX_LOGIN = "https://api.weixin.qq.com/sns/jscode2session";
29 |
30 | @Autowired
31 | private UserMapper userMapper;
32 |
33 | @Autowired
34 | private WeChatProperties weChatProperties;
35 |
36 | @Override
37 | public User wxLogin(UserLoginDTO userLoginDTO) {
38 | String openId = getOpenId(userLoginDTO.getCode());
39 |
40 | if (openId == null){
41 | throw new LoginFailedException(MessageConstant.LOGIN_FAILED);
42 | }
43 |
44 | User user = userMapper.getByOpenId(openId);
45 |
46 | if (user == null){
47 | // 新用户
48 | user = User.builder().openid(openId)
49 | .createTime(LocalDateTime.now()).build();
50 | userMapper.insert(user);
51 | }
52 | return user;
53 | }
54 |
55 | /**
56 | * 获取微信用户openid
57 | * @param code
58 | * @return
59 | */
60 | private String getOpenId(String code){
61 | Map map = new HashMap<>();
62 | map.put("appid", weChatProperties.getAppid());
63 | map.put("secret", weChatProperties.getSecret());
64 | map.put("js_code", code);
65 | map.put("grant_type", "authorization_code");
66 |
67 | String json = HttpClientUtil.doGet(WX_LOGIN, map);
68 |
69 | JSONObject jsonObject = JSON.parseObject(json);
70 | String openid = jsonObject.getString("openid");
71 |
72 | return openid;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/admin/WorkSpaceController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.admin;
2 |
3 | import com.sky.result.Result;
4 | import com.sky.service.WorkspaceService;
5 | import com.sky.vo.BusinessDataVO;
6 | import com.sky.vo.DishOverViewVO;
7 | import com.sky.vo.OrderOverViewVO;
8 | import com.sky.vo.SetmealOverViewVO;
9 | import io.swagger.annotations.Api;
10 | import io.swagger.annotations.ApiOperation;
11 | import lombok.extern.slf4j.Slf4j;
12 | import org.springframework.beans.factory.annotation.Autowired;
13 | import org.springframework.web.bind.annotation.GetMapping;
14 | import org.springframework.web.bind.annotation.RequestMapping;
15 | import org.springframework.web.bind.annotation.RestController;
16 | import java.time.LocalDateTime;
17 | import java.time.LocalTime;
18 |
19 | /**
20 | * 工作台
21 | */
22 | @RestController
23 | @RequestMapping("/admin/workspace")
24 | @Slf4j
25 | @Api(tags = "工作台相关接口")
26 | public class WorkSpaceController {
27 |
28 | @Autowired
29 | private WorkspaceService workspaceService;
30 |
31 | /**
32 | * 工作台今日数据查询
33 | * @return
34 | */
35 | @GetMapping("/businessData")
36 | @ApiOperation("工作台今日数据查询")
37 | public Result businessData(){
38 | //获得当天的开始时间
39 | LocalDateTime begin = LocalDateTime.now().with(LocalTime.MIN);
40 | //获得当天的结束时间
41 | LocalDateTime end = LocalDateTime.now().with(LocalTime.MAX);
42 |
43 | BusinessDataVO businessDataVO = workspaceService.getBusinessData(begin, end);
44 | return Result.success(businessDataVO);
45 | }
46 |
47 | /**
48 | * 查询订单管理数据
49 | * @return
50 | */
51 | @GetMapping("/overviewOrders")
52 | @ApiOperation("查询订单管理数据")
53 | public Result orderOverView(){
54 | return Result.success(workspaceService.getOrderOverView());
55 | }
56 |
57 | /**
58 | * 查询菜品总览
59 | * @return
60 | */
61 | @GetMapping("/overviewDishes")
62 | @ApiOperation("查询菜品总览")
63 | public Result dishOverView(){
64 | return Result.success(workspaceService.getDishOverView());
65 | }
66 |
67 | /**
68 | * 查询套餐总览
69 | * @return
70 | */
71 | @GetMapping("/overviewSetmeals")
72 | @ApiOperation("查询套餐总览")
73 | public Result setmealOverView(){
74 | return Result.success(workspaceService.getSetmealOverView());
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/SetmealMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.github.pagehelper.Page;
4 | import com.sky.anotation.AutoFill;
5 | import com.sky.dto.SetmealPageQueryDTO;
6 | import com.sky.entity.Setmeal;
7 | import com.sky.entity.SetmealDish;
8 | import com.sky.enumeration.OperationType;
9 | import com.sky.vo.DishItemVO;
10 | import com.sky.vo.SetmealVO;
11 | import org.apache.ibatis.annotations.Insert;
12 | import org.apache.ibatis.annotations.Mapper;
13 | import org.apache.ibatis.annotations.Select;
14 |
15 | import java.util.List;
16 | import java.util.Map;
17 |
18 | @Mapper
19 | public interface SetmealMapper {
20 |
21 | /**
22 | * 根据分类id查询套餐的数量
23 | * @param id
24 | * @return
25 | */
26 | @Select("select count(id) from setmeal where category_id = #{categoryId}")
27 | Integer countByCategoryId(Long id);
28 |
29 | /**
30 | * 套餐分页查询
31 | * @param setmealPageQueryDTO
32 | * @return
33 | */
34 | Page pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);
35 |
36 | /**
37 | * 新增套餐
38 | * @param setmeal
39 | */
40 | @AutoFill(OperationType.INSERT)
41 | void insert(Setmeal setmeal);
42 |
43 | /**
44 | * 保存套餐和菜品的关联关系
45 | * @param setmealDishes
46 | */
47 | void insertBatch(List setmealDishes);
48 |
49 | /**
50 | * 更新套餐数据
51 | * @param setmeal
52 | */
53 | @AutoFill(OperationType.UPDATE)
54 | void update(Setmeal setmeal);
55 |
56 | /**
57 | * 根据id查询套餐
58 | * @param id
59 | * @return
60 | */
61 | @Select("select * from setmeal where id = #{id}")
62 | Setmeal getById(Long id);
63 |
64 | /**
65 | * 批量删除套餐
66 | * @param ids
67 | */
68 | void deleteBatch(List ids);
69 |
70 | /**
71 | * 动态条件查询套餐
72 | * @param setmeal
73 | * @return
74 | */
75 | List list(Setmeal setmeal);
76 |
77 | /**
78 | * 根据套餐id查询菜品选项
79 | * @param setmealId
80 | * @return
81 | */
82 | @Select("select sd.name, sd.copies, d.image, d.description " +
83 | "from setmeal_dish sd left join dish d on sd.dish_id = d.id " +
84 | "where sd.setmeal_id = #{setmealId}")
85 | List getDishItemBySetmealId(Long setmealId);
86 |
87 | /**
88 | * 根据条件统计套餐数量
89 | * @param map
90 | * @return
91 | */
92 | Integer countByMap(Map map);
93 | }
94 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/mapper/OrdersMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.mapper;
2 |
3 | import com.github.pagehelper.Page;
4 | import com.sky.dto.GoodsSalesDTO;
5 | import com.sky.dto.OrdersPageQueryDTO;
6 | import com.sky.entity.Orders;
7 | import org.apache.ibatis.annotations.Insert;
8 | import org.apache.ibatis.annotations.Mapper;
9 | import org.apache.ibatis.annotations.Select;
10 |
11 | import java.time.LocalDateTime;
12 | import java.util.List;
13 | import java.util.Map;
14 |
15 | /**
16 | * @author Mark
17 | * @date 2024/2/17
18 | */
19 |
20 | @Mapper
21 | public interface OrdersMapper {
22 | /**
23 | * 插入订单数据
24 | * @param orders
25 | */
26 | void insert(Orders orders);
27 |
28 | /**
29 | * 根据订单号查询订单
30 | * @param orderNumber
31 | */
32 | @Select("select * from orders where number = #{orderNumber}")
33 | Orders getByNumber(String orderNumber);
34 |
35 | /**
36 | * 修改订单信息
37 | * @param orders
38 | */
39 | void update(Orders orders);
40 |
41 | /**
42 | * 分页条件查询并按下单时间排序
43 | * @param ordersPageQueryDTO
44 | */
45 | Page pageQuery(OrdersPageQueryDTO ordersPageQueryDTO);
46 |
47 | /**
48 | * 根据id查询订单
49 | * @param id
50 | * @return
51 | */
52 | @Select("select * from orders where id = #{id};")
53 | Orders getById(Long id);
54 |
55 | /**
56 | * 根据状态统计订单数量
57 | * @param status
58 | * @return
59 | */
60 | @Select("select count(id) from orders where status = #{status}")
61 | Integer countStatus(Integer status);
62 |
63 | /**
64 | * 查询超时未支付订单
65 | * @param status
66 | * @param time
67 | */
68 | @Select("select * from orders where status = #{status} and order_time < #{time}")
69 | List getByStatusAndOrderTimeLT(Integer status, LocalDateTime time);
70 |
71 | @Select("select * from orders where number = #{number} and user_id = #{userId}")
72 | Orders getByNumberAndUserId(String number, Long userId);
73 |
74 | /**
75 | * 计算当天营业额
76 | * @param map
77 | * @return
78 | */
79 | Double sumByMap(Map map);
80 |
81 | /**
82 | * 统计订单数量
83 | * @param map
84 | * @return
85 | */
86 | Integer countByMap(Map map);
87 |
88 | /**
89 | *
90 | * @param begin
91 | * @param end
92 | * @return
93 | */
94 | List getSalesTop10(LocalDateTime begin, LocalDateTime end);
95 | }
96 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/sky/css/login.f8377ced.css:
--------------------------------------------------------------------------------
1 | .avatar-uploader .el-upload{border-radius:4px!important;background:#fcfcfc}.avatar-uploader .avatar-uploader-icon{background:#fcfcfc}.avatar-uploader .el-icon-plus:before{content:"\4E0A\4F20\56FE\7247"!important;font-size:12px;color:#000}.el-dialog{border-radius:8px}.el-dialog__header{background:#fbfbfa;border-radius:8px 8px 0 0;border:none}.login{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;background-color:#333}.login,.login-box{display:-webkit-box;display:-ms-flexbox;display:flex}.login-box{width:1000px;height:474.38px;border-radius:8px}.login-box img{width:60%;height:auto}.title{margin:0 auto 10px auto;text-align:left;color:#707070}.login-form{background:#fff;width:40%;border-radius:0 8px 8px 0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.login-form .el-form{width:214px;height:307px}.login-form .el-form-item{margin-bottom:30px}.login-form .el-form-item.is-error .el-input__inner{border:0!important;border-bottom:1px solid #fd7065!important;background:#fff!important}.login-form .input-icon{height:32px;width:18px;margin-left:-2px}.login-form .el-input__inner{border:0;border-bottom:1px solid #e9e9e8;border-radius:0;font-size:12px;font-weight:400;color:#333;height:32px;line-height:32px}.login-form .el-input__prefix{left:0}.login-form .el-input--prefix .el-input__inner{padding-left:26px}.login-form .el-input__inner::-webkit-input-placeholder{color:#aeb5c4}.login-form .el-input__inner::-moz-placeholder{color:#aeb5c4}.login-form .el-input__inner:-ms-input-placeholder{color:#aeb5c4}.login-form .el-input__inner::-ms-input-placeholder{color:#aeb5c4}.login-form .el-input__inner::placeholder{color:#aeb5c4}.login-form .el-form-item--medium .el-form-item__content,.login-form .el-input--medium .el-input__icon{line-height:32px}.login-btn{border-radius:17px;padding:11px 20px!important;margin-top:10px;font-size:12px;border:0;font-weight:500;color:#333;background-color:#ffc200}.login-btn:focus,.login-btn:hover{background-color:#ffc200;color:#fff}.login-form-title{height:36px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:40px}.login-form-title .title-label{font-weight:500;font-size:20px;color:#333;margin-left:10px}
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/impl/AddressBookServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.sky.service.impl;
2 |
3 | import com.sky.context.BaseContext;
4 | import com.sky.entity.AddressBook;
5 | import com.sky.mapper.AddressBookMapper;
6 | import com.sky.service.AddressBookService;
7 | import lombok.extern.slf4j.Slf4j;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.stereotype.Service;
10 | import org.springframework.transaction.annotation.Transactional;
11 | import java.util.List;
12 |
13 | @Service
14 | @Slf4j
15 | public class AddressBookServiceImpl implements AddressBookService {
16 | @Autowired
17 | private AddressBookMapper addressBookMapper;
18 |
19 | /**
20 | * 条件查询
21 | *
22 | * @param addressBook
23 | * @return
24 | */
25 | public List list(AddressBook addressBook) {
26 | return addressBookMapper.list(addressBook);
27 | }
28 |
29 | /**
30 | * 新增地址
31 | *
32 | * @param addressBook
33 | */
34 | public void save(AddressBook addressBook) {
35 | addressBook.setUserId(BaseContext.getCurrentId());
36 | addressBook.setIsDefault(0);
37 | addressBookMapper.insert(addressBook);
38 | }
39 |
40 | /**
41 | * 根据id查询
42 | *
43 | * @param id
44 | * @return
45 | */
46 | public AddressBook getById(Long id) {
47 | AddressBook addressBook = addressBookMapper.getById(id);
48 | return addressBook;
49 | }
50 |
51 | /**
52 | * 根据id修改地址
53 | *
54 | * @param addressBook
55 | */
56 | public void update(AddressBook addressBook) {
57 | addressBookMapper.update(addressBook);
58 | }
59 |
60 | /**
61 | * 设置默认地址
62 | *
63 | * @param addressBook
64 | */
65 | @Transactional
66 | public void setDefault(AddressBook addressBook) {
67 | //1、将当前用户的所有地址修改为非默认地址 update address_book set is_default = ? where user_id = ?
68 | addressBook.setIsDefault(0);
69 | addressBook.setUserId(BaseContext.getCurrentId());
70 | addressBookMapper.updateIsDefaultByUserId(addressBook);
71 |
72 | //2、将当前地址改为默认地址 update address_book set is_default = ? where id = ?
73 | addressBook.setIsDefault(1);
74 | addressBookMapper.update(addressBook);
75 | }
76 |
77 | /**
78 | * 根据id删除地址
79 | *
80 | * @param id
81 | */
82 | public void deleteById(Long id) {
83 | addressBookMapper.deleteById(id);
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/service/OrderService.java:
--------------------------------------------------------------------------------
1 | package com.sky.service;
2 |
3 | import com.sky.dto.*;
4 | import com.sky.result.PageResult;
5 | import com.sky.vo.OrderPaymentVO;
6 | import com.sky.vo.OrderStatisticsVO;
7 | import com.sky.vo.OrderSubmitVO;
8 | import com.sky.vo.OrderVO;
9 |
10 | /**
11 | * @author Mark
12 | * @date 2024/2/17
13 | */
14 | public interface OrderService {
15 | /**
16 | * 用户下单
17 | * @param orders
18 | * @return
19 | */
20 | OrderSubmitVO submitOrder(OrdersSubmitDTO orders);
21 |
22 | /**
23 | * 订单支付
24 | * @param ordersPaymentDTO
25 | * @return
26 | */
27 | OrderPaymentVO payment(OrdersPaymentDTO ordersPaymentDTO) throws Exception;
28 |
29 | /**
30 | * 支付成功,修改订单状态
31 | * @param outTradeNo
32 | */
33 | void paySuccess(String outTradeNo);
34 |
35 | /**
36 | * 历史订单查询
37 | * @param page
38 | * @param pageSize
39 | * @param status
40 | * @return
41 | */
42 | PageResult pageQueryUser(int page, int pageSize, Integer status);
43 |
44 | /**
45 | * 查询订单详情
46 | * @param id
47 | * @return
48 | */
49 | OrderVO detail(Long id);
50 |
51 | /**
52 | * 通过id取消订单
53 | * @param id
54 | */
55 | void cancelOrderById(Long id) throws Exception;
56 |
57 | /**
58 | * 再来一单
59 | * @param id
60 | */
61 | void repetition(Long id);
62 |
63 | /**
64 | * 根据条件搜索
65 | * @param ordersPageQueryDTO
66 | * @return
67 | */
68 | PageResult conditionSearch(OrdersPageQueryDTO ordersPageQueryDTO);
69 |
70 | /**
71 | * 各个状态的订单数量统计
72 | * @return
73 | */
74 | OrderStatisticsVO statistics();
75 |
76 | /**
77 | * 接单
78 | * @param confirmDTO
79 | */
80 | void confirm(OrdersConfirmDTO confirmDTO);
81 |
82 | /**
83 | * 拒单
84 | * @param ordersRejectionDTO
85 | */
86 | void rejection(OrdersRejectionDTO ordersRejectionDTO) throws Exception;
87 |
88 | /**
89 | * 取消订单
90 | * @param ordersCancelDTO
91 | */
92 | void cancel(OrdersCancelDTO ordersCancelDTO) throws Exception;
93 |
94 | /**
95 | * 派送订单
96 | * @param id
97 | */
98 | void delivery(Long id);
99 |
100 | /**
101 | * 完成订单
102 | * @param id
103 | */
104 | void complete(Long id);
105 |
106 | /**
107 | * 用户催单
108 | * @param id
109 | */
110 | void reminder(Long id);
111 | }
112 |
--------------------------------------------------------------------------------
/sky-common/src/main/java/com/sky/utils/AliOssUtil.java:
--------------------------------------------------------------------------------
1 | package com.sky.utils;
2 |
3 | import com.aliyun.oss.ClientException;
4 | import com.aliyun.oss.OSS;
5 | import com.aliyun.oss.OSSClientBuilder;
6 | import com.aliyun.oss.OSSException;
7 | import lombok.AllArgsConstructor;
8 | import lombok.Data;
9 | import lombok.extern.slf4j.Slf4j;
10 | import java.io.ByteArrayInputStream;
11 |
12 | @Data
13 | @AllArgsConstructor
14 | @Slf4j
15 | public class AliOssUtil {
16 |
17 | private String endpoint;
18 | private String accessKeyId;
19 | private String accessKeySecret;
20 | private String bucketName;
21 |
22 | /**
23 | * 文件上传
24 | *
25 | * @param bytes
26 | * @param objectName
27 | * @return
28 | */
29 | public String upload(byte[] bytes, String objectName) {
30 |
31 | // 创建OSSClient实例。
32 | OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
33 |
34 | try {
35 | // 创建PutObject请求。
36 | ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(bytes));
37 | } catch (OSSException oe) {
38 | System.out.println("Caught an OSSException, which means your request made it to OSS, "
39 | + "but was rejected with an error response for some reason.");
40 | System.out.println("Error Message:" + oe.getErrorMessage());
41 | System.out.println("Error Code:" + oe.getErrorCode());
42 | System.out.println("Request ID:" + oe.getRequestId());
43 | System.out.println("Host ID:" + oe.getHostId());
44 | } catch (ClientException ce) {
45 | System.out.println("Caught an ClientException, which means the client encountered "
46 | + "a serious internal problem while trying to communicate with OSS, "
47 | + "such as not being able to access the network.");
48 | System.out.println("Error Message:" + ce.getMessage());
49 | } finally {
50 | if (ossClient != null) {
51 | ossClient.shutdown();
52 | }
53 | }
54 |
55 | //文件访问路径规则 https://BucketName.Endpoint/ObjectName
56 | StringBuilder stringBuilder = new StringBuilder("https://");
57 | stringBuilder
58 | .append(bucketName)
59 | .append(".")
60 | .append(endpoint)
61 | .append("/")
62 | .append(objectName);
63 |
64 | log.info("文件上传到:{}", stringBuilder.toString());
65 |
66 | return stringBuilder.toString();
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/sky-pojo/src/main/java/com/sky/entity/Orders.java:
--------------------------------------------------------------------------------
1 | package com.sky.entity;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.math.BigDecimal;
10 | import java.time.LocalDateTime;
11 |
12 | /**
13 | * 订单
14 | */
15 | @Data
16 | @Builder
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | public class Orders implements Serializable {
20 |
21 | /**
22 | * 订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消
23 | */
24 | public static final Integer PENDING_PAYMENT = 1;
25 | public static final Integer TO_BE_CONFIRMED = 2;
26 | public static final Integer CONFIRMED = 3;
27 | public static final Integer DELIVERY_IN_PROGRESS = 4;
28 | public static final Integer COMPLETED = 5;
29 | public static final Integer CANCELLED = 6;
30 |
31 | /**
32 | * 支付状态 0未支付 1已支付 2退款
33 | */
34 | public static final Integer UN_PAID = 0;
35 | public static final Integer PAID = 1;
36 | public static final Integer REFUND = 2;
37 |
38 | private static final long serialVersionUID = 1L;
39 |
40 | private Long id;
41 |
42 | //订单号
43 | private String number;
44 |
45 | //订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消 7退款
46 | private Integer status;
47 |
48 | //下单用户id
49 | private Long userId;
50 |
51 | //地址id
52 | private Long addressBookId;
53 |
54 | //下单时间
55 | private LocalDateTime orderTime;
56 |
57 | //结账时间
58 | private LocalDateTime checkoutTime;
59 |
60 | //支付方式 1微信,2支付宝
61 | private Integer payMethod;
62 |
63 | //支付状态 0未支付 1已支付 2退款
64 | private Integer payStatus;
65 |
66 | //实收金额
67 | private BigDecimal amount;
68 |
69 | //备注
70 | private String remark;
71 |
72 | //用户名
73 | private String userName;
74 |
75 | //手机号
76 | private String phone;
77 |
78 | //地址
79 | private String address;
80 |
81 | //收货人
82 | private String consignee;
83 |
84 | //订单取消原因
85 | private String cancelReason;
86 |
87 | //订单拒绝原因
88 | private String rejectionReason;
89 |
90 | //订单取消时间
91 | private LocalDateTime cancelTime;
92 |
93 | //预计送达时间
94 | private LocalDateTime estimatedDeliveryTime;
95 |
96 | //配送状态 1立即送出 0选择具体时间
97 | private Integer deliveryStatus;
98 |
99 | //送达时间
100 | private LocalDateTime deliveryTime;
101 |
102 | //打包费
103 | private int packAmount;
104 |
105 | //餐具数量
106 | private int tablewareNumber;
107 |
108 | //餐具数量状态 1按餐量提供 0选择具体数量
109 | private Integer tablewareStatus;
110 | }
111 |
--------------------------------------------------------------------------------
/sky-common/src/main/java/com/sky/json/JacksonObjectMapper.java:
--------------------------------------------------------------------------------
1 | package com.sky.json;
2 |
3 | import com.fasterxml.jackson.databind.DeserializationFeature;
4 | import com.fasterxml.jackson.databind.ObjectMapper;
5 | import com.fasterxml.jackson.databind.module.SimpleModule;
6 | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
7 | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
8 | import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
9 | import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
10 | import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
11 | import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
12 |
13 | import java.time.LocalDate;
14 | import java.time.LocalDateTime;
15 | import java.time.LocalTime;
16 | import java.time.format.DateTimeFormatter;
17 |
18 | import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES;
19 |
20 | /**
21 | * 对象映射器:基于jackson将Java对象转为json,或者将json转为Java对象
22 | * 将JSON解析为Java对象的过程称为 [从JSON反序列化Java对象]
23 | * 从Java对象生成JSON的过程称为 [序列化Java对象到JSON]
24 | */
25 | public class JacksonObjectMapper extends ObjectMapper {
26 |
27 | public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
28 | //public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
29 | public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm";
30 | public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
31 |
32 | public JacksonObjectMapper() {
33 | super();
34 | //收到未知属性时不报异常
35 | this.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
36 |
37 | //反序列化时,属性不存在的兼容处理
38 | this.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
39 |
40 | SimpleModule simpleModule = new SimpleModule()
41 | .addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
42 | .addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
43 | .addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)))
44 | .addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
45 | .addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
46 | .addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
47 |
48 | //注册功能模块 例如,可以添加自定义序列化器和反序列化器
49 | this.registerModule(simpleModule);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/nginx-1.20.2/conf/koi-win:
--------------------------------------------------------------------------------
1 |
2 | charset_map koi8-r windows-1251 {
3 |
4 | 80 88 ; # euro
5 |
6 | 95 95 ; # bullet
7 |
8 | 9A A0 ; #
9 |
10 | 9E B7 ; # ·
11 |
12 | A3 B8 ; # small yo
13 | A4 BA ; # small Ukrainian ye
14 |
15 | A6 B3 ; # small Ukrainian i
16 | A7 BF ; # small Ukrainian yi
17 |
18 | AD B4 ; # small Ukrainian soft g
19 | AE A2 ; # small Byelorussian short u
20 |
21 | B0 B0 ; # °
22 |
23 | B3 A8 ; # capital YO
24 | B4 AA ; # capital Ukrainian YE
25 |
26 | B6 B2 ; # capital Ukrainian I
27 | B7 AF ; # capital Ukrainian YI
28 |
29 | B9 B9 ; # numero sign
30 |
31 | BD A5 ; # capital Ukrainian soft G
32 | BE A1 ; # capital Byelorussian short U
33 |
34 | BF A9 ; # (C)
35 |
36 | C0 FE ; # small yu
37 | C1 E0 ; # small a
38 | C2 E1 ; # small b
39 | C3 F6 ; # small ts
40 | C4 E4 ; # small d
41 | C5 E5 ; # small ye
42 | C6 F4 ; # small f
43 | C7 E3 ; # small g
44 | C8 F5 ; # small kh
45 | C9 E8 ; # small i
46 | CA E9 ; # small j
47 | CB EA ; # small k
48 | CC EB ; # small l
49 | CD EC ; # small m
50 | CE ED ; # small n
51 | CF EE ; # small o
52 |
53 | D0 EF ; # small p
54 | D1 FF ; # small ya
55 | D2 F0 ; # small r
56 | D3 F1 ; # small s
57 | D4 F2 ; # small t
58 | D5 F3 ; # small u
59 | D6 E6 ; # small zh
60 | D7 E2 ; # small v
61 | D8 FC ; # small soft sign
62 | D9 FB ; # small y
63 | DA E7 ; # small z
64 | DB F8 ; # small sh
65 | DC FD ; # small e
66 | DD F9 ; # small shch
67 | DE F7 ; # small ch
68 | DF FA ; # small hard sign
69 |
70 | E0 DE ; # capital YU
71 | E1 C0 ; # capital A
72 | E2 C1 ; # capital B
73 | E3 D6 ; # capital TS
74 | E4 C4 ; # capital D
75 | E5 C5 ; # capital YE
76 | E6 D4 ; # capital F
77 | E7 C3 ; # capital G
78 | E8 D5 ; # capital KH
79 | E9 C8 ; # capital I
80 | EA C9 ; # capital J
81 | EB CA ; # capital K
82 | EC CB ; # capital L
83 | ED CC ; # capital M
84 | EE CD ; # capital N
85 | EF CE ; # capital O
86 |
87 | F0 CF ; # capital P
88 | F1 DF ; # capital YA
89 | F2 D0 ; # capital R
90 | F3 D1 ; # capital S
91 | F4 D2 ; # capital T
92 | F5 D3 ; # capital U
93 | F6 C6 ; # capital ZH
94 | F7 C2 ; # capital V
95 | F8 DC ; # capital soft sign
96 | F9 DB ; # capital Y
97 | FA C7 ; # capital Z
98 | FB D8 ; # capital SH
99 | FC DD ; # capital E
100 | FD D9 ; # capital SHCH
101 | FE D7 ; # capital CH
102 | FF DA ; # capital hard sign
103 | }
104 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/admin/CategoryController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.admin;
2 |
3 | import com.sky.dto.CategoryDTO;
4 | import com.sky.dto.CategoryPageQueryDTO;
5 | import com.sky.entity.Category;
6 | import com.sky.result.PageResult;
7 | import com.sky.result.Result;
8 | import com.sky.service.CategoryService;
9 | import io.swagger.annotations.Api;
10 | import io.swagger.annotations.ApiOperation;
11 | import lombok.extern.slf4j.Slf4j;
12 | import org.springframework.beans.factory.annotation.Autowired;
13 | import org.springframework.web.bind.annotation.*;
14 | import java.util.List;
15 |
16 | /**
17 | * 分类管理
18 | */
19 | @RestController
20 | @RequestMapping("/admin/category")
21 | @Api(tags = "分类相关接口")
22 | @Slf4j
23 | public class CategoryController {
24 |
25 | @Autowired
26 | private CategoryService categoryService;
27 |
28 | /**
29 | * 新增分类
30 | * @param categoryDTO
31 | * @return
32 | */
33 | @PostMapping
34 | @ApiOperation("新增分类")
35 | public Result save(@RequestBody CategoryDTO categoryDTO){
36 | log.info("新增分类:{}", categoryDTO);
37 | categoryService.save(categoryDTO);
38 | return Result.success();
39 | }
40 |
41 | /**
42 | * 分类分页查询
43 | * @param categoryPageQueryDTO
44 | * @return
45 | */
46 | @GetMapping("/page")
47 | @ApiOperation("分类分页查询")
48 | public Result page(CategoryPageQueryDTO categoryPageQueryDTO){
49 | log.info("分页查询:{}", categoryPageQueryDTO);
50 | PageResult pageResult = categoryService.pageQuery(categoryPageQueryDTO);
51 | return Result.success(pageResult);
52 | }
53 |
54 | /**
55 | * 删除分类
56 | * @param id
57 | * @return
58 | */
59 | @DeleteMapping
60 | @ApiOperation("删除分类")
61 | public Result deleteById(Long id){
62 | log.info("删除分类:{}", id);
63 | categoryService.deleteById(id);
64 | return Result.success();
65 | }
66 |
67 | /**
68 | * 修改分类
69 | * @param categoryDTO
70 | * @return
71 | */
72 | @PutMapping
73 | @ApiOperation("修改分类")
74 | public Result update(@RequestBody CategoryDTO categoryDTO){
75 | categoryService.update(categoryDTO);
76 | return Result.success();
77 | }
78 |
79 | /**
80 | * 启用、禁用分类
81 | * @param status
82 | * @param id
83 | * @return
84 | */
85 | @PostMapping("/status/{status}")
86 | @ApiOperation("启用禁用分类")
87 | public Result startOrStop(@PathVariable("status") Integer status, Long id){
88 | categoryService.startOrStop(status,id);
89 | return Result.success();
90 | }
91 |
92 | /**
93 | * 根据类型查询分类
94 | * @param type
95 | * @return
96 | */
97 | @GetMapping("/list")
98 | @ApiOperation("根据类型查询分类")
99 | public Result> list(Integer type){
100 | List list = categoryService.list(type);
101 | return Result.success(list);
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/sky/precache-manifest.5e430aca4979062ff3bb5d045cb4a7aa.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "24013d487a0256c7f73c",
4 | "url": "css/404.6a750851.css"
5 | },
6 | {
7 | "revision": "24013d487a0256c7f73c",
8 | "url": "js/404.c61770cf.js"
9 | },
10 | {
11 | "revision": "51e829e56f213b57ca76",
12 | "url": "css/app.fd9b670b.css"
13 | },
14 | {
15 | "revision": "51e829e56f213b57ca76",
16 | "url": "js/app.d0aa4eb3.js"
17 | },
18 | {
19 | "revision": "7a3a7e33ab783cefaec7",
20 | "url": "css/chunk-vendors.37cc3fbd.css"
21 | },
22 | {
23 | "revision": "7a3a7e33ab783cefaec7",
24 | "url": "js/chunk-vendors.9b7e46a0.js"
25 | },
26 | {
27 | "revision": "355a63bba4e9f571e50b",
28 | "url": "css/dashboard.8da8967e.css"
29 | },
30 | {
31 | "revision": "355a63bba4e9f571e50b",
32 | "url": "js/dashboard.630a609e.js"
33 | },
34 | {
35 | "revision": "d9b8ea589fcb23371fb5",
36 | "url": "css/login.f8377ced.css"
37 | },
38 | {
39 | "revision": "d9b8ea589fcb23371fb5",
40 | "url": "js/login.90288d75.js"
41 | },
42 | {
43 | "revision": "6701dd7c295485717209",
44 | "url": "css/shopTable.5fd29e98.css"
45 | },
46 | {
47 | "revision": "6701dd7c295485717209",
48 | "url": "js/shopTable.fe534d8f.js"
49 | },
50 | {
51 | "revision": "0f4bc32b0f52f7cfb7d19305a6517724",
52 | "url": "img/404-cloud.0f4bc32b.png"
53 | },
54 | {
55 | "revision": "89ccbe0c2d72c31965177702b8819493",
56 | "url": "img/noImg.89ccbe0c.png"
57 | },
58 | {
59 | "revision": "e769fc3e331db6393679005e3c9b43fd",
60 | "url": "img/search_table_empty.e769fc3e.png"
61 | },
62 | {
63 | "revision": "732389ded34cb9c52dd88271f1345af9",
64 | "url": "fonts/element-icons.732389de.ttf"
65 | },
66 | {
67 | "revision": "535877f50039c0cb49a6196a5b7517cd",
68 | "url": "fonts/element-icons.535877f5.woff"
69 | },
70 | {
71 | "revision": "885371bc928de5c918d64e713802eaba",
72 | "url": "img/table_empty.885371bc.png"
73 | },
74 | {
75 | "revision": "a57b6f31fa77c50f14d756711dea4158",
76 | "url": "img/404.a57b6f31.png"
77 | },
78 | {
79 | "revision": "38b01728209c82713206be752ed54b3a",
80 | "url": "img/icon_logo.38b01728.png"
81 | },
82 | {
83 | "revision": "6ef9d2601d2ec762577f90aa72ad97aa",
84 | "url": "img/login-l.6ef9d260.png"
85 | },
86 | {
87 | "revision": "3f1fe127c88eefb495aeccb83e0fdbe8",
88 | "url": "media/preview.3f1fe127.mp3"
89 | },
90 | {
91 | "revision": "38b01728209c82713206be752ed54b3a",
92 | "url": "img/logo.38b01728.png"
93 | },
94 | {
95 | "revision": "bf141cfc2896c5eda967747dcee92776",
96 | "url": "img/mini-logo.bf141cfc.png"
97 | },
98 | {
99 | "revision": "0a3849af76d2bea914a0df06aa75d892",
100 | "url": "media/reminder.0a3849af.mp3"
101 | },
102 | {
103 | "revision": "1a82643b8f1ab45ccdc52c0a678dc975",
104 | "url": "index.html"
105 | },
106 | {
107 | "revision": "735ab4f94fbcd57074377afca324c813",
108 | "url": "robots.txt"
109 | }
110 | ];
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/admin/SetmealController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.admin;
2 |
3 | import com.sky.dto.SetmealDTO;
4 | import com.sky.dto.SetmealPageQueryDTO;
5 | import com.sky.result.PageResult;
6 | import com.sky.result.Result;
7 | import com.sky.service.SetmealService;
8 | import com.sky.vo.SetmealVO;
9 | import io.swagger.annotations.ApiOperation;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.cache.annotation.CacheEvict;
12 | import org.springframework.web.bind.annotation.*;
13 |
14 | import java.util.List;
15 |
16 | /**
17 | * @author Mark
18 | * @date 2024/2/12
19 | */
20 |
21 | @RestController
22 | @RequestMapping("/admin/setmeal")
23 | @ApiOperation("套餐管理")
24 | public class SetmealController {
25 |
26 | @Autowired
27 | private SetmealService setmealService;
28 |
29 | /**
30 | * 套餐分页查询
31 | * @param setmealPageQueryDTO
32 | * @return
33 | */
34 | @GetMapping("/page")
35 | @ApiOperation("套餐分页查询")
36 | public Result page(SetmealPageQueryDTO setmealPageQueryDTO){
37 | PageResult pageResult = setmealService.pageQuery(setmealPageQueryDTO);
38 | return Result.success(pageResult);
39 | }
40 |
41 | /**
42 | * 新增套餐
43 | * @param setmealDTO
44 | * @return
45 | */
46 | @PostMapping
47 | @CacheEvict(cacheNames = "setmealCache", key = "#setmealDTO.categoryId")
48 | @ApiOperation("新增套餐")
49 | public Result save(@RequestBody SetmealDTO setmealDTO){
50 | setmealService.saveWithDish(setmealDTO);
51 | return Result.success();
52 | }
53 |
54 | /**
55 | * 套餐起售、停售
56 | * @param status
57 | * @return
58 | */
59 | @PostMapping("/status/{status}")
60 | @CacheEvict(cacheNames = "setmealCache", allEntries = true)
61 | @ApiOperation("套餐起售、停售")
62 | public Result startOrStop(@PathVariable Integer status, Long id){
63 | setmealService.startOrStop(status, id);
64 | return Result.success();
65 | }
66 |
67 | /**
68 | * 批量删除套餐
69 | * @param ids
70 | * @return
71 | */
72 | @DeleteMapping
73 | @CacheEvict(cacheNames = "setmealCache", allEntries = true)
74 | @ApiOperation("批量删除套餐")
75 | public Result delete(@RequestParam List ids){
76 | setmealService.deleteBatch(ids);
77 | return Result.success();
78 | }
79 |
80 | /**
81 | * 根据id查询套餐
82 | * @param id
83 | * @return
84 | */
85 | @GetMapping("/{id}")
86 | @ApiOperation("根据id查询套餐")
87 | public Result getById(@PathVariable Long id){
88 | SetmealVO setmealVO = setmealService.getByIdWithDish(id);
89 | return Result.success(setmealVO);
90 | }
91 |
92 | /**
93 | * 修改菜品
94 | * @param setmealDTO
95 | * @return
96 | */
97 | @PutMapping
98 | @CacheEvict(cacheNames = "setmealCache", allEntries = true)
99 | @ApiOperation("修改套餐")
100 | public Result update(@RequestBody SetmealDTO setmealDTO){
101 | setmealService.update(setmealDTO);
102 | return Result.success();
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/aspect/AutoFillAspect.java:
--------------------------------------------------------------------------------
1 | package com.sky.aspect;
2 |
3 | /**
4 | * @author Mark
5 | * @date 2024/2/10
6 | */
7 |
8 | import com.sky.anotation.AutoFill;
9 | import com.sky.constant.AutoFillConstant;
10 | import com.sky.context.BaseContext;
11 | import com.sky.enumeration.OperationType;
12 | import org.aspectj.lang.JoinPoint;
13 | import org.aspectj.lang.Signature;
14 | import org.aspectj.lang.annotation.Aspect;
15 | import org.aspectj.lang.annotation.Before;
16 | import org.aspectj.lang.annotation.Pointcut;
17 | import org.aspectj.lang.reflect.MethodSignature;
18 | import org.springframework.stereotype.Component;
19 |
20 | import java.lang.reflect.Method;
21 | import java.time.LocalDateTime;
22 |
23 | /**
24 | * 自定义切面,填充公共字段,减少重复代码
25 | */
26 | @Aspect
27 | @Component
28 | public class AutoFillAspect {
29 | /**
30 | * 切入点
31 | */
32 | @Pointcut("execution(* com.sky.mapper.*.*(..)) && @annotation(com.sky.anotation.AutoFill)")
33 | public void autoFillPointCut(){}
34 |
35 | /**
36 | * 前置通知
37 | * @param point
38 | */
39 | @Before("autoFillPointCut()")
40 | public void autoFill(JoinPoint point){
41 | // 方法签名
42 | MethodSignature signature = (MethodSignature) point.getSignature();
43 | // 获取方法上的注解对象
44 | AutoFill annotation = signature.getMethod().getAnnotation(AutoFill.class);
45 | // 获取数据库操作类型
46 | OperationType type = annotation.value();
47 | // 实体对象
48 | Object[] args = point.getArgs();
49 | if (args == null || args.length == 0){
50 | return;
51 | }
52 | Object arg = args[0];
53 |
54 | LocalDateTime localDateTime = LocalDateTime.now();
55 | Long currentId = BaseContext.getCurrentId();
56 |
57 | if (type == OperationType.INSERT){
58 | try {
59 | Method createTime = arg.getClass().getDeclaredMethod(AutoFillConstant.SET_CREATE_TIME, LocalDateTime.class);
60 | Method createUser = arg.getClass().getDeclaredMethod(AutoFillConstant.SET_CREATE_USER, Long.class);
61 | Method updateTime = arg.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_TIME, LocalDateTime.class);
62 | Method updateUser = arg.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_USER, Long.class);
63 |
64 | createTime.invoke(arg, localDateTime);
65 | createUser.invoke(arg, currentId);
66 | updateTime.invoke(arg, localDateTime);
67 | updateUser.invoke(arg, currentId);
68 | } catch (Exception e) {
69 | throw new RuntimeException(e);
70 | }
71 | } else if (type == OperationType.UPDATE) {
72 | try {
73 | Method updateTime = arg.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_TIME, LocalDateTime.class);
74 | Method updateUser = arg.getClass().getDeclaredMethod(AutoFillConstant.SET_UPDATE_USER, Long.class);
75 |
76 | updateTime.invoke(arg, localDateTime);
77 | updateUser.invoke(arg, currentId);
78 | }catch (Exception exception){
79 | throw new RuntimeException(exception);
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/nginx-1.20.2/html/sky/js/login.90288d75.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["login"],{2017:function(e,t,n){"use strict";var o=n("25ae"),r=n.n(o);r.a},"25ae":function(e,t,n){e.exports={menuBg:"#343744",menuText:"#bfcbd9",menuActiveText:"#ffc200"}},5387:function(e,t,n){e.exports=n.p+"img/icon_logo.38b01728.png"},"802f":function(e,t,n){e.exports=n.p+"img/login-l.6ef9d260.png"},"9ed6":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login"},[o("div",{staticClass:"login-box"},[o("img",{attrs:{src:n("802f"),alt:""}}),o("div",{staticClass:"login-form"},[o("el-form",{ref:"loginForm",attrs:{model:e.loginForm,rules:e.loginRules}},[o("div",{staticClass:"login-form-title"},[o("img",{staticStyle:{width:"149px",height:"38px"},attrs:{src:n("5387"),alt:""}})]),o("el-form-item",{attrs:{prop:"username"}},[o("el-input",{attrs:{type:"text","auto-complete":"off",placeholder:"账号","prefix-icon":"iconfont icon-user"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),o("el-form-item",{attrs:{prop:"password"}},[o("el-input",{attrs:{type:"password",placeholder:"密码","prefix-icon":"iconfont icon-lock"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}})],1),o("el-form-item",{staticStyle:{width:"100%"}},[o("el-button",{staticClass:"login-btn",staticStyle:{width:"100%"},attrs:{loading:e.loading,size:"medium",type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e.loading?o("span",[e._v("登录中...")]):o("span",[e._v("登录")])])],1)],1)],1)])])},r=[],a=(n("96cf"),n("3b8d")),i=n("d225"),l=n("b0b4"),s=n("308d"),c=n("6bb5"),u=n("4e2b"),d=n("9ab4"),p=n("60a3"),g=n("9dba"),m=function(e){function t(){var e;return Object(i["a"])(this,t),e=Object(s["a"])(this,Object(c["a"])(t).apply(this,arguments)),e.validateUsername=function(e,t,n){t?n():n(new Error("请输入用户名"))},e.validatePassword=function(e,t,n){t.length<6?n(new Error("密码必须在6位以上")):n()},e.loginForm={username:"admin",password:"123456"},e.loginRules={username:[{validator:e.validateUsername,trigger:"blur"}],password:[{validator:e.validatePassword,trigger:"blur"}]},e.loading=!1,e}return Object(u["a"])(t,e),Object(l["a"])(t,[{key:"onRouteChange",value:function(e){}},{key:"handleLogin",value:function(){var e=this;this.$refs.loginForm.validate(function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=6;break}return e.loading=!0,t.next=4,g["a"].Login(e.loginForm).then((function(t){"1"===String(t.code)?e.$router.push("/"):e.loading=!1})).catch((function(){e.loading=!1}));case 4:t.next=7;break;case 6:return t.abrupt("return",!1);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}]),t}(p["c"]);Object(d["a"])([Object(p["d"])("$route",{immediate:!0})],m.prototype,"onRouteChange",null),m=Object(d["a"])([Object(p["a"])({name:"Login"})],m);var f=m,b=f,v=(n("2017"),n("2877")),h=Object(v["a"])(b,o,r,!1,null,null,null);t["default"]=h.exports}}]);
2 | //# sourceMappingURL=login.90288d75.js.map
--------------------------------------------------------------------------------
/nginx-1.20.2/conf/koi-utf:
--------------------------------------------------------------------------------
1 |
2 | # This map is not a full koi8-r <> utf8 map: it does not contain
3 | # box-drawing and some other characters. Besides this map contains
4 | # several koi8-u and Byelorussian letters which are not in koi8-r.
5 | # If you need a full and standard map, use contrib/unicode2nginx/koi-utf
6 | # map instead.
7 |
8 | charset_map koi8-r utf-8 {
9 |
10 | 80 E282AC ; # euro
11 |
12 | 95 E280A2 ; # bullet
13 |
14 | 9A C2A0 ; #
15 |
16 | 9E C2B7 ; # ·
17 |
18 | A3 D191 ; # small yo
19 | A4 D194 ; # small Ukrainian ye
20 |
21 | A6 D196 ; # small Ukrainian i
22 | A7 D197 ; # small Ukrainian yi
23 |
24 | AD D291 ; # small Ukrainian soft g
25 | AE D19E ; # small Byelorussian short u
26 |
27 | B0 C2B0 ; # °
28 |
29 | B3 D081 ; # capital YO
30 | B4 D084 ; # capital Ukrainian YE
31 |
32 | B6 D086 ; # capital Ukrainian I
33 | B7 D087 ; # capital Ukrainian YI
34 |
35 | B9 E28496 ; # numero sign
36 |
37 | BD D290 ; # capital Ukrainian soft G
38 | BE D18E ; # capital Byelorussian short U
39 |
40 | BF C2A9 ; # (C)
41 |
42 | C0 D18E ; # small yu
43 | C1 D0B0 ; # small a
44 | C2 D0B1 ; # small b
45 | C3 D186 ; # small ts
46 | C4 D0B4 ; # small d
47 | C5 D0B5 ; # small ye
48 | C6 D184 ; # small f
49 | C7 D0B3 ; # small g
50 | C8 D185 ; # small kh
51 | C9 D0B8 ; # small i
52 | CA D0B9 ; # small j
53 | CB D0BA ; # small k
54 | CC D0BB ; # small l
55 | CD D0BC ; # small m
56 | CE D0BD ; # small n
57 | CF D0BE ; # small o
58 |
59 | D0 D0BF ; # small p
60 | D1 D18F ; # small ya
61 | D2 D180 ; # small r
62 | D3 D181 ; # small s
63 | D4 D182 ; # small t
64 | D5 D183 ; # small u
65 | D6 D0B6 ; # small zh
66 | D7 D0B2 ; # small v
67 | D8 D18C ; # small soft sign
68 | D9 D18B ; # small y
69 | DA D0B7 ; # small z
70 | DB D188 ; # small sh
71 | DC D18D ; # small e
72 | DD D189 ; # small shch
73 | DE D187 ; # small ch
74 | DF D18A ; # small hard sign
75 |
76 | E0 D0AE ; # capital YU
77 | E1 D090 ; # capital A
78 | E2 D091 ; # capital B
79 | E3 D0A6 ; # capital TS
80 | E4 D094 ; # capital D
81 | E5 D095 ; # capital YE
82 | E6 D0A4 ; # capital F
83 | E7 D093 ; # capital G
84 | E8 D0A5 ; # capital KH
85 | E9 D098 ; # capital I
86 | EA D099 ; # capital J
87 | EB D09A ; # capital K
88 | EC D09B ; # capital L
89 | ED D09C ; # capital M
90 | EE D09D ; # capital N
91 | EF D09E ; # capital O
92 |
93 | F0 D09F ; # capital P
94 | F1 D0AF ; # capital YA
95 | F2 D0A0 ; # capital R
96 | F3 D0A1 ; # capital S
97 | F4 D0A2 ; # capital T
98 | F5 D0A3 ; # capital U
99 | F6 D096 ; # capital ZH
100 | F7 D092 ; # capital V
101 | F8 D0AC ; # capital soft sign
102 | F9 D0AB ; # capital Y
103 | FA D097 ; # capital Z
104 | FB D0A8 ; # capital SH
105 | FC D0AD ; # capital E
106 | FD D0A9 ; # capital SHCH
107 | FE D0A7 ; # capital CH
108 | FF D0AA ; # capital hard sign
109 | }
110 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/admin/ReportController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.admin;
2 |
3 | import com.sky.result.Result;
4 | import com.sky.service.ReportService;
5 | import com.sky.vo.OrderReportVO;
6 | import com.sky.vo.SalesTop10ReportVO;
7 | import com.sky.vo.TurnoverReportVO;
8 | import com.sky.vo.UserReportVO;
9 | import io.swagger.annotations.Api;
10 | import io.swagger.annotations.ApiOperation;
11 | import lombok.extern.slf4j.Slf4j;
12 | import org.springframework.beans.factory.annotation.Autowired;
13 | import org.springframework.format.annotation.DateTimeFormat;
14 | import org.springframework.web.bind.annotation.GetMapping;
15 | import org.springframework.web.bind.annotation.RequestMapping;
16 | import org.springframework.web.bind.annotation.RestController;
17 |
18 | import javax.servlet.http.HttpServletResponse;
19 | import java.time.LocalDate;
20 |
21 |
22 | /**
23 | * @author Mark
24 | * @date 2024/2/25
25 | */
26 |
27 | @RestController
28 | @RequestMapping("/admin/report")
29 | @Api(tags = "数据统计相关接口")
30 | @Slf4j
31 | public class ReportController {
32 |
33 | @Autowired
34 | private ReportService reportService;
35 |
36 | /**
37 | * 营业额统计
38 | * @return
39 | */
40 | @GetMapping("/turnoverStatistics")
41 | @ApiOperation("营业额统计")
42 | public Result turnoverStatistics(
43 | @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,
44 | @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){
45 | log.info("营业额数据统计:{},{}",begin,end);
46 | return Result.success(reportService.getTurnoverStatistics(begin, end));
47 | }
48 |
49 | /**
50 | * 用户数量统计
51 | * @param begin
52 | * @param end
53 | * @return
54 | */
55 | @GetMapping("/userStatistics")
56 | @ApiOperation("用户数量统计")
57 | public Result userStatistics(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,
58 | @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){
59 | return Result.success(reportService.getUserSratistics(begin, end));
60 | }
61 |
62 | /**
63 | * 订单统计
64 | * @param begin
65 | * @param end
66 | * @return
67 | */
68 | @GetMapping("/ordersStatistics")
69 | @ApiOperation("订单统计")
70 | public Result ordersStatistics(
71 | @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,
72 | @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end) {
73 | log.info("订单数据统计:{},{}", begin, end);
74 | return Result.success(reportService.getOrderStatistics(begin, end));
75 | }
76 |
77 |
78 | /**
79 | * 获取销量前十的菜品
80 | * @param begin
81 | * @param end
82 | * @return
83 | */
84 | @GetMapping("/top10")
85 | @ApiOperation("获取销量前十的菜品")
86 | public Result top10(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,
87 | @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){
88 | return Result.success(reportService.getSalesTop10(begin,end));
89 | }
90 |
91 | /**
92 | * 导出数据
93 | * @param response
94 | */
95 | @GetMapping("/export")
96 | @ApiOperation("导出数据")
97 | public void export(HttpServletResponse response) throws Exception{
98 | reportService.exportData(response);
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/AddressBookController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.context.BaseContext;
4 | import com.sky.entity.AddressBook;
5 | import com.sky.result.Result;
6 | import com.sky.service.AddressBookService;
7 | import io.swagger.annotations.Api;
8 | import io.swagger.annotations.ApiOperation;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.web.bind.annotation.*;
11 | import java.util.List;
12 |
13 | @RestController
14 | @RequestMapping("/user/addressBook")
15 | @Api(tags = "C端地址簿接口")
16 | public class AddressBookController {
17 |
18 | @Autowired
19 | private AddressBookService addressBookService;
20 |
21 | /**
22 | * 查询当前登录用户的所有地址信息
23 | *
24 | * @return
25 | */
26 | @GetMapping("/list")
27 | @ApiOperation("查询当前登录用户的所有地址信息")
28 | public Result> list() {
29 | AddressBook addressBook = new AddressBook();
30 | addressBook.setUserId(BaseContext.getCurrentId());
31 | List list = addressBookService.list(addressBook);
32 | return Result.success(list);
33 | }
34 |
35 | /**
36 | * 新增地址
37 | *
38 | * @param addressBook
39 | * @return
40 | */
41 | @PostMapping
42 | @ApiOperation("新增地址")
43 | public Result save(@RequestBody AddressBook addressBook) {
44 | addressBookService.save(addressBook);
45 | return Result.success();
46 | }
47 |
48 | @GetMapping("/{id}")
49 | @ApiOperation("根据id查询地址")
50 | public Result getById(@PathVariable Long id) {
51 | AddressBook addressBook = addressBookService.getById(id);
52 | return Result.success(addressBook);
53 | }
54 |
55 | /**
56 | * 根据id修改地址
57 | *
58 | * @param addressBook
59 | * @return
60 | */
61 | @PutMapping
62 | @ApiOperation("根据id修改地址")
63 | public Result update(@RequestBody AddressBook addressBook) {
64 | addressBookService.update(addressBook);
65 | return Result.success();
66 | }
67 |
68 | /**
69 | * 设置默认地址
70 | *
71 | * @param addressBook
72 | * @return
73 | */
74 | @PutMapping("/default")
75 | @ApiOperation("设置默认地址")
76 | public Result setDefault(@RequestBody AddressBook addressBook) {
77 | addressBookService.setDefault(addressBook);
78 | return Result.success();
79 | }
80 |
81 | /**
82 | * 根据id删除地址
83 | *
84 | * @param id
85 | * @return
86 | */
87 | @DeleteMapping
88 | @ApiOperation("根据id删除地址")
89 | public Result deleteById(Long id) {
90 | addressBookService.deleteById(id);
91 | return Result.success();
92 | }
93 |
94 | /**
95 | * 查询默认地址
96 | */
97 | @GetMapping("default")
98 | @ApiOperation("查询默认地址")
99 | public Result getDefault() {
100 | //SQL:select * from address_book where user_id = ? and is_default = 1
101 | AddressBook addressBook = new AddressBook();
102 | addressBook.setIsDefault(1);
103 | addressBook.setUserId(BaseContext.getCurrentId());
104 | List list = addressBookService.list(addressBook);
105 |
106 | if (list != null && list.size() == 1) {
107 | return Result.success(list.get(0));
108 | }
109 |
110 | return Result.error("没有查询到默认地址");
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/user/OrderController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.user;
2 |
3 | import com.sky.dto.OrdersPaymentDTO;
4 | import com.sky.dto.OrdersSubmitDTO;
5 | import com.sky.entity.Orders;
6 | import com.sky.result.PageResult;
7 | import com.sky.result.Result;
8 | import com.sky.service.OrderService;
9 | import com.sky.vo.OrderPaymentVO;
10 | import com.sky.vo.OrderSubmitVO;
11 | import com.sky.vo.OrderVO;
12 | import io.swagger.annotations.Api;
13 | import io.swagger.annotations.ApiOperation;
14 | import lombok.extern.slf4j.Slf4j;
15 | import org.springframework.beans.factory.annotation.Autowired;
16 | import org.springframework.web.bind.annotation.*;
17 |
18 | /**
19 | * @author Mark
20 | * @date 2024/2/17
21 | */
22 |
23 | @RestController("userOrder")
24 | @RequestMapping("/user/order")
25 | @Api("订单接口")
26 | @Slf4j
27 | public class OrderController {
28 |
29 | @Autowired
30 | private OrderService orderService;
31 |
32 | @PostMapping("/submit")
33 | @ApiOperation("用户下单")
34 | public Result submit(@RequestBody OrdersSubmitDTO ordersSubmitDTO){
35 | OrderSubmitVO orderSubmitVO = orderService.submitOrder(ordersSubmitDTO);
36 | return Result.success(orderSubmitVO);
37 | }
38 |
39 | /**
40 | * 订单支付
41 | *
42 | * @param ordersPaymentDTO
43 | * @return
44 | */
45 | @PutMapping("/payment")
46 | @ApiOperation("订单支付")
47 | public Result payment(@RequestBody OrdersPaymentDTO ordersPaymentDTO) throws Exception {
48 | log.info("订单支付:{}", ordersPaymentDTO);
49 | OrderPaymentVO orderPaymentVO = orderService.payment(ordersPaymentDTO);
50 | log.info("生成预支付交易单:{}", orderPaymentVO);
51 | return Result.success(orderPaymentVO);
52 | }
53 |
54 | /**
55 | * 历史订单查询
56 | * @return
57 | */
58 | @GetMapping("/historyOrders")
59 | @ApiOperation("历史订单查询")
60 | public Result page(int page, int pageSize, Integer status){
61 | PageResult pageResult = orderService.pageQueryUser(page, pageSize, status);
62 | return Result.success(pageResult);
63 | }
64 |
65 | /**
66 | * 查询订单详情
67 | * @param id
68 | * @return
69 | */
70 | @GetMapping("/orderDetail/{id}")
71 | @ApiOperation("查询订单详情")
72 | public Result details(@PathVariable Long id){
73 | OrderVO orderVO = orderService.detail(id);
74 | return Result.success(orderVO);
75 | }
76 |
77 | /**
78 | * 取消订单
79 | * @param id
80 | * @return
81 | */
82 | @PutMapping("/cancel/{id}")
83 | @ApiOperation("取消订单")
84 | public Result cancel(@PathVariable Long id) throws Exception{
85 | orderService.cancelOrderById(id);
86 | return Result.success();
87 | }
88 |
89 | /**
90 | * 再来一单
91 | * @param id
92 | * @return
93 | */
94 | @PostMapping("/repetition/{id}")
95 | @ApiOperation("再来一单")
96 | public Result repetition(@PathVariable Long id){
97 | orderService.repetition(id);
98 | return Result.success();
99 | }
100 |
101 | /**
102 | * 用户催单
103 | * @param id
104 | * @return
105 | */
106 | @GetMapping("/reminder/{id}")
107 | @ApiOperation("用户催单")
108 | public Result reminder(@PathVariable Long id){
109 | orderService.reminder(id);
110 | return Result.success();
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/sky-server/src/main/resources/mapper/SetmealMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
26 |
27 |
28 | insert into setmeal
29 | (category_id, name, price, status, description, image, create_time, update_time, create_user, update_user)
30 | values (#{categoryId}, #{name}, #{price}, #{status}, #{description}, #{image}, #{createTime}, #{updateTime},
31 | #{createUser}, #{updateUser})
32 |
33 |
34 |
35 | update setmeal
36 |
37 |
38 | category_id = #{categoryId},
39 |
40 |
41 | name = #{name},
42 |
43 |
44 | price = #{price},
45 |
46 |
47 | status = #{status},
48 |
49 |
50 | description = #{description},
51 |
52 |
53 | image = #{image},
54 |
55 |
56 | update_time = #{updateTime},
57 |
58 |
59 | update_user = #{updateUser}
60 |
61 |
62 | where id = #{id}
63 |
64 |
65 |
66 | delete from setmeal where id =
67 |
68 | #{id}
69 |
70 |
71 |
72 |
86 |
87 |
98 |
--------------------------------------------------------------------------------
/nginx-1.20.2/docs/PCRE.LICENCE:
--------------------------------------------------------------------------------
1 | PCRE LICENCE
2 | ------------
3 |
4 | PCRE is a library of functions to support regular expressions whose syntax
5 | and semantics are as close as possible to those of the Perl 5 language.
6 |
7 | Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
8 | specified below. The documentation for PCRE, supplied in the "doc"
9 | directory, is distributed under the same terms as the software itself. The data
10 | in the testdata directory is not copyrighted and is in the public domain.
11 |
12 | The basic library functions are written in C and are freestanding. Also
13 | included in the distribution is a set of C++ wrapper functions, and a
14 | just-in-time compiler that can be used to optimize pattern matching. These
15 | are both optional features that can be omitted when the library is built.
16 |
17 |
18 | THE BASIC LIBRARY FUNCTIONS
19 | ---------------------------
20 |
21 | Written by: Philip Hazel
22 | Email local part: ph10
23 | Email domain: cam.ac.uk
24 |
25 | University of Cambridge Computing Service,
26 | Cambridge, England.
27 |
28 | Copyright (c) 1997-2020 University of Cambridge
29 | All rights reserved.
30 |
31 |
32 | PCRE JUST-IN-TIME COMPILATION SUPPORT
33 | -------------------------------------
34 |
35 | Written by: Zoltan Herczeg
36 | Email local part: hzmester
37 | Email domain: freemail.hu
38 |
39 | Copyright(c) 2010-2020 Zoltan Herczeg
40 | All rights reserved.
41 |
42 |
43 | STACK-LESS JUST-IN-TIME COMPILER
44 | --------------------------------
45 |
46 | Written by: Zoltan Herczeg
47 | Email local part: hzmester
48 | Email domain: freemail.hu
49 |
50 | Copyright(c) 2009-2020 Zoltan Herczeg
51 | All rights reserved.
52 |
53 |
54 | THE C++ WRAPPER FUNCTIONS
55 | -------------------------
56 |
57 | Contributed by: Google Inc.
58 |
59 | Copyright (c) 2007-2012, Google Inc.
60 | All rights reserved.
61 |
62 |
63 | THE "BSD" LICENCE
64 | -----------------
65 |
66 | Redistribution and use in source and binary forms, with or without
67 | modification, are permitted provided that the following conditions are met:
68 |
69 | * Redistributions of source code must retain the above copyright notice,
70 | this list of conditions and the following disclaimer.
71 |
72 | * Redistributions in binary form must reproduce the above copyright
73 | notice, this list of conditions and the following disclaimer in the
74 | documentation and/or other materials provided with the distribution.
75 |
76 | * Neither the name of the University of Cambridge nor the name of Google
77 | Inc. nor the names of their contributors may be used to endorse or
78 | promote products derived from this software without specific prior
79 | written permission.
80 |
81 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
82 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
83 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
84 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
85 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
86 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
87 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
88 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
89 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
90 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
91 | POSSIBILITY OF SUCH DAMAGE.
92 |
93 | End
94 |
--------------------------------------------------------------------------------
/sky-server/src/main/java/com/sky/controller/admin/DishController.java:
--------------------------------------------------------------------------------
1 | package com.sky.controller.admin;
2 |
3 | import com.sky.dto.DishDTO;
4 | import com.sky.dto.DishPageQueryDTO;
5 | import com.sky.entity.Dish;
6 | import com.sky.result.PageResult;
7 | import com.sky.result.Result;
8 | import com.sky.service.DishService;
9 | import com.sky.vo.DishVO;
10 | import io.swagger.annotations.Api;
11 | import io.swagger.annotations.ApiOperation;
12 | import io.swagger.models.auth.In;
13 | import org.springframework.beans.factory.annotation.Autowired;
14 | import org.springframework.data.redis.core.RedisTemplate;
15 | import org.springframework.web.bind.annotation.*;
16 |
17 | import java.util.List;
18 | import java.util.Set;
19 |
20 | /**
21 | * @author Mark
22 | * @date 2024/2/10
23 | */
24 |
25 | @RestController
26 | @RequestMapping("/admin/dish")
27 | public class DishController {
28 | @Autowired
29 | private DishService dishService;
30 |
31 | @Autowired
32 | private RedisTemplate redisTemplate;
33 |
34 | /**
35 | * 新增菜品
36 | * @param dishDTO
37 | * @return
38 | */
39 | @PostMapping
40 | @ApiOperation("新增菜品")
41 | public Result save(@RequestBody DishDTO dishDTO){
42 | dishService.saveWithFlavor(dishDTO);
43 | cleanCache("dish_" + dishDTO.getCategoryId());
44 | return Result.success();
45 | }
46 |
47 | /**
48 | * 菜品分页查询
49 | * @return
50 | */
51 | @GetMapping("/page")
52 | @ApiOperation("菜品分页查询")
53 | public Result page(DishPageQueryDTO queryDTO){
54 | PageResult pageResult = dishService.page(queryDTO);
55 | return Result.success(pageResult);
56 | }
57 |
58 | /**
59 | * 批量删除菜品
60 | * @param ids
61 | * @return
62 | */
63 | @DeleteMapping
64 | @ApiOperation("批量删除菜品功能")
65 | public Result delete(@RequestParam List ids){
66 | dishService.deleteBatch(ids);
67 |
68 | cleanCache("dish_*");
69 | return Result.success();
70 | }
71 |
72 | /**
73 | * 对菜品进行起售禁售
74 | * @param status
75 | * @param id
76 | * @return
77 | */
78 | @PostMapping("/status/{status}")
79 | @ApiOperation("停售起售菜品")
80 | public Result startOrStop(@PathVariable Integer status, Long id){
81 | dishService.startOrStop(status, id);
82 | cleanCache("dish_*");
83 | return Result.success();
84 | }
85 |
86 | /**
87 | * 根据id查询菜品和相关联的口味数据
88 | * @param id
89 | * @return
90 | */
91 | @GetMapping("/{id}")
92 | @ApiOperation("根据id查询菜品和相关联的口味数据")
93 | public Result getById(@PathVariable Long id){
94 | return Result.success(dishService.getByIdWithFlavor(id));
95 | }
96 |
97 | /**
98 | * 修改菜品信息
99 | * @param dishDTO
100 | * @return
101 | */
102 | @PutMapping
103 | @ApiOperation("修改菜品信息")
104 | public Result update(@RequestBody DishDTO dishDTO){
105 | dishService.updateWithFlavor(dishDTO);
106 | cleanCache("dish_*");
107 | return Result.success();
108 | }
109 |
110 | /**
111 | * 根据分类id查询菜品
112 | * @param categoryId
113 | * @return
114 | */
115 | @GetMapping("/list")
116 | @ApiOperation("根据分类id查询菜品")
117 | public Result> list(Long categoryId){
118 | List list = dishService.list(categoryId);
119 | return Result.success(list);
120 | }
121 |
122 | private void cleanCache(String pattern){
123 | Set keys = redisTemplate.keys(pattern);
124 | redisTemplate.delete(keys);
125 | }
126 | }
127 |
--------------------------------------------------------------------------------