@Override public List<IdentityStatusTransfer> queryIdentityStatusTransfer(IdentityType identityType) { logger.debug( "IdentityStatusTransferServiceImpl:queryIdentityStatusTransfer(" + (BeanUtils.isNotNull(identityType) ? identityType.toString() : "") + ")"); Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>(); filters.put( EntityConstant.IdentityStatusTransfer.IDENTITY_TYPE, new SearchFilter( EntityConstant.IdentityStatusTransfer.IDENTITY_TYPE, Operator.EQ, identityType)); Specification<IdentityStatusTransfer> spec = DynamicSpecifications.bySearchFilter(filters.values(), IdentityStatusTransfer.class); List<IdentityStatusTransfer> identityStatusTransferList = identityStatusTransferDao.findAll(spec); if (identityStatusTransferList != null) { logger.debug( "IdentityStatusTransferServiceImpl:queryIdentityStatusTransfer(" + (BeanUtils.isNotNull(identityStatusTransferList) ? Collections3.convertToString( identityStatusTransferList, Constant.Common.SEPARATOR) : "") + ")[返回信息]"); return identityStatusTransferList; } else { logger.debug("IdentityStatusTransferServiceImpl:queryIdentityStatusTransfer(未找到状态机信息)[返回信息]"); String[] msgParams = new String[] {"", "", identityType.toString()}; ApplicationException e = new ApplicationException("identity001054", msgParams); throw ExceptionUtil.throwException(e); } }
@Override public IdentityStatusTransfer queryIdentityStatusTransferById(Long id) { logger.debug("IdentityStatusTransferServiceImpl:queryIdentityStatusTransferById(" + id + ")"); IdentityStatusTransfer identityStatusTransfer = identityStatusTransferDao.findOne(id); logger.debug( "IdentityStatusTransferServiceImpl:queryIdentityStatusTransferById(" + (BeanUtils.isNotNull(identityStatusTransfer) ? identityStatusTransfer.toString() : "") + ")[返回信息]"); return identityStatusTransfer; }
@Override public IdentityStatusTransfer savaIdentityStatusTransfer( IdentityStatusTransfer identityStatusTransfer) { logger.debug( "IdentityStatusTransferServiceImpl:savaIdentityStatusTransfer(" + (BeanUtils.isNotNull(identityStatusTransfer) ? identityStatusTransfer.toString() : "") + ")"); identityStatusTransfer = identityStatusTransferDao.save(identityStatusTransfer); logger.debug( "IdentityStatusTransferServiceImpl:savaIdentityStatusTransfer(" + (BeanUtils.isNotNull(identityStatusTransfer) ? identityStatusTransfer.toString() : "") + ")[返回信息]"); return identityStatusTransfer; }
@Override public IdentityStatusTransfer queryIdentityStatusTransferByParams( IdentityStatus oldStatus, IdentityStatus newStatus, IdentityType identityType) { logger.debug( "IdentityStatusTransferServiceImpl:queryIdentityStatusTransferByParams(" + (BeanUtils.isNotNull(oldStatus) ? oldStatus.getStatus().toString() : "") + "," + (BeanUtils.isNotNull(newStatus) ? newStatus.getStatus().toString() : "") + "," + (BeanUtils.isNotNull(identityType) ? identityType.toString() : "") + ")"); if (BeanUtils.isNotNull(oldStatus) && BeanUtils.isNotNull(newStatus) && BeanUtils.isNotNull(identityType)) { Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>(); filters.put( EntityConstant.IdentityStatusTransfer.IDENTITY_STATUS_OLD, new SearchFilter( EntityConstant.IdentityStatusTransfer.IDENTITY_STATUS_OLD, Operator.EQ, oldStatus.getStatus())); filters.put( EntityConstant.IdentityStatusTransfer.IDENTITY_STATUS_NEW, new SearchFilter( EntityConstant.IdentityStatusTransfer.IDENTITY_STATUS_NEW, Operator.EQ, newStatus.getStatus())); filters.put( EntityConstant.IdentityStatusTransfer.IDENTITY_TYPE, new SearchFilter( EntityConstant.IdentityStatusTransfer.IDENTITY_TYPE, Operator.EQ, identityType)); Specification<IdentityStatusTransfer> spec = DynamicSpecifications.bySearchFilter(filters.values(), IdentityStatusTransfer.class); IdentityStatusTransfer identityStatusTransfer = identityStatusTransferDao.findOne(spec); if (identityStatusTransfer != null) { logger.debug( "IdentityStatusTransferServiceImpl:queryIdentityStatusTransferByParams(" + (BeanUtils.isNotNull(identityStatusTransfer) ? identityStatusTransfer.toString() : "") + ")[返回信息]"); return identityStatusTransfer; } else { logger.debug( "IdentityStatusTransferServiceImpl:queryIdentityStatusTransferByParams(未找到状态机信息)[返回信息]"); String[] msgParams = new String[] { oldStatus.getStatus().toString(), newStatus.getStatus().toString(), identityType.toString() }; ApplicationException e = new ApplicationException("identity001054", msgParams); throw ExceptionUtil.throwException(e); } } else { logger.debug( "IdentityStatusTransferServiceImpl:queryIdentityStatusTransferByParams(参数为空)[返回信息]"); ApplicationException e = new ApplicationException("identity001055"); throw ExceptionUtil.throwException(e); } }
@Override public void deleteIdentityStatusTransferById(Long id) { logger.debug("IdentityStatusTransferServiceImpl:deleteIdentityStatusTransferById(" + id + ")"); identityStatusTransferDao.delete(id); }