feat:十二分制-奖惩规则
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.cool.store.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 字典表填充字段
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface DictField {
|
||||
String sourceField() default "";
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 十二分制 辅助工具类
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/4
|
||||
*/
|
||||
public class TpHelper {
|
||||
private final static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyMMddHHmmssSSS");
|
||||
|
||||
/**
|
||||
* 生成惩处单号
|
||||
*/
|
||||
public static String generatePenaltyRuleCode() {
|
||||
return "CC" + generateCode();
|
||||
}
|
||||
/**
|
||||
* 生成加分单号
|
||||
*/
|
||||
public static String generateRewardRuleCode() {
|
||||
return "JF" + generateCode();
|
||||
}
|
||||
|
||||
private static String generateCode() {
|
||||
return LocalDateTime.now().format(dtf) + (int) (Math.random() * 900) + 100;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user