package cn.huge.module.mediate.utils; import cn.huge.base.common.constant.GzAreaEnum; import cn.huge.base.common.utils.DateUtils; import java.text.SimpleDateFormat; import java.util.Date; /** * @title: 事项编号生成工具 * @description: 事项编号生成工具 * @company: hugeinfo * @author: liyj * @time: 2021-11-05 16:51:48 * @version: 1.0.0 */ public class CaseRefUtils { /** * 时间Id统计常量,常量后缀 */ public static int CASE_REF_COUNT = 10000; /** * 时间Id统计常量,常量后缀 */ public static String CASE_REF_SIGN = "GZ"; /** * 各区调解案号是否要重新查询 */ public static boolean CASE_REF_FLAG = true; /** * 获取粤云调号 * @return */ public synchronized static String getCaseRef(){ String timeId = getNowTime() + (CASE_REF_COUNT++); if(CASE_REF_COUNT > 99999){ CASE_REF_COUNT = 10000; } String cloudCaseRef = CASE_REF_SIGN + timeId.substring(2, timeId.length()); System.out.println(cloudCaseRef); return cloudCaseRef; } /** * 获取时间Id,后四位常量 * @return String */ public synchronized static String getNowTime(){ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); String nowTime = sdf.format(new Date()); return nowTime; } } /** * -------------------_ooOoo_------------------- * ------------------o8888888o------------------ * ------------------88" . "88------------------ * ------------------(| -_- |)------------------ * ------------------O\ = /O------------------ * ---------------____/`---'\____--------------- * -------------.' \\| |// `.------------- * ------------/ \\||| : |||// \------------ * -----------/ _||||| -:- |||||- \----------- * -----------| | \\\ - /// | |----------- * -----------| \_| ''\---/'' | |----------- * -----------\ .-\__ `-` ___/-. /----------- * ---------___`. .' /--.--\ `. . __---------- * ------."" '< `.___\_<|>_/___.' >'"".------- * -----| | : `- \`.;`\ _ /`;.`/ - ` : | |----- * -----\ \ `-. \_ __\ /__ _/ .-` / /----- * ======`-.____`-.___\_____/___.-`____.-'====== * -------------------`=---=' * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * ---------佛祖保佑---hugeinfo---永无BUG---------- */