|  |  | @ -146,28 +146,34 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea | 
			
		
	
		
			
				
					|  |  |  |         //1:热心居民申请行为记录表新增数据
 | 
			
		
	
		
			
				
					|  |  |  |         result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         if (!result.success()) { | 
			
		
	
		
			
				
					|  |  |  |             log.warn(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION); | 
			
		
	
		
			
				
					|  |  |  |             log.error(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData(); | 
			
		
	
		
			
				
					|  |  |  |         //2:查询是否已申请热心居民
 | 
			
		
	
		
			
				
					|  |  |  |         //2:查询是否已申请热心居民(不查询审核未通过的)
 | 
			
		
	
		
			
				
					|  |  |  |         formDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED); | 
			
		
	
		
			
				
					|  |  |  |         ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         if (null == resiWarmheartedApplyDTO || StringUtils.isEmpty(resiWarmheartedApplyDTO.getId())) { | 
			
		
	
		
			
				
					|  |  |  |             //是否已申请热心居民 0:否, 1:是
 | 
			
		
	
		
			
				
					|  |  |  |             resiWarmheartedResultDTO.setIsApplied(NumConstant.ZERO_STR); | 
			
		
	
		
			
				
					|  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |             resiWarmheartedResultDTO.setIsApplied(NumConstant.ONE_STR); | 
			
		
	
		
			
				
					|  |  |  |             result.setCode(EpmetErrorCode.RESI_WARM_INIT.getCode()); | 
			
		
	
		
			
				
					|  |  |  |             result.setMsg(EpmetErrorCode.RESI_WARM_INIT.getMsg()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return new Result<ResiWarmheartedResultDTO>().ok(resiWarmheartedResultDTO); | 
			
		
	
		
			
				
					|  |  |  |         return result.ok(resiWarmheartedResultDTO); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  |     public Result submit(ResiWarmheartedSubmitFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  |         Result result = new Result(); | 
			
		
	
		
			
				
					|  |  |  |         //1:将申请记录存入热心居民申请表中
 | 
			
		
	
		
			
				
					|  |  |  |         saveResiWarmApply(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         //2:将最后一次操作行为更新到热心居民申请行为记录表中
 | 
			
		
	
		
			
				
					|  |  |  |         resiWarmheartedVisitService.updateResiWarmVisit(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         return new Result(); | 
			
		
	
		
			
				
					|  |  |  |         result.setCode(EpmetErrorCode.RESI_WARM_SUBMIT.getCode()); | 
			
		
	
		
			
				
					|  |  |  |         result.setMsg(EpmetErrorCode.RESI_WARM_SUBMIT.getMsg()); | 
			
		
	
		
			
				
					|  |  |  |         return result; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
	
		
			
				
					|  |  | @ -204,9 +210,9 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea | 
			
		
	
		
			
				
					|  |  |  |         if (!StringUtils.isBlank(formDTO.getRefuseReason())) { | 
			
		
	
		
			
				
					|  |  |  |             entity.setRefuseReason(formDTO.getRefuseReason()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         baseDao.updateById(entity); | 
			
		
	
		
			
				
					|  |  |  |         int num = baseDao.updateById(entity); | 
			
		
	
		
			
				
					|  |  |  |         //2:审核通过的添加热心居民的角色
 | 
			
		
	
		
			
				
					|  |  |  |         if (NumConstant.ONE_STR.equals(formDTO.getAuditStatus())) { | 
			
		
	
		
			
				
					|  |  |  |         if (num > NumConstant.ZERO && NumConstant.ONE_STR.equals(formDTO.getAuditStatus())) { | 
			
		
	
		
			
				
					|  |  |  |             //查询需要添加热心居民角色的userId
 | 
			
		
	
		
			
				
					|  |  |  |             ResiWarmheartedApplyEntity resiWarmheartedApplyEntity = baseDao.selectById(formDTO.getResiWarmApplyId()); | 
			
		
	
		
			
				
					|  |  |  |             UserRoleDTO dto = new UserRoleDTO(); | 
			
		
	
	
		
			
				
					|  |  | 
 |