广州市综治平台后端
xusd
2 days ago c490640493f04e2ed0fc5c4c8fbc92ebdd4d5380
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
package cn.huge.module.mediate.utils;
 
import cn.huge.base.common.constant.GzRegionBaseEnum;
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 CaseNoUtils {
 
    /**
     * 常量前缀
     */
    public static String CASE_NO_SIGN_TH = "穗天综调";
    public static String CASE_NO_SIGN_HZ = "穗海综调";
    public static String CASE_NO_SIGN_LW = "穗荔综调";
    public static String CASE_NO_SIGN_YX = "穗越综调";
    public static String CASE_NO_SIGN_PY = "穗番综调";
    public static String CASE_NO_SIGN_HD = "穗花综调";
    public static String CASE_NO_SIGN_BY = "穗云综调";
    public static String CASE_NO_SIGN_NS = "穗南综调";
    public static String CASE_NO_SIGN_HP = "穗埔综调";
    public static String CASE_NO_SIGN_ZC = "穗增综调";
    public static String CASE_NO_SIGN_CH = "穗从综调";
    public static String CASE_NO_SIGN_GZ = "粤调";
 
    /**
     * 序号
     */
    public static int CASE_NO_COUNT_TH = 0;
    public static int CASE_NO_COUNT_HZ = 0;
    public static int CASE_NO_COUNT_LW = 0;
    public static int CASE_NO_COUNT_YX = 0;
    public static int CASE_NO_COUNT_PY = 0;
    public static int CASE_NO_COUNT_HD = 0;
    public static int CASE_NO_COUNT_BY = 0;
    public static int CASE_NO_COUNT_NS = 0;
    public static int CASE_NO_COUNT_HP = 0;
    public static int CASE_NO_COUNT_ZC = 0;
    public static int CASE_NO_COUNT_CH = 0;
    public static int CASE_NO_COUNT_GZ = 0;
 
    /**
     * 是否要重新查询,true是
     */
    public static boolean CASE_NO_FLAG_TH = true;
    public static boolean CASE_NO_FLAG_HZ = true;
    public static boolean CASE_NO_FLAG_LW = true;
    public static boolean CASE_NO_FLAG_YX = true;
    public static boolean CASE_NO_FLAG_PY = true;
    public static boolean CASE_NO_FLAG_HD = true;
    public static boolean CASE_NO_FLAG_BY = true;
    public static boolean CASE_NO_FLAG_NS = true;
    public static boolean CASE_NO_FLAG_HP = true;
    public static boolean CASE_NO_FLAG_ZC = true;
    public static boolean CASE_NO_FLAG_CH = true;
    public static boolean CASE_NO_FLAG_GZ = true;
 
    /**
     * 判断是否要重新查询
     * @return
     */
    public synchronized static Boolean getFlag(String area){
        if (GzRegionBaseEnum.AREA_1.getIndex().equals(area)){
            return CASE_NO_FLAG_TH;
        }else if (GzRegionBaseEnum.AREA_2.getIndex().equals(area)){
            return CASE_NO_FLAG_HZ;
        }else if (GzRegionBaseEnum.AREA_3.getIndex().equals(area)){
            return CASE_NO_FLAG_LW;
        }else if (GzRegionBaseEnum.AREA_4.getIndex().equals(area)){
            return CASE_NO_FLAG_YX;
        }else if (GzRegionBaseEnum.AREA_5.getIndex().equals(area)){
            return CASE_NO_FLAG_PY;
        }else if (GzRegionBaseEnum.AREA_6.getIndex().equals(area)){
            return CASE_NO_FLAG_HD;
        }else if (GzRegionBaseEnum.AREA_7.getIndex().equals(area)){
            return CASE_NO_FLAG_BY;
        }else if (GzRegionBaseEnum.AREA_8.getIndex().equals(area)){
            return CASE_NO_FLAG_NS;
        }else if (GzRegionBaseEnum.AREA_9.getIndex().equals(area)){
            return CASE_NO_FLAG_HP;
        }else if (GzRegionBaseEnum.AREA_10.getIndex().equals(area)){
            return CASE_NO_FLAG_ZC;
        }else if (GzRegionBaseEnum.AREA_11.getIndex().equals(area)){
            return CASE_NO_FLAG_CH;
        }else {
            return CASE_NO_FLAG_GZ;
        }
    }
 
    /**
     * 设置是否要重新查询
     * @return
     */
    public synchronized static void setFlag(String area, boolean flag){
        if (GzRegionBaseEnum.AREA_1.getIndex().equals(area)){
            CASE_NO_FLAG_TH = flag;
        }else if (GzRegionBaseEnum.AREA_2.getIndex().equals(area)){
            CASE_NO_FLAG_HZ = flag;
        }else if (GzRegionBaseEnum.AREA_3.getIndex().equals(area)){
            CASE_NO_FLAG_LW = flag;
        }else if (GzRegionBaseEnum.AREA_4.getIndex().equals(area)){
            CASE_NO_FLAG_YX = flag;
        }else if (GzRegionBaseEnum.AREA_5.getIndex().equals(area)){
            CASE_NO_FLAG_PY = flag;
        }else if (GzRegionBaseEnum.AREA_6.getIndex().equals(area)){
            CASE_NO_FLAG_HD = flag;
        }else if (GzRegionBaseEnum.AREA_7.getIndex().equals(area)){
            CASE_NO_FLAG_BY = flag;
        }else if (GzRegionBaseEnum.AREA_8.getIndex().equals(area)){
            CASE_NO_FLAG_NS = flag;
        }else if (GzRegionBaseEnum.AREA_9.getIndex().equals(area)){
            CASE_NO_FLAG_HP = flag;
        }else if (GzRegionBaseEnum.AREA_10.getIndex().equals(area)){
            CASE_NO_FLAG_ZC = flag;
        }else if (GzRegionBaseEnum.AREA_11.getIndex().equals(area)){
            CASE_NO_FLAG_CH = flag;
        }else {
            CASE_NO_FLAG_GZ = flag;
        }
    }
 
    /**
     * 获取前缀
     * @return
     */
    public synchronized static String getSign(String area){
        StringBuffer caseNoSign = new StringBuffer();
        // 设置年号
        int year = DateUtils.getYear(DateUtils.getNowDate());
        caseNoSign.append(year);
        if (GzRegionBaseEnum.AREA_1.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_TH);
        }else if (GzRegionBaseEnum.AREA_2.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_HZ);
        }else if (GzRegionBaseEnum.AREA_3.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_LW);
        }else if (GzRegionBaseEnum.AREA_4.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_YX);
        }else if (GzRegionBaseEnum.AREA_5.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_PY);
        }else if (GzRegionBaseEnum.AREA_6.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_HD);
        }else if (GzRegionBaseEnum.AREA_7.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_BY);
        }else if (GzRegionBaseEnum.AREA_8.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_NS);
        }else if (GzRegionBaseEnum.AREA_9.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_HP);
        }else if (GzRegionBaseEnum.AREA_10.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_ZC);
        }else if (GzRegionBaseEnum.AREA_11.getIndex().equals(area)){
            caseNoSign.append(CASE_NO_SIGN_CH);
        }else {
            caseNoSign.append(CASE_NO_SIGN_GZ);
        }
        return caseNoSign.toString();
    }
 
    /**
     * 设置常量数
     * @return
     */
    public synchronized static void setCount(String area, int num){
        if (GzRegionBaseEnum.AREA_1.getIndex().equals(area)){
            CASE_NO_COUNT_TH = num;
        }else if (GzRegionBaseEnum.AREA_2.getIndex().equals(area)){
            CASE_NO_COUNT_HZ = num;
        }else if (GzRegionBaseEnum.AREA_3.getIndex().equals(area)){
            CASE_NO_COUNT_LW = num;
        }else if (GzRegionBaseEnum.AREA_4.getIndex().equals(area)){
            CASE_NO_COUNT_YX = num;
        }else if (GzRegionBaseEnum.AREA_5.getIndex().equals(area)){
            CASE_NO_COUNT_PY = num;
        }else if (GzRegionBaseEnum.AREA_6.getIndex().equals(area)){
            CASE_NO_COUNT_HD = num;
        }else if (GzRegionBaseEnum.AREA_7.getIndex().equals(area)){
            CASE_NO_COUNT_BY = num;
        }else if (GzRegionBaseEnum.AREA_8.getIndex().equals(area)){
            CASE_NO_COUNT_NS = num;
        }else if (GzRegionBaseEnum.AREA_9.getIndex().equals(area)){
            CASE_NO_COUNT_HP = num;
        }else if (GzRegionBaseEnum.AREA_10.getIndex().equals(area)){
            CASE_NO_COUNT_ZC = num;
        }else if (GzRegionBaseEnum.AREA_11.getIndex().equals(area)){
            CASE_NO_COUNT_CH = num;
        }else {
            CASE_NO_COUNT_GZ = num;
        }
    }
 
    /**
     * 获取案号
     * @return
     */
    public synchronized static String getCaseNo(String area){
        StringBuffer caseNo = new StringBuffer();
        // 设置前缀
        caseNo.append(getSign(area));
        if (GzRegionBaseEnum.AREA_1.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_TH += 1;
            caseNo.append(CASE_NO_COUNT_TH).append("号");
        }else if (GzRegionBaseEnum.AREA_2.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_HZ += 1;
            caseNo.append(CASE_NO_COUNT_HZ).append("号");
        }else if (GzRegionBaseEnum.AREA_3.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_LW += 1;
            caseNo.append(CASE_NO_COUNT_LW).append("号");
        }else if (GzRegionBaseEnum.AREA_4.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_YX += 1;
            caseNo.append(CASE_NO_COUNT_YX).append("号");
        }else if (GzRegionBaseEnum.AREA_5.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_PY += 1;
            caseNo.append(CASE_NO_COUNT_PY).append("号");
        }else if (GzRegionBaseEnum.AREA_6.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_HD += 1;
            caseNo.append(CASE_NO_COUNT_HD).append("号");
        }else if (GzRegionBaseEnum.AREA_7.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_BY += 1;
            caseNo.append(CASE_NO_COUNT_BY).append("号");
        }else if (GzRegionBaseEnum.AREA_8.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_NS += 1;
            caseNo.append(CASE_NO_COUNT_NS).append("号");
        }else if (GzRegionBaseEnum.AREA_9.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_HP += 1;
            caseNo.append(CASE_NO_COUNT_HP).append("号");
        }else if (GzRegionBaseEnum.AREA_10.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_ZC += 1;
            caseNo.append(CASE_NO_COUNT_ZC).append("号");
        }else if (GzRegionBaseEnum.AREA_11.getIndex().equals(area)){
            // 当前序号+1
            CASE_NO_COUNT_CH += 1;
            caseNo.append(CASE_NO_COUNT_CH).append("号");
        }else {
            // 当前序号+1
            CASE_NO_COUNT_GZ += 1;
            caseNo.append(CASE_NO_COUNT_GZ).append("号");
        }
        System.out.println(caseNo.toString());
        return caseNo.toString();
    }
}
/**
 * -------------------_ooOoo_-------------------
 * ------------------o8888888o------------------
 * ------------------88" . "88------------------
 * ------------------(| -_- |)------------------
 * ------------------O\  =  /O------------------
 * ---------------____/`---'\____---------------
 * -------------.'  \\|     |//  `.-------------
 * ------------/  \\|||  :  |||//  \------------
 * -----------/  _||||| -:- |||||-  \-----------
 * -----------|   | \\\  -  /// |   |-----------
 * -----------| \_|  ''\---/''  |   |-----------
 * -----------\  .-\__  `-`  ___/-. /-----------
 * ---------___`. .'  /--.--\  `. . __----------
 * ------."" '<  `.___\_<|>_/___.'  >'"".-------
 * -----| | :  `- \`.;`\ _ /`;.`/ - ` : | |-----
 * -----\  \ `-.   \_ __\ /__ _/   .-` /  /-----
 * ======`-.____`-.___\_____/___.-`____.-'======
 * -------------------`=---='
 * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 * ---------佛祖保佑---hugeinfo---永无BUG----------
 */