a934765f9922939abeef9d8b99b47550e3a66521.svn-base 40.5 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 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144
/**
 * Copyright © 2015-2018 ODM All rights reserved.
 */
package com.thinkgem.jeesite.modules.reg.service.bus;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.activiti.tracelog.ActivitiLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.common.service.ServiceException;
import com.thinkgem.jeesite.common.utils.DateUtils;
import com.thinkgem.jeesite.common.utils.IdGen;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.act.entity.Act;
import com.thinkgem.jeesite.modules.act.service.ActTaskService;
import com.thinkgem.jeesite.modules.act.utils.ActUtils;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusSjchildDao;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusSlsqDao;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseH;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseHbhqk;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseSllm;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseSllmbhqk;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseXm;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdbhqk;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZdjbxx;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZrz;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBaseZrzbg;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusCfdj;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusDyaq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusDyiq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusFdcq1;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusFdcq2;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusFz;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusQlr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusRights;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSf;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSjchild;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSjmain;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusSlsq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusTdsyq;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYgdj;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYwr;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusYydj;
import com.thinkgem.jeesite.modules.reg.entity.bus.YcslSlsq;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseFdcqxmService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseHService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseHbhqkService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseSllmService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseSllmbhqkService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseXmService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdbhqkService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZdjbxxService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZrzService;
import com.thinkgem.jeesite.modules.reg.service.base.RegBaseZrzbgService;
import com.thinkgem.jeesite.modules.reg.utils.RegUtils;
import com.thinkgem.jeesite.modules.reg.web.httprest.httpRestController.HttpRestPush;
import com.thinkgem.jeesite.modules.reg.web.httprest.utils.DatatypeUtil;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.DictUtils;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import com.thinkgem.jeesite.modules.ycsl.entity.xttj.YcslXttj;
import com.thinkgem.jeesite.modules.ycsl.entity.ywzt.YcslYwzt;
import com.thinkgem.jeesite.modules.ycsl.service.xttj.YcslXttjService;
import com.thinkgem.jeesite.modules.ycsl.service.ywzt.YcslYwztService;

/**
 * 受理申请表单维护Service
 * 
 * @author xuyg
 * @version 2015-10-07
 */
@Service
@Transactional(readOnly = true)
public class RegBusSlsqService extends CrudService<RegBusSlsqDao, RegBusSlsq> {

	@Autowired
	private ActTaskService actTaskService;
	@Autowired
	private RegBusQlrService regBusQlrService;
	@Autowired
	private RegBusYwrService regBusYwrService;
	@Autowired
	private RegBusBdcqzsdjxxService RegBusBdcqzsdjxxService;
	@Autowired
	private RegBusSjmainService regBusSjmainService;
	@Autowired
	private RegBusTdsyqService regBusTdsyqService;
	@Autowired
	private RegBusYgdjService regBusYgdjService;
	@Autowired
	private RegBusJsydsyqService regBusJsydsyqService;
	@Autowired
	private RegBusFdcq2Service regBusFdcq2Service;
	@Autowired
	private RegBusDyiqService regBusDyiqService;
	@Autowired
	private RegBusDyaqService regBusDyaqService;
	@Autowired
	private RegBusSfService regBusSfService;
	@Autowired
	private RegBusFzService regBusFzService;
	@Autowired
	private RegBaseZrzService regBaseZrzService;
	@Autowired
	private RegBusBdcqzsdjxxService regBusBdcqzsdjxxService;
	@Autowired
	private RegBaseZdjbxxService regBaseZdjbxxService;
	@Autowired
	private RegBusCfdjService regBusCfdjService;
	@Autowired
	private RegBaseHService regBaseHService;
	@Autowired
	private RegBusYydjService regBusYydjService;
	@Autowired
	private RegBusSjchildDao regBusSjchildDao;
	@Autowired
	private RegBaseZrzbgService regBaseZrzbgService;
	@Autowired
	private RegBaseZdbhqkService regBaseZdbhqkService;
	@Autowired
	private RegBaseHbhqkService regBaseHbhqkService;
	@Autowired
	private RegBusLqService regBusLqService;
	@Autowired
	private RegBaseSllmService regBaseSllmService;
	@Autowired
	private RegBaseSllmbhqkService regBaseSllmbhqkService;
	@Autowired
	private RegBusRightsService regBusRightsService;
	@Autowired
	private RegBusNydsyqService regBusNydsyqService;
	@Autowired
	private RegBusFdcq1Service regBusFdcq1Service;
	@Autowired
	private RegBaseFdcqxmService regBaseFdcqxmService;
	@Autowired
	private RegBaseXmService regBaseXmService;
	@Autowired
	private YcslXttjService ycslXttjService;
	@Autowired
	private YcslYwztService ycslYwztService;
	@Autowired
	private YcslSlsqService ycslSlsqService;

	public RegBusSlsq getByProcInsId(String procInsId) {
		return dao.getByProcInsId(procInsId);
	}

	public RegBusSlsq get(String id) {
		return super.get(id);
	}

	/**
	 * 
	 * @Title: getByYwh @Description: 通过业务号获取一条申请受理记录 @param @param
	 *         ywh @param @return 设定文件 @return RegBusSlsq 返回类型 @throws
	 */
	public RegBusSlsq getByYwh(String ywh) {
		return dao.getByYwh(ywh);
	}

	public List<RegBusSlsq> findList(RegBusSlsq regBusSlsq) {
		return super.findList(regBusSlsq);
	}

	public Page<RegBusSlsq> findPage(Page<RegBusSlsq> page, RegBusSlsq regBusSlsq) {
		regBusSlsq.setPage(page);
		page.setList(dao.findList(regBusSlsq));
		return page;
	}

	public Map<Object, Object> getBsst(Map<String, Object> map) {
		return dao.getBsst(map);
	}

	public List<RegBusSlsq> getBsst1(Map<String, Object> map) {
		if ("oracle".equals(Global.getDbName())) {
			return dao.OracleGetBsst1(map);
		} else {
			return dao.getBsst1(map);
		}
	}

	/**
	 * @Title: findMaxYwh @Description:
	 *         获取当前最大的业务号,用于生成下一个业务号使用【需要同步处理】 @param @return 设定文件 @return String
	 *         返回类型 @throws
	 */
	public String findMaxYwh() {
		return dao.findMaxYwh();
	}

	public String getCreateYwh() {
		return dao.getCreateYwh();
	}

	public String createNewYwh(int i) throws InterruptedException {
		if (i > 10) {
			throw new ServiceException("业务号生成规则异常,请联系系统管理员");
		}
		String ywh = getCreateYwh();
		try {
			User user = UserUtils.getUser();
			ywh = getCreateYwh();
			Map record = Maps.newHashMap();
			record.put("id", IdGen.uuid());
			record.put("ywh", ywh);
			record.put("rq", DateUtils.getDate("yyyyMMdd"));
			record.put("userid", user.getId());
			dao.saveRecord(record);
		} catch (DuplicateKeyException e) {
			ywh = createNewYwh(i + 1);
		}

		return ywh;
	}

	@Transactional(readOnly = false)
	public void save(RegBusSlsq regBusSlsq) {
		User user = UserUtils.getUser();
		// 受理申请发起
		if (StringUtils.isBlank(regBusSlsq.getId())) {
			regBusSlsq.preInsert();
			dao.insert(regBusSlsq);

			// 给Act的ywh set值
			regBusSlsq.getAct().setYwh(regBusSlsq.getYwh());
			regBusSlsq.getAct().setSqr(regBusSlsq.getTzrxm());
			regBusSlsq.getAct().setDjlx(regBusSlsq.getDjdl());
			regBusSlsq.getAct().setSlr(user.getLoginName());// 只是流程发起的时候才用到
			// 转移登记进行一窗受理业务号显示 20190114GL
			if ("302".equals(regBusSlsq.getDjxl())) {
				regBusSlsq.getAct().setProid(regBusSlsq.getProid());
			}
			Map<String, Object> vars = Maps.newHashMap();
			// 增加业务号查询变量参数【这样后查询时按照先存在 vars 里面的ywh;然后再通过给 Act加一个 ywh的属性 ;
			// 最后是通过 act.ywh 跟 vars 里面的 ywh 进行比对实现查询】
			vars.put("ywh", regBusSlsq.getYwh());
			vars.put("sqr", regBusSlsq.getTzrxm());
			vars.put("djlx", regBusSlsq.getDjdl());
			// 转移登记进行一窗受理业务号显示
			if ("302".equals(regBusSlsq.getDjxl())) {
				vars.put("proid", regBusSlsq.getProid());
			}
			// 一窗受理过来的请求信息设置受理人员
			if ("99".equals(regBusSlsq.getRemarks())) {
				vars.put("slr", regBusSlsq.getSlry()); // 只是流程发起的时候才用到
			} else {
				vars.put("slr", user.getLoginName()); // 只是流程发起的时候才用到
			}

			// 启动流程
			String ProcInsId = actTaskService.startProcess(ActUtils.PD_REG_AUDIT[0], ActUtils.PD_REG_AUDIT[1],
					regBusSlsq.getId(), DictUtils.getDictLabel(regBusSlsq.getDjxl(), "reg_bus_djxl", "不动产登记业务受理"),
					vars);
			regBusSlsq.setProcInsId(ProcInsId);
		}

		// 重新编辑申请
		else {
			regBusSlsq.preUpdate();
			dao.update(regBusSlsq);
			/*
			 * regBusSlsq.getAct().setComment(("yes".equals(regBusSlsq.getAct().getFlag())
			 * ?"[重申] ":"[销毁] ")+ regBusSlsq.getAct().getComment());
			 */
			regBusSlsq.getAct().setComment(DictUtils.getDictLabel(regBusSlsq.getDjxl(), "reg_bus_djxl", "") + "-同意受理");
			// 完成流程任务
			Map<String, Object> vars = Maps.newHashMap();
			vars.put("pass", "yes".equals(regBusSlsq.getAct().getFlag()) ? "1" : "0");
			// 申请人更新
			vars.put("sqr", regBusSlsq.getTzrxm());// 在没有权利人的业务当中就写入通知人(申请人)

//			RegBusQlr qlr = new RegBusQlr();
//			qlr.setYwh(regBusSlsq.getYwh());
//			List<RegBusQlr> qlrlist = regBusQlrService.findList_1(qlr);
//			if(qlrlist.size() > 0){
//				for(int y=0;y<qlrlist.size();y++){
//					if(qlrlist.get(y).getSxh() == 1){
//						qlr = qlrlist.get(y);
//						if(qlr.getSxh() == 1){
//							//申请人更新
//							vars.put("sqr", qlr.getQlrmc());
//						}
//					}
//				}
//			}

			// 增加公示环节
			if ("gsyes".equals(regBusSlsq.getAct().getFlag())) {
				vars.put("pass", "2");
			}
			actTaskService.complete(regBusSlsq.getAct().getTaskId(), regBusSlsq.getAct().getProcInsId(),
					regBusSlsq.getAct().getComment(),
					DictUtils.getDictLabel(regBusSlsq.getDjxl(), "reg_bus_djxl", "不动产登记业务受理"), vars);
		}
	}

	@Transactional(readOnly = false)
	public void regssave(RegBusSlsq regBusSlsq) {
		if (StringUtils.isBlank(regBusSlsq.getId())) {
			regBusSlsq.preInsert();
			dao.insert(regBusSlsq);
		} else {
			regBusSlsq.preUpdate();
			dao.update(regBusSlsq);
		}
	}

	/**
	 * @Title: zsave @Description: 受理申请单暂存 @param @param regBusSlsq 设定文件 @return
	 *         void 返回类型 @throws
	 */
	@Transactional(readOnly = false)
	public void zsave(RegBusSlsq regBusSlsq) {
		// 受理申请发起
		if (StringUtils.isNotBlank(regBusSlsq.getId())) {
			dao.update(regBusSlsq);
		}
	}

	/**
	 * 审核审批保存
	 * 
	 * @param testAudit
	 */
	@Transactional(readOnly = false)
	public void auditSave(RegBusSlsq regBusSlsq) {
		// 获取县区代码
		String areaCode = Global.getAreaCode();
		// add point for trace the claim operation issue.
		ActivitiLog.debug("Begin executing auditSave service. taskId:" + regBusSlsq.getAct().getTaskId());
		// 设置意见
		regBusSlsq.getAct().setComment(regBusSlsq.getAct().getComment());
		regBusSlsq.preUpdate();

		// 对不同环节的业务逻辑进行操作
		String taskDefKey = regBusSlsq.getAct().getTaskDefKey();
		logger.info("******(期转现楼盘变更记录)环节名称:" + taskDefKey + "********" + ",变量值:" + regBusSlsq.getAct().getFlag()
				+ ",业务号:" + regBusSlsq.getYwh());
		// 【没有公示情况】不同县区从初审环节进来 - 提交流程后到了复审,环节修改
		if ("reg_audit".equals(taskDefKey)) {
			if ("610702".equals(areaCode) || "610725".equals(areaCode) || "610721".equals(areaCode)
					|| "610727".equals(areaCode) || "610728".equals(areaCode) || "610724".equals(areaCode)) {
				if (!regBusSlsq.getYwh().contains("X")) {
					regBusSlsq.setTaskdefkey("reg_audit3");
				} else {
					regBusSlsq.setTaskdefkey("reg_audit2");
				}
			} else {
				regBusSlsq.setTaskdefkey("reg_audit2");
			}
		}
		// 从复审环节进来 - 提交流程后到了核定,环节修改
		else if ("reg_audit2".equals(taskDefKey) && !"610725".equals(areaCode) && !"610721".equals(areaCode)
				&& !"610727".equals(areaCode) && !"610728".equals(areaCode) && !"610724".equals(areaCode)) {
			if ("610702".equals(areaCode) && regBusSlsq.getYwh().contains("X")) {
				regBusSlsq.setTaskdefkey("reg_audit3");
			} else if ("610722".equals(areaCode) || "610723".equals(areaCode) || "610724".equals(areaCode)
					|| "610726".equals(areaCode) || "610729".equals(areaCode) || "610730".equals(areaCode)) {
				regBusSlsq.setTaskdefkey("reg_audit3");
			}
		}
		// 从核定环节进来 - 提交流程后到了登簿
		else if ("reg_audit3".equals(taskDefKey)) {
			if ("429".equals(regBusSlsq.getDjxl())) {
				regBusSlsq.setTaskdefkey("reg_end");// 楼盘变更到归档
				regBusSlsq.getAct().setFlag("guid");
			} else {
				regBusSlsq.setTaskdefkey("reg_audit4");
			}
		}
		// 从登簿进来 - 提交流程后到了缮证
		else if ("reg_audit4".equals(taskDefKey)) {
			if ("400".equals(regBusSlsq.getDjdl()) || "704".equals(regBusSlsq.getDjxl())
					|| "800".equals(regBusSlsq.getDjdl()) || "510".equals(regBusSlsq.getDjxl())
					|| "511".equals(regBusSlsq.getDjxl()) || "512".equals(regBusSlsq.getDjxl())
					|| "513".equals(regBusSlsq.getDjxl()) || "441".equals(regBusSlsq.getDjxl())) {
				regBusSlsq.setTaskdefkey("reg_end");
			} else {
				regBusSlsq.setTaskdefkey("reg_audit5");
			}
			regBusSlsq.getAct().setComment(regBusSlsq.getAct().getComment());
		}
		// 从缮证进来 - 提交流程后到了收费或者是发证
		else if ("reg_audit5".equals(taskDefKey)) {
			if ("yes".equals(regBusSlsq.getAct().getFlag())) {
				// 到收费
				regBusSlsq.setTaskdefkey("reg_audit56");
			} else {
				// 到发证
				regBusSlsq.setTaskdefkey("reg_audit6");
			}
			// regBusSlsq.getAct().setComment("[缮证]"+ regBusSlsq.getAct().getComment());
			// 重新更新一次流程说明,为no时不是驳回,而是【到发证】
			regBusSlsq.getAct().setComment(regBusSlsq.getAct().getComment());
		}
		// 从收费进来 - 提交流程后到了发证
		else if ("reg_audit56".equals(taskDefKey)) {
			regBusSlsq.setTaskdefkey("reg_audit6");
			regBusSlsq.getAct().setComment(regBusSlsq.getAct().getComment());
		}
		// 从发证进来 - 提交流程后到了归档
		else if ("reg_audit6".equals(taskDefKey)) {
			regBusSlsq.setTaskdefkey("reg_end");
			regBusSlsq.getAct().setComment(regBusSlsq.getAct().getComment());
		}
		// 从归档进来 - 提交流程后还是归档
		else if ("reg_end".equals(taskDefKey)) {
			regBusSlsq.getAct().setComment(regBusSlsq.getAct().getComment());
		}
		// 未知环节,直接返回
		else {
			return;
		}

		// 提交流程任务
		Map<String, Object> vars = Maps.newHashMap();
		logger.info("regBusSlsq.getAct().getFlag() == {}", regBusSlsq.getAct().getFlag());
		if ("yes".equals(regBusSlsq.getAct().getFlag())) {
			vars.put("pass", "1");
		} else if ("cfyyzx".equals(regBusSlsq.getAct().getFlag())) {
			vars.put("pass", "99");// 查封异议注销直接走归档
		} else if ("no_sf_sz".equals(regBusSlsq.getAct().getFlag())) {
			// 判断当前业务是从缮证[0]走过来的还是收费[10]
			if ("400".equals(regBusSlsq.getDjdl()) || "300".equals(regBusSlsq.getDjdl())
					|| "500".equals(regBusSlsq.getDjdl()) || "800".equals(regBusSlsq.getDjdl())
					|| "700".equals(regBusSlsq.getDjdl())) { // TODO 检查
				// 回退到缮证
				vars.put("pass", "0");
				regBusSlsq.setTaskdefkey("reg_audit5");
			} else {
				// 回退到收费
				vars.put("pass", "10");
				regBusSlsq.setTaskdefkey("reg_audit56");
			}
			// 清理发证信息
			RegBusFz regBusFz = new RegBusFz();
			regBusFz.setYwh(regBusSlsq.getYwh());
			List<RegBusFz> findFzList = regBusFzService.findList(regBusFz);
			if (findFzList.size() > 0) {
				regBusFz = findFzList.get(0);
				regBusFzService.delete(regBusFz);
			}
			
			RegBusBdcqzsdjxx regBusBdcqzsdjxxTemp = new RegBusBdcqzsdjxx();
			regBusBdcqzsdjxxTemp.setYwh(regBusSlsq.getYwh());
			List<RegBusBdcqzsdjxx> regBusBdcqzsdjxxTempList = regBusBdcqzsdjxxService
					.findList(regBusBdcqzsdjxxTemp);

			if (regBusBdcqzsdjxxTempList != null && regBusBdcqzsdjxxTempList.size() > 0) {
				RegBusBdcqzsdjxx djxx = regBusBdcqzsdjxxTempList.get(0);

				YcslXttj xttj = new YcslXttj();
				xttj.setYwh(regBusSlsq.getYwh());
				 
				if("20".equals(regBusSlsq.getSllx())) {
					YcslSlsq ycslSlsq = new YcslSlsq();
					ycslSlsq.setYwh(regBusSlsq.getProid());
					List<YcslSlsq> slsqList = ycslSlsqService.findList(ycslSlsq);
					if(slsqList == null || slsqList.size() <= 0) {
						xttj.setProid(regBusSlsq.getProid());
					}else {
						YcslSlsq y_slsq = slsqList.get(0);
						xttj.setProid(y_slsq.getWwywh());
					}
				
				}else {
					xttj.setProid(regBusSlsq.getProid());
				}

				
				xttj.setCzbz("1");
				xttj.setBdcdyh(djxx.getBdcdyh());
				xttj.setTjywzt(taskDefKey);
				xttj.setYj(regBusSlsq.getAct().getComment());
				ycslXttjService.save(xttj);

 
			}
		} else if ("guid".equals(regBusSlsq.getAct().getFlag())) {
			vars.put("pass", "2");// 走向楼盘变更
		} else {
			vars.put("pass", "0");
			// 驳回时删除已办任务表列相关的信息
			// 更新步骤
			// 初审驳回
			if ("reg_audit".equals(taskDefKey)) {
				regBusSlsq.setTaskdefkey("reg_start");
				// regBusSlsq.getAct().setComment("驳回");
			}
			// 从复审驳回 ,环节修改,环节修改
			else if ("reg_audit2".equals(taskDefKey)) {
				regBusSlsq.setTaskdefkey("reg_start");
				// regBusSlsq.getAct().setComment("驳回");
			}
			// 从核定驳回
			else if ("reg_audit3".equals(taskDefKey)) {
				regBusSlsq.setTaskdefkey("reg_start");
				// regBusSlsq.getAct().setComment("驳回");
			}
			// 从登簿进来 - 提交流程后到了缮证
			else if ("reg_audit4".equals(taskDefKey)) {
				regBusSlsq.setTaskdefkey("reg_start");
				// regBusSlsq.getAct().setComment("驳回");
			}

			// 从缮证进来 - 提交流程后 yes到了收费 no到发证
			if (!"reg_audit5".equals(taskDefKey)) {
				RegBusBdcqzsdjxx regBusBdcqzsdjxxTemp = new RegBusBdcqzsdjxx();
				regBusBdcqzsdjxxTemp.setYwh(regBusSlsq.getYwh());
				List<RegBusBdcqzsdjxx> regBusBdcqzsdjxxTempList = regBusBdcqzsdjxxService
						.findList(regBusBdcqzsdjxxTemp);

				if (regBusBdcqzsdjxxTempList != null && regBusBdcqzsdjxxTempList.size() > 0) {
					RegBusBdcqzsdjxx djxx = regBusBdcqzsdjxxTempList.get(0);

					YcslXttj xttj = new YcslXttj();
					xttj.setYwh(regBusSlsq.getYwh());
					if("20".equals(regBusSlsq.getSllx())) {
						YcslSlsq ycslSlsq = new YcslSlsq();
						ycslSlsq.setYwh(regBusSlsq.getProid());
						List<YcslSlsq> slsqList = ycslSlsqService.findList(ycslSlsq);
						if(slsqList == null || slsqList.size() <= 0) {
							xttj.setProid(regBusSlsq.getProid());
						}else {
							YcslSlsq y_slsq = slsqList.get(0);
							xttj.setProid(y_slsq.getWwywh());
						}
					
					}else {
						xttj.setProid(regBusSlsq.getProid());
					}
					xttj.setCzbz("1");
					xttj.setBdcdyh(djxx.getBdcdyh());
					xttj.setTjywzt(taskDefKey);
					xttj.setYj(regBusSlsq.getAct().getComment());
					ycslXttjService.save(xttj);
 
				}
			}

		}
		/*
		 * 增加一个批量处理的环境标识,以和其他手动处理的区分开.
		 */
		if (ActivitiLog.batchProcessThread.get() != null && ActivitiLog.batchProcessThread.get()) {
			vars.put("batchApprove", 1);
		}
		// 收费环节驳回:
		if ("no".equals(regBusSlsq.getAct().getFlag()) && "reg_audit56".equals(taskDefKey)) { // TODO 检查
			// 清理收费信息
			RegBusSf regBusSf = new RegBusSf();
			regBusSf.setYwh(regBusSlsq.getYwh());
			List<RegBusSf> findSfList = regBusSfService.findList(regBusSf);
			if (findSfList.size() > 0) {
				regBusSf = findSfList.get(0);
				regBusSfService.delete(regBusSf);
			}
			regBusSlsq.setTaskdefkey("reg_audit5");
		}

		dao.updateTaskDefKey(regBusSlsq);

		// 增加公示环节
		/*
		 * if("gsyes".equals(regBusSlsq.getAct().getFlag())){ vars.put("pass", "2"); }
		 */
		logger.info("******(方法走完后,数据更新了)环节名称:" + regBusSlsq.getTaskdefkey() + "********" + ",变量值:"
				+ regBusSlsq.getAct().getFlag() + ",业务号:" + regBusSlsq.getYwh());
		// System.out.println("流程提交complete参数:"+regBusSlsq.getAct().getTaskId()+";"+regBusSlsq.getAct().getProcInsId());
		actTaskService.complete(regBusSlsq.getAct().getTaskId(), regBusSlsq.getAct().getProcInsId(),
				regBusSlsq.getAct().getComment(), vars);
		// add point for trace the claim operation issue.
		ActivitiLog.debug("End executing auditSave service. taskId:" + regBusSlsq.getAct().getTaskId());
	}

	@Transactional(readOnly = false)
	public void delete(RegBusSlsq regBusSlsq) {
		super.delete(regBusSlsq);
	}

	@Transactional(readOnly = false)
	public void deleteRelationInfo(String ywh, String djxl, HttpServletRequest request) {
		// 权利人、义务人信息表【可能还没有添加,需要判断】
		/*
		 * RegBusQlr regBusQlr = new RegBusQlr(); regBusQlr.setYwh(ywh); List<RegBusQlr>
		 * findList = regBusQlrService.findList_1(regBusQlr); int regBusQlrCount =
		 * findList.size(); if(regBusQlrCount>0){ for(int i=0;i<regBusQlrCount; i++){
		 * regBusQlrService.delete(findList.get(i)); } }
		 */
		regBusQlrService.deleteywh(ywh);

		// 义务人信息

		RegBusYwr regBusYwr = new RegBusYwr();
		regBusYwr.setYwh(ywh);
		/*
		 * List<RegBusYwr> findList2 = regBusYwrService.findList(regBusYwr); int
		 * regBusYwrCount = findList2.size(); if(regBusYwrCount>0){ for(int
		 * i=0;i<regBusYwrCount; i++){ regBusYwrService.delete(findList2.get(i)); } }
		 */
		regBusYwrService.deleteywr(regBusYwr);

		// 收件主子表【可能还没有添加,需要判断】
		RegBusSjmain regBusSjmain = new RegBusSjmain();
		regBusSjmain.setYwh(ywh);
		List<RegBusSjmain> findList4 = regBusSjmainService.findList(regBusSjmain);
		int regBusSjmainCount = findList4.size();
		if (regBusSjmainCount > 0) {
			for (int i = 0; i < regBusSjmainCount; i++) {
				RegBusSjmain regBusSjmain2 = findList4.get(i);

				// 删除收件子表中的附件
				List<RegBusSjchild> regBusSjchildList = regBusSjchildDao.findList(new RegBusSjchild(regBusSjmain2));
				int sjchildcount = regBusSjchildList.size();
				for (int j = 0; j < sjchildcount; j++) {
					RegBusSjchild regBusSjchild = regBusSjchildList.get(j);
					RegUtils.deletefjinfo(ywh, regBusSjchild.getSjfj(), request);
				}
				regBusSjmainService.delete(regBusSjmain2);
			}
		}

		if ("220".equals(djxl)) {
			if (StringUtils.isNotBlank(ywh)) {

				RegBusFdcq1 regBusFdcq1 = new RegBusFdcq1();
				regBusFdcq1.setYwh(ywh);
				List<RegBusFdcq1> listfdcq1 = regBusFdcq1Service.findList(regBusFdcq1);
				if (listfdcq1 != null && listfdcq1.size() > 0) {
					regBusFdcq1 = listfdcq1.get(0);
					if (regBusFdcq1 != null) {

						String xmid = regBusFdcq1.getXmid();
						RegBaseXm xm = regBaseXmService.get(xmid);
						xm.setIsaudit("1");
						regBaseXmService.save(xm);
						RegBaseZrz zrz = new RegBaseZrz();
						zrz.setXmid(xmid);
						List<RegBaseZrz> zrzList = regBaseZrzService.findList(zrz);
						for (int i = 0; i < zrzList.size(); i++) {
							zrz = zrzList.get(i);
							zrz.setIsaudit("1");
							regBaseZrzService.save(zrz);
							RegBaseH h = new RegBaseH();
							h.setBdcdyh(zrz.getBdcdyh().substring(0, 24));
							List<RegBaseH> Hlist = regBaseHService.findAllList(h);
							for (int j = 0; j < Hlist.size(); j++) {
								h = Hlist.get(j);
								if (h.getRights().equals("3")) {
									h.setDelFlag("1");
								} else {
									h.setRights("0");
								}
								h.setIsaudit("1");
								regBaseHService.save(h);
							}
						}

						regBaseFdcqxmService.deleteywh(ywh);
						regBusQlrService.deleteywh(ywh);
						RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
						regBusBdcqzsdjxx.setBdcdyh(regBusFdcq1.getBdcdyh());
						regBusBdcqzsdjxx.setYwh(ywh);
						regBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxx);
						regBusFdcq1Service.deletefdcq1(regBusFdcq1);
					}
				}
			}
		}

		if ("207".equals(djxl) || "803".equals(djxl) || "213".equals(djxl)) {
			// 删除任务,户信息变为反审核状态
			RegBusBdcqzsdjxx regBusBdcqzsdjxxh = new RegBusBdcqzsdjxx();
			RegBusBdcqzsdjxx regBusBdcqzsdjxxhxx = new RegBusBdcqzsdjxx();
			int bz = 0;
			regBusBdcqzsdjxxh.setYwh(ywh);
			List<RegBusBdcqzsdjxx> findListh = RegBusBdcqzsdjxxService.findList(regBusBdcqzsdjxxh);
			int regBusBdcqzsdjxxCounth = findListh.size();
			if (regBusBdcqzsdjxxCounth > 0) {
				// 三大入口删除任务时判定有无其他业务引用,如没有才能把户信息改为反审核
				for (int i = 0; i < regBusBdcqzsdjxxCounth; i++) {
					regBusBdcqzsdjxxhxx = findListh.get(i);
					RegBusRights rights = new RegBusRights();
					rights.setBdcdyh(regBusBdcqzsdjxxhxx.getBdcdyh());
					List<RegBusRights> rlist = regBusRightsService.findList(rights);
					if ("207".equals(findListh.get(0).getDjlx())) {
						if (rlist.size() > 0) {
							if (StringUtils.isNotBlank(rlist.get(0).getXtxq())
									|| StringUtils.isNotBlank(rlist.get(0).getXsouyq())) {
								bz = 1;
								break;
							}
						}
					}
					if (bz == 1) {
						break;
					}
					if ("803".equals(findListh.get(0).getDjlx())) {
						if (rlist.size() > 0) {
							if (StringUtils.isNotBlank(rlist.get(0).getXtxq())
									|| StringUtils.isNotBlank(rlist.get(0).getSsouyq())) {
								bz = 1;
								break;
							}
						}
					}
					if (bz == 1) {
						break;
					}
					if ("213".equals(findListh.get(0).getDjlx())) {
						if (rlist.size() > 0) {
							if (StringUtils.isNotBlank(rlist.get(0).getXsouyq())
									|| StringUtils.isNotBlank(rlist.get(0).getSsouyq())) {
								bz = 1;
								break;
							}
						}
					}
					if (bz == 1) {
						break;
					}
				}
				if (bz == 0) {
					for (int i = 0; i < regBusBdcqzsdjxxCounth; i++) {
						regBusBdcqzsdjxxh = findListh.get(i);
						RegBaseH h = regBaseHService.getdy(regBusBdcqzsdjxxh.getBdcdyh());
						if ("0".equals(h.getRights())) {
							h.setIsaudit("1");
							regBaseHService.save(h);
						}
					}
				}
			}
		}
		// 已登记信息表【可能还没有添加,需要判断】
		RegBusBdcqzsdjxx regBusBdcqzsdjxx = new RegBusBdcqzsdjxx();
		regBusBdcqzsdjxx.setYwh(ywh);
		RegBusBdcqzsdjxxService.deletezyyg(regBusBdcqzsdjxx);

		// 各种权属表【可能还没有添加,需要判断】
		// 土地所有权
		RegBusTdsyq regBusTdsyq = new RegBusTdsyq();
		regBusTdsyq.setYwh(ywh);
		/*
		 * List<RegBusTdsyq> findList5 = regBusTdsyqService.findList(regBusTdsyq); int
		 * regBusTdsyqCount = findList5.size(); if(regBusTdsyqCount>0){ for(int
		 * i=0;i<regBusTdsyqCount; i++){ regBusTdsyqService.delete(findList5.get(i)); }
		 * }
		 */
		regBusTdsyqService.deleteRegBusTdsyq(regBusTdsyq);

		// 土地使用权
		/*
		 * RegBusJsydsyq regBusJsydsyq = new RegBusJsydsyq(); regBusJsydsyq.setYwh(ywh);
		 * List<RegBusJsydsyq> findList6 = regBusJsydsyqService.findList(regBusJsydsyq);
		 * int regBusJsydsyqCount = findList6.size(); if(regBusJsydsyqCount>0){ for(int
		 * i=0;i<regBusJsydsyqCount; i++){
		 * regBusJsydsyqService.delete(findList6.get(i)); } }
		 */
		regBusJsydsyqService.deleteRegBusJsydsyq(ywh);
		regBusNydsyqService.deletenydzyywh(ywh);
		// 抵押权
		RegBusDyaq regBusDyaq = new RegBusDyaq();
		regBusDyaq.setYwh(ywh);
		/*
		 * List<RegBusDyaq> findList7 = regBusDyaqService.findList(regBusDyaq); int
		 * regBusDyaqCount = findList7.size(); if(regBusDyaqCount>0){ for(int
		 * i=0;i<regBusDyaqCount; i++){ regBusDyaqService.delete(findList7.get(i)); } }
		 */
		regBusDyaqService.deletexfdy(regBusDyaq);

		// 地役权
		RegBusDyiq regBusDyiq = new RegBusDyiq();
		regBusDyiq.setYwh(ywh);
		List<RegBusDyiq> findList8 = regBusDyiqService.findList(regBusDyiq);
		int regBusDyiqCount = findList8.size();
		if (regBusDyiqCount > 0) {
			for (int i = 0; i < regBusDyiqCount; i++) {
				regBusDyiqService.delete(findList8.get(i));
			}
		}

		// 房地产权
		RegBusFdcq2 regBusFdcq2 = new RegBusFdcq2();
		regBusFdcq2.setYwh(ywh);
		/*
		 * List<RegBusFdcq2> findList11 = regBusFdcq2Service.findList(regBusFdcq2); int
		 * regBusFdcq2Count = findList11.size(); if(regBusFdcq2Count>0){ for(int
		 * i=0;i<regBusFdcq2Count; i++){ regBusFdcq2Service.delete(findList11.get(i)); }
		 * }
		 */
		regBusFdcq2Service.deletefdcq2(regBusFdcq2);

		// 预告
		RegBusYgdj regBusYgdj = new RegBusYgdj();
		regBusYgdj.setYwh(ywh);
		/*
		 * List<RegBusYgdj> findList9 = regBusYgdjService.findList(regBusYgdj); int
		 * regBusYgdjCount = findList9.size(); if(regBusYgdjCount>0){ for(int
		 * i=0;i<regBusYgdjCount; i++){ regBusYgdjService.delete(findList9.get(i)); } }
		 */
		regBusYgdjService.deletezyyg(regBusYgdj);

		// 所有牵扯到宗地基本信息删除的业务
		if (djxl.equals("401") || djxl.equals("418") || djxl.equals("419") || djxl.equals("601")// 所有权
				|| djxl.equals("405") || djxl.equals("406") || djxl.equals("407") || djxl.equals("602")
				|| djxl.equals("410") || djxl.equals("411")) {// 使用权
			RegBaseZdbhqk regBaseZdbhqk = new RegBaseZdbhqk();
			RegBaseZdjbxx regBaseZdjbxx = new RegBaseZdjbxx();
			RegBaseZdjbxx regBaseZdjbxxtmp = new RegBaseZdjbxx();
			regBaseZdbhqk.setYwh(ywh);
			List<RegBaseZdbhqk> findListZdbhqk = regBaseZdbhqkService.findList(regBaseZdbhqk);
			if (findListZdbhqk.size() > 0) {
				for (int i = 0; i < findListZdbhqk.size(); i++) {
					regBaseZdbhqk = findListZdbhqk.get(i);
					regBaseZdjbxx = regBaseZdjbxxService.get(regBaseZdbhqk.getZdid());
					regBaseZdjbxxtmp.setBdcdyh(regBaseZdjbxx.getBdcdyh());
					regBaseZdjbxxtmp.setIslogout("13");
					List<RegBaseZdjbxx> findListZdtmp = regBaseZdjbxxService.findList(regBaseZdjbxxtmp);
					if (findListZdtmp.size() > 1) {// 在原有总地上变更更正,不引用测绘,只新增宗地信息
						regBaseZdjbxxService.deleteRegBaseZdjbxx(regBaseZdjbxx);
					} else {// 引用测绘,宗地信息只有一条
						regBaseZdjbxxService.delete(regBaseZdjbxx);
					}
				}
				regBaseZdbhqk.setZddm(null);
				regBaseZdbhqkService.deletezdbhqk(regBaseZdbhqk);
			}
		}

		// 所有牵扯到房屋基本信息删除的业务
		if (djxl.equals("402") || djxl.equals("403") || djxl.equals("404") || djxl.equals("427") || djxl.equals("428")
				|| djxl.equals("812") || djxl.equals("609") || djxl.equals("810") || djxl.equals("811")) {
			RegBaseHbhqk regBaseHbhqk = new RegBaseHbhqk();
			RegBaseH regBaseH = new RegBaseH();
			regBaseHbhqk.setYwh(ywh);
			List<RegBaseHbhqk> findListHbhqk = regBaseHbhqkService.findList(regBaseHbhqk);
			if (findListHbhqk.size() > 0) {
				for (int i = 0; i < findListHbhqk.size(); i++) {
					regBaseHbhqk = findListHbhqk.get(i);
					regBaseH.setId(regBaseHbhqk.getHid());
					regBaseHService.hdelete(regBaseH);
				}
				regBaseHbhqk.setBdcdyh(null);
				regBaseHbhqkService.deleteByYwhAndBdcdyh(regBaseHbhqk);
			}
		}

		// 所有牵扯到林权基本信息删除的业务
		if (djxl.equals("414") || djxl.equals("415") || djxl.equals("417") || djxl.equals("610")) {
			// 删除森林、林木信息
			RegBaseSllm regBaseSllm = new RegBaseSllm();
			RegBaseSllmbhqk regBaseSllmbhqk = new RegBaseSllmbhqk();
			regBaseSllmbhqk.setYwh(ywh);
			List<RegBaseSllmbhqk> listregBaseSllmbhqk = regBaseSllmbhqkService.findList(regBaseSllmbhqk);
			if (listregBaseSllmbhqk.size() > 0) {
				for (int i = 0; i < listregBaseSllmbhqk.size(); i++) {
					RegBaseSllmbhqk regBaseSllmbhqkT = listregBaseSllmbhqk.get(i);
					regBaseSllm.setId(regBaseSllmbhqkT.getSllmid());
					regBaseSllm = regBaseSllmService.get(regBaseSllmbhqkT.getSllmid());
					RegBaseZdjbxx regBaseZdjbxx = new RegBaseZdjbxx();
					regBaseZdjbxx.setZddm(regBaseSllm.getZddm());
					regBaseZdjbxx.setIslogout("13");
					List<RegBaseZdjbxx> findListZdjbxx = regBaseZdjbxxService.findList(regBaseZdjbxx);
					if (findListZdjbxx.size() > 0) {
						regBaseZdjbxx = findListZdjbxx.get(0);
						regBaseZdjbxx.setIsaudit("1");// 已审核
						regBaseZdjbxxService.save(regBaseZdjbxx);
					}
					regBaseSllmService.delete(regBaseSllm);
				}
			}
			regBaseSllmbhqkService.deleteSllmbhqk(regBaseSllmbhqk);
		}
		regBusLqService.deleteLq(ywh);

		// 房屋异议
		if ("703".equals(djxl)) {
			if (StringUtils.isNotBlank(ywh)) {
				RegBusYydj yydj = new RegBusYydj();
				yydj.setYwh(ywh);
				List<RegBusYydj> yylist = regBusYydjService.findList(yydj);
				if (yylist.size() > 0) {
					regBusQlrService.deleteywh(ywh);
					for (int i = 0; i < yylist.size(); i++) {
						yydj = yylist.get(i);
						RegBaseH h = new RegBaseH();
						h.setBdcdyh(yydj.getBdcdyh().substring(0, 19));
						List<RegBaseH> hList = regBaseHService.findList(h);
						if (hList.size() > 0) {
							for (int ii = 0; ii < hList.size(); ii++) {
								h = hList.get(ii);
								int Isyiyi = 0;
								h.setIsyiyi(String.valueOf(Isyiyi));
								regBaseHService.save(h);
							}
						}
						RegBusBdcqzsdjxx regBusBdcqzsdjxxyy = new RegBusBdcqzsdjxx();
						regBusBdcqzsdjxxyy.setYwh(yydj.getYwh());
						regBusBdcqzsdjxxyy.setBdcdyh(yydj.getBdcdyh());
						regBusBdcqzsdjxxyy.setDjlx("703");
						List<RegBusBdcqzsdjxx> regBusBdcqzsdjxxlist = regBusBdcqzsdjxxService
								.findList(regBusBdcqzsdjxxyy);
						if (regBusBdcqzsdjxxlist.size() > 0) {
							for (int t = 0; t < regBusBdcqzsdjxxlist.size(); t++) {
								regBusBdcqzsdjxx = regBusBdcqzsdjxxlist.get(t);
								// 所有异议登记类型的数据
								RegBusBdcqzsdjxx regBusBdcqzsdjxxold = regBusBdcqzsdjxxService
										.get(regBusBdcqzsdjxx.getOldid());
								int islogout = Integer.parseInt(regBusBdcqzsdjxxold.getIslogout());
								if (islogout >= 100) {
									islogout = islogout - 1;
									// 如果小于100则说明是最后一次解封
									if (islogout < 100) {
										islogout = 0;
										h.setIslogout(String.valueOf(islogout));
									} else {
										h.setIslogout(String.valueOf(islogout));
									}
								} else {
									islogout = 0;
								}
								regBusBdcqzsdjxxold.setIslogout(String.valueOf(islogout));
								regBusBdcqzsdjxxService.save(regBusBdcqzsdjxxold);
							}
						}
						regBusYydjService.deleteyyywh(yydj);
					}
				}
			}
		}

		// 房屋异议注销
		if ("704".equals(djxl)) {
			RegBusYydj regBusYydj = new RegBusYydj();
			regBusYydj.setZxyyywh(ywh);
			List<RegBusYydj> yydjlist = regBusYydjService.findList(regBusYydj);
			if (yydjlist.size() > 0) {
				for (int t = 0; t < yydjlist.size(); t++) {
					regBusYydj = yydjlist.get(t);
					regBusYydj.setZxyydjsj(null);
					regBusYydj.setZxyyywh(null);
					regBusYydj.setZxyyyy(null);
					regBusYydj.setZxyydbr(null);
					regBusYydjService.save(regBusYydj);
				}
			}
		}

		// 查封

		// 土地房屋查封
		if ("905".equals(djxl) || "901".equals(djxl) || "907".equals(djxl)) {
			if (StringUtils.isNotBlank(ywh)) {
				RegBusCfdj cfdj = new RegBusCfdj();
				cfdj.setYwh(ywh);
				List<RegBusCfdj> cflist = regBusCfdjService.findList(cfdj);
				if (cflist.size() > 0) {
					regBusQlrService.deleteywh(ywh);
					for (int i = 0; i < cflist.size(); i++) {
						cfdj = cflist.get(i);

						RegBaseZdjbxx zdjbxx = new RegBaseZdjbxx();
						zdjbxx.setZddm(cfdj.getBdcdyh().substring(0, 19));
						List<RegBaseZdjbxx> findList = regBaseZdjbxxService.findList(zdjbxx);
						if (findList.size() > 0) {
							zdjbxx = findList.get(0);
							zdjbxx.setIschafeng("0");
							regBaseZdjbxxService.save(zdjbxx);
						}

						RegBaseH h = new RegBaseH();
						h.setBdcdyh(cfdj.getBdcdyh().substring(0, 19));
						List<RegBaseH> hList = regBaseHService.findList(h);
						if (hList.size() > 0) {
							for (int ii = 0; ii < hList.size(); ii++) {
								h = hList.get(ii);
								int Ischafeng = 0;
								Ischafeng = Integer.parseInt(h.getIschafeng());
								if (Ischafeng >= 100) {
									Ischafeng = Ischafeng - 1;
									// 如果小于100则说明是最后一次解封
									if (Ischafeng < 100) {
										Ischafeng = 0;
										h.setIschafeng(String.valueOf(Ischafeng));
										regBaseHService.save(h);
									} else {
										h.setIschafeng(String.valueOf(Ischafeng));
										regBaseHService.save(h);
									}
								} else {
									Ischafeng = 0;
									h.setIschafeng(String.valueOf(Ischafeng));
									regBaseHService.save(h);
								}
							}
						}
						// 查询使用权登记信息
						RegBusBdcqzsdjxx regBusBdcqzsdjxxtdfw = new RegBusBdcqzsdjxx();
						regBusBdcqzsdjxxtdfw.setIslogout(djxl);// 未注销
						regBusBdcqzsdjxxtdfw.setDbsj("ISNULL");// 未登簿
						regBusBdcqzsdjxxtdfw.setBdcdyh(cfdj.getBdcdyh());
						if ("905".equals(djxl)) {
							regBusBdcqzsdjxxtdfw.setRights("1");
						}
						if ("907".equals(djxl)) {
							regBusBdcqzsdjxxtdfw.setRights("4");
						}
						if ("901".equals(djxl)) {
							regBusBdcqzsdjxxtdfw.setRights("3");
						}
						List<RegBusBdcqzsdjxx> djList = regBusBdcqzsdjxxService.findcfList(regBusBdcqzsdjxxtdfw);
						if (djList.size() > 0) {
							regBusBdcqzsdjxx = djList.get(0);
							int islogut = Integer.parseInt(regBusBdcqzsdjxx.getIslogout());
							islogut = islogut - 1;
							if (islogut >= 100) {
								regBusBdcqzsdjxx.setIslogout(String.valueOf(islogut));
								regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
							} else {
								regBusBdcqzsdjxx.setIslogout("0");
								regBusBdcqzsdjxxService.save(regBusBdcqzsdjxx);
							}
						}
						regBusCfdjService.fwcfdelete(cfdj);
					}
				}
			}
		}

		// 土地房屋查封注销
		if ("906".equals(djxl) || "908".equals(djxl) || "904".equals(djxl)) {
			RegBusCfdj regBuscfdj = new RegBusCfdj();
			regBuscfdj.setJfywh(ywh);
			List<RegBusCfdj> cfdjlist = regBusCfdjService.findList(regBuscfdj);
			if (cfdjlist.size() > 0) {
				int conut = cfdjlist.size();
				for (int i = 0; i < conut; i++) {
					regBuscfdj = cfdjlist.get(i);
					regBuscfdj.setJfdbr(null);
					regBuscfdj.setJfywh(null);
					regBuscfdj.setJfdjsj(null);
					regBuscfdj.setJfwh(null);
					regBuscfdj.setJfjg(null);
					regBuscfdj.setJfwj(null);
					if ("906".equals(djxl)) {
						regBuscfdj.setDjlx("905");
					} else if ("904".equals(djxl)) {
						regBuscfdj.setDjlx("901");
					} else {
						regBuscfdj.setDjlx("907");
					}
					regBusCfdjService.save(regBuscfdj);
				}
			}
		}
		// 房屋楼盘变更
		if (djxl.equals("440")) {
			RegBaseZrzbg regBaseZrzbg = new RegBaseZrzbg();
			regBaseZrzbg.setYwh(ywh);
			regBaseZrzbgService.delete(regBaseZrzbg);
		}
	}

	/**
	 * 自动启流程保存
	 */
	@Transactional(readOnly = false)
	public void saveslsq(RegBusSlsq regBusSlsq) {
		super.save(regBusSlsq);
	}

	/**
	 * 自动启流程
	 */
	public void updateidentity(Map map) {
		dao.updateidentity(map);
	}

	/**
	 * 自动启流程
	 */
	public void updatetask(Map map) {
		dao.updatetask(map);
	}

	/**
	 * 自动启流程
	 */
	public String taskidinfo(Map map) {
		return dao.taskidinfo(map);
	}

	/**
	 * 自动启流程--签收任务时提交受理申请
	 */
	public void updateslsqidentity(Map map) {
		dao.updateslsqidentity(map);
	}

	/**
	 * 自动启流程--签收任务时提交受理申请
	 */
	public void updateslsqtask(Map map) {
		dao.updateslsqtask(map);
	}

	/**
	 * 自动启流程--签收任务时提交受理申请
	 */
	public Map<String, Object> taskactinfo(Map<String, Object> map) {
		return dao.taskactinfo(map);
	}

	public List<Map<String, String>> getYflow(String date) {
		// TODO Auto-generated method stub
		return dao.getYflow(date);
	}

	public List<Map<String, String>> getWflow(String format) {
		// TODO Auto-generated method stub
		return dao.getWflow(format);
	}

	public Map<String, String> progress(String ywh) {
		// TODO Auto-generated method stub
		return dao.progress(ywh);
	}

}