a9d28dbf46042be498d3cef129176bdbe8e3193a.svn-base 40.1 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 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062
/**
 * Copyright &copy; 2015-2018 <a href="#">J-Site</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.reg.web.base;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
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.google.common.collect.Lists;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.mapper.JsonMapper;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseH;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBasePerson;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseXm;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdjbxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisHouseQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusHisHouseYwr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSlsq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYwr;
import com.thinkgem.jeesite.modules.reg.service.base.RegBasePersonService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseXmService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdjbxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusHisBdcqzsdjxxService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusHisHouseQlrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusHisHouseYwrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusQlrService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusSlsqService;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusYwrService;
import com.thinkgem.jeesite.modules.reg.utils.RegUtils;
import com.thinkgem.jeesite.modules.reg.web.bus.RegBusUtils;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.service.InterSiService;
import com.thinkgem.jeesite.modules.sys.service.SystemService;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;

/**
 * 人员信息维护Controller
 * @author xuyg
 * @version 2016-04-12
 */
@Controller
@RequestMapping(value = "${adminPath}/reg/base/regBasePerson")
public class RegBasePersonController extends BaseController {

	@Autowired
	private RegBasePersonService regBasePersonService;
	@Autowired
	private RegBaseZdjbxxService regBaseZdjbxxService;
	@Autowired
	private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
	@Autowired
	private RegBusHisBdcqzsdjxxService regBusHisBdcqzsdjxxService;
	@Autowired
	private RegBusQlrService regBusQlrService;
	@Autowired
	private RegBusYwrService regBusYwrService;
	@Autowired
	private SystemService systemService;
	@Autowired
	private RegBusSlsqService regBusSlsqService;
	@Autowired
	private RegBaseXmService regBaseXmService;
	@Autowired
	private RegBusHisHouseQlrService regBusHisHouseQlrService;
	@Autowired
	private RegBusHisHouseYwrService regBusHisHouseYwrService;
	@Autowired
	private InterSiService siService;
	
	@ModelAttribute
	public RegBasePerson get(@RequestParam(required=false) String id) {
		RegBasePerson entity = null;
		if (StringUtils.isNotBlank(id)){
			entity = regBasePersonService.get(id);
		}
		if (entity == null){
			entity = new RegBasePerson();
		}
		return entity;
	}
	
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = {"list", ""})
	public String list(RegBasePerson regBasePerson, HttpServletRequest request, HttpServletResponse response, Model model) {
		String djlx = "";
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			djlx = request.getParameter("djlx");
		}
		//房屋更名调用
		String xz = "";
		System.out.println(request.getParameter("xz"));
		if("true".equals(request.getParameter("xz")) || "1".equals(request.getParameter("xz"))){
			model.addAttribute("xz", "1");
		}else if("false".equals(request.getParameter("xz")) || "0".equals(request.getParameter("xz"))){
			model.addAttribute("xz", "0");
		}else{
			if("809".equals(djlx) || "422".equals(djlx) || "819".equals(djlx) || "416".equals(djlx)){
				model.addAttribute("xz", "0");
			}else{
				model.addAttribute("xz",null);
			}
		}
		System.err.println(request.getParameter("VIEW"));
		Page<RegBasePerson> page =null;
		logger.info("djlx=="+djlx);
		if("809".equals(djlx) || "422".equals(djlx) || "819".equals(djlx) || "416".equals(djlx)){
			 if("false".equals(request.getParameter("xz")) || request.getParameter("xz") == null){
				 String pcode =  request.getParameter("pcode");
				 String zjzl  =  request.getParameter("zjzl");
				 String qlrmc = request.getParameter("qlrmc");
				 String zjh =  request.getParameter("zjh");
				 regBasePerson.setPcode(pcode);
				 regBasePerson.setZjzl(zjzl);
				 regBasePerson.setRymc(qlrmc);
				 regBasePerson.setZjh(zjh);
				 page = regBasePersonService.findfwqlrgmPage(new Page<RegBasePerson>(request, response), regBasePerson);
			 }else{
				 page = regBasePersonService.findPage(new Page<RegBasePerson>(request, response), regBasePerson);
			 }
		}else{
			 page = regBasePersonService.findPage(new Page<RegBasePerson>(request, response), regBasePerson);
		}
		model.addAttribute("page", page);
		System.out.println(request.getParameter("xz"));
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx", request.getParameter("djlx"));
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEW"))){//权属调用只能添加不能修改删除
			model.addAttribute("VIEW", request.getParameter("VIEW"));
		} 
		String chxxxz = request.getParameter("CHXXXZ");
		if(StringUtils.isNotBlank(chxxxz) && !"null".equals(chxxxz)){//权属调用只能添加不能修改删除
			model.addAttribute("CHXXXZ", chxxxz);
		}
		if(StringUtils.isNotBlank(request.getParameter("addPerson"))){
			model.addAttribute("addPerson", request.getParameter("addPerson"));
		}
		String xzqhz = Global.getAreaCode();
		model.addAttribute("xzqhz", xzqhz);
		if(StringUtils.isNotBlank(request.getParameter("dyqs"))){//抵押权属调用只能添加不能修改删除,传参方式是页面传入
			return "modules/reg/base/regBasePersonDyqsList";
		}else if(StringUtils.isNotBlank(chxxxz) && !"null".equals(chxxxz)){
			return "modules/reg/base/regBasePersonChxxList";
		}else if(StringUtils.isNotBlank(request.getParameter("gm"))){//房屋历史入口更名标记
			return "modules/reg/base/regBaseGMPersonList";
		}else {//权利人传入人员信息
			return "modules/reg/base/regBasePersonList";
		}
	}
	
	/**
	 * 人员信息反审核查询
	 * @param regBasePerson
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = {"listedit"})
	public String listedit(RegBasePerson regBasePerson, HttpServletRequest request, HttpServletResponse response, Model model) {
		String djlx = "";
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			djlx = request.getParameter("djlx");
		}
		Page<RegBasePerson> page =null;
		regBasePerson.setIsaudit("2");
	    page = regBasePersonService.findPage(new Page<RegBasePerson>(request, response), regBasePerson);
		model.addAttribute("page", page);
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("djlx"))){
			model.addAttribute("djlx", request.getParameter("djlx"));
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEW"))){//权属调用只能添加不能修改删除
			model.addAttribute("VIEW", request.getParameter("VIEW"));
		} 
		//权利人传入人员信息
		return "modules/reg/base/regBasePersonListedit";
	}
	
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "alllist")
	public String alllist(RegBasePerson regBasePerson, HttpServletRequest request, HttpServletResponse response, Model model) {
		Page<RegBasePerson> page = regBasePersonService.findPage(new Page<RegBasePerson>(request, response), regBasePerson); 
		model.addAttribute("page", page); 
		return "modules/reg/base/regBasePersonAllList";
	}

	/**
	 * 房屋历史入口人员信息添加
	 * @param regBasePerson
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "lslist")
	public String lslist(RegBasePerson regBasePerson, HttpServletRequest request, HttpServletResponse response, Model model) {
		Page<RegBasePerson> page = regBasePersonService.findPage(new Page<RegBasePerson>(request, response), regBasePerson);
		
		model.addAttribute("page", page);
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("VIEW"))){//权属调用只能添加不能修改删除
			model.addAttribute("VIEW", request.getParameter("VIEW"));
		}
		String chxxxz = request.getParameter("CHXXXZ");
		if(StringUtils.isNotBlank(chxxxz) && !"null".equals(chxxxz)){//权属调用只能添加不能修改删除
			model.addAttribute("CHXXXZ", chxxxz);
		}
		return "modules/reg/base/regBaseHisHousePersonList";
	}
	
	/**
	* @Title: valizj 
	* @Description: 验证证件唯一
	* @param @param regBasePerson
	* @param @param request
	* @param @param response
	* @param @param model
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "valizj")
	@ResponseBody
	public ModelMap valizj(RegBasePerson regBasePerson, HttpServletRequest request, HttpServletResponse response, Model model) {
		ModelMap modelMap = new ModelMap();
		String pcodeother = request.getParameter("PCODEOTHER");
		String zjzl = request.getParameter("ZJZL");
		String zjh = request.getParameter("ZJH");
		regBasePerson.setZjzl(zjzl);
		regBasePerson.setZjh(zjh);
		List<RegBasePerson> findList = regBasePersonService.findList(regBasePerson);
		int count = findList.size();
		RegBasePerson regBasePerson_ = findList.get(0);
		if(count>0 && !regBasePerson_.getPcode().equals(pcodeother)){
			modelMap.put("data", "1");//已经存在其他人员信息是这个证件种类和证件号
			modelMap.put("regBasePersonRymc",regBasePerson_.getRymc());
			modelMap.put("regBasePersonZjh",regBasePerson_.getZjh());
			modelMap.put("regBasePersonZjzl",regBasePerson_.getZjzl());
		}else{
			modelMap.put("data", "0");
		}
        return modelMap;
	}

	
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "changelist")
	public String changelist(RegBasePerson regBasePerson, HttpServletRequest request, HttpServletResponse response, Model model) {
		Page<RegBasePerson> page = regBasePersonService.findPage(new Page<RegBasePerson>(request, response), regBasePerson);
		model.addAttribute("page", page);
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		return "modules/reg/base/regBasePersonChangeList";
	}
	
	/**
	 * 房屋历史入口人员信息添加
	 * @param regBasePerson
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "lsform")
	public String lsform(RegBasePerson regBasePerson, Model model, HttpServletRequest request) {
		model.addAttribute("regBasePerson", regBasePerson);
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("CHXXXZ"))){//权属调用只能添加不能修改删除
			model.addAttribute("CHXXXZ", request.getParameter("CHXXXZ"));
		}
		return "modules/reg/base/regBaseHisHousePersonForm";
	}
	
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "form")
	public String form(RegBasePerson regBasePerson, Model model, HttpServletRequest request) {
		model.addAttribute("regBasePerson", regBasePerson);
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		//人员信息被引用了反审核点击修改直接赋值
		if(StringUtils.isNotBlank(request.getParameter("fshbj"))){
			model.addAttribute("fshbj", request.getParameter("fshbj"));
			model.addAttribute("WO", "1");
		}
		if(StringUtils.isNotBlank(request.getParameter("CHXXXZ"))){//权属调用只能添加不能修改删除
			model.addAttribute("CHXXXZ", request.getParameter("CHXXXZ"));
		}
		if(StringUtils.isNotBlank(request.getParameter("addPerson"))){
			model.addAttribute("addPerson", request.getParameter("addPerson"));
		}
		
		return "modules/reg/base/regBasePersonFormReadCard";
		
		/** 
		 
		if("610702".equals(Global.getAreaCode()) || "610722".equals(Global.getAreaCode())){
			return "modules/reg/base/regBasePersonFormReadCard";
		}else{
			return "modules/reg/base/regBasePersonForm";
		}
		
		**/
	}
	
	//基础信息修改
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "jcinfoform")
	public String jcinfoform(RegBasePerson regBasePerson, Model model, HttpServletRequest request) {
		model.addAttribute("regBasePerson", regBasePerson);
		return "modules/reg/base/regBasePersoninfoForm";
	}
	
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "formview")
	public String formview(RegBasePerson regBasePerson, Model model, HttpServletRequest request) {
		model.addAttribute("regBasePerson", regBasePerson);
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("CHXXXZ"))){//权属调用只能添加不能修改删除
			model.addAttribute("CHXXXZ", request.getParameter("CHXXXZ"));
		}
		return "modules/reg/base/regBasePersonFormView";
	}
	
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = "changeform")
	public String changeform(RegBasePerson regBasePerson, Model model, HttpServletRequest request) {
		model.addAttribute("regBasePerson", regBasePerson);
		if(StringUtils.isNotBlank(request.getParameter("VIEWS"))){
			model.addAttribute("VIEWS", request.getParameter("VIEWS"));
		}
		if(StringUtils.isNotBlank(request.getParameter("WO"))){
			model.addAttribute("WO", request.getParameter("WO"));
		}
		if(StringUtils.isNotBlank(request.getParameter("oldywid"))){
			model.addAttribute("oldywid", request.getParameter("oldywid"));
		}
		if(StringUtils.isNotBlank(request.getParameter("DJLX"))){
			model.addAttribute("DJLX", request.getParameter("DJLX"));
		}
		if(StringUtils.isNotBlank(request.getParameter("YWH"))){
			model.addAttribute("YWH", request.getParameter("YWH"));
		}
		
		return "modules/reg/base/regBasePersonChangeForm";
	}

	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "save")
	public synchronized String save(RegBasePerson regBasePerson, Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		if (!beanValidator(model, regBasePerson)){
			return form(regBasePerson, model, request);
		}
		//如果出现重名的,给出提示
		//获取到当前已有人员中的最大标识码
		if(StringUtils.isBlank(request.getParameter("WO"))){
//			String pCode = "1000000";
//			RegBasePerson regBasePersonT = new RegBasePerson();
//			List<RegBasePerson> findListT = regBasePersonService.findList(regBasePersonT);
//			if(findListT.size() != 0){
//				pCode = RegUtils.getHMaxFwbm(regBasePersonService.getHMaxPCode());//没有的时候返回100000,然后+1最为第一笔
//			}
			String pCode = getpcode();
			regBasePerson.setPcode(pCode);
		}
		regBasePerson.setVeritydatamsg(StringEscapeUtils.unescapeHtml(regBasePerson.getVeritydatamsg()));
		boolean issave = false;
		if(StringUtils.isEmpty(regBasePerson.getId())) {
			issave = true;
		}
		regBasePersonService.save(regBasePerson);
		String interhis_id = request.getParameter("interhis_id");
		if(issave) {
			siService.updatePersonInfo(regBasePerson,interhis_id);
		}
		
		addMessage(redirectAttributes, "保存人员信息成功");
		String views = "";
		if(StringUtils.isNotBlank(request.getParameter("ls"))){//房屋历史入口抵押
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/lslist?WO="+request.getParameter("WO")+"&CHXXXZ="+request.getParameter("CHXXXZ");
		}else if(StringUtils.isNotBlank(request.getParameter("fshbj"))){
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/listedit";
		}else{
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/list?WO="+request.getParameter("WO")+"&CHXXXZ="+request.getParameter("CHXXXZ");
		}
		return views;
	}
	
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "jcinfosave")
	public String jcinfosave(RegBasePerson regBasePerson, Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		System.out.println("222222");
		regBasePersonService.save(regBasePerson);
		
		 
		addMessage(redirectAttributes, "保存人员信息成功");
		return "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/listedit?WO=1";
	}
	
	/***
	* @Title: getpcode 
	* @Description: 获取并生成业务号 
	* @param @return    设定文件 
	* @return String    返回类型 
	* @throws
	 */
	public synchronized String getpcode() {
		String pCode = "1000000";
		pCode = RegUtils.getHMaxFwbm(regBasePersonService.getHMaxPCode());//没有的时候返回100000,然后+1最为第一笔
		return pCode;
	}
	
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "changesave")
	public synchronized String changesave(RegBasePerson regBasePerson, Model model, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		if (!beanValidator(model, regBasePerson)){
			return form(regBasePerson, model, request);
		} 
		regBasePersonService.save(regBasePerson);
		addMessage(redirectAttributes, "保存人员信息成功");
		//还要更新宗地基本信息中的权利人
		String personName = regBasePerson.getRymc();
		RegBaseZdjbxx regBaseZdjbxx = new RegBaseZdjbxx();
		regBaseZdjbxx.setSfzh(regBasePerson.getZjh());
		regBaseZdjbxx.setIslogout("0");
		List<RegBaseZdjbxx> listJbxx = regBaseZdjbxxService.findList(regBaseZdjbxx);
		int count = listJbxx.size();
		for(int i=0; i<count; i++){
			regBaseZdjbxx = listJbxx.get(i);
			regBaseZdjbxx.setQlrxm(personName);
			regBaseZdjbxxService.save(regBaseZdjbxx);
		}
		
		//保存新的已登记信息
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		RegBusBdcqzsdjxx  regBusBdcqzsdjxxold = regBusBdcqzsdjxxService.get(request.getParameter("oldywid"));
		
		regBusBdcqzsdjxx.setYwh(request.getParameter("YWH"));
		regBusBdcqzsdjxx.setQlrmc(personName);//更名
		regBusBdcqzsdjxx.setZl(regBusBdcqzsdjxxold.getZl());
		//然后把宗地代码先填入到不动产单元号里面,作为不动产单元号生成的备用信息,直到初审通过的那一刻才真正生成不动产单元号
		regBusBdcqzsdjxx.setBdcdyh(regBusBdcqzsdjxxold.getBdcdyh());
		regBusBdcqzsdjxx.setQllx(regBusBdcqzsdjxxold.getQllx());
		regBusBdcqzsdjxx.setQlxz(regBusBdcqzsdjxxold.getQlxz());
		regBusBdcqzsdjxx.setYt(regBusBdcqzsdjxxold.getYt());
		regBusBdcqzsdjxx.setMj(regBusBdcqzsdjxxold.getMj()+"");
		regBusBdcqzsdjxx.setTh(regBusBdcqzsdjxxold.getTh());
		regBusBdcqzsdjxx.setZddm(regBusBdcqzsdjxxold.getZddm());
		regBusBdcqzsdjxx.setOldid(regBusBdcqzsdjxxold.getId());
		regBusBdcqzsdjxx.setDjlx(request.getParameter("DJLX"));
		regBusBdcqzsdjxx.setSyqx(regBusBdcqzsdjxxold.getSyqx());
		regBusBdcqzsdjxx.setStatus(regBusBdcqzsdjxxold.getStatus());
		regBusBdcqzsdjxx.setIsfdsj(Integer.valueOf("0"));
		regBusBdcqzsdjxx.setIshistory(regBusBdcqzsdjxxold.getIshistory());
		regBusBdcqzsdjxx.setIslogout("0");
		regBusBdcqzsdjxx.setIsprint("0"); 
		regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
		
		//写权利人信息
		RegBusQlr regBusQlr = new RegBusQlr();
		RegBusQlr regBusOldQlr = new RegBusQlr();
		regBusOldQlr.setYwh(regBusBdcqzsdjxxold.getYwh());
		List<RegBusQlr> findList_1 = regBusQlrService.findList_1(regBusOldQlr);
		int qlrcount = findList_1.size();
		for(int i=0; i<qlrcount; i++){
			regBusOldQlr = findList_1.get(i);
			regBusQlr.setYwh(request.getParameter("YWH"));//当前有业务号
			regBusQlr.setYsdm(regBusOldQlr.getYsdm());
			regBusQlr.setSxh(regBusOldQlr.getSxh());
			regBusQlr.setBdcdyh(regBusOldQlr.getBdcdyh());
			regBusQlr.setQlrmc(personName);//更名后的
			regBusQlr.setPcode(regBusOldQlr.getPcode());
			regBusQlr.setBdcqzh(regBusOldQlr.getBdcqzh());
			regBusQlr.setQzysxlh(regBusOldQlr.getQzysxlh());
			regBusQlr.setSfczr(regBusOldQlr.getSfczr());
			regBusQlr.setZjzl(regBusOldQlr.getZjzl());
			regBusQlr.setZjh(regBusOldQlr.getZjh());
			regBusQlr.setFzjg(regBusOldQlr.getFzjg());
			regBusQlr.setSshy(regBusOldQlr.getSshy());
			regBusQlr.setGj(regBusOldQlr.getGj());
			regBusQlr.setHjszss(regBusOldQlr.getHjszss());
			regBusQlr.setXb(regBusOldQlr.getXb());
			regBusQlr.setDh(regBusOldQlr.getDh());
			regBusQlr.setDz(regBusOldQlr.getDz());
			regBusQlr.setYb(regBusOldQlr.getYb());
			regBusQlr.setGzdw(regBusOldQlr.getGzdw());
			regBusQlr.setDzyj(regBusOldQlr.getDzyj());
			regBusQlr.setQlrlx(regBusOldQlr.getQlrlx());
			regBusQlr.setQlbl(regBusOldQlr.getQlbl());
			regBusQlr.setGyfs(regBusOldQlr.getGyfs());
			regBusQlr.setGyqk(regBusOldQlr.getGyqk());
			regBusQlr.setFddbrfzr(regBusOldQlr.getFddbrfzr());
			regBusQlr.setFddbrfzrdh(regBusOldQlr.getFddbrfzrdh());
			regBusQlr.setDlrmc(regBusOldQlr.getDljgmc());
			regBusQlr.setDlrdh(regBusOldQlr.getDlrdh());
			regBusQlr.setDljgmc(regBusOldQlr.getDljgmc());
			regBusQlr.setBz(regBusOldQlr.getBz());
			regBusQlr.setRemarks(regBusOldQlr.getRemarks());
			regBusQlrService.save(regBusQlr);
		}
		
		return "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/changelist?WO="+request.getParameter("WO");
	}

	/**
	 * 查询统计中--信息查询--统一查询
	 * @param regBusBdcqzsdjxx
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:bus:regBusBdcqzsdjxx:view")
	@RequestMapping(value = "selectTy")
	public String selectTy(RegBasePerson regBasePerson, HttpServletRequest request, HttpServletResponse response, Model model) {
		String cxfs = request.getParameter("cxfs");
		if(StringUtils.isNotBlank(cxfs)){
			RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
			regBusBdcqzsdjxx.setQlrmc(regBasePerson.getPcode());
			Page<RegBusBdcqzsdjxx> page = regBusBdcqzsdjxxService.selectTyPage(new Page<RegBusBdcqzsdjxx>(request, response), regBusBdcqzsdjxx);
			List<RegBusBdcqzsdjxx> listregBusBdcqzsdjxx = page.getList();
			RegBusBdcqzsdjxx temp = new RegBusBdcqzsdjxx();
			for(int i=0; i<listregBusBdcqzsdjxx.size(); i++){
				temp = listregBusBdcqzsdjxx.get(i);
				User creater = systemService.getUser(temp.getCreateBy().getId());
				temp.setCreater(creater.getName());//该笔业务的操作人员名称
				if(temp.getYwh().substring(0, 2).equals("LS") || temp.getYwh().substring(0, 2).equals("LST")){
					RegBusBdcqzsdjxx regBusBdcqzsdjxxtmp = new RegBusBdcqzsdjxx();
					regBusBdcqzsdjxxtmp.setYwh(temp.getYwh());
					regBusBdcqzsdjxxtmp.setBdcdyh(temp.getBdcdyh());
					regBusBdcqzsdjxxtmp.setDbsj("NOTNULL");
					List<RegBusBdcqzsdjxx> listRegBusBdcqzsdjxx = regBusBdcqzsdjxxService.findList(regBusBdcqzsdjxxtmp);
					if(listRegBusBdcqzsdjxx.size() > 0){
						regBusBdcqzsdjxxtmp = listRegBusBdcqzsdjxx.get(0);
						temp.setBjbz("是");
						temp.setUpdatesj(regBusBdcqzsdjxxtmp.getDbsj());
					}else {
						temp.setBjbz("否");
						temp.setUpdatesj("");
					}
				}else {
					RegBusSlsq regBusSlsq = new RegBusSlsq();
					regBusSlsq.setYwh(temp.getYwh());
					regBusSlsq.setDelFlag("0");
					List<RegBusSlsq> listregBusSlsq = regBusSlsqService.findList(regBusSlsq);
					if(listregBusSlsq.size() > 0){//如果归档了就判定为办结,在此借用批文号字段和登簿时间一用//
						regBusSlsq = listregBusSlsq.get(0);
						if(regBusSlsq.getTaskdefkey().equals("reg_end")){
							temp.setBjbz("是");
							temp.setUpdatesj(DateUtils.formatDate(regBusSlsq.getUpdateDate(),"yyyy-MM-dd"));
						}else {
							temp.setBjbz("否");
							temp.setUpdatesj("");
						}
					}
				}
				if(!temp.getDjlx().equals("701") && !temp.getDjlx().equals("703") 
						&& !temp.getDjlx().equals("901") && !temp.getDjlx().equals("905") && !temp.getDjlx().equals("907")){
					temp.setDbsj("");//首次限制时间
				}
				if(temp.getStatus() != null){
					if(temp.getStatus().equals("99") || temp.getStatus().equals("98")){
						temp.setDjlx((DictUtils.getDictLabel(temp.getDjlx(),"reg_bus_djxl", ""))+temp.getFj());
					}else {
						temp.setDjlx(DictUtils.getDictLabel(temp.getDjlx(),"reg_bus_djxl", ""));
					}
				}else {
					temp.setDjlx(DictUtils.getDictLabel(temp.getDjlx(),"reg_bus_djxl", ""));
				}
				RegBusQlr qlr = new RegBusQlr();
				String qlrmc = "";
				qlr.setYwh(temp.getYwh());
				List<RegBusQlr> listqlr = regBusQlrService.findListSxh(qlr);
				if(listqlr.size() > 0){//获取该笔业务的权利人
					for (int j = 0; j < listqlr.size(); j++) {
						qlr = listqlr.get(j);
						if(StringUtils.isNoneBlank(qlrmc)){
							qlrmc += ";"+ qlr.getQlrmc();
						}else {
							qlrmc = qlr.getQlrmc();
						}
					}
				}
				temp.setQlrmc(qlrmc);
				RegBusYwr ywr = new RegBusYwr();
				String ywrmc = "";
				ywr.setYwh(temp.getYwh());
				ywr.setBdcdyh(temp.getBdcdyh());
				List<RegBusYwr> listywr = regBusYwrService.findListSxh(ywr);
				if(listywr.size() > 0){//获取该笔业务的权利人
					for (int j = 0; j < listywr.size(); j++) {
						ywr = listywr.get(j);
						if(StringUtils.isNoneBlank(ywrmc)){
							ywrmc += ";"+ ywr.getQlrmc();
						}else {
							ywrmc = ywr.getQlrmc();
						}
					}
				}
				temp.setQlgyr(ywrmc);
			}
			page.setList(listregBusBdcqzsdjxx);
			model.addAttribute("page", page); 
			model.addAttribute("cxfs", cxfs); 
			model.addAttribute("pcode", regBasePerson.getPcode()); 
			return "modules/reg/bus/dialog/openDjxxInfoView";
		}else {
			regBasePerson.setDljg("1");//传入参数进行倒序排列
			Page<RegBasePerson> page = regBasePersonService.findPage(new Page<RegBasePerson>(request, response), regBasePerson); 
			model.addAttribute("page", page); 
			return "modules/reg/bus/dialog/selectInfoTyView";
		}
	}
	
	/***
	* @Title: isnotexist 
	* @Description: 检查同一证件类型情况下只能有一个证件号
	* @param @param request
	* @param @return    设定文件 
	* @return ModelMap    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "isnotexist")
	@ResponseBody
	public ModelMap isnotexist(HttpServletRequest request) {
		String rymc = request.getParameter("RYMC");//人员名称
		String code = request.getParameter("CODE");//证件号
		String zjzl = request.getParameter("ZJZL");//证件种类
		String qlrlx = request.getParameter("qlrlx");//证件种类
		ModelMap modelMap = new ModelMap();
		RegBasePerson regBasePerson = new RegBasePerson();
		if(!"1".equals(qlrlx)){
			RegBasePerson regBasePerson1 = new RegBasePerson();
			regBasePerson1.setRymc(rymc);
			List<RegBasePerson> findPerson1List = regBasePersonService.findListqy(regBasePerson1);
			if(findPerson1List.size() > 0){
				modelMap.put("data", "3");//已经存在
			}else{
				regBasePerson.setZjh(code);
				regBasePerson.setZjzl(zjzl);
				List<RegBasePerson> findPersonList = regBasePersonService.findIsexistList(regBasePerson);
				if(findPersonList.size() > 0){
					modelMap.put("data", "1");//已经存在
				}else{
					RegBasePerson regBasePerson2 = new RegBasePerson();
					regBasePerson2.setRymc(rymc);
					List<RegBasePerson> findPerson2List = regBasePersonService.findList(regBasePerson2);
					if(findPerson2List.size() > 0){
						modelMap.put("data", "2");//已经存在
					}else{
						modelMap.put("data", "0");
					}
				}
			}
			regBasePerson.setRymc(rymc);
		}else{
			regBasePerson.setZjh(code);
			regBasePerson.setZjzl(zjzl);
			List<RegBasePerson> findPersonList = regBasePersonService.findIsexistList(regBasePerson);
			if(findPersonList.size() > 0){
				modelMap.put("data", "1");//已经存在
			}else{
				RegBasePerson regBasePerson2 = new RegBasePerson();
				regBasePerson2.setRymc(rymc);
				List<RegBasePerson> findPerson2List = regBasePersonService.findList(regBasePerson2);
				if(findPerson2List.size() > 0){
					modelMap.put("data", "2");//已经存在
				}else{
					modelMap.put("data", "0");
				}
			}
		}
        return modelMap;
	}
	
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "audit")
	@Transactional
	public String audit(RegBasePerson regBasePerson, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		String wo = request.getParameter("WO");
		String chxxxz = request.getParameter("CHXXXZ");
		regBasePerson = regBasePersonService.get(regBasePerson.getId());
		//设置该数据已经被审核
		regBasePerson.setIsaudit("1");
		regBasePersonService.save(regBasePerson);
		addMessage(redirectAttributes, "人员信息审核成功!");
		String views = "";
		if(StringUtils.isNotBlank(request.getParameter("ls"))){//房屋历史入口抵押
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/lslist?WO="+wo+"&CHXXXZ="+chxxxz;
		}else{
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/list?WO="+wo+"&CHXXXZ="+chxxxz;
		}
		return views;
	}
	
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "unaudit")
	@Transactional
	public String unaudit(RegBasePerson regBasePerson, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		regBasePerson = regBasePersonService.get(regBasePerson.getId());
		//设置该数据已经被审核
		regBasePerson.setIsaudit("0");
		regBasePersonService.save(regBasePerson);
		addMessage(redirectAttributes, "人员信息反审核成功!");
		String views = "";
		if(StringUtils.isNotBlank(request.getParameter("ls"))){//房屋历史入口抵押
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/lslist?WO="+request.getParameter("WO")+"&CHXXXZ="+request.getParameter("CHXXXZ");
		}else{
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/list?WO="+request.getParameter("WO")+"&CHXXXZ="+request.getParameter("CHXXXZ");
		}
		return views;
	}


	/**
	 * 人员信息反审核修改后重审核
	 * @param regBasePerson
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "auditedit")
	@Transactional
	public String auditedit(RegBasePerson regBasePerson, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		String wo = request.getParameter("WO");
		String id =  request.getParameter("id");
		regBasePerson = regBasePersonService.get(id);
		//设置该数据已经被审核
		regBasePerson.setIsaudit("1");
		regBasePersonService.save(regBasePerson);
		addMessage(redirectAttributes, "人员信息审核成功!");
		String views = "";
		views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/listedit";
		return views;
	}
	
	/**
	 * 人员信息反审核修改
	 * @param regBasePerson
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "unauditedit")
	@Transactional
	public String unauditedit(RegBasePerson regBasePerson, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		String id = request.getParameter("id");
		regBasePerson = regBasePersonService.get(id);
		//设置该数据已经被审核
		regBasePerson.setRemarks("1");
		regBasePerson.setIsaudit("0");
		regBasePersonService.save(regBasePerson);
		addMessage(redirectAttributes, "人员信息反审核成功!");
		String views = "";
		views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/listedit";
		return views;
	}
	
	/**
	 * 人员信息反审核删除
	 * @param regBasePerson
	 * @param request
	 * @param response
	 * @param model
	 * @return
	 */
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "deleteedit")
	@Transactional
	public String deleteedit(RegBasePerson regBasePerson, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		regBasePersonService.delete(regBasePerson);
		addMessage(redirectAttributes, "删除人员信息成功");
		String views = "";
		views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/listedit";
		return views;
	}
	
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "delete")
	public String delete(RegBasePerson regBasePerson, HttpServletRequest request, RedirectAttributes redirectAttributes) {
		regBasePersonService.delete(regBasePerson);
		addMessage(redirectAttributes, "删除人员信息成功");
		String views = "";
		if(StringUtils.isNotBlank(request.getParameter("ls"))){//房屋历史入口抵押
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/lslist?WO="+request.getParameter("WO")+"&CHXXXZ="+request.getParameter("CHXXXZ");
		}else{
			views = "redirect:"+Global.getAdminPath()+"/reg/base/regBasePerson/list?WO="+request.getParameter("WO")+"&CHXXXZ="+request.getParameter("CHXXXZ");
		}
		return views;
	}

	/***
	* @Title: 人员信息已引用的状态下需要反审核,查需是否能够反审核
	* @param @param request
	* @param @return    设定文件 
	* @return ModelMap    返回类型 
	* @throws
	 */
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "queryinfo")
	@ResponseBody
	public ModelMap queryinfo(HttpServletRequest request) {
		String ids = request.getParameter("ids");//人员名称
		RegBasePerson regBasePerson = regBasePersonService.get(ids);
		int bz = 0;
		int sum = 0;//记录引用次数
		//开始各个表查询是否有多个地方引用此人信息,超过1个则提示不能反审核
		//查询宗地基本信息
		if(bz == 0){
			RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
			zdjbxx.setSfzh(regBasePerson.getZjh());
			zdjbxx.setZjlx(regBasePerson.getZjzl());
			zdjbxx.setIslogout("13");
			List<RegBaseZdjbxx> zdjbxxlist = regBaseZdjbxxService.findList(zdjbxx);
			if(zdjbxxlist.size() >1){
				bz = 1;
			}
			if(zdjbxxlist.size() == 1){
				sum = sum+1;
			}
		}
		//查询权利人基本信息
		if(bz == 0){
			String ywh="";
			RegBusQlr qlrxx = new RegBusQlr();
			qlrxx.setZjh(regBasePerson.getZjh());
			qlrxx.setZjzl(regBasePerson.getZjzl());
			List<RegBusQlr> qlrxxlist = regBusQlrService.findList(qlrxx);
			
			List<RegBusQlr> qlrList = Lists.newArrayList();
			for(RegBusQlr qlr : qlrxxlist) {
				List<RegBusBdcqzsdjxx> djxxList = regBusBdcqzsdjxxService.findByYwh(qlr.getYwh());
				if(djxxList!= null && djxxList.size() >0) {
					qlrList.add(qlr);
				}
			}
			
			int count = qlrList.size();
			if(qlrList.size() > 1){
				for(int i=0;i<count;i++){
					qlrxx = qlrList.get(i);
					if("".equals(ywh)){
						ywh = qlrxx.getYwh();
					}else{
						if(ywh.equals(qlrxx.getYwh())){
							ywh = qlrxx.getYwh();
							bz = 0;
						}else{
							bz = 1;
							break;
						}
					} 
				}
			}
			if(qlrList.size() == 1){
				sum = sum+1;
				bz = 1;
			}
		}
		//查询义务人基本信息
		if(bz == 0){
			String ywh="";
			RegBusYwr ywrxx = new RegBusYwr();
			ywrxx.setZjh(regBasePerson.getZjh());
			ywrxx.setZjzl(regBasePerson.getZjzl());
			List<RegBusYwr> ywrxxlist = regBusYwrService.findList(ywrxx);
			
			List<RegBusYwr> ywrlist = Lists.newArrayList();
			for(RegBusYwr ywr : ywrxxlist) {
				List<RegBusBdcqzsdjxx> djxxList = regBusBdcqzsdjxxService.findByYwh(ywr.getYwh());
				if(djxxList!= null && djxxList.size() >0) {
					ywrlist.add(ywr);
				}
			}
			
			int count = ywrlist.size();
			if(ywrlist.size() >1){
				for(int i=0;i<count;i++){
					ywrxx = ywrlist.get(i);
					if("".equals(ywh)){
						ywh = ywrxx.getYwh();
					}else{
						if(ywh.equals(ywrxx.getYwh())){
							ywh = ywrxx.getYwh();
							bz = 0;
						}else{
							bz = 1;
							break;
						}
					}
				}
			}
			if(ywrlist.size() == 1){
				sum = sum+1;
				bz = 1;
			}
		}
		//查询历史权利人基本信息
		if(bz == 0){
			String ywh="";
			RegBusHisHouseQlr qlrhishousexx = new RegBusHisHouseQlr();
			qlrhishousexx.setZjh(regBasePerson.getZjh());
			qlrhishousexx.setZjzl(regBasePerson.getZjzl());
			List<RegBusHisHouseQlr> qlrhisxxlist = regBusHisHouseQlrService.findList(qlrhishousexx);
			
			List<RegBusHisHouseQlr> qlrList = Lists.newArrayList();
			for(RegBusHisHouseQlr qlr : qlrhisxxlist) {
				RegBusHisBdcqzsdjxx djxx = new RegBusHisBdcqzsdjxx();
				djxx.setYwh(qlr.getYwh());
				List<RegBusHisBdcqzsdjxx> djxxList = regBusHisBdcqzsdjxxService.findList(djxx);
				if(djxxList!= null && djxxList.size() >0) {
					qlrList.add(qlr);
				}
			}
			
			int count = qlrList.size();
			if(qlrList.size() > 1){
				for(int i=0;i<count;i++){
					qlrhishousexx = qlrList.get(i);
					if("".equals(ywh)){
						ywh = qlrhishousexx.getYwh();
					}else{
						if(ywh.equals(qlrhishousexx.getYwh())){
							ywh = qlrhishousexx.getYwh();
							bz = 0;
						}else{
							bz = 1;
							break;
						}
					}
				}
			}
			if(qlrList.size() == 1){
				sum = sum+1;
				bz = 1;
			}
		}
		//查询历史义务人基本信息
		if(bz == 0){
			String ywh="";
			RegBusHisHouseYwr ywrhishousexx = new RegBusHisHouseYwr();
			ywrhishousexx.setZjh(regBasePerson.getZjh());
			ywrhishousexx.setZjzl(regBasePerson.getZjzl());
			List<RegBusHisHouseYwr> ywrhisxxlist = regBusHisHouseYwrService.findList(ywrhishousexx);
			List<RegBusHisHouseYwr> ywrlist = Lists.newArrayList();
			for(RegBusHisHouseYwr ywr : ywrhisxxlist) {
				RegBusHisBdcqzsdjxx djxx = new RegBusHisBdcqzsdjxx();
				djxx.setYwh(ywr.getYwh());
				List<RegBusHisBdcqzsdjxx> djxxList = regBusHisBdcqzsdjxxService.findList(djxx);
				if(djxxList!= null && djxxList.size() >0) {
					ywrlist.add(ywr);
				}
			}
			int count = ywrlist.size();
			if(ywrlist.size() >1){
				for(int i=0;i<count;i++){
					ywrhishousexx = ywrlist.get(i);
					if("".equals(ywh)){
						ywh = ywrhishousexx.getYwh();
					}else{
						if(ywh.equals(ywrhishousexx.getYwh())){
							ywh = ywrhishousexx.getYwh();
							bz = 0;
						}else{
							bz = 1;
							break;
						}
					}
				}
			}
			if(ywrlist.size() == 1){
				sum = sum+1;
				bz = 1;
			}
		}
		ModelMap modelMap = new ModelMap();
		if(bz == 1 || sum > 1){
			modelMap.put("success", "1");
			modelMap.put("msg", "该人员信息可能已被单个或多个业务引用,不能进行反审核!");
		}
		if(bz == 0 ){
			modelMap.put("success", "0");
		}
        return modelMap;
	}
	
	@RequiresPermissions("reg:base:regBasePerson:edit")
	@RequestMapping(value = "commitperson")
	@ResponseBody
	public ModelMap commitperson(HttpServletRequest request) {
		String zjh = request.getParameter("zjh");
		String zjzl = request.getParameter("zjzl");
		ModelMap modelMap = new ModelMap();
		modelMap.put("success",0);
		String msg="";
		if("0".equals(modelMap.get("success").toString())){
			//验证人员信息
			RegBusUtils utils = new RegBusUtils();
			msg = utils.IDCardValidate(zjh,zjzl);
			if(!"YES".equals(msg)){
				modelMap.put("success","1");
			}
		}
		modelMap.put("msg",msg);
		return modelMap;
	}
	
}