7911511f556a50046fa0e76c2fca17cc1bf9d967.svn-base
19.4 KB
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
/**
* Copyright © 2015-2018 <a href="#">J-Site</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.web.bus;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ctc.wstx.util.StringUtil;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBasePerson;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusClhjFw;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisHouseBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisHouseQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.service.base.RegBasePersonService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusClhjFwService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusHisHouseBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusHisHouseQlrService;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 房屋历史数据录入权利人属性表Controller
* @author wb
* @version 2016-04-16
*/
@Controller
@RequestMapping(value = "${adminPath}/reg/bus/regBusHisHouseQlr")
public class RegBusHisHouseQlrController extends BaseController {
@Autowired
private RegBusHisHouseQlrService regBusHisHouseQlrService;
@Autowired
private RegBasePersonService regBasePersonService;
@Autowired
private RegBusHisHouseBdcqzsdjxxService regBusHisHouseBdcqzsdjxxService;
@Autowired
private RegBusClhjFwService regBusClhjFwService;
@ModelAttribute
public RegBusHisHouseQlr get(@RequestParam(required=false) String id) {
RegBusHisHouseQlr entity = null;
if (StringUtils.isNotBlank(id)){
entity = regBusHisHouseQlrService.get(id);
}
if (entity == null){
entity = new RegBusHisHouseQlr();
}
return entity;
}
@RequiresPermissions("reg:bus:regBusHisHouseQlr:view")
@RequestMapping(value = {"list", ""})
public String list(RegBusHisHouseQlr regBusHisHouseQlr, HttpServletRequest request, HttpServletResponse response, Model model) {
System.out.println(request.getParameter("YWH"));
if(StringUtils.isNotBlank(request.getParameter("YWH"))){
regBusHisHouseQlr.setYwh(request.getParameter("YWH"));
model.addAttribute("LSH",request.getParameter("YWH"));
}
Page<RegBusHisHouseQlr> page = regBusHisHouseQlrService.findPage(new Page<RegBusHisHouseQlr>(request, response), regBusHisHouseQlr);
//WinOpen标示
if(StringUtils.isNotBlank(request.getParameter("WO"))){
model.addAttribute("WO", "1");
}
if(StringUtils.isNotBlank(request.getParameter("optype"))){
model.addAttribute("xg", "1");
}
if(StringUtils.isNotBlank(request.getParameter("zjd"))){
model.addAttribute("zjd", "1");
model.addAttribute("optype", "1");
}
//不为空说明是宅基地权籍导入的入口进的,则要把权利人证件号,证件种类,等信息放开时手动修改,1 为宅基地导入
if(StringUtils.isNotBlank(request.getParameter("zjddr"))){
model.addAttribute("zjddr", "1");
}
if(StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))){
model.addAttribute("LISTVIEWS", "1");
}
model.addAttribute("page", page);
return "modules/reg/bus/regBusHisHouseQlrList";
}
/**
* 中间库查询list列表
* @param regBusHisHouseQlr
* @param request
* @param response
* @param model
* 2018-01-09
* @return
*/
@RequiresPermissions("reg:bus:regBusHisHouseQlr:view")
@RequestMapping(value = "zjklist")
public String zjklist(RegBusHisHouseQlr regBusHisHouseQlr, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isNotBlank(request.getParameter("YWH"))){
regBusHisHouseQlr.setYwh(request.getParameter("YWH"));
model.addAttribute("YWH", request.getParameter("YWH"));
}
Page<RegBusHisHouseQlr> page = regBusHisHouseQlrService.findqlrzjkPage(new Page<RegBusHisHouseQlr>(request, response), regBusHisHouseQlr);
//WinOpen标示
if(StringUtils.isNotBlank(request.getParameter("WO"))){
model.addAttribute("WO", "1");
}
if(StringUtils.isNotBlank(request.getParameter("xg"))){
model.addAttribute("xg", "1");
}
if(StringUtils.isNotBlank(request.getParameter("zjk"))){
model.addAttribute("zjk", "1");
}
if(StringUtils.isNotBlank(request.getParameter("LISTVIEWS"))){
model.addAttribute("LISTVIEWS", "1");
}
model.addAttribute("page", page);
return "modules/reg/bus/regBusHisHouseQlrList";
}
@RequiresPermissions("reg:bus:regBusHisHouseQlr:view")
@RequestMapping(value = "form")
public String form(RegBusHisHouseQlr regBusHisHouseQlr, Model model, HttpServletRequest request) {
System.out.println(request.getParameter("optype"));
if(StringUtils.isBlank(request.getParameter("optype"))){
model.addAttribute("SXH", getQlrmcOrderNumber(request.getParameter("YWH")));
}else{
model.addAttribute("SXH", getQlrmcOrderNumber(request.getParameter("YWH")));
model.addAttribute("optype",request.getParameter("optype"));
}
if(StringUtils.isNotBlank(request.getParameter("YWH"))){
String ywh = request.getParameter("YWH");
regBusHisHouseQlr.setYwh(ywh);
}
if(StringUtils.isNotBlank(request.getParameter("gyfs"))){
model.addAttribute("gyfs",request.getParameter("gyfs"));
regBusHisHouseQlr.setGyfs(request.getParameter("gyfs"));
}
if(StringUtils.isNotBlank(request.getParameter("XG"))){
model.addAttribute("xg", "1");
}
if(StringUtils.isNotBlank(request.getParameter("zjd"))){
model.addAttribute("zjd",request.getParameter("zjd"));
model.addAttribute("gyfs","1");
model.addAttribute("SXH", regBusHisHouseQlr.getSxh());
}
if(StringUtils.isNotBlank(request.getParameter("zjddr"))){
model.addAttribute("zjddr",request.getParameter("zjddr"));
}else{
model.addAttribute("zjddr","");
}
if(StringUtils.isNotBlank(request.getParameter("mainid"))){
model.addAttribute("mainid",request.getParameter("mainid"));
}
String qxdm = DictUtils.getDictLabel(Global.getAreaCode(), "reg_bus_xq","");
regBusHisHouseQlr.setSfczr("1");
model.addAttribute("regBusHisHouseQlr", regBusHisHouseQlr);
return "modules/reg/bus/regBusHisHouseQlrForm";
}
@RequiresPermissions("reg:bus:regBusHisHouseQlr:view")
@RequestMapping(value = "showform")
public String showform(RegBusHisHouseQlr regBusHisHouseQlr, Model model, HttpServletRequest request) {
if(StringUtils.isBlank(request.getParameter("optype"))){
model.addAttribute("SXH", regBusHisHouseQlr.getSxh());
}
if(StringUtils.isNotBlank(request.getParameter("ids"))){
model.addAttribute("idss",request.getParameter("ids"));
regBusHisHouseQlr = regBusHisHouseQlrService.get(request.getParameter("ids"));
}
if(StringUtils.isNotBlank(request.getParameter("YWH"))){
String ywh = request.getParameter("YWH");
regBusHisHouseQlr.setYwh(ywh);
}
model.addAttribute("show", "1");
model.addAttribute("regBusHisHouseQlr", regBusHisHouseQlr);
return "modules/reg/bus/regBusHisHouseQlrForm";
}
/**
* 房屋历史入口权利人添加
* @param regBusHisHouseQlr
* @param model
* @param request
* @return
*/
@RequiresPermissions("reg:bus:regBusHisHouseQlr:view")
@RequestMapping(value = "yrform")
public String yrform(RegBusHisHouseQlr regBusHisHouseQlr, Model model, HttpServletRequest request) {
Map<String,String> map = new HashMap<String,String>();
//计算当前顺序号【注意:只有新增时才需要这个值】
if(StringUtils.isBlank(request.getParameter("optype"))){
model.addAttribute("SXH", getQlrmcOrderNumber(request.getParameter("YWH")));
}else{
model.addAttribute("SXH", getQlrmcOrderNumber(request.getParameter("YWH")));
model.addAttribute("optype",request.getParameter("optype"));
}
if(StringUtils.isNotBlank(request.getParameter("xg"))){
model.addAttribute("xg", "1");
model.addAttribute("zjd", "1");
}
if(StringUtils.isNotBlank(request.getParameter("zjddr"))){
model.addAttribute("zjddr", "1");
}else{
model.addAttribute("zjddr", "");
}
if(StringUtils.isNotBlank(request.getParameter("mainid"))){
regBusHisHouseQlr.setMainid(request.getParameter("mainid"));
model.addAttribute("mainid", request.getParameter("mainid"));
}
if(StringUtils.isNotBlank(request.getParameter("YWH"))){
String ywh = request.getParameter("YWH");
regBusHisHouseQlr.setYwh(ywh);
}
if(StringUtils.isNotBlank(request.getParameter("gyfs"))){
model.addAttribute("gyfs",request.getParameter("gyfs"));
regBusHisHouseQlr.setGyfs(request.getParameter("gyfs"));
}
String ids = request.getParameter("ids");
RegBasePerson person = new RegBasePerson();
person = regBasePersonService.get(ids);
regBusHisHouseQlr.setZjzl(person.getZjzl());
regBusHisHouseQlr.setZjh(person.getZjh());
regBusHisHouseQlr.setQlrmc(person.getRymc());
regBusHisHouseQlr.setDz(person.getDz());
regBusHisHouseQlr.setHjszss(person.getHjszss());
regBusHisHouseQlr.setXb(person.getXb());
regBusHisHouseQlr.setSshy(person.getSshy());
regBusHisHouseQlr.setDh(person.getDh());
regBusHisHouseQlr.setYb(person.getYb());
regBusHisHouseQlr.setGzdw(person.getGzdw());
regBusHisHouseQlr.setDzyj(person.getDzyj());
regBusHisHouseQlr.setDlrmc(person.getDlrymc());
regBusHisHouseQlr.setDljgmc(person.getDljg());
regBusHisHouseQlr.setDlrdh(person.getDlrydh());
regBusHisHouseQlr.setBz(person.getBz());
regBusHisHouseQlr.setQlrlx(person.getRylx());
regBusHisHouseQlr.setPcode(person.getPcode());
regBusHisHouseQlr.setHjszss(person.getHjszss());
regBusHisHouseQlr.setSfczr(DictUtils.getDictValue("是", "yes_no",""));
regBusHisHouseQlr.setFzjg(person.getFzjg());
regBusHisHouseQlr.setId("");
model.addAttribute("pcode", person.getPcode());
model.addAttribute("maps", map);
model.addAttribute("regBusHisHouseQlr", regBusHisHouseQlr);
return "modules/reg/bus/regBusHisHouseQlrForm";
}
@RequiresPermissions("reg:bus:regBusHisHouseQlr:edit")
@RequestMapping(value = "save")
public synchronized String save(RegBusHisHouseQlr regBusHisHouseQlr, Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) {
User user = UserUtils.getUser();
String userid = user.getId();
if (!beanValidator(model, regBusHisHouseQlr)){
return form(regBusHisHouseQlr, model,request);
}
String zjd ="";
String zjddr ="";
if(StringUtils.isNotBlank(request.getParameter("zjd"))){
model.addAttribute("zjd",request.getParameter("zjd"));
zjd = request.getParameter("zjd");
}
if(StringUtils.isNotBlank(request.getParameter("zjddr"))){
model.addAttribute("zjddr",request.getParameter("zjddr"));
zjddr = request.getParameter("zjddr");
}else{
model.addAttribute("zjddr","");
zjddr = "";
}
if(StringUtils.isNotBlank(request.getParameter("mainid"))){
regBusHisHouseQlr.setMainid(request.getParameter("mainid"));
//获取不动产单元号
RegBusClhjFw clhjfw = regBusClhjFwService.get(regBusHisHouseQlr.getMainid());
regBusHisHouseQlr.setBdcdyh(clhjfw.getBdcdyh());
}
String lstywh = regBusHisHouseQlr.getYwh();
//通过id获取房屋大表和权利人表数据如果存在数据直接更新
RegBusHisHouseQlr qlr = new RegBusHisHouseQlr();
String ywhs = regBusHisHouseQlr.getYwh();
regBusHisHouseQlr.setId("");
qlr.setYwh(regBusHisHouseQlr.getYwh());
qlr.setZjh(regBusHisHouseQlr.getZjh());
List<RegBusHisHouseQlr> qlrlist = regBusHisHouseQlrService.findList(qlr);//获取权利人子表数据
if(qlrlist.size()>0){
regBusHisHouseQlr.setSxh(qlrlist.get(0).getSxh());
regBusHisHouseQlr.setId(qlrlist.get(0).getId());
}
regBusHisHouseQlr.setGyqk(DictUtils.getDictLabel(regBusHisHouseQlr.getGyfs(), "reg_bus_gyfs", ""));
regBusHisHouseQlrService.save(regBusHisHouseQlr);
addMessage(redirectAttributes, "保存房屋历史数据录入权利人信息成功");
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusHisHouseQlr/list?WO=1&LISTVIEWS=1&YWH="+ywhs+"&zjd="+zjd+"&zjddr="+zjddr;
}
@RequiresPermissions("reg:bus:regBusHisHouseQlr:edit")
@RequestMapping(value = "delete")
public String delete(RegBusHisHouseQlr regBusHisHouseQlr, RedirectAttributes redirectAttributes) {
RegBusHisHouseQlr regBushishouseQlr1 = new RegBusHisHouseQlr();
regBushishouseQlr1.setYwh(regBusHisHouseQlr.getYwh());
List<RegBusHisHouseQlr> regBusQlrlist = regBusHisHouseQlrService.findList(regBushishouseQlr1);
if(regBusQlrlist.size() > 0){
regBushishouseQlr1 = regBusQlrlist.get(regBusQlrlist.size()-1);
if(Integer.parseInt(regBushishouseQlr1.getSxh()) > Integer.parseInt(regBusHisHouseQlr.getSxh())){//判断当前顺序号是否是最大顺序号
addMessage(redirectAttributes, "请先删除最大顺序号权利人!");
}else{
if(StringUtils.isNotBlank(regBushishouseQlr1.getId())){
regBusHisHouseQlrService.deleteqlrzjk(regBushishouseQlr1);
logger.info("删除权利人sql被调用了,删除业务号为:"+regBusHisHouseQlr.getYwh()+",查询响应数:"+regBusQlrlist.size());
}
addMessage(redirectAttributes, "删除房屋历史数据录入权利人信息成功");
}
}
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusHisHouseQlr/list?YWH="+regBusHisHouseQlr.getYwh();
}
/**
* 中间库删除
* @param regBusHisHouseQlr
* @param redirectAttributes
* @return
*/
@RequiresPermissions("reg:bus:regBusHisHouseQlr:edit")
@RequestMapping(value = "qlrzjkdelete")
public String qlrzjkdelete(RegBusHisHouseQlr regBusHisHouseQlr, RedirectAttributes redirectAttributes,HttpServletRequest request) {
if(StringUtils.isNotBlank(regBusHisHouseQlr.getYwh())){
RegBusHisHouseQlr regBushishouseQlr1 = new RegBusHisHouseQlr();
regBushishouseQlr1.setYwh(regBusHisHouseQlr.getYwh());
List<RegBusHisHouseQlr> regBusQlrlist = regBusHisHouseQlrService.findqlrzjkList(regBushishouseQlr1);
regBushishouseQlr1 = regBusHisHouseQlrService.getqlrzjk(request.getParameter("id"));
if(regBusQlrlist.size() > 0){
regBushishouseQlr1 = regBusQlrlist.get(regBusQlrlist.size()-1);
if(Integer.parseInt(regBushishouseQlr1.getSxh()) > Integer.parseInt(regBusHisHouseQlr.getSxh())){//判断当前顺序号是否是最大顺序号
addMessage(redirectAttributes, "请先删除最大顺序号权利人!");
}else{
if(StringUtils.isNotBlank(regBusHisHouseQlr.getId())){
regBusHisHouseQlrService.deleteqlrzjk(regBusHisHouseQlr);
}
addMessage(redirectAttributes, "删除房屋历史数据录入权利人信息成功");
}
}
}
return "redirect:"+Global.getAdminPath()+"/reg/bus/regBusHisHouseQlr/list?YWH="+regBusHisHouseQlr.getYwh();
}
/**
* 判断是否已有第一笔为共同共有的权利人
* @param request
* @return
*/
@RequiresPermissions("reg:bus:regBusHisHouseQlr:view")
@RequestMapping(value = "isFlagGyqk")
@ResponseBody
public ModelMap isFlagGyqk(HttpServletRequest request) {
ModelMap modelMap = new ModelMap();
String ywh = request.getParameter("YWH");
RegBusHisHouseQlr regBusQlr = new RegBusHisHouseQlr();
regBusQlr.setYwh(ywh);
List<RegBusHisHouseQlr> findList = regBusHisHouseQlrService.findList(regBusQlr);
if(findList.size() > 0){
regBusQlr = findList.get(0);
if(regBusQlr.getGyfs().equals("0")){//单独所有
modelMap.put("success", 0);
modelMap.put("msg", "第一权利人为单独所有,不能继续添加权利人!");
}else {
modelMap.put("success", 1);
}
modelMap.put("gyfs", regBusQlr.getGyfs());
}else {
modelMap.put("success", 1);
modelMap.put("gyfs", "");
}
return modelMap;
}
/**
* 判断是否已有第一笔为共同共有的权利人
* @param request
* @return
*/
@RequiresPermissions("reg:bus:regBusHisHouseQlr:view")
@RequestMapping(value = "querygyfs")
@ResponseBody
public ModelMap querygyfs(HttpServletRequest request) {
ModelMap modelMap = new ModelMap();
String ywh = request.getParameter("YWH");
RegBusHisHouseQlr regBusQlr = new RegBusHisHouseQlr();
regBusQlr.setYwh(ywh);
List<RegBusHisHouseQlr> findList = regBusHisHouseQlrService.findList(regBusQlr);
if(findList.size() > 0){
regBusQlr = findList.get(0);
if("0".equals(regBusQlr.getGyfs())){
if(findList.size() == 1){
modelMap.put("success", 0);
}else{
modelMap.put("success", 1);
modelMap.put("msg","共有情况为:"+DictUtils.getDictLabel(regBusQlr.getGyfs(), "reg_bus_gyfs", "")+"。权利人为空或多个与情况不符,请确认!");
}
}else{
if(findList.size() > 1){
modelMap.put("success", 0);
}else{
modelMap.put("success", 1);
modelMap.put("msg","共有情况为:"+DictUtils.getDictLabel(regBusQlr.getGyfs(), "reg_bus_gyfs", "")+"。权利人为空或一个与情况不符,请确认!");
}
}
}
return modelMap;
}
/***
* @Title: getQlrmcOrderNumber
* @Description: 通过业务号获取当前权利人在此业务中的顺序号
* @param @param ywhStr
* @param @return 设定文件
* @return String 返回类型
* @throws
*/
public int getQlrmcOrderNumber(String ywhStr){
int qlrmcOrderNumber = 1;//默认为001
if(StringUtils.isBlank(ywhStr)){
return qlrmcOrderNumber;
}
//首先获取权利人 ID个数
RegBusHisHouseQlr qlr = new RegBusHisHouseQlr();
qlr.setYwh(ywhStr);
List<RegBusHisHouseQlr> qlrlist = regBusHisHouseQlrService.findList(qlr);
int count = qlrlist.size();
if(count > 0){
qlrmcOrderNumber = qlrlist.size() + 1;
}
return qlrmcOrderNumber;
}
/***
* @Title: getNextYwh
* @Description: 获取并生成业务号
* @param @return 设定文件
* @return String 返回类型
* @throws
*/
private synchronized String getNextqlrYwhs() {
String maxYwh = regBusHisHouseQlrService.findMaxYwhLs();
if(StringUtils.isNotBlank(maxYwh) && DateUtils.getDate("yyyyMMdd").equals(maxYwh.substring(3, 11))){
maxYwh = maxYwh.substring(3, 15);
}else{
maxYwh = DateUtils.getDate("yyyyMMdd") + "0000";
}
String nextYwh = DateUtils.getDate("yyyyMMdd") + "0001";
//如果数据里的最大业务号不为空,就取出来进行处理;否则直接默认值
if(StringUtils.isNotBlank(maxYwh)){
//如果当前日期字符串等于数据库里最大业务号前面的日期字符串,那只要顺序往上加就好;否则直接默认值
if(DateUtils.getDate("yyyyMMdd").equals(maxYwh.substring(0, 8))){
int nextSerNum = Integer.parseInt(maxYwh.substring(8)) + 1;
if (nextSerNum < 10) {
nextYwh = DateUtils.getDate("yyyyMMdd") + "000" + nextSerNum;
}else if (nextSerNum > 9 && nextSerNum < 100) {
nextYwh = DateUtils.getDate("yyyyMMdd") + "00" + nextSerNum;
}else if (nextSerNum > 99 && nextSerNum < 1000) {
nextYwh = DateUtils.getDate("yyyyMMdd") + "0" + nextSerNum;
}else {
nextYwh = DateUtils.getDate("yyyyMMdd") + nextSerNum;
}
}
}
System.out.println(nextYwh);
return nextYwh;
}
}