提交 | 用户 | 时间
|
8d3ff6
|
1 |
package com.iailab.module.pms.coalquality.common.utils; |
J |
2 |
|
|
3 |
import com.iailab.framework.common.util.date.DateUtils; |
|
4 |
import org.apache.commons.lang3.StringUtils; |
|
5 |
|
|
6 |
import java.util.Date; |
|
7 |
|
|
8 |
/** |
|
9 |
* @author Jay |
|
10 |
*/ |
|
11 |
public class SerialNumUtils { |
|
12 |
|
|
13 |
public static String getSerialNum(String prefix, Date date, String bc) { |
|
14 |
StringBuilder sb = new StringBuilder(); |
|
15 |
if (StringUtils.isNotEmpty(prefix)) { |
|
16 |
sb.append(prefix); |
|
17 |
} |
|
18 |
|
|
19 |
if (date != null) { |
|
20 |
sb.append(DateUtils.format(date, "yyyyMMdd")); |
|
21 |
} |
|
22 |
|
|
23 |
if ("bb".equals(bc)) { |
|
24 |
sb.append("1"); |
|
25 |
} else { |
|
26 |
sb.append("2"); |
|
27 |
} |
|
28 |
|
|
29 |
return sb.toString(); |
|
30 |
} |
|
31 |
} |