Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
   }
 }
Ejemplo n.º 6
0
 @Override
 public DivFtDtl findByFactorNo(String factorNo) {
   SearchSetting search = createSearchTemplete();
   search.addSearchModeParameters(SearchMode.EQUALS, "factorNo", factorNo);
   return findUniqueOrNone(search);
 }
Ejemplo n.º 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);
 }