@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 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);
   }
 }
示例#3
0
 /** 创建动态查询条件组合. */
 private Specification<Task> buildSpecification(Long userId, Map<String, Object> searchParams) {
   Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
   filters.put("user.id", new SearchFilter("user.id", Operator.EQ, userId));
   Specification<Task> spec = DynamicSpecifications.bySearchFilter(filters.values(), Task.class);
   return spec;
 }
示例#4
0
 private Specification<AppDiff> buildSpecification(Map<String, Object> searchParams) {
   searchParams.put("EQ_deleteFlag", "0");
   Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
   return DynamicSpecifications.bySearchFilter(filters.values(), AppDiff.class);
 }