/** * 下拉维度列表 * * @return */ public String combo() { List<Demension> list = demensionService.getAll(); StringBuffer sb = new StringBuffer("[['0','全部..']"); for (Demension dem : list) { sb.append(",['").append(dem.getDemId()).append("','").append(dem.getDemName()).append("']"); } sb.append("]"); jsonString = sb.toString(); return SUCCESS; }
/** 添加及保存操作 */ public String save() { if (demension.getDemId() == null) { demensionService.save(demension); } else { Demension orgDemension = demensionService.get(demension.getDemId()); try { BeanUtil.copyNotNullProperties(orgDemension, demension); demensionService.save(orgDemension); } catch (Exception ex) { logger.error(ex.getMessage()); } } setJsonString("{success:true}"); return SUCCESS; }