Example #1
0
 @Override
 public List<DivFtDtl> findByFactorNos(String[] factorNos) {
   SearchSetting search = createSearchTemplete();
   search.addSearchModeParameters(SearchMode.EQUALS, "factorNo", factorNos);
   search.setFirstResult(0).setMaxResults(Integer.MAX_VALUE);
   search.addOrderBy("codeOrder");
   return find(search);
 }
Example #2
0
 @Override
 public DivFtDtl findByFactorNoAndRangeNo(String factorNo, String rangeNos) {
   SearchSetting search = createSearchTemplete();
   search.addSearchModeParameters(SearchMode.EQUALS, "factorNo", factorNo);
   search.addSearchModeParameters(SearchMode.EQUALS, "rangeNo", rangeNos);
   search.setFirstResult(0).setMaxResults(Integer.MAX_VALUE);
   search.addOrderBy("rangeNo");
   return findUniqueOrNone(search);
 }
Example #3
0
 @HandlerType(HandlerTypeEnum.GRID)
 public BeanGridResult queryAllUserStatus(SearchSetting search, Request params) {
   search.addOrderBy("codeValue", false);
   search.addSearchModeParameters(SearchMode.EQUALS, "codeType", "userStatus");
   search.addSearchModeParameters(
       SearchMode.EQUALS,
       "locale",
       ((Locale) SimpleContextHolder.get(CapWebUtil.localeKey)).toString());
   Page<CodeType> page = commonService.findPage(CodeType.class, search);
   return new BeanGridResult(page.getContent(), page.getTotalRow(), null);
 }
Example #4
0
 @HandlerType(HandlerTypeEnum.GRID)
 public MapGridResult query(SearchSetting search, Request params) {
   String code = params.get("code");
   String name = params.get("name");
   String[] roleCodes = params.getParamsAsStringArray("roleCodes");
   String[] status = params.getParamsAsStringArray("status");
   Page<Map<String, Object>> page =
       userService.findUser(
           code, name, roleCodes, status, search.getMaxResults(), search.getFirstResult());
   Map<String, Formatter> fmt = new HashMap<String, Formatter>();
   fmt.put("createTime", new ADDateFormatter());
   fmt.put("updateTime", new ADDateFormatter());
   fmt.put("pwdExpiredTime", new ADDateFormatter());
   fmt.put(
       "status",
       new CodeTypeFormatter(
           codeTypeService, "userStatus", (Locale) SimpleContextHolder.get(CapWebUtil.localeKey)));
   return new MapGridResult(page.getContent(), page.getTotalRow(), fmt);
 }
Example #5
0
 @SuppressWarnings("rawtypes")
 @HandlerType(HandlerTypeEnum.GRID)
 public GridResult findRole(SearchSetting search, Request params) {
   String type = params.get("type");
   if ("modify".equalsIgnoreCase(type)) {
     List<Map<String, Object>> roleList = null;
     String userCode = params.get("userCode");
     roleList = roleSetService.findAllRoleWithSelectedByUserCode(userCode);
     MapGridResult gridResult = new MapGridResult();
     if (!CollectionUtils.isEmpty(roleList)) {
       gridResult.setRowData(roleList);
     }
     return gridResult;
   } else {
     search.addOrderBy("code", false);
     Page<DefaultRole> page = commonService.findPage(DefaultRole.class, search);
     return new BeanGridResult(page.getContent(), page.getTotalRow(), null);
   }
 }
Example #6
0
 @Override
 public DivFtDtl findByFactorNo(String factorNo) {
   SearchSetting search = createSearchTemplete();
   search.addSearchModeParameters(SearchMode.EQUALS, "factorNo", factorNo);
   return findUniqueOrNone(search);
 }
Example #7
0
 @HandlerType(HandlerTypeEnum.GRID)
 public BeanGridResult queryAllRole(SearchSetting search, Request params) {
   search.addOrderBy("code", false);
   Page<DefaultRole> page = commonService.findPage(DefaultRole.class, search);
   return new BeanGridResult(page.getContent(), page.getTotalRow(), null);
 }