| | |
| | | package com.fzzy.igds.utils; |
| | | |
| | | import com.fzzy.igds.camera.data.ydqly.YdQlyNode; |
| | | import com.fzzy.igds.constant.GrainFrequence; |
| | | import com.ruoyi.common.config.FrameworkConfig; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.ShiroUtils; |
| | |
| | | */ |
| | | public static Map<String, String> contextSnCompanyIdMap = new HashMap<>(); |
| | | |
| | | /** |
| | | * 流媒体节点使用 |
| | | */ |
| | | public static List<YdQlyNode> nodeList = null; |
| | | |
| | | /** |
| | | * 生成顺序ID:年月日时分秒毫秒(17位) + 序列号(4位) = 21位 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据系统配置的批次频率获取批次编号 |
| | | * |
| | | * @param freq |
| | | * @return |
| | | */ |
| | | public static String getBatchIdByFireq(String freq) { |
| | | // 一天一次 |
| | | if (GrainFrequence.FREQ_02.getCode().equals(freq)) { |
| | | return DateFormatUtils.format(new Date(), "yyyyMMdd") + "1801"; |
| | | } |
| | | |
| | | // 一天两次 |
| | | if (GrainFrequence.FREQ_03.getCode().equals(freq)) { |
| | | String hour = DateFormatUtils.format(new Date(), "HH"); |
| | | if (Integer.valueOf(hour) >= 0 && Integer.valueOf(hour) <= 12) { |
| | | return DateFormatUtils.format(new Date(), "yyyyMMdd") + "1301"; |
| | | } else { |
| | | return DateFormatUtils.format(new Date(), "yyyyMMdd") + "1802"; |
| | | } |
| | | } |
| | | return getDefaultBatchId(); |
| | | } |
| | | |
| | | public static String getDefaultBatchId() { |
| | | return DateFormatUtils.format(new Date(), "yyyyMMddHHmm"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | for (int i = 0; i < 10; i++){ |
| | | String id = generateId(); |