springboot2.1商城系统含后台管理系统源码含文档和论文

开发工具:idea (eclipse) 环境:jdk1.8  mysql5.7


DROP TABLE IF EXISTS `hibernate_sequence`;
CREATE TABLE `hibernate_sequence` (
  `next_val` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of hibernate_sequence
-- ----------------------------
INSERT INTO `hibernate_sequence` VALUES ('44');
INSERT INTO `hibernate_sequence` VALUES ('44');
INSERT INTO `hibernate_sequence` VALUES ('44');
INSERT INTO `hibernate_sequence` VALUES ('44');
INSERT INTO `hibernate_sequence` VALUES ('44');
INSERT INTO `hibernate_sequence` VALUES ('44');
INSERT INTO `hibernate_sequence` VALUES ('44');

-- ----------------------------
-- Table structure for order
-- ----------------------------
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
  `id` int(11) NOT NULL,
  `address_id` int(11) DEFAULT NULL,
  `order_time` datetime DEFAULT NULL,
  `state` int(11) DEFAULT NULL,
  `total` double DEFAULT NULL,
  `total_integral` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of order
-- ----------------------------
INSERT INTO `order` VALUES ('37', '36', '2019-12-29 08:50:17', '4', '79', '8', '22');
INSERT INTO `order` VALUES ('39', '35', '2019-11-29 08:52:20', '3', '10078', '20', '22');

-- ----------------------------
-- Table structure for order_item
-- ----------------------------
DROP TABLE IF EXISTS `order_item`;
CREATE TABLE `order_item` (
  `id` int(11) NOT NULL,
  `count` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `product_id` int(11) DEFAULT NULL,
  `sub_integral` int(11) DEFAULT NULL,
  `sub_total` double DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of order_item
-- ----------------------------
INSERT INTO `order_item` VALUES ('38', '1', '37', '34', '8', '79');
INSERT INTO `order_item` VALUES ('40', '1', '39', '33', '12', '9999');
INSERT INTO `order_item` VALUES ('41', '1', '39', '34', '8', '79');

-- ----------------------------
-- Table structure for product
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
  `id` int(11) NOT NULL,
  `cs_id` int(11) DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `description` varchar(2000) DEFAULT NULL,
  `image1` varchar(255) DEFAULT NULL,
  `image2` varchar(255) DEFAULT NULL,
  `image3` varchar(255) DEFAULT NULL,
  `image4` varchar(255) DEFAULT NULL,
  `integral` int(11) DEFAULT NULL,
  `is_hot` int(11) DEFAULT NULL,
  `market_price` double DEFAULT NULL,
  `shop_price` double DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of product
-- ----------------------------
INSERT INTO `product` VALUES ('33', '27', '2019-12-29 08:46:45', '苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111苹果11111', '/mall/admin/product/img/7ADCAADE8B7DE8DD191117CDEBEE82.jpg', '/mall/admin/product/img/578688CE642BB237FAB487F917D2CE.jpg', '/mall/admin/product/img/075CB1035E1872998946B5D5EFF786.jpg', '/mall/admin/product/img/96DFC81710DB86D2B02F896B60D908.jpg', '12', '1', '11900', '9999', '苹果11');
INSERT INTO `product` VALUES ('34', '27', '2019-12-29 08:48:11', '奶粉很好啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊奶粉很好啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊奶粉很好啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊奶粉很好啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊奶粉很好啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊', '/mall/admin/product/img/5272E4840404EF5E03A5BBD179DD66.png', '/mall/admin/product/img/6FCD89ADDA9D51A0A11CA39BD5F273.jpg', '', '', '8', '1', '89', '79', '奶粉');
INSERT INTO `product` VALUES ('42', '32', '2019-12-29 09:01:10', '童装', '/mall/admin/product/img/5261EDA7B61240992D5866A8455242.jpg', '/mall/admin/product/img/AB915BFF47BCFF89687B2ED579B2E0.jpg', '', '', '3', '1', '89', '58', '包包衣服');
INSERT INTO `product` VALUES ('43', '29', '2019-12-29 09:02:51', '是东窗事发vsdfvdfvxfvdsfv', '/mall/admin/product/img/C7398A9DA2307A6356CCD5B593DA0D.jpg', '/mall/admin/product/img/4F13BCB785C15409228CD53B8F3750.jpg', '/mall/admin/product/img/F3FA59AB71008C6A3E25AD39ED7FA0.jpg', '', '2', '1', '90', '80', '图书111');

-- ----------------------------
-- Table structure for product_category
-- ----------------------------
DROP TABLE IF EXISTS `product_category`;
CREATE TABLE `product_category` (
  `id` int(11) NOT NULL,
  `cname` varchar(255) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of product_category
-- ----------------------------
INSERT INTO `product_category` VALUES ('23', '数码', '0', '1');
INSERT INTO `product_category` VALUES ('24', '图书', '0', '1');
INSERT INTO `product_category` VALUES ('25', '母婴', '0', '1');
INSERT INTO `product_category` VALUES ('26', '服装', '0', '1');
INSERT INTO `product_category` VALUES ('27', '手机', '23', '2');
INSERT INTO `product_category` VALUES ('28', '笔记本', '23', '2');
INSERT INTO `product_category` VALUES ('29', '学习', '24', '2');
INSERT INTO `product_category` VALUES ('30', '菜谱', '24', '2');
INSERT INTO `product_category` VALUES ('31', '女装', '26', '2');
INSERT INTO `product_category` VALUES ('32', '童装', '26', '2');

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL,
  `integration` int(11) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', '0', '123', '15766345459', 'liu');
INSERT INTO `user` VALUES ('2', '52', '123', '15113597631', '123');
INSERT INTO `user` VALUES ('14', '0', '11', '18388888888', '11');
INSERT INTO `user` VALUES ('22', '28', '123456', '18389999999', 'test');

package com.scut.mall.web.adminUser;

import com.scut.mall.entity.Order;
import com.scut.mall.entity.OrderItem;
import com.scut.mall.entity.ReturnOrder;
import com.scut.mall.entity.pojo.ResultBean;
import com.scut.mall.service.OrderService;
import com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.core.CollectionUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.persistence.Tuple;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;


/**
 * @ Author     :cookie
 * @ Date       :2020/02/1 21:11
 * @ Description:${统计模块的后台controller,历史订单总数,总金额,用户总数}
 * @ Modified By:
 */
@Controller
@RequestMapping("/admin/analysis")
public class AdminAnalysisController {
    @Autowired
    private OrderService orderService;

    @RequestMapping("/toList.html")
    public  String toAnalysisList(ModelMap map){
        /* 获取历史订单总营业额 */
        double moneySum = orderService.getMoneySum();
        map.addAttribute("moneySum", moneySum);
        /* 获取历史订单总用户量 */
        map.addAttribute("orderSum",orderService.getOrderSum());
       int  userSum = orderService.getUserSum();
        map.addAttribute("userSum", userSum);

        List<Tuple> list = orderService.getMonthly();
        List<ReturnOrder> returnOrders = new ArrayList<>() ;
        if(list.size()>0){
            list.stream().forEach(tuple -> {
                ReturnOrder returnOrder = new ReturnOrder();
                returnOrder.setMonths(tuple.get(0).toString());
                returnOrder.setOrdernum(Integer.parseInt(tuple.get(1).toString()));
                returnOrder.setTotal(Double.valueOf(tuple.get(2).toString()));
                returnOrders.add(returnOrder);
            });
        }
        map.addAttribute("returnOrders", returnOrders);
        return "admin/analysis/list";
    }

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿毕业分享网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值