wangjiang988 6 gadi atpakaļ
vecāks
revīzija
8ba0f8b818

+ 4 - 1
sql/20200110.sql

@@ -2,4 +2,7 @@
 
 简易流程会签改为简易流程处理中
 
-update dictionary_item set name="简易流程处理中" where tid="2" and name ="简易流程会签"
+update dictionary_item set name="简易流程处理中" where tid="2" and name ="简易流程会签"
+
+INSERT INTO `dictionary_item`(`id`, `sort`, `name`, `value`, `tid`, `is_active`, `remark`, `create_time`, `create_by`, `create_name`, `update_by`, `update_name`, `update_time`, `del_flag`) VALUES (11237, NULL, '简易流程审核通过', '80', 2, 1, NULL, '2020-01-14 17:12:47', 1, '超级管理员', NULL, NULL, NULL, 0);
+INSERT INTO `dictionary_item`(`id`, `sort`, `name`, `value`, `tid`, `is_active`, `remark`, `create_time`, `create_by`, `create_name`, `update_by`, `update_name`, `update_time`, `del_flag`) VALUES (11238, NULL, '简易流程审核不通过', '90', 2, 1, NULL, '2020-01-15 12:46:36', 1, '超级管理员', NULL, NULL, NULL, 0);

+ 805 - 798
src/main/java/platform/modules/company/service/StockLandApproveService.java

@@ -55,61 +55,63 @@ import java.util.*;
 
 /**
  * 存量用地审核Service
- * @author hp
  *
+ * @author hp
  */
 @Service
 @Transactional
 public class StockLandApproveService extends BaseService<StockLand> {
 
-	private static final Logger logger = LoggerFactory.getLogger(StockLandApproveService.class);
-    
-	@Autowired
-	private StockLandService stockLandService;
-	
+    private static final Logger logger = LoggerFactory.getLogger(StockLandApproveService.class);
+
+    @Autowired
+    private StockLandService stockLandService;
+
     @Autowired
-	private MessageService messageService;
-    
+    private MessageService messageService;
+
     @Autowired
     private ApprovalService approvalService;
-    
+
     @Autowired
     private UserGroupDao userGroupDao;
-    
+
     @Autowired
     private StockLandDao stockLandDao;
 
     @Autowired
     private AttachmentDao attachmentDao;
-    
+
     @Autowired
     private ProcessFeedbackService processFeedbackService;
-    
+
     @Autowired
     private UserService userService;
-    
+
     @Autowired
     private GroupService groupService;
-    
+
     @Autowired
     private UserGroupService userGroupService;
-    
+
+    @Autowired
+    private DictionaryItemService dictionaryItemService;
+
     @Autowired
-	private DictionaryItemService dictionaryItemService;
-    
+    private DictionaryTypeService dictionaryTypeService;
+
     @Autowired
-	private DictionaryTypeService dictionaryTypeService;
-    
+    private CompanyContactService companyContactService;
+
     @Autowired
-	private CompanyContactService companyContactService;
-    
+    private ProjectApplicationCompanyInfoService projectApplicationCompanyInfoService;
+
     @Autowired
-	private ProjectApplicationCompanyInfoService projectApplicationCompanyInfoService;
-    
-	@Autowired
-	private WaitToDoService waitToDoService;
+    private WaitToDoService waitToDoService;
+
     /**
      * 审核列表数据
+     *
      * @param pageNum
      * @param pageSize
      * @param param
@@ -118,126 +120,126 @@ public class StockLandApproveService extends BaseService<StockLand> {
      * @throws Exception
      */
     @Transactional(readOnly = true)
-    public PageInfo<StockLand> findPage(Integer pageNum, Integer pageSize, String param,StockLand searchCondition) throws Exception {
-	        Approval approvalCondition = new Approval();
+    public PageInfo<StockLand> findPage(Integer pageNum, Integer pageSize, String param, StockLand searchCondition) throws Exception {
+        Approval approvalCondition = new Approval();
         approvalCondition.setNextchecker(String.valueOf(ShiroUtils.getUserId()));
         approvalCondition.setType(Constant.DictionaryType.STOCKLAND);
-    	FindRequest request = new FindRequest();
+        FindRequest request = new FindRequest();
         request.setKeyword(param);
         Integer userType = ShiroUtils.getUserType();
-        if(userType.equals(Constant.UserType.STREET)) {
-        	Integer streetId = ShiroUtils.getStreetId();
-        	request.setStreet_id(streetId);
+        if (userType.equals(Constant.UserType.STREET)) {
+            Integer streetId = ShiroUtils.getStreetId();
+            request.setStreet_id(streetId);
         }
         PageHelper.startPage(pageNum, pageSize);
-        List<StockLand> landApplys = stockLandDao.findApprovePageInfo(request, searchCondition,approvalCondition);
-        for(StockLand stockLand:landApplys) {
-        	stockLandService.getFullLandInfo(stockLand);
-        	//绑定处理时间 、绑定是否需要街道通知企业
-        	if(searchCondition.getIsPendingAudit()==Constant.PendingAuditStatus.PENDING_AUDIT) {
-            	//剩余或超出时间
-            	Approval latestApproval = approvalService.getLatestApproval(stockLand.getId(),Constant.DictionaryType.STOCKLAND);
-            	if(null != latestApproval) {
-            		Integer overTime = 5;
-            		if(stockLand.getApply_type().equals(Constant.LandApplyType.RENT)) {
-            			overTime = 10;
-            		}
-            		String overTimeStr = DateUtil.getOverTimeStr(latestApproval.getCreate_time(),overTime);
-            		stockLand.setOverTimeStr(overTimeStr);
-            	}
-            	//是否是政府返回的申请数据,需要确认并通知
-            	if(isPendingNotify(stockLand)) {
-            		stockLand.setIsPendingNotify(Constant.PendingNotifyStatus.PENDING_NOTIFY);
-            	}
-            	//是否到了登录用户的审核层级
-            	String[] userIds = latestApproval.getNextchecker().split(",");
-            	User currUser = ShiroUtils.getUserEntity();
-            	if(userIds.length>0) {
-            		for(String userId : userIds) {
-                    	User user = userService.findById(Integer.valueOf(userId));
-                    	if(null != user.getApprove_level() && null != currUser.getApprove_level() && user.getApprove_level()>currUser.getApprove_level()) {
-                    		stockLand.setIsApproval(0);
-                    	}
-            		}
-            	}
-            	if(stockLand.getCanEdit() || null != stockLand.getProcess_status()
-            			|| !isPendingAudit(stockLand) ) {
-            		//不能审核
-            		stockLand.setIsApproval(0);
-            	}
-            	
-            	
-        	}else {
-        		//已处理的数据,处理时间
-            	Approval latestApproval = approvalService.getLatestApprovalByUser(stockLand.getId(),Constant.DictionaryType.STOCKLAND,ShiroUtils.getUserId());
-            	if(null != latestApproval) {
-            		Integer overTime = 5;
-            		if(stockLand.getApply_type().equals(Constant.LandApplyType.RENT)) {
-            			overTime = 10;
-            		}
-                	String dealTimeStr = DateUtil.getDealTimeStr(latestApproval.getCreate_time(),latestApproval.getDeal_time(),overTime);
-                	stockLand.setOverTimeStr(dealTimeStr);
-                	//审核时间
-                	stockLand.setDeal_time(latestApproval.getCreate_time());
-            	}
-            	//最近一次是否是当前用户审核的,如果是且没有撤回,则可撤回
-            	if(!(stockLand.getApprove_status().equals(Constant.LandApproveStatus.APPROVED) || stockLand.getApprove_status().equals(Constant.LandApproveStatus.PASSED) 
-            			||stockLand.getApprove_status().equals(Constant.LandApproveStatus.NOTPASSED))) {
-            		
-            		Approval latestAllApproval = approvalService.getLatestApprovalAll(stockLand.getId(),Constant.DictionaryType.STOCKLAND);
-            		if(null != latestAllApproval) {
-            			if(null == latestAllApproval.getIs_withdraw() && !latestAllApproval.getOper_type().equals(Constant.OperType.CONFIRM_AND_NOTIFY)) {
-            				//没有撤回过,不是确认并通知
-            				if( null != latestAllApproval.getChecker() && latestAllApproval.getChecker().equals(ShiroUtils.getUserId())) {
-                        		//最后一次操作是当前用户
-            					stockLand.setCanWithdraw(Constant.True_False.TRUE);
-                        	}
-            			}
-            		}
-            		//stockLand.setCanWithdraw(this.canWithdraw(stockLand,ShiroUtils.getUserId()));
-            	}
-        	}
+        List<StockLand> landApplys = stockLandDao.findApprovePageInfo(request, searchCondition, approvalCondition);
+        for (StockLand stockLand : landApplys) {
+            stockLandService.getFullLandInfo(stockLand);
+            //绑定处理时间 、绑定是否需要街道通知企业
+            if (searchCondition.getIsPendingAudit() == Constant.PendingAuditStatus.PENDING_AUDIT) {
+                //剩余或超出时间
+                Approval latestApproval = approvalService.getLatestApproval(stockLand.getId(), Constant.DictionaryType.STOCKLAND);
+                if (null != latestApproval) {
+                    Integer overTime = 5;
+                    if (stockLand.getApply_type().equals(Constant.LandApplyType.RENT)) {
+                        overTime = 10;
+                    }
+                    String overTimeStr = DateUtil.getOverTimeStr(latestApproval.getCreate_time(), overTime);
+                    stockLand.setOverTimeStr(overTimeStr);
+                }
+                //是否是政府返回的申请数据,需要确认并通知
+                if (isPendingNotify(stockLand)) {
+                    stockLand.setIsPendingNotify(Constant.PendingNotifyStatus.PENDING_NOTIFY);
+                }
+                //是否到了登录用户的审核层级
+                String[] userIds = latestApproval.getNextchecker().split(",");
+                User currUser = ShiroUtils.getUserEntity();
+                if (userIds.length > 0) {
+                    for (String userId : userIds) {
+                        User user = userService.findById(Integer.valueOf(userId));
+                        if (null != user.getApprove_level() && null != currUser.getApprove_level() && user.getApprove_level() > currUser.getApprove_level()) {
+                            stockLand.setIsApproval(0);
+                        }
+                    }
+                }
+                if (stockLand.getCanEdit() || null != stockLand.getProcess_status()
+                        || !isPendingAudit(stockLand)) {
+                    //不能审核
+                    stockLand.setIsApproval(0);
+                }
+
+
+            } else {
+                //已处理的数据,处理时间
+                Approval latestApproval = approvalService.getLatestApprovalByUser(stockLand.getId(), Constant.DictionaryType.STOCKLAND, ShiroUtils.getUserId());
+                if (null != latestApproval) {
+                    Integer overTime = 5;
+                    if (stockLand.getApply_type().equals(Constant.LandApplyType.RENT)) {
+                        overTime = 10;
+                    }
+                    String dealTimeStr = DateUtil.getDealTimeStr(latestApproval.getCreate_time(), latestApproval.getDeal_time(), overTime);
+                    stockLand.setOverTimeStr(dealTimeStr);
+                    //审核时间
+                    stockLand.setDeal_time(latestApproval.getCreate_time());
+                }
+                //最近一次是否是当前用户审核的,如果是且没有撤回,则可撤回
+                if (!(stockLand.getApprove_status().equals(Constant.LandApproveStatus.APPROVED) || stockLand.getApprove_status().equals(Constant.LandApproveStatus.PASSED)
+                        || stockLand.getApprove_status().equals(Constant.LandApproveStatus.NOTPASSED))) {
+
+                    Approval latestAllApproval = approvalService.getLatestApprovalAll(stockLand.getId(), Constant.DictionaryType.STOCKLAND);
+                    if (null != latestAllApproval) {
+                        if (null == latestAllApproval.getIs_withdraw() && !latestAllApproval.getOper_type().equals(Constant.OperType.CONFIRM_AND_NOTIFY)) {
+                            //没有撤回过,不是确认并通知
+                            if (null != latestAllApproval.getChecker() && latestAllApproval.getChecker().equals(ShiroUtils.getUserId())) {
+                                //最后一次操作是当前用户
+                                stockLand.setCanWithdraw(Constant.True_False.TRUE);
+                            }
+                        }
+                    }
+                    //stockLand.setCanWithdraw(this.canWithdraw(stockLand,ShiroUtils.getUserId()));
+                }
+            }
         }
         return new PageInfo<StockLand>(landApplys);
     }
 
     //当前单据是否可以撤回
-	private Integer canWithdraw(StockLand stockLand, int userId) {
-		Approval latestAllApprovalByUser = approvalService.getLatestApprovalAllByUser(stockLand.getId(),Constant.DictionaryType.STOCKLAND,userId);
-		if( null == latestAllApprovalByUser.getIs_withdraw() && latestAllApprovalByUser.getCan_withdraw().equals(Constant.True_False.TRUE)) {
-			return Constant.True_False.TRUE;
-		}
-		return Constant.True_False.FASLE;
-	}
-
-	//审核方法
-	public Boolean approve(StockLandApprovalDto approval) {
-		StockLand apply = stockLandService.findLandApplyById(approval.getApply_id());
-		if(null != apply) {
-			if(apply.getApply_type().equals(Constant.LandApplyType.RENT)){
-				//房屋出租
-				return rentAuditLocal(apply,approval);
-			}else {
-				return auditLocal(apply,approval);
-			}
-		}
-		
-		return false;
-	}
-
-	//房屋出租审核街道属地初审
-	private Boolean rentAuditLocal(StockLand apply, StockLandApprovalDto approval) {
-		Boolean flag = true;
-		approval.setApproval_department(ShiroUtils.getUserEntity().getStreet_name());
-		if(approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
-			//退回
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
-				//2.找出下一审核人
-				String [] nextCheckerArr = nextChecker.split(",");
-				if(null != nextCheckerArr && nextCheckerArr.length > 0){
-					//“街道合规性审核小组”最后一个人审核(退回)
+    private Integer canWithdraw(StockLand stockLand, int userId) {
+        Approval latestAllApprovalByUser = approvalService.getLatestApprovalAllByUser(stockLand.getId(), Constant.DictionaryType.STOCKLAND, userId);
+        if (null == latestAllApprovalByUser.getIs_withdraw() && latestAllApprovalByUser.getCan_withdraw().equals(Constant.True_False.TRUE)) {
+            return Constant.True_False.TRUE;
+        }
+        return Constant.True_False.FASLE;
+    }
+
+    //审核方法
+    public Boolean approve(StockLandApprovalDto approval) {
+        StockLand apply = stockLandService.findLandApplyById(approval.getApply_id());
+        if (null != apply) {
+            if (apply.getApply_type().equals(Constant.LandApplyType.RENT)) {
+                //房屋出租
+                return rentAuditLocal(apply, approval);
+            } else {
+                return auditLocal(apply, approval);
+            }
+        }
+
+        return false;
+    }
+
+    //房屋出租审核街道属地初审
+    private Boolean rentAuditLocal(StockLand apply, StockLandApprovalDto approval) {
+        Boolean flag = true;
+        approval.setApproval_department(ShiroUtils.getUserEntity().getStreet_name());
+        if (approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
+            //退回
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
+                //2.找出下一审核人
+                String[] nextCheckerArr = nextChecker.split(",");
+                if (null != nextCheckerArr && nextCheckerArr.length > 0) {
+                    //“街道合规性审核小组”最后一个人审核(退回)
 					/*if(nextCheckerArr.length == 1){
 						//apply.setApprove_status(Constant.LandApproveStatus.REJECT);
 						apply.setTemporary_state(Constant.LandApproveStatus.REJECT);//记录状态
@@ -253,48 +255,48 @@ public class StockLandApproveService extends BaseService<StockLand> {
 						nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");
 						stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 					}*/
-					//2018-05-11 - 街道办事员也可以退回
-					apply.setTemporary_state(Constant.LandApproveStatus.REJECT);//记录状态
-					//街道所有工业用地审核组的人都可以确认并通知
-					if(StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
-						nextChecker = get_HGXSHXZ_Checkers();
-					}else {
-						throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
-					}
-				}
-				insertApproval(apply,Constant.OperType.REJECT,nextChecker,approval);
-				//新增待办
-				String handler = nextChecker;
-				waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
-						Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-			}
-		}else if(approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
-			//通过
-			apply.setApprove_status(Constant.LandApproveStatus.APPROVED);
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
-				//2.找出下一审核人
-				//String [] nextCheckerArr = nextChecker.split(",");
-				//判断是第几级审核,每一级只要一个审核过了就过了。 --20180528--
-				nextChecker = getNextLevelChecker(ShiroUtils.getUserId(),nextChecker);
-				if(StringUtils.isNotBlank(nextChecker)){
-					//还有下级审核
-					//不是最后一个人审核
-					apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
-					stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
-				
-				}else {
-					//没有下级审核领导审核通过
-					//apply.setApprove_status(Constant.LandApproveStatus.APPROVED);
-					apply.setTemporary_state(Constant.LandApproveStatus.APPROVED);//记录状态
-					//街道所有工业用地审核组的人都可以确认并通知
-					if(StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
-						nextChecker = get_HGXSHXZ_Checkers();
-					}else {
-						throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
-					}
-				}
+                    //2018-05-11 - 街道办事员也可以退回
+                    apply.setTemporary_state(Constant.LandApproveStatus.REJECT);//记录状态
+                    //街道所有工业用地审核组的人都可以确认并通知
+                    if (StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
+                        nextChecker = get_HGXSHXZ_Checkers();
+                    } else {
+                        throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
+                    }
+                }
+                insertApproval(apply, Constant.OperType.REJECT, nextChecker, approval);
+                //新增待办
+                String handler = nextChecker;
+                waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
+                        Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+            }
+        } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
+            //通过
+            apply.setApprove_status(Constant.LandApproveStatus.APPROVED);
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
+                //2.找出下一审核人
+                //String [] nextCheckerArr = nextChecker.split(",");
+                //判断是第几级审核,每一级只要一个审核过了就过了。 --20180528--
+                nextChecker = getNextLevelChecker(ShiroUtils.getUserId(), nextChecker);
+                if (StringUtils.isNotBlank(nextChecker)) {
+                    //还有下级审核
+                    //不是最后一个人审核
+                    apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
+                    stockLandService.sendAuditMessage(apply, Constant.UserType.STREET, null, stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
+
+                } else {
+                    //没有下级审核领导审核通过
+                    //apply.setApprove_status(Constant.LandApproveStatus.APPROVED);
+                    apply.setTemporary_state(Constant.LandApproveStatus.APPROVED);//记录状态
+                    //街道所有工业用地审核组的人都可以确认并通知
+                    if (StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
+                        nextChecker = get_HGXSHXZ_Checkers();
+                    } else {
+                        throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
+                    }
+                }
 				/* 每一级用户所有人都要审核
 				 * if(null != nextCheckerArr && nextCheckerArr.length > 0){
 					//“街道合规性审核小组”最后一个人审核(通过)
@@ -314,17 +316,17 @@ public class StockLandApproveService extends BaseService<StockLand> {
 						stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 					}
 				}*/
-				insertApproval(apply,Constant.OperType.APPROVED,nextChecker,approval);
-				//新增待办
-				String handler = nextChecker;
-				waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
-						Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-			}
-		}else if(approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
-			//不通过,直接不通过,无需再审核
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
+                insertApproval(apply, Constant.OperType.APPROVED, nextChecker, approval);
+                //新增待办
+                String handler = nextChecker;
+                waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
+                        Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+            }
+        } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
+            //不通过,直接不通过,无需再审核
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
 				/*
 				//2.找出下一审核人
 				
@@ -348,38 +350,38 @@ public class StockLandApproveService extends BaseService<StockLand> {
 						stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 					}
 				}*/
-				//apply.setApprove_status(Constant.LandApproveStatus.NOTAPPROVED);
-				apply.setTemporary_state(Constant.LandApproveStatus.NOTAPPROVED);//记录状态
-				//nextChecker = String.valueOf(apply.getCreate_by());
-				//街道所有工业用地审核组的人都可以确认并通知
-				if(StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
-					nextChecker = get_HGXSHXZ_Checkers();
-				}else {
-					throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
-				}
-				insertApproval(apply,Constant.OperType.NOTAPPROVED,nextChecker,approval);
-				//新增待办
-				String handler = nextChecker;
-				waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
-						Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-			}
-		}else if(approval.getStatus().equals(Constant.ApproveButtonStatus.SUBMIT_COMMENT)) {
-			//提交审核意见
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
-				//2.找出下一审核人
-				nextChecker = getNextLevelChecker(ShiroUtils.getUserId(),nextChecker);
-				if(StringUtils.isNotBlank(nextChecker)){
-					//还有下级审核
-					apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
-					//nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");	
-					stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
-					//新增待办
-					String handler = nextChecker;
-					waitToDoService.newTODO("存量用地审核", "/stockLand/approvePage/" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
-							Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-				}
+                //apply.setApprove_status(Constant.LandApproveStatus.NOTAPPROVED);
+                apply.setTemporary_state(Constant.LandApproveStatus.NOTAPPROVED);//记录状态
+                //nextChecker = String.valueOf(apply.getCreate_by());
+                //街道所有工业用地审核组的人都可以确认并通知
+                if (StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
+                    nextChecker = get_HGXSHXZ_Checkers();
+                } else {
+                    throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
+                }
+                insertApproval(apply, Constant.OperType.NOTAPPROVED, nextChecker, approval);
+                //新增待办
+                String handler = nextChecker;
+                waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
+                        Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+            }
+        } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.SUBMIT_COMMENT)) {
+            //提交审核意见
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
+                //2.找出下一审核人
+                nextChecker = getNextLevelChecker(ShiroUtils.getUserId(), nextChecker);
+                if (StringUtils.isNotBlank(nextChecker)) {
+                    //还有下级审核
+                    apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
+                    //nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");
+                    stockLandService.sendAuditMessage(apply, Constant.UserType.STREET, null, stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
+                    //新增待办
+                    String handler = nextChecker;
+                    waitToDoService.newTODO("存量用地审核", "/stockLand/approvePage/" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
+                            Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+                }
 				/*String [] nextCheckerArr = nextChecker.split(",");
 				if(null != nextCheckerArr && nextCheckerArr.length > 0){
 					//街道合规性审核小组不是最后一个人审核
@@ -387,52 +389,52 @@ public class StockLandApproveService extends BaseService<StockLand> {
 					nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");	
 					stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 				}*/
-				insertApproval(apply,Constant.OperType.SUBMIT_COMMENT,nextChecker,approval);
-				
-			}
-			
-		}
-		
-		flag = stockLandService.updateSelective(apply) > 0;
-		return flag;
-		
-	}
-	
-	//找到下一级审核人
-	private String getNextLevelChecker(Integer currCheckerId , String nextChecker) {
-		String [] nextCheckerArr = nextChecker.split(",");
-		User currChecker = userService.findById(currCheckerId);
-		Integer level = currChecker.getApprove_level();
-		if(null == level){
-			throw new BaseException("当前用户没有审核层级,请检查");
-		}
-		//去除相同级别的checker
-		for(String userId : nextCheckerArr) {
-			User checker = userService.findById(Integer.valueOf(userId));
-			if(null == checker.getApprove_level()){
-				throw new BaseException("审核组有审核人员没有审核层级,请检查");
-			}
-			if(null != checker.getApprove_level() && checker.getApprove_level().equals(level)) {
-				nextChecker = nextChecker.replace(userId + ",", "");
-			}
-		}
-		
-		return nextChecker;
-	}
-
-	//其他三种审核-街道属地初审
-	private Boolean auditLocal(StockLand apply, StockLandApprovalDto approval) {
-		Boolean flag = true;
-		approval.setApproval_department(ShiroUtils.getUserEntity().getStreet_name());
-		if(approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
-			//退回
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
-				//2.找出下一审核人
-				String [] nextCheckerArr = nextChecker.split(",");
-				if(null != nextCheckerArr && nextCheckerArr.length > 0){
-					//“街道合规性审核小组”最后一个人审核(退回)
+                insertApproval(apply, Constant.OperType.SUBMIT_COMMENT, nextChecker, approval);
+
+            }
+
+        }
+
+        flag = stockLandService.updateSelective(apply) > 0;
+        return flag;
+
+    }
+
+    //找到下一级审核人
+    private String getNextLevelChecker(Integer currCheckerId, String nextChecker) {
+        String[] nextCheckerArr = nextChecker.split(",");
+        User currChecker = userService.findById(currCheckerId);
+        Integer level = currChecker.getApprove_level();
+        if (null == level) {
+            throw new BaseException("当前用户没有审核层级,请检查");
+        }
+        //去除相同级别的checker
+        for (String userId : nextCheckerArr) {
+            User checker = userService.findById(Integer.valueOf(userId));
+            if (null == checker.getApprove_level()) {
+                throw new BaseException("审核组有审核人员没有审核层级,请检查");
+            }
+            if (null != checker.getApprove_level() && checker.getApprove_level().equals(level)) {
+                nextChecker = nextChecker.replace(userId + ",", "");
+            }
+        }
+
+        return nextChecker;
+    }
+
+    //其他三种审核-街道属地初审
+    private Boolean auditLocal(StockLand apply, StockLandApprovalDto approval) {
+        Boolean flag = true;
+        approval.setApproval_department(ShiroUtils.getUserEntity().getStreet_name());
+        if (approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
+            //退回
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
+                //2.找出下一审核人
+                String[] nextCheckerArr = nextChecker.split(",");
+                if (null != nextCheckerArr && nextCheckerArr.length > 0) {
+                    //“街道合规性审核小组”最后一个人审核(退回)
 					/*if(nextCheckerArr.length == 1){
 						apply.setApprove_status(Constant.LandApproveStatus.REJECT);
 						nextChecker = String.valueOf(apply.getCreate_by());
@@ -450,57 +452,57 @@ public class StockLandApproveService extends BaseService<StockLand> {
 						nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");
 						stockLandService.sendAuditMessage(apply,Constant.UserType.GOVERNMENT,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 					}*/
-					//2018-05-11 - 街道办事员也可以退回
-					apply.setApprove_status(Constant.LandApproveStatus.REJECT);//记录状态
-					//街道所有工业用地审核组的人都可以确认并通知
-					//根据工作组名称查出工作组
-					if(StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
-						nextChecker = get_HGXSHXZ_Checkers();
-					}else {
-						throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
-					}
-				}
-				insertApproval(apply,Constant.OperType.REJECT,nextChecker,approval);
-				//新增待办
-				String handler = nextChecker;
-				waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
-						Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-			}
-		}else if(approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
-			//通过
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
-				//2.找出下一审核人
-				//String [] nextCheckerArr = nextChecker.split(",");
-				//判断是第几级审核,每一级只要一个审核过了就过了。 --20180528--
-				nextChecker = getNextLevelChecker(ShiroUtils.getUserId(),nextChecker);
-				if(StringUtils.isNotBlank(nextChecker)){
-					//还有下级审核
-					//不是最后一个人审核
-					apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
-					stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
-					//新增待办
-					String handler = nextChecker;
-					waitToDoService.newTODO("存量用地审核", "/stockLand/approvePage/" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
-							Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-				}else {
-					//没有下级审核领导审核通过
-					apply.setApprove_status(Constant.LandApproveStatus.PENDING_DISTRIBUTE);
-					nextChecker = userGroupDao.findUserIdsByGroupName(Constant.GroupName.UNITEDWORKGROUP)+ ",";
-					if(StringUtils.isBlank(nextChecker)) {
-						throw new BaseException("协调工作组暂无审核人员,请联系政府管理员配置!");
-					}
-					List<Integer> checkerIds = new ArrayList<Integer>();
-					for(String checkerId : nextChecker.split(",")) {
-						checkerIds.add(Integer.valueOf(checkerId));
-					}
-					stockLandService.sendAuditMessage(apply,Constant.UserType.GOVERNMENT,null,checkerIds);
-					//新增待办
-					String handler = nextChecker;
-					waitToDoService.newTODO("存量用地审核", "/areaManager/approval?id=" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
-							Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-				}
+                    //2018-05-11 - 街道办事员也可以退回
+                    apply.setApprove_status(Constant.LandApproveStatus.REJECT);//记录状态
+                    //街道所有工业用地审核组的人都可以确认并通知
+                    //根据工作组名称查出工作组
+                    if (StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
+                        nextChecker = get_HGXSHXZ_Checkers();
+                    } else {
+                        throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
+                    }
+                }
+                insertApproval(apply, Constant.OperType.REJECT, nextChecker, approval);
+                //新增待办
+                String handler = nextChecker;
+                waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
+                        Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+            }
+        } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
+            //通过
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
+                //2.找出下一审核人
+                //String [] nextCheckerArr = nextChecker.split(",");
+                //判断是第几级审核,每一级只要一个审核过了就过了。 --20180528--
+                nextChecker = getNextLevelChecker(ShiroUtils.getUserId(), nextChecker);
+                if (StringUtils.isNotBlank(nextChecker)) {
+                    //还有下级审核
+                    //不是最后一个人审核
+                    apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
+                    stockLandService.sendAuditMessage(apply, Constant.UserType.STREET, null, stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
+                    //新增待办
+                    String handler = nextChecker;
+                    waitToDoService.newTODO("存量用地审核", "/stockLand/approvePage/" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
+                            Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+                } else {
+                    //没有下级审核领导审核通过
+                    apply.setApprove_status(Constant.LandApproveStatus.PENDING_DISTRIBUTE);
+                    nextChecker = userGroupDao.findUserIdsByGroupName(Constant.GroupName.UNITEDWORKGROUP) + ",";
+                    if (StringUtils.isBlank(nextChecker)) {
+                        throw new BaseException("协调工作组暂无审核人员,请联系政府管理员配置!");
+                    }
+                    List<Integer> checkerIds = new ArrayList<Integer>();
+                    for (String checkerId : nextChecker.split(",")) {
+                        checkerIds.add(Integer.valueOf(checkerId));
+                    }
+                    stockLandService.sendAuditMessage(apply, Constant.UserType.GOVERNMENT, null, checkerIds);
+                    //新增待办
+                    String handler = nextChecker;
+                    waitToDoService.newTODO("存量用地审核", "/areaManager/approval?id=" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
+                            Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+                }
 				/*String [] nextCheckerArr = nextChecker.split(",");
 				if(null != nextCheckerArr && nextCheckerArr.length > 0){
 					//“街道合规性审核小组”最后一个人审核
@@ -524,15 +526,15 @@ public class StockLandApproveService extends BaseService<StockLand> {
 						stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 					}
 				}*/
-				insertApproval(apply,Constant.OperType.APPROVED,nextChecker,approval);
-			}
-			
-		}else if(approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
-			//不通过
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
-				//2.找出下一审核人
+                insertApproval(apply, Constant.OperType.APPROVED, nextChecker, approval);
+            }
+
+        } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
+            //不通过
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
+                //2.找出下一审核人
 				/*String [] nextCheckerArr = nextChecker.split(",");
 				if(null != nextCheckerArr && nextCheckerArr.length > 0){
 					//“街道合规性审核小组”最后一个人审核
@@ -552,33 +554,33 @@ public class StockLandApproveService extends BaseService<StockLand> {
 						stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 					}
 				}*/
-				apply.setApprove_status(Constant.LandApproveStatus.NOTAPPROVED);//记录状态
-				//nextChecker = String.valueOf(apply.getCreate_by());
-				//街道所有工业用地审核组的人都可以确认并通知
-				if(StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
-					nextChecker = get_HGXSHXZ_Checkers();
-				}else {
-					throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
-				}
-				insertApproval(apply,Constant.OperType.NOTAPPROVED,nextChecker,approval);
-				//新增待办
-				String handler = nextChecker;
-				waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
-						Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-			}
-		}else if(approval.getStatus().equals(Constant.ApproveButtonStatus.SUBMIT_COMMENT)) {
-			//提交审核意见
-			Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-			if(null != latestApproval){
-				String nextChecker = latestApproval.getNextchecker();
-				//2.找出下一审核人
-				nextChecker = getNextLevelChecker(ShiroUtils.getUserId(),nextChecker);
-				if(StringUtils.isNotBlank(nextChecker)){
-					//还有下级审核
-					apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
-					//nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");	
-					stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
-				}
+                apply.setApprove_status(Constant.LandApproveStatus.NOTAPPROVED);//记录状态
+                //nextChecker = String.valueOf(apply.getCreate_by());
+                //街道所有工业用地审核组的人都可以确认并通知
+                if (StringUtils.isNotBlank(get_HGXSHXZ_Checkers())) {
+                    nextChecker = get_HGXSHXZ_Checkers();
+                } else {
+                    throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
+                }
+                insertApproval(apply, Constant.OperType.NOTAPPROVED, nextChecker, approval);
+                //新增待办
+                String handler = nextChecker;
+                waitToDoService.newTODO("存量用地确认并通知", "/stockLand/confirmPage/" + apply.getId(), Constant.WaitToDo_OperType.CONFIRM_AND_NOTIFY, apply.getId(),
+                        Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+            }
+        } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.SUBMIT_COMMENT)) {
+            //提交审核意见
+            Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            if (null != latestApproval) {
+                String nextChecker = latestApproval.getNextchecker();
+                //2.找出下一审核人
+                nextChecker = getNextLevelChecker(ShiroUtils.getUserId(), nextChecker);
+                if (StringUtils.isNotBlank(nextChecker)) {
+                    //还有下级审核
+                    apply.setApprove_status(Constant.LandApproveStatus.LOCAL_AUDIT);
+                    //nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");
+                    stockLandService.sendAuditMessage(apply, Constant.UserType.STREET, null, stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
+                }
 				/*String [] nextCheckerArr = nextChecker.split(",");
 				if(null != nextCheckerArr && nextCheckerArr.length > 0){
 					//街道合规性审核小组不是最后一个人审核
@@ -586,41 +588,44 @@ public class StockLandApproveService extends BaseService<StockLand> {
 					nextChecker = nextChecker.replace(ShiroUtils.getUserId()+",","");	
 					stockLandService.sendAuditMessage(apply,Constant.UserType.STREET,null,stockLandService.getNextCheckersByLevelAndIdsStr(nextChecker));
 				}*/
-				insertApproval(apply,Constant.OperType.SUBMIT_COMMENT,nextChecker,approval);
-				//新增待办
-				String handler = nextChecker;
-				waitToDoService.newTODO("存量用地审核", "/stockLand/approvePage/" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
-						Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-			}
-		}
-		flag = stockLandService.updateSelective(apply) > 0;
-		return flag;
-	}
-
-	//确认并通知企业
-	public Boolean confirm(Message message) {
-		StockLand apply = stockLandService.findById(message.getApply_id());
-		if(null != apply) {
-			int[] pushIds = {apply.getCompany_id()};
-			message.setBusiness_type(Constant.Message_Business_type.STOCKLAND);
-			message.setBusiness_type_name(Constant.DictionaryType.STOCKLAND);
-			messageService.saveMessageAndPush(message, pushIds,Constant.UserType.COMPANY);
-
-			//2018-08-23 如果是受理员申请的,同时通知受理
-			User createUser = userService.findById(apply.getCreate_by());
-			if(null != createUser){
-				int[] pushStreetIds = {apply.getCreate_by()};
-				if(createUser.getUser_type().equals(Constant.UserType.STREET)){
-					messageService.saveMessageAndPushToUser(message, pushStreetIds,Constant.UserType.STREET);
-				}
-			}
-
-			//通知企业,给applystatus赋值,企业可以看到状态改变
-			if(apply.getApply_type().equals(Constant.LandApplyType.RENT)){
-				apply.setApprove_status(apply.getTemporary_state());
-			}
-
-			// 不建议这种写法,会出现空指针
+                insertApproval(apply, Constant.OperType.SUBMIT_COMMENT, nextChecker, approval);
+                //新增待办
+                String handler = nextChecker;
+                waitToDoService.newTODO("存量用地审核", "/stockLand/approvePage/" + apply.getId(), Constant.WaitToDo_OperType.AUDIT, apply.getId(),
+                        Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+            }
+        }
+        flag = stockLandService.updateSelective(apply) > 0;
+        return flag;
+    }
+
+    //确认并通知企业
+    public Boolean confirm(Message message) {
+        logger.info("==== 进行单据处理 ====");
+        logger.info("当前消息message:{}", message);
+        StockLand apply = stockLandService.findById(message.getApply_id());
+        logger.info("当前消息apply:{}", apply);
+        if (null != apply) {
+            int[] pushIds = {apply.getCompany_id()};
+            message.setBusiness_type(Constant.Message_Business_type.STOCKLAND);
+            message.setBusiness_type_name(Constant.DictionaryType.STOCKLAND);
+            messageService.saveMessageAndPush(message, pushIds, Constant.UserType.COMPANY);
+
+            //2018-08-23 如果是受理员申请的,同时通知受理
+            User createUser = userService.findById(apply.getCreate_by());
+            if (null != createUser) {
+                int[] pushStreetIds = {apply.getCreate_by()};
+                if (createUser.getUser_type().equals(Constant.UserType.STREET)) {
+                    messageService.saveMessageAndPushToUser(message, pushStreetIds, Constant.UserType.STREET);
+                }
+            }
+
+            //通知企业,给applystatus赋值,企业可以看到状态改变
+            if (apply.getApply_type().equals(Constant.LandApplyType.RENT)) {
+                apply.setApprove_status(apply.getTemporary_state());
+            }
+
+            // 不建议这种写法,会出现空指针
 //			if(apply.getApprove_status().equals(Constant.LandApproveStatus.REJECT)) {
 //				apply.setApply_status(Constant.LandApplyStatus.REJECT);
 //			}else if(apply.getApprove_status().equals(Constant.LandApproveStatus.APPROVED)) {
@@ -630,426 +635,428 @@ public class StockLandApproveService extends BaseService<StockLand> {
 //				apply.setApply_status(Constant.LandApplyStatus.NOTAPPROVED);
 //			}
 
-			if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.REJECT)) {
-				apply.setApply_status(Constant.LandApplyStatus.REJECT);
-			} else if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.APPROVED)
-					  || Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.EASY_PROCESS_APPROVED)) {
-				apply.setApply_status(Constant.LandApplyStatus.APPROVED);
-				apply.setProcess_status(Constant.ProcessStatus.IN_PROGRESS);
-			}else if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.NOTAPPROVED)
-				     || Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.EASY_PROCESS_DENY)) {
-				apply.setApply_status(Constant.LandApplyStatus.NOTAPPROVED);
-			} else {
-				logger.error("单据的状态:{}", apply.getApprove_status());
-				throw new RuntimeException("错误的单据状态:" + apply.getApprove_status());
-			}
-
-			stockLandService.updateSelective(apply);
-			//置空临时状态
-			stockLandService.updateTempporaryStateToNull(apply.getId());
-			//如果街道确认并通知企业,插入街道通知企业的数据,不然审核流一直停留在街道
-			StockLandApprovalDto approval = new StockLandApprovalDto();
-			approval.setApproval_department(ShiroUtils.getUserEntity().getStreet_name());
-			String nextChecker = String.valueOf(apply.getCreate_by());
-			if(apply.getApprove_status().equals(Constant.LandApproveStatus.APPROVED)) {
-				nextChecker = "";
-			}
-			approval.setApproval_comment(message.getContent());
-			insertApproval(apply,Constant.OperType.CONFIRM_AND_NOTIFY,nextChecker,approval);
-			
-			if(apply.getApprove_status().equals(Constant.LandApproveStatus.REJECT)){
-				//新增待办
-				String handler = String.valueOf(apply.getCreate_by());
-				waitToDoService.newTODO("存量用地编辑", "/stockLand/editApply/" + apply.getId(), Constant.WaitToDo_OperType.EDIT, apply.getId(),
-						Constant.DictionaryType.STOCKLAND,apply.getApply_no(), handler , Constant.WaitToDo_IsSerial.IS_SERIAL);
-			}else {
-				waitToDoService.completeAllTODO(apply.getId(), Constant.DictionaryType.STOCKLAND);
-			}
-			
-			return true;
-		}
-		return false;
-	}
-
-	public Boolean sendMsg(Message message) {
-		StockLand apply = stockLandService.findById(message.getApply_id());
-		//发送短信通知企业
-		try {
-			Boolean flag = sendSMSToCompany(apply,message);
-			return flag;
-		} catch (ClientException | InterruptedException e) {
-			throw new BaseException("短信接口异常!发送短信失败!");
-		}
-	}
-	
-	private Boolean sendSMSToCompany(StockLand apply, Message message) throws ClientException, InterruptedException {
-		String phone = "";
-		CompanyContact contact = companyContactService.findFirstByCompanyId(apply.getCompany_id());
-		ProjectApplicationCompanyInfo companyInfo = projectApplicationCompanyInfoService.findByApplyIdAndType(apply.getId(),Constant.DictionaryType.STOCKLAND);
-        if(null != companyInfo && null != companyInfo.getContact_phone()) {
-        	phone = companyInfo.getContact_phone();
-        }else if(null != contact){
-        	phone = contact.getPhone();
+            if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.REJECT)) {
+                apply.setApply_status(Constant.LandApplyStatus.REJECT);
+            } else if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.APPROVED)
+                    || Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.EASY_PROCESS_APPROVED)) {
+                apply.setApply_status(Constant.LandApplyStatus.APPROVED);
+                apply.setProcess_status(Constant.ProcessStatus.IN_PROGRESS);
+            } else if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.NOTAPPROVED)
+                    || Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.EASY_PROCESS_DENY)) {
+                apply.setApply_status(Constant.LandApplyStatus.NOTAPPROVED);
+            } else {
+                logger.error("=====错误=====");
+                logger.error("单据的状态:{}", apply.getApprove_status());
+                logger.error("单据数据:{}", apply);
+                logger.error("消息数据:{}", message);
+                logger.error("============");
+                throw new RuntimeException("错误的单据状态:" + apply.getApprove_status());
+            }
+
+            stockLandService.updateSelective(apply);
+            //置空临时状态
+            stockLandService.updateTempporaryStateToNull(apply.getId());
+            //如果街道确认并通知企业,插入街道通知企业的数据,不然审核流一直停留在街道
+            StockLandApprovalDto approval = new StockLandApprovalDto();
+            approval.setApproval_department(ShiroUtils.getUserEntity().getStreet_name());
+            String nextChecker = String.valueOf(apply.getCreate_by());
+            if (apply.getApprove_status().equals(Constant.LandApproveStatus.APPROVED)) {
+                nextChecker = "";
+            }
+            approval.setApproval_comment(message.getContent());
+            insertApproval(apply, Constant.OperType.CONFIRM_AND_NOTIFY, nextChecker, approval);
+
+            if (apply.getApprove_status().equals(Constant.LandApproveStatus.REJECT)) {
+                //新增待办
+                String handler = String.valueOf(apply.getCreate_by());
+                waitToDoService.newTODO("存量用地编辑", "/stockLand/editApply/" + apply.getId(), Constant.WaitToDo_OperType.EDIT, apply.getId(),
+                        Constant.DictionaryType.STOCKLAND, apply.getApply_no(), handler, Constant.WaitToDo_IsSerial.IS_SERIAL);
+            } else {
+                waitToDoService.completeAllTODO(apply.getId(), Constant.DictionaryType.STOCKLAND);
+            }
+
+            return true;
+        }
+        return false;
+    }
+
+    public Boolean sendMsg(Message message) {
+        StockLand apply = stockLandService.findById(message.getApply_id());
+        //发送短信通知企业
+        try {
+            Boolean flag = sendSMSToCompany(apply, message);
+            return flag;
+        } catch (ClientException | InterruptedException e) {
+            throw new BaseException("短信接口异常!发送短信失败!");
+        }
+    }
+
+    private Boolean sendSMSToCompany(StockLand apply, Message message) throws ClientException, InterruptedException {
+        String phone = "";
+        CompanyContact contact = companyContactService.findFirstByCompanyId(apply.getCompany_id());
+        ProjectApplicationCompanyInfo companyInfo = projectApplicationCompanyInfoService.findByApplyIdAndType(apply.getId(), Constant.DictionaryType.STOCKLAND);
+        if (null != companyInfo && null != companyInfo.getContact_phone()) {
+            phone = companyInfo.getContact_phone();
+        } else if (null != contact) {
+            phone = contact.getPhone();
         }
-        if(StringUtils.isNotBlank(phone)) {
-        	// ${street_name}提醒您,您的存量用地申请 :${apply_type}(单号:${apply_no})单据已审核,
-    		// 状态为:  ${approve_status} ! 具体信息请登录PC端查看。感谢您的支持。
-    		String apply_no = apply.getApply_no();
-    		String apply_type = "";
-    		if(StringUtils.isNotBlank(apply.getApply_type())) {
-    			apply_type = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND, apply.getApply_type());
-    		}
-    		String approve_status = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS, apply.getApprove_status());
-    		
-    		String street_name = ShiroUtils.getUserEntity().getStreet_name();
-    		String templateParam = "{\"street_name\":\""+street_name+"\",\"apply_type\":\""+apply_type+"\",\"apply_no\":\""+apply_no+"\",\"approve_status\":\""+approve_status+"\"}";
-    		AlibabaSMSUtil.sendSMS(phone, Constant.SMS_TemplateCode.STOCKLAND_CONFIRM_AND_NOTIFY, "企业提升发展服务平台",templateParam);
-    		return true;
-        }else {
-        	return false;
+        if (StringUtils.isNotBlank(phone)) {
+            // ${street_name}提醒您,您的存量用地申请 :${apply_type}(单号:${apply_no})单据已审核,
+            // 状态为:  ${approve_status} ! 具体信息请登录PC端查看。感谢您的支持。
+            String apply_no = apply.getApply_no();
+            String apply_type = "";
+            if (StringUtils.isNotBlank(apply.getApply_type())) {
+                apply_type = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND, apply.getApply_type());
+            }
+            String approve_status = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS, apply.getApprove_status());
+
+            String street_name = ShiroUtils.getUserEntity().getStreet_name();
+            String templateParam = "{\"street_name\":\"" + street_name + "\",\"apply_type\":\"" + apply_type + "\",\"apply_no\":\"" + apply_no + "\",\"approve_status\":\"" + approve_status + "\"}";
+            AlibabaSMSUtil.sendSMS(phone, Constant.SMS_TemplateCode.STOCKLAND_CONFIRM_AND_NOTIFY, "企业提升发展服务平台", templateParam);
+            return true;
+        } else {
+            return false;
         }
-	}
-
-	//插审核工作流表,审核材料
-	public void insertApproval(StockLand apply,String oper_type,String nextChecker,StockLandApprovalDto approval) {
-		Approval latestApproval = approvalService.getLatestApproval(apply.getId(),Constant.DictionaryType.STOCKLAND);
-		//设置审核完成时间
-		latestApproval.setDeal_time(DateUtil.getTimeString(new Date()));	
-		approvalService.updateSelective(latestApproval);
-		//添加新审核流
-		Approval approvalInfo = new Approval();
-		approvalInfo.setApply_id(apply.getId());
-		approvalInfo.setBefore_approvalstatus(latestApproval.getAfter_approvalstatus());
-		approvalInfo.setAfter_approvalstatus(apply.getApprove_status());
-		approvalInfo.setApproval_round(latestApproval.getApproval_round());
-		approvalInfo.setChecker(ShiroUtils.getUserId());
-		approvalInfo.setNextchecker(nextChecker);
-		approvalInfo.setType(Constant.DictionaryType.STOCKLAND);
-		approvalInfo.setOper_type(oper_type);
-		approvalInfo.setDepartment(approval.getApproval_department());
-		approvalInfo.setApproval_comment(approval.getApproval_comment());
-		approvalService.insertAndGetId(approvalInfo);
-		//插入审核材料
-		if(null != approval.getFileDowns() && approval.getFileDowns().size()>0) {
-			for(FileDown file : approval.getFileDowns()) {
-				if(null != file && null !=file.getFile_id()) {
-					attachmentDao.updateAttachment(Constant.Attachment.STOCKLAND_APPROVE, approvalInfo.getId(), file.getFile_id());
-				}
-			}
-		}
-		
-	}
-	
-	//是否等待通知企业-申请状态与审核状态不一样时,通知企业
-	public Boolean isPendingNotify(StockLand apply) {
-		String approveStatus = apply.getApprove_status();
-		String applyStatus = apply.getApply_status();
-		if ( isApprovalStatusApproved(approveStatus)
+    }
+
+    //插审核工作流表,审核材料
+    public void insertApproval(StockLand apply, String oper_type, String nextChecker, StockLandApprovalDto approval) {
+        Approval latestApproval = approvalService.getLatestApproval(apply.getId(), Constant.DictionaryType.STOCKLAND);
+        //设置审核完成时间
+        latestApproval.setDeal_time(DateUtil.getTimeString(new Date()));
+        approvalService.updateSelective(latestApproval);
+        //添加新审核流
+        Approval approvalInfo = new Approval();
+        approvalInfo.setApply_id(apply.getId());
+        approvalInfo.setBefore_approvalstatus(latestApproval.getAfter_approvalstatus());
+        approvalInfo.setAfter_approvalstatus(apply.getApprove_status());
+        approvalInfo.setApproval_round(latestApproval.getApproval_round());
+        approvalInfo.setChecker(ShiroUtils.getUserId());
+        approvalInfo.setNextchecker(nextChecker);
+        approvalInfo.setType(Constant.DictionaryType.STOCKLAND);
+        approvalInfo.setOper_type(oper_type);
+        approvalInfo.setDepartment(approval.getApproval_department());
+        approvalInfo.setApproval_comment(approval.getApproval_comment());
+        approvalService.insertAndGetId(approvalInfo);
+        //插入审核材料
+        if (null != approval.getFileDowns() && approval.getFileDowns().size() > 0) {
+            for (FileDown file : approval.getFileDowns()) {
+                if (null != file && null != file.getFile_id()) {
+                    attachmentDao.updateAttachment(Constant.Attachment.STOCKLAND_APPROVE, approvalInfo.getId(), file.getFile_id());
+                }
+            }
+        }
+
+    }
+
+    //是否等待通知企业-申请状态与审核状态不一样时,通知企业
+    public Boolean isPendingNotify(StockLand apply) {
+        String approveStatus = apply.getApprove_status();
+        String applyStatus = apply.getApply_status();
+        if (isApprovalStatusApproved(approveStatus)
                 && !applyStatus.equals(Constant.LandApplyStatus.APPROVED)) {
-			return true;
-		}
-		if(approveStatus.equals(Constant.LandApproveStatus.NOTAPPROVED)
-				&& !applyStatus.equals(Constant.LandApplyStatus.NOTAPPROVED)) {
-			return true;
-		}
-		if( isApprovalStatusRejected(approveStatus)
-				&& !applyStatus.equals(Constant.LandApplyStatus.REJECT)) {
-			return true;
-		}
-
-		String temporary_state = apply.getTemporary_state();
-		if(StringUtils.isNotBlank(temporary_state)){
-			return true;
-		}
-		return false;
-	}
-
-	private boolean isApprovalStatusRejected(String approveStatus) {
-		return approveStatus.equals(Constant.LandApproveStatus.REJECT)
-				|| approveStatus.equals(Constant.LandApproveStatus.EASY_PROCESS_DENY);
-	}
-
-	private boolean isApprovalStatusApproved(String approveStatus) {
+            return true;
+        }
+        if (approveStatus.equals(Constant.LandApproveStatus.NOTAPPROVED)
+                && !applyStatus.equals(Constant.LandApplyStatus.NOTAPPROVED)) {
+            return true;
+        }
+        if (isApprovalStatusRejected(approveStatus)
+                && !applyStatus.equals(Constant.LandApplyStatus.REJECT)) {
+            return true;
+        }
+
+        String temporary_state = apply.getTemporary_state();
+        if (StringUtils.isNotBlank(temporary_state)) {
+            return true;
+        }
+        return false;
+    }
+
+    private boolean isApprovalStatusRejected(String approveStatus) {
+        return approveStatus.equals(Constant.LandApproveStatus.REJECT)
+                || approveStatus.equals(Constant.LandApproveStatus.EASY_PROCESS_DENY);
+    }
+
+    private boolean isApprovalStatusApproved(String approveStatus) {
         return approveStatus.equals(Constant.LandApproveStatus.APPROVED)
                 || approveStatus.equals(Constant.LandApproveStatus.EASY_PROCESS_APPROVED);
     }
 
     //是否待审批状态
-	public Boolean isPendingAudit(StockLand apply) {
-		String approveStatus = apply.getApprove_status();
-		if(approveStatus.equals(Constant.LandApproveStatus.APPROVED)||approveStatus.equals(Constant.LandApproveStatus.NOTAPPROVED)
-				||approveStatus.equals(Constant.LandApproveStatus.REJECT)) {
-			return false;
-		}
-		return true;
-	}
-
-	//添加/编辑进程反馈
-	public Boolean processFeedback(ProcessFeedback feedback) {
-		StockLand apply = stockLandService.findById(feedback.getApply_id());
-		if(null != apply) {
-			if(null == feedback.getId()) {
-				feedback.setType(Constant.DictionaryType.STOCKLAND);
-				processFeedbackService.saveFeedback(feedback);
-			}else {
-				processFeedbackService.updateFeedback(feedback);
-			}
-			apply.setProcess_status(feedback.getProcess_status());//给申请的线下处理状态processStatus赋值
-			if(feedback.getProcess_status().equals(Constant.ProcessStatus.PASS)) {
-				apply.setApprove_status(Constant.LandApproveStatus.PASSED);
-				apply.setApply_status(Constant.LandApplyStatus.PASSED);
-			}else if(feedback.getProcess_status().equals(Constant.ProcessStatus.NOTPASS)) {
-				apply.setApprove_status(Constant.LandApproveStatus.NOTPASSED);
-				apply.setApply_status(Constant.LandApplyStatus.NOTPASSED);
-			}
-			stockLandService.updateSelective(apply);
-			return true;
-		}
-		return false;
-	}
-	
-	public Boolean isLeader(String groupName) {
-		//登录用户的审核层级是不是工作组最高级,最高级则是领导,可以选择通过/不通过/退回
-		Integer level = 0;
-    	User currUser = ShiroUtils.getUserEntity();
-        level = groupService.getHighestApproveLevel(groupName,Constant.UserType.STREET);
-        if(null != level && currUser.getApprove_level().equals(level)) {
-        	return true;
+    public Boolean isPendingAudit(StockLand apply) {
+        String approveStatus = apply.getApprove_status();
+        if (approveStatus.equals(Constant.LandApproveStatus.APPROVED) || approveStatus.equals(Constant.LandApproveStatus.NOTAPPROVED)
+                || approveStatus.equals(Constant.LandApproveStatus.REJECT)) {
+            return false;
+        }
+        return true;
+    }
+
+    //添加/编辑进程反馈
+    public Boolean processFeedback(ProcessFeedback feedback) {
+        StockLand apply = stockLandService.findById(feedback.getApply_id());
+        if (null != apply) {
+            if (null == feedback.getId()) {
+                feedback.setType(Constant.DictionaryType.STOCKLAND);
+                processFeedbackService.saveFeedback(feedback);
+            } else {
+                processFeedbackService.updateFeedback(feedback);
+            }
+            apply.setProcess_status(feedback.getProcess_status());//给申请的线下处理状态processStatus赋值
+            if (feedback.getProcess_status().equals(Constant.ProcessStatus.PASS)) {
+                apply.setApprove_status(Constant.LandApproveStatus.PASSED);
+                apply.setApply_status(Constant.LandApplyStatus.PASSED);
+            } else if (feedback.getProcess_status().equals(Constant.ProcessStatus.NOTPASS)) {
+                apply.setApprove_status(Constant.LandApproveStatus.NOTPASSED);
+                apply.setApply_status(Constant.LandApplyStatus.NOTPASSED);
+            }
+            stockLandService.updateSelective(apply);
+            return true;
         }
         return false;
-	}
-	
-	//获取街道合规性审核小组所有人员
-	public String get_HGXSHXZ_Checkers() {
-		//根据工作组名称查出工作组
-		Group group = groupService.findByNameAndUserType(Constant.HGXSHXZ, null,Constant.UserType.STREET,null);
-		//如果不为空
-		if(null != group){
-			//根据工作组id查出UserGroup
-			List<UserGroup> list = userGroupService.findByGroupId(group.getId());
-			if(null == list || list.size()==0) {
-				throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
-			}
-			//构建一个StringBuffer 存放下一审核人id
-			StringBuffer sb = new StringBuffer("");
-			for (UserGroup userGroup: list) {
-				Integer userId = userGroup.getUser_id();
-				sb.append(userId+",");
-			}
-			return sb.toString();
-		}
-		return null;
-	}
-
-	/**
-	 * 
-	 * findApprovePassPage(查询审批通过列表)
-	 * @param pageNum
-	 * @param pagesize
-	 * @param keyword
-	 * @param company_name
-	 * @param apply_type
-	 * @param itemId
-	 * @param street_id
-	 * @return PageInfo<StockLand>
-	 * @throws ParseException
-	 */
-	@Transactional(readOnly = true)
-	public PageInfo<StockLand> findApprovePassPage(
-			Integer pageNum, Integer pagesize, String keyword,String company_name,String apply_type,Integer itemId,Integer street_id,Integer applyUserType) throws ParseException {
-		if (StringUtils.isNotBlank(keyword)) {
-			keyword = keyword.trim();
-		}
-		if (StringUtils.isNotBlank(company_name)) {
-			company_name = company_name.trim();
-		}
-		Integer user_type = ShiroUtils.getUserEntity().getUser_type();
-		UserData userData = new UserData();
-		if (user_type.equals(Constant.UserType.STREET)) {
- 			userData.setStreet_id(ShiroUtils.getUserEntity().getStreet_id());
- 		//超级管理员
- 		}
-		String approve = Constant.LandApproveStatus.APPROVED;
-		//获取存量用地type id
-		Integer stockLandId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND).getId();
-		//存量用地审核状态 id
-		Integer approvedId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS).getId();
-		//通过的状态
-		List<String> statusList = new ArrayList<String>();
-		statusList.add(Constant.LandApproveStatus.APPROVED);
-		statusList.add(Constant.LandApproveStatus.PASSED);
-		PageHelper.startPage(pageNum, pagesize);
-		List<StockLand> stockLandList = stockLandDao.findApprovePassPage(keyword,company_name,apply_type,approve,userData,stockLandId,approvedId,itemId,street_id,applyUserType,statusList);
-		for (StockLand stockLand : stockLandList) {
-			stockLand.setPassTime(stockLand.getCreate_time());
-			//是否是重大项目
-			Integer is_zdxm = stockLand.getIs_zdxm();
-			if (is_zdxm != null) {
-				if (is_zdxm == 1) {
-					stockLand.setIs_zdxm_str("是");
-				}else {
-					stockLand.setIs_zdxm_str("否");
-				}
-			}
-		}
-		
-		return new PageInfo<StockLand>(stockLandList);
-	}
-	
-	/**
-	 * 
-	 * findSelectPage(查询所有审核状态下列表)
-	 * @param pageNum
-	 * @param pagesize
-	 * @param keyword
-	 * @param company_name
-	 * @param apply_type
-	 * @param approve_status
-	 * @param itemId
-	 * @param street_id
-	 * @return PageInfo<StockLand>
-	 */
-	public PageInfo<StockLand> findSelectPage(
-			Integer pageNum, Integer pagesize, String keyword,String company_name,String apply_type,
-			String approve_status,Integer itemId,Integer street_id,Integer applyUserType) {
-		if (StringUtils.isNotBlank(keyword)) {
-			keyword = keyword.trim();
-		}
-		if (StringUtils.isNotBlank(company_name)) {
-			company_name = company_name.trim();
-		}
-		Integer user_type = ShiroUtils.getUserEntity().getUser_type();
-		UserData userData = new UserData();
-		if (user_type.equals(Constant.UserType.STREET)) {
- 			userData.setStreet_id(ShiroUtils.getUserEntity().getStreet_id());
- 		//超级管理员
- 		}
-		//获取存量用地type id
-		Integer stockLandId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND).getId();
-		//存量用地审核状态 id
-		Integer approvedId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS).getId();
-		PageHelper.startPage(pageNum, pagesize);
-		String rejectStatus = Constant.LandApproveStatus.REJECT;
-		List<StockLand> stockLandList = stockLandDao.findSelectPage(stockLandId,approvedId,itemId,street_id,keyword,company_name,approve_status,userData,applyUserType,rejectStatus);
-		
-		for (StockLand stockLand : stockLandList) {
-			stockLand.setPassTime(stockLand.getCreate_time());
-			//是否是重大项目
-			Integer is_zdxm = stockLand.getIs_zdxm();
-			if (is_zdxm != null) {
-				if (is_zdxm == 1) {
-					stockLand.setIs_zdxm_str("是");
-				}else {
-					stockLand.setIs_zdxm_str("否");
-				}
-			}
-		}
-		return new PageInfo<StockLand>(stockLandList);
-	}
-
-	//审核撤回
-	public void withDraw(Integer apply_id) {
-		StockLand apply = stockLandService.findById(apply_id);
-		if(stockLandService.canWithdraw(apply,ShiroUtils.getUserId()).equals(Constant.True_False.FASLE)) {
-			throw new BaseException("当前单据已不可撤回!");
-		}
-		Approval latestApproval = approvalService.getLatestApprovalAll(apply_id,Constant.DictionaryType.STOCKLAND);
-		if(latestApproval.getBefore_approvalstatus().equals(Constant.LandApproveStatus.COMPLIANCE_AUDIT) 
-				&& (apply.getApprove_status().equals(Constant.LandApproveStatus.COMPLIANCE_AUDIT) || apply.getApprove_status().equals(Constant.LandApproveStatus.HGXSCTG)) ) {
-			//合规性审核撤回
-			if(latestApproval.getChecker().equals(ShiroUtils.getUserId())) {
-				//最近一条就是当前用户审核的
-				latestApproval.setIs_withdraw(Constant.True_False.TRUE);
-				latestApproval.setDel_flag(true);
-				approvalService.updateSelective(latestApproval);
-				apply.setApprove_status(latestApproval.getBefore_approvalstatus());
-				stockLandService.updateSelective(apply);
-			}else {
-				//最近一条不是当前用户审核的
-				Approval latestAllApprovalByUser = approvalService.getLatestApprovalAllByUser(apply.getId(),Constant.DictionaryType.STOCKLAND,ShiroUtils.getUserId());
-				latestAllApprovalByUser.setIs_withdraw(Constant.True_False.TRUE);
-				latestAllApprovalByUser.setDel_flag(true);
-				approvalService.updateSelective(latestAllApprovalByUser);
-				
-				latestApproval.setNextchecker(latestApproval.getNextchecker() + ShiroUtils.getUserId()+",");
-				approvalService.updateSelective(latestApproval);
-				apply.setApprove_status(latestApproval.getBefore_approvalstatus());
-				stockLandService.updateSelective(apply);
-			}
-		}else {
-			latestApproval.setIs_withdraw(Constant.True_False.TRUE);
-			latestApproval.setDel_flag(true);
-			approvalService.updateSelective(latestApproval);
-			//撤回,更改单据状态为原状态
-			//StockLand apply = stockLandService.findById(apply_id);
-			apply.setApprove_status(latestApproval.getBefore_approvalstatus());
-			if(StringUtils.isNotBlank(apply.getTemporary_state())) {
-				//清空临时状态
-				stockLandService.updateTempporaryStateToNull(apply_id);
-			}
-			stockLandService.updateSelective(apply);
-			
-		}
-		
-		
-	}
-
-	//是否是当前审核人
-	public Boolean isCurrChecker(Integer apply_id , StockLandApprovalDto approvalInfo) {
-		Boolean isNextChecker = false;
-		Approval latestApproval = approvalService.getLatestApproval(apply_id,Constant.DictionaryType.STOCKLAND);
-    	User currUser = ShiroUtils.getUserEntity();
-    	Integer currUserId = currUser.getId();
-		
-    	String[] userIds = latestApproval.getNextchecker().split(",");
-    	if(userIds.length>0) {
-        	for(String userId : userIds) {
-            	if(userId.equals(String.valueOf(currUserId))) {
-            		isNextChecker = true;
-            	}
-    		}
-        	if(isNextChecker) {
-        		//是否到了登录用户的审核层级
-        		if(currUser.getUser_type().equals(Constant.UserType.GOVERNMENT)) {
-        			for(String userId : userIds) {
-                    	User user = userService.findById(Integer.valueOf(userId));
-                    	if(null != user.getDepartment_id() && user.getDepartment_id().equals(currUser.getDepartment_id())) {
-                    		if(null != user.getApprove_level() && null != currUser.getApprove_level() && user.getApprove_level()>currUser.getApprove_level()) {
-                        		//没有到当前用户审核层级
-                        		isNextChecker = false;
-                        	}
-                    	}
-            		}
-        		}else if(currUser.getUser_type().equals(Constant.UserType.STREET)){
-        			for(String userId : userIds) {
-                    	User user = userService.findById(Integer.valueOf(userId));
-                    	if(null != user.getApprove_level() && null != currUser.getApprove_level() && user.getApprove_level()>currUser.getApprove_level()) {
-                        		//没有到当前用户审核层级
-                        		isNextChecker = false;
+    }
+
+    public Boolean isLeader(String groupName) {
+        //登录用户的审核层级是不是工作组最高级,最高级则是领导,可以选择通过/不通过/退回
+        Integer level = 0;
+        User currUser = ShiroUtils.getUserEntity();
+        level = groupService.getHighestApproveLevel(groupName, Constant.UserType.STREET);
+        if (null != level && currUser.getApprove_level().equals(level)) {
+            return true;
+        }
+        return false;
+    }
+
+    //获取街道合规性审核小组所有人员
+    public String get_HGXSHXZ_Checkers() {
+        //根据工作组名称查出工作组
+        Group group = groupService.findByNameAndUserType(Constant.HGXSHXZ, null, Constant.UserType.STREET, null);
+        //如果不为空
+        if (null != group) {
+            //根据工作组id查出UserGroup
+            List<UserGroup> list = userGroupService.findByGroupId(group.getId());
+            if (null == list || list.size() == 0) {
+                throw new BaseException("街道工业用地合规性审核组没有配置人员,请联系街道管理员配置!");
+            }
+            //构建一个StringBuffer 存放下一审核人id
+            StringBuffer sb = new StringBuffer("");
+            for (UserGroup userGroup : list) {
+                Integer userId = userGroup.getUser_id();
+                sb.append(userId + ",");
+            }
+            return sb.toString();
+        }
+        return null;
+    }
+
+    /**
+     * findApprovePassPage(查询审批通过列表)
+     *
+     * @param pageNum
+     * @param pagesize
+     * @param keyword
+     * @param company_name
+     * @param apply_type
+     * @param itemId
+     * @param street_id
+     * @return PageInfo<StockLand>
+     * @throws ParseException
+     */
+    @Transactional(readOnly = true)
+    public PageInfo<StockLand> findApprovePassPage(
+            Integer pageNum, Integer pagesize, String keyword, String company_name, String apply_type, Integer itemId, Integer street_id, Integer applyUserType) throws ParseException {
+        if (StringUtils.isNotBlank(keyword)) {
+            keyword = keyword.trim();
+        }
+        if (StringUtils.isNotBlank(company_name)) {
+            company_name = company_name.trim();
+        }
+        Integer user_type = ShiroUtils.getUserEntity().getUser_type();
+        UserData userData = new UserData();
+        if (user_type.equals(Constant.UserType.STREET)) {
+            userData.setStreet_id(ShiroUtils.getUserEntity().getStreet_id());
+            //超级管理员
+        }
+        String approve = Constant.LandApproveStatus.APPROVED;
+        //获取存量用地type id
+        Integer stockLandId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND).getId();
+        //存量用地审核状态 id
+        Integer approvedId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS).getId();
+        //通过的状态
+        List<String> statusList = new ArrayList<String>();
+        statusList.add(Constant.LandApproveStatus.APPROVED);
+        statusList.add(Constant.LandApproveStatus.PASSED);
+        PageHelper.startPage(pageNum, pagesize);
+        List<StockLand> stockLandList = stockLandDao.findApprovePassPage(keyword, company_name, apply_type, approve, userData, stockLandId, approvedId, itemId, street_id, applyUserType, statusList);
+        for (StockLand stockLand : stockLandList) {
+            stockLand.setPassTime(stockLand.getCreate_time());
+            //是否是重大项目
+            Integer is_zdxm = stockLand.getIs_zdxm();
+            if (is_zdxm != null) {
+                if (is_zdxm == 1) {
+                    stockLand.setIs_zdxm_str("是");
+                } else {
+                    stockLand.setIs_zdxm_str("否");
+                }
+            }
+        }
+
+        return new PageInfo<StockLand>(stockLandList);
+    }
+
+    /**
+     * findSelectPage(查询所有审核状态下列表)
+     *
+     * @param pageNum
+     * @param pagesize
+     * @param keyword
+     * @param company_name
+     * @param apply_type
+     * @param approve_status
+     * @param itemId
+     * @param street_id
+     * @return PageInfo<StockLand>
+     */
+    public PageInfo<StockLand> findSelectPage(
+            Integer pageNum, Integer pagesize, String keyword, String company_name, String apply_type,
+            String approve_status, Integer itemId, Integer street_id, Integer applyUserType) {
+        if (StringUtils.isNotBlank(keyword)) {
+            keyword = keyword.trim();
+        }
+        if (StringUtils.isNotBlank(company_name)) {
+            company_name = company_name.trim();
+        }
+        Integer user_type = ShiroUtils.getUserEntity().getUser_type();
+        UserData userData = new UserData();
+        if (user_type.equals(Constant.UserType.STREET)) {
+            userData.setStreet_id(ShiroUtils.getUserEntity().getStreet_id());
+            //超级管理员
+        }
+        //获取存量用地type id
+        Integer stockLandId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND).getId();
+        //存量用地审核状态 id
+        Integer approvedId = dictionaryTypeService.getDictionaryType(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS).getId();
+        PageHelper.startPage(pageNum, pagesize);
+        String rejectStatus = Constant.LandApproveStatus.REJECT;
+        List<StockLand> stockLandList = stockLandDao.findSelectPage(stockLandId, approvedId, itemId, street_id, keyword, company_name, approve_status, userData, applyUserType, rejectStatus);
+
+        for (StockLand stockLand : stockLandList) {
+            stockLand.setPassTime(stockLand.getCreate_time());
+            //是否是重大项目
+            Integer is_zdxm = stockLand.getIs_zdxm();
+            if (is_zdxm != null) {
+                if (is_zdxm == 1) {
+                    stockLand.setIs_zdxm_str("是");
+                } else {
+                    stockLand.setIs_zdxm_str("否");
+                }
+            }
+        }
+        return new PageInfo<StockLand>(stockLandList);
+    }
+
+    //审核撤回
+    public void withDraw(Integer apply_id) {
+        StockLand apply = stockLandService.findById(apply_id);
+        if (stockLandService.canWithdraw(apply, ShiroUtils.getUserId()).equals(Constant.True_False.FASLE)) {
+            throw new BaseException("当前单据已不可撤回!");
+        }
+        Approval latestApproval = approvalService.getLatestApprovalAll(apply_id, Constant.DictionaryType.STOCKLAND);
+        if (latestApproval.getBefore_approvalstatus().equals(Constant.LandApproveStatus.COMPLIANCE_AUDIT)
+                && (apply.getApprove_status().equals(Constant.LandApproveStatus.COMPLIANCE_AUDIT) || apply.getApprove_status().equals(Constant.LandApproveStatus.HGXSCTG))) {
+            //合规性审核撤回
+            if (latestApproval.getChecker().equals(ShiroUtils.getUserId())) {
+                //最近一条就是当前用户审核的
+                latestApproval.setIs_withdraw(Constant.True_False.TRUE);
+                latestApproval.setDel_flag(true);
+                approvalService.updateSelective(latestApproval);
+                apply.setApprove_status(latestApproval.getBefore_approvalstatus());
+                stockLandService.updateSelective(apply);
+            } else {
+                //最近一条不是当前用户审核的
+                Approval latestAllApprovalByUser = approvalService.getLatestApprovalAllByUser(apply.getId(), Constant.DictionaryType.STOCKLAND, ShiroUtils.getUserId());
+                latestAllApprovalByUser.setIs_withdraw(Constant.True_False.TRUE);
+                latestAllApprovalByUser.setDel_flag(true);
+                approvalService.updateSelective(latestAllApprovalByUser);
+
+                latestApproval.setNextchecker(latestApproval.getNextchecker() + ShiroUtils.getUserId() + ",");
+                approvalService.updateSelective(latestApproval);
+                apply.setApprove_status(latestApproval.getBefore_approvalstatus());
+                stockLandService.updateSelective(apply);
+            }
+        } else {
+            latestApproval.setIs_withdraw(Constant.True_False.TRUE);
+            latestApproval.setDel_flag(true);
+            approvalService.updateSelective(latestApproval);
+            //撤回,更改单据状态为原状态
+            //StockLand apply = stockLandService.findById(apply_id);
+            apply.setApprove_status(latestApproval.getBefore_approvalstatus());
+            if (StringUtils.isNotBlank(apply.getTemporary_state())) {
+                //清空临时状态
+                stockLandService.updateTempporaryStateToNull(apply_id);
+            }
+            stockLandService.updateSelective(apply);
+
+        }
+
+
+    }
+
+    //是否是当前审核人
+    public Boolean isCurrChecker(Integer apply_id, StockLandApprovalDto approvalInfo) {
+        Boolean isNextChecker = false;
+        Approval latestApproval = approvalService.getLatestApproval(apply_id, Constant.DictionaryType.STOCKLAND);
+        User currUser = ShiroUtils.getUserEntity();
+        Integer currUserId = currUser.getId();
+
+        String[] userIds = latestApproval.getNextchecker().split(",");
+        if (userIds.length > 0) {
+            for (String userId : userIds) {
+                if (userId.equals(String.valueOf(currUserId))) {
+                    isNextChecker = true;
+                }
+            }
+            if (isNextChecker) {
+                //是否到了登录用户的审核层级
+                if (currUser.getUser_type().equals(Constant.UserType.GOVERNMENT)) {
+                    for (String userId : userIds) {
+                        User user = userService.findById(Integer.valueOf(userId));
+                        if (null != user.getDepartment_id() && user.getDepartment_id().equals(currUser.getDepartment_id())) {
+                            if (null != user.getApprove_level() && null != currUser.getApprove_level() && user.getApprove_level() > currUser.getApprove_level()) {
+                                //没有到当前用户审核层级
+                                isNextChecker = false;
+                            }
                         }
-            		}
-        		}
-        		
-        		if(isNextChecker) {
-            		//当前节点是否已经审核过(两个用户同时审核)
-                	if(StringUtils.isNotBlank(approvalInfo.getStatu())) {
-                		if(!(approvalInfo.getStatu().equals(Constant.LandApproveStatus.JYLCHQ)
-                				||approvalInfo.getStatu().equals(Constant.LandApproveStatus.COMPLIANCE_AUDIT)
-                				||approvalInfo.getStatu().equals(Constant.LandApproveStatus.LOCAL_AUDIT)))
-                		if(stockLandService.isApproved(apply_id , approvalInfo.getStatu())) {
-                			isNextChecker = false;
-                		}
-                	}
-            	}
-        	}
-    		
-    	}
-    	
-    	
-		
-    	
-		return isNextChecker;
-	}
-
-	
+                    }
+                } else if (currUser.getUser_type().equals(Constant.UserType.STREET)) {
+                    for (String userId : userIds) {
+                        User user = userService.findById(Integer.valueOf(userId));
+                        if (null != user.getApprove_level() && null != currUser.getApprove_level() && user.getApprove_level() > currUser.getApprove_level()) {
+                            //没有到当前用户审核层级
+                            isNextChecker = false;
+                        }
+                    }
+                }
+
+                if (isNextChecker) {
+                    //当前节点是否已经审核过(两个用户同时审核)
+                    if (StringUtils.isNotBlank(approvalInfo.getStatu())) {
+                        if (!(approvalInfo.getStatu().equals(Constant.LandApproveStatus.JYLCHQ)
+                                || approvalInfo.getStatu().equals(Constant.LandApproveStatus.COMPLIANCE_AUDIT)
+                                || approvalInfo.getStatu().equals(Constant.LandApproveStatus.LOCAL_AUDIT)))
+                            if (stockLandService.isApproved(apply_id, approvalInfo.getStatu())) {
+                                isNextChecker = false;
+                            }
+                    }
+                }
+            }
+
+        }
+
+
+        return isNextChecker;
+    }
+
+
 }

+ 0 - 2
src/main/java/platform/modules/company/web/StockLandApproveController.java

@@ -109,7 +109,6 @@ public class StockLandApproveController extends BaseController {
             modelMap.put("isPendingAudit", isPendingAudit);
             modelMap.put("searchCondition", searchCondition == null ? new StockLand() : searchCondition);
             stockLandService.getDictInfo(modelMap);
-
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -459,7 +458,6 @@ public class StockLandApproveController extends BaseController {
             modelMap.put("itemList", itemList);
             modelMap.put("pageInfo", pageInfo);
             return BASE_STREET_PATH + "stock_land/approve_pass_on_street_page";
-
         } else {
             //查询所有街道
             //统计查询不同街道的不同申请类型数量