feat:十二分制-奖惩规则

This commit is contained in:
wangff
2025-11-04 17:53:02 +08:00
parent 867a45f154
commit 75a0ad4676
31 changed files with 1644 additions and 0 deletions

View File

@@ -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 "";
}

View File

@@ -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;
}
}