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

网站建设的分类网上购物系统数据流图

网站建设的分类,网上购物系统数据流图,网站开发是网站后台开发吗,app商城网站开发背景 因邮件数据过多,因此采用了分表的方式来进行存储, 支持按照天、周、月来分表以下为设计的方法 import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.ArrayList; import…
背景

因邮件数据过多,因此采用了分表的方式来进行存储, 支持按照天、周、月来分表以下为设计的方法

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.List;public class IndexSuffixCalculator {// 按天格式化日期的模式private static final DateTimeFormatter DAY_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");// 按周格式化日期的模式private static final DateTimeFormatter WEEK_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");// 按月格式化日期的模式private static final DateTimeFormatter MONTH_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM");/*** 根据时间范围和配置计算索引后缀** @param startDate 开始日期* @param endDate   结束日期* @param mode      配置模式:day, week 或 month* @return 索引后缀列表*/public List<String> calculateIndexSuffixes(LocalDate startDate, LocalDate endDate, String mode) {if ("day".equalsIgnoreCase(mode)) {return calculateDailySuffixes(startDate, endDate);} else if ("week".equalsIgnoreCase(mode)) {return calculateWeeklySuffixes(startDate, endDate);} else if ("month".equalsIgnoreCase(mode)) {return calculateMonthlySuffixes(startDate, endDate);} else {throw new IllegalArgumentException("Unsupported mode: " + mode);}}/*** 按天计算索引后缀** @param startDate 开始日期* @param endDate   结束日期* @return 按天的索引后缀列表*/private List<String> calculateDailySuffixes(LocalDate startDate, LocalDate endDate) {List<String> suffixes = new ArrayList<>();LocalDate currentDate = startDate;while (!currentDate.isAfter(endDate)) {suffixes.add(currentDate.format(DAY_FORMATTER));currentDate = currentDate.plusDays(1); // 移动到下一天}return suffixes;}/*** 按周计算索引后缀** @param startDate 开始日期* @param endDate   结束日期* @return 按周的索引后缀列表*/private List<String> calculateWeeklySuffixes(LocalDate startDate, LocalDate endDate) {List<String> suffixes = new ArrayList<>();LocalDate currentDate = startDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));while (!currentDate.isAfter(endDate)) {suffixes.add(currentDate.format(WEEK_FORMATTER));currentDate = currentDate.plusWeeks(1); // 移动到下一周的周一}return suffixes;}/*** 按月计算索引后缀** @param startDate 开始日期* @param endDate   结束日期* @return 按月的索引后缀列表*/private List<String> calculateMonthlySuffixes(LocalDate startDate, LocalDate endDate) {List<String> suffixes = new ArrayList<>();LocalDate currentDate = startDate.with(TemporalAdjusters.firstDayOfMonth());while (!currentDate.isAfter(endDate)) {suffixes.add(currentDate.format(MONTH_FORMATTER));currentDate = currentDate.plusMonths(1); // 移动到下一个月的第一天}return suffixes;}public static void main(String[] args) {// 测试用例LocalDate startDate = LocalDate.of(2025, 4, 1);LocalDate endDate = LocalDate.of(2025, 6, 30);IndexSuffixCalculator calculator = new IndexSuffixCalculator();// 按天计算List<String> dailySuffixes = calculator.calculateIndexSuffixes(startDate, endDate, "day");System.out.println("Daily Suffixes: " + dailySuffixes);// 按周计算List<String> weeklySuffixes = calculator.calculateIndexSuffixes(startDate, endDate, "week");System.out.println("Weekly Suffixes: " + weeklySuffixes);// 按月计算List<String> monthlySuffixes = calculator.calculateIndexSuffixes(startDate, endDate, "month");System.out.println("Monthly Suffixes: " + monthlySuffixes);}
}
http://www.dtcms.com/wzjs/589771.html

相关文章:

  • 微信息公众平台微网站建设wordpress的ping
  • 如何介绍自己做的网站建立网站的链接结构有哪几种形式简述其各自的优缺点
  • 怎么查询最新网站兰州网站运营
  • 企业手机网站 案例网站备案跟做哪个推广有关系吗
  • 自学网站平面设计typecho做网站
  • 电脑如何做ppt模板下载网站小程序代理公司
  • 深圳品牌网站建设公司有哪些企业网站如何上存
  • 网站开发流程丽江免费商城版网站制作
  • 做网站需要竞品分析么拓者设计吧电脑版
  • pc网站是什么西安做网站魔盒
  • 网站建设zgkr无锡有人代做淘宝网站吗
  • 自己做的网站怎么查福州市网站建设公司
  • 深圳市南山区住房和建设局官方网站wordpress炫酷网页
  • 全国门户网站有哪些广州学生做网站
  • 网站建设区别广州注册公司代理
  • 千万不要报培训班学室内设计天津做网站优化价格
  • 宠物网站设计的代码北京微信网站建设公司
  • 防网站模板微信自建小程序
  • 企业网站需要什么深州市住房保障和城乡建设局网站
  • html 网站源码 卖手机核心关键词和长尾关键词举例
  • 知道源代码如何做网站dedecms 网站安装教程
  • 如何查看网站的更新频率网站建设公司 华艺网络
  • 商丘网站建设方案昆明市门户网站
  • 单页面网站无锡网络营销推广公司
  • 长沙做企业网站推广的公司湖南宣传片制作公司
  • 电子商务网站接口费率企业网站开发用什么软件
  • 网站架构的优化wamp做的网站外网怎么访问不了
  • 科技公司主要经营什么知乎seo
  • 网页设计与网站建设全攻略上海临平路网站建设
  • 网站上线 文案龙岩做网站改版一般多久