public void setIsAttach(String isAttach) { if (StringUtil.isEmpty(isAttach)) { this.isAttach = "0"; return; } if (isAttach.equals("1")) { this.isAttach = "1"; } else { this.isAttach = "0"; } }
public void setIsIndexPic(String isIndexPic) { if (StringUtil.isEmpty(isIndexPic)) { this.isIndexPic = "0"; return; } if (isIndexPic.equals("1")) { this.isIndexPic = "1"; } else { this.isIndexPic = "0"; } }
/** * ** 查询系统用户信息(条件查询,查询多笔,按照系统用户码或名称) * * @param model * @param request * @return */ @RequestMapping(value = "/list", method = RequestMethod.POST) @ResponseBody public Object list( Model model, HttpServletRequest request, String userId, String search_condition) { HttpServletRequestUtil.debugParams(request); try { DBObject query = new BasicDBObject(); if (StringUtil.isNotEmpty(userId)) { query.put("owner_user_id", userId); } query.put("useflg", "1"); if (StringUtil.isNotEmpty(search_condition)) { String name = search_condition.trim(); Pattern namePattern = RegexPatternUtil.getLikePattern(name); BasicDBList values = new BasicDBList(); values.add(new BasicDBObject("client_name", namePattern)); values.add(new BasicDBObject("pinyin_name", namePattern)); values.add(new BasicDBObject("first_char_header", namePattern)); values.add(new BasicDBObject("all_char_header", namePattern)); query.put("$or", values); } DBObject sort = new BasicDBObject(); sort.put("client_name_full_py", 1); DBObject returnFields = null; return this.clientService.batchSearchPage(query, sort, returnFields); } catch (Exception e) { return this.handleException(e); } }
/** * ** 进入添加用户页面 * * @return */ @RequestMapping(value = "/add", method = RequestMethod.GET) public String add( @ModelAttribute("client") Client client, HttpServletRequest request, Model model) { String userId = this.getUserId(); if (StringUtil.isEmpty(userId)) { userId = request.getParameter("owner_user_id"); } model.addAttribute("owner_user_id", userId); // 开启modelDriven return "front/client/client_info/full/add"; }
public static ExhibitionStage getByCode(String code) { if (StringUtil.isEmpty(code)) { return null; } ExhibitionStage[] enums = ExhibitionStage.values(); for (ExhibitionStage exhibitionstage : enums) { if (exhibitionstage.getCode().equals(code)) { return exhibitionstage; } } return null; }
@Override public String getAutoIncreaseString(String mainkey) { DBObject queryCondition = new BasicDBObject(); queryCondition.put("mainkey", mainkey); // 自增标识 DBObject returnFields = new BasicDBObject(); returnFields.put("val", 1); // 自增值 returnFields.put("length", 1); // 自增值 DBObject update = new BasicDBObject(); update.put("$inc", new BasicDBObject("val", 1)); DBObject result = commonDaoMongo.updateOneByCondition( queryCondition, returnFields, update, true, COLLECTION_AUTO_INCREASER); int value = (Integer) (result.get("val")); int length = result.get("length") == null ? 8 : (Integer) (result.get("length")); return StringUtil.addCharL(value, length, "0"); }