当前位置: 首页 > news >正文

上海网站定制价格低wordpress 加跳板

上海网站定制价格低,wordpress 加跳板,自己免费做网站(二),装修公司网站怎么做的效果展示 Apache ECharts 介绍 常见图表 入门案例 快速上手 - Handbook - Apache ECharts 营业额统计——需求分析与设计 产品原型 接口设计 VO设计 营业额统计——代码开发 Controller中 /*** 数据统计相关接口*/ RestController RequestMapping(/admin/reportRestController RequestMapping(/admin/report) Api(tags数据统计相关接口) Slf4j public class ReportController {Autowiredprivate ReportService reportService;/*** 营业额统计* param begin* param end* return*/GetMapping(/turnoverStatistics)ApiOperation(营业额统计)public ResultTurnoverReportVO turnoverStatistics(DateTimeFormat(pattern yyyy-MM-dd) LocalDate begin,DateTimeFormat(pattern yyyy-MM-dd) LocalDate end){log.info(营业额数据统计{}{},begin,end);return Result.success(reportService.getTurnoverStatistics(begin,end));} } Service中 Service Slf4j public class ReportServiceImpl implements ReportService {Autowiredprivate OrderMapper orderMapper;/*** 统计指定时间区间内的营业额数据* param begin* param end* return*/Overridepublic TurnoverReportVO getTurnoverStatistics(LocalDate begin, LocalDate end) {//当前集合存在从begin到end的日期ListLocalDate dateListnew ArrayList();dateList.add(begin);while(!begin.equals(end)){//计算指定日期的后一天beginbegin.plusDays(1);dateList.add(begin);}//存放每天营业额ListDouble turnoverListnew ArrayList();for (LocalDate date : dateList) {//查询date对应的营业额为已经完成的订单金额合计LocalDateTime beginTime LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime LocalDateTime.of(date, LocalTime.MAX);//select sum(amount) from orders where order_time ? and order_time ? and status 5Map mapnew HashMap();map.put(begin,beginTime);map.put(end,endTime);map.put(status, Orders.COMPLETED);Double turnoverorderMapper.sumByMap(map);turnover turnover null?0.0:turnover;turnoverList.add(turnover);}//封装返回结果return TurnoverReportVO.builder().dateList(StringUtils.join(dateList,,)).turnoverList(StringUtils.join(turnoverList,,)).build();} } Mapper中 /*** 根据动态条件统计营业额数据* param map* return*/Double sumByMap(Map map); 对应的映射文件 select idsumByMap resultTypejava.lang.Doubleselect sum(amount) from orderswhereif testbegin ! nulland order_time gt; #{begin}/ifif testend ! nulland order_time lt; #{end}/ifif teststatus ! nulland status #{status}/if/where/select 营业额统计——功能测试 用户统计——需求分析与设计 产品原型 接口设计 VO设计 用户统计——代码开发 Controller中 /*** 用户统计* param begin* param end* return*/GetMapping(userStatistics)ApiOperation(用户统计)public ResultUserReportVO userStatistics(DateTimeFormat(pattern yyyy-MM-dd) LocalDate begin,DateTimeFormat(pattern yyyy-MM-dd) LocalDate end){log.info(营业额数据统计{}{},begin,end);UserReportVO userStatistics reportService.getUserStatistics(begin, end);return Result.success(userStatistics);} Service中 /*** 统计指定时间区间内的用户数量* return*/Overridepublic UserReportVO getUserStatistics(LocalDate begin, LocalDate end) {//当前集合存放从begin到end的日期ListLocalDate dateListnew ArrayList();dateList.add(begin);while(!begin.equals(end)){//计算指定日期的后一天beginbegin.plusDays(1);dateList.add(begin);}//存放每天的新增用户数量 select count(id) from user where create_time ? and create_time ?ListInteger newUserListnew ArrayList();//存放每天的总用户数量 select count(id) from user where create_time ?ListInteger totalUserListnew ArrayList();for (LocalDate date:dateList){LocalDateTime beginTime LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime LocalDateTime.of(date, LocalTime.MAX);Map mapnew HashMap();map.put(end,endTime);//总用户数量Integer totalUser userMapper.countByMap(map);map.put(begin,beginTime);//新增用户数量Integer newUseruserMapper.countByMap(map);totalUserList.add(totalUser);newUserList.add(newUser);}return UserReportVO.builder().dateList(StringUtils.join(dateList,,)).totalUserList(StringUtils.join(totalUserList,,)).newUserList(StringUtils.join(newUserList,,)).build();} Mapper中 /*** 根据动态天条件统计用户数量* param map* return*/Integer countByMap(Map map); 对应的映射文件 select idcountByMap resultTypejava.lang.Integerselect count(id) from userwhereif testbegin ! nulland create_time gt; #{begin}/ifif testend ! nulland create_time lt; #{end}/if/where/select 用户统计——功能测试 订单统计——需求分析与设计 产品原型 接口设计 VO设计 订单统计——代码开发 Controller中 /*** 订单统计* param begin* param end* return*/GetMapping(ordersStatistics)ApiOperation(订单统计)public ResultOrderReportVO ordersStatistics(DateTimeFormat(pattern yyyy-MM-dd) LocalDate begin,DateTimeFormat(pattern yyyy-MM-dd) LocalDate end){log.info(营业额数据统计{}{},begin,end);return Result.success(reportService.getOrderStatistics(begin, end));} Service中 /*** 统计指定时间区间内的订单数据* param begin* param end* return*/Overridepublic OrderReportVO getOrderStatistics(LocalDate begin, LocalDate end) {//当前集合存放从begin到end的日期ListLocalDate dateListnew ArrayList();dateList.add(begin);while(!begin.equals(end)){//计算指定日期的后一天beginbegin.plusDays(1);dateList.add(begin);}//存放每天的订单总数ListInteger orderCountListnew ArrayList();//存放每天的有效订单数ListInteger validOrderCountListnew ArrayList();//遍历dateList集合查询每天的有效订单数和订单总数for (LocalDate date : dateList) {//查询每天订单总数 select count(id) from orders where order_time ? and order_time ?LocalDateTime beginTime LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime LocalDateTime.of(date, LocalTime.MAX);Integer orderCount getOrderCount(beginTime, endTime, null);//查询每天有效订单数 select count(id) from orders where order_time ? and order_time ? and status 5Integer validOrderCount getOrderCount(beginTime, endTime, Orders.CONFIRMED);orderCountList.add(orderCount);validOrderCountList.add(validOrderCount);}//计算时间区间内的订单总数量Integer totalOrderCount orderCountList.stream().reduce(Integer::sum).get();//计算时间区间内的有效订单数量Integer validOrderCount validOrderCountList.stream().reduce(Integer::sum).get();Double orderCompletionRate 0.0;if(totalOrderCount!0)//计算订单完成各率orderCompletionRate validOrderCount.doubleValue()/totalOrderCount;return OrderReportVO.builder().dateList(StringUtils.join(dateList,,)).orderCountList(StringUtils.join(orderCountList,,)).validOrderCountList(StringUtils.join(validOrderCountList,,)).totalOrderCount(totalOrderCount).validOrderCount(validOrderCount).orderCompletionRate(orderCompletionRate).build();}/*** 根据条件统计订单数量* param begin* param end* param status* return*/private Integer getOrderCount(LocalDateTime begin,LocalDateTime end,Integer status){Map mapnew HashMap();map.put(begin,begin);map.put(end,end);map.put(status,status);return orderMapper.countByMap(map);} Mapper中 /*** 根据动态条件统计订单数量* param map* return*/Integer countByMap(Map map); 对应的映射文件 select idcountByMap resultTypejava.lang.Integerselect count(id) from orderswhereif testbegin ! nulland order_time gt; #{begin}/ifif testend ! nulland order_time lt; #{end}/ifif teststatus ! nulland status #{status}/if/where/select 订单统计——功能测试 销量排名统计——需求分析与设计 产品原型 接口设计 VO设计 销量排名统计——代码开发 Controller中 /*** 订单统计* param begin* param end* return*/GetMapping(top10)ApiOperation(销量排名top10)public ResultSalesTop10ReportVO top10(DateTimeFormat(pattern yyyy-MM-dd) LocalDate begin,DateTimeFormat(pattern yyyy-MM-dd) LocalDate end){log.info(销量排名top10:{},{},begin,end);return Result.success(reportService.getSalesTop10(begin, end));} Service中 /*** 统计指定时间区间内的销量排名前10* return*/Overridepublic SalesTop10ReportVO getSalesTop10(LocalDate begin, LocalDate end) {//获得当前日期的起始时间LocalDateTime beginTime LocalDateTime.of(begin, LocalTime.MIN);LocalDateTime endTime LocalDateTime.of(end, LocalTime.MAX);ListGoodsSalesDTO salesTop10 orderMapper.getSalesTop10(beginTime, endTime);ListString names salesTop10.stream().map(GoodsSalesDTO::getName).collect(Collectors.toList());String nameListStringUtils.join(names,,);ListInteger numbers salesTop10.stream().map(GoodsSalesDTO::getNumber).collect(Collectors.toList());String numberListStringUtils.join(numbers,,);//封装返回结果数据return SalesTop10ReportVO.builder().nameList(nameList).numberList(numberList).build();} Mapper中 select od.name ,sum(od.number) number from order_detail od,orders o where od.order_id o.id and o.status 5 and o.order_time 2022-10-01 and o.order_time 2023-10-01 group by od.name order by number desc limit 0,10 /*** 统计指定时间区间内的销量排名前10* return*/ListGoodsSalesDTO getSalesTop10(LocalDateTime begin ,LocalDateTime end); 对应的映射文件 select idgetSalesTop10 resultTypecom.sky.dto.GoodsSalesDTOselect od.name ,sum(od.number) numberfrom order_detail od,orders owhere od.order_id o.id and o.status 5if testbegin!nulland o.order_time gt; #{begin}/ifif testend !nulland o.order_time lt; #{end}/ifgroup by od.nameorder by number desclimit 0,10/select 销量排名统计——功能测试
http://www.hkea.cn/news/14515094/

相关文章:

  • 给公司怎么做官方网站湛江百度网站快速排名
  • 做网站难不难ppt模板app
  • 全新网站如何做百度竞价wordpress搜索功能
  • 学校网站的建设论文公司做网站的意义
  • 网站降权查询企业形象vi设计案例分析
  • 免费网站空间免备案湖南郴州
  • 网站的一般制作流程牛天下网站做的怎么样
  • 塑料袋销售做哪个网站推广好国内的c2c网站有哪些
  • 商标设计网站提供哪些服务电子商务网站怎么做推广
  • 文明网站建设管理培训心得企业信息查询网站查询
  • 南宁制作网站的公司毕业设计 建设网站
  • 深圳专业学校网站建设三合一 网站 前端
  • 网站设计实训心得体会手机网站模板欣赏
  • 建设网站简单教程申请一个电子邮箱
  • 仿牌网站专用vps中国建设银行英文网站
  • DW个人网站怎么做国外网站鞋子做的好的网站
  • diango是做网站的后端吗制作网站能赚钱吗
  • 园区官方网站建设淘宝实时优惠券网站怎么做的
  • 建立网站 英语wordpress音乐播放插件
  • 文本编辑器做网站贵阳小程序定制开发
  • 宁波江北区城市建设档案馆网站怎么做空包网站
  • 镇江企业网站排名优化吴江城乡住房和城乡建设局网站
  • 中小企业网站建设渠道做ic用什么网站
  • 烟台电子商务网站建设天津做网站需要多少钱
  • 无锡做网站的公司电话企业咨询公司管理
  • 广州网站关键字优化ps外包网站
  • 好的品牌设计网站服饰网站建设目的
  • 网站浏览器兼容性问题吗顺德定制网站建设
  • 关于新闻管理的网站建设报告怎么申请百度网盘免费空间
  • 网站留言短信通知中英双语网站程序