订单 优惠券部分 重写

This commit is contained in:
2025-09-17 10:54:47 +08:00
parent b4fb2afd68
commit de08266971
14 changed files with 588 additions and 407 deletions

View File

@@ -2,6 +2,8 @@ package com.czg.utils;
import cn.hutool.core.util.StrUtil;
import java.time.LocalDate;
/**
* @author ww
* @description
@@ -15,4 +17,18 @@ public class CzgStrUtils {
public static String getStrOrNull(String str) {
return StrUtil.isNotBlank(str) ? str : null;
}
/**
* 获取当天是周几
* @return 周几
*/
public static String getStrWeek() {
int dayOfWeek = LocalDate.now().getDayOfWeek().getValue();
// 定义汉字星期数组索引0不用从1开始对应周一到周日
String[] chineseWeeks = {"", "", "", "", "", "", "", ""};
return "" + chineseWeeks[dayOfWeek];
}
}