org.springframework.ui.ModelMap Java Examples

The following examples show how to use org.springframework.ui.ModelMap. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdminJasperReport.java    From Spring-MVC-Blueprints with MIT License 7 votes vote down vote up
@RequestMapping(value = "/hrms/showJasperManagerPDF", method = RequestMethod.GET)
public String showJasperManagerPDF(ModelMap model,
		HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException, JRException, NamingException {

	usersList = loginService.getUserList();

	AdminJasperBase dsUsers = new AdminJasperBase(usersList);
	Map<String, Object> params = new HashMap<>();
	params.put("users", usersList);
	JasperReport jasperReport = getCompiledFile("JRUsers", request);
	JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,
			params, dsUsers);

	response.setContentType("application/x-pdf");
	response.setHeader("Content-disposition",
			"inline; filename=userList.pdf");

	final OutputStream outStream = response.getOutputStream();
	JasperExportManager.exportReportToPdfStream(jasperPrint, outStream);

	return null;
}
 
Example #2
Source File: MchNotifyController.java    From xxpay-master with MIT License 6 votes vote down vote up
@RequestMapping("/view.html")
public String viewInput(String orderId, ModelMap model) {
    MchNotify item = null;
    if(StringUtils.isNotBlank(orderId)) {
        item = mchNotifyService.selectMchNotify(orderId);
    }
    if(item == null) {
        item = new MchNotify();
        model.put("item", item);
        return "mch_notify/view";
    }
    JSONObject object = (JSONObject) JSON.toJSON(item);
    if(item.getCreateTime() != null) object.put("createTime", DateUtil.date2Str(item.getCreateTime()));
    if(item.getUpdateTime() != null) object.put("updateTime", DateUtil.date2Str(item.getUpdateTime()));
    if(item.getLastNotifyTime() != null) object.put("lastNotifyTime", DateUtil.date2Str(item.getLastNotifyTime()));
    model.put("item", object);
    return "mch_notify/view";
}
 
Example #3
Source File: FileUpload.java    From LDMS with Apache License 2.0 6 votes vote down vote up
@RequestMapping(
        value = "/action/file.do",
        method = {RequestMethod.POST, RequestMethod.GET})
public @ResponseBody
String uploadPhoto(@RequestParam MultipartFile uFile,
                   HttpServletRequest request,
                   HttpServletResponse response,
                   ModelMap map) {
    System.out.println("Hello");
    try {
        if (uFile != null && !uFile.isEmpty()) {
            System.out.println("file:" + uFile.getOriginalFilename());
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return "success";
}
 
Example #4
Source File: DisableUserNameManageAction.java    From bbs with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * 禁止的用户名称 显示修改
 */
@RequestMapping(params="method=edit",method=RequestMethod.GET)
public String editUI(ModelMap model,Integer disableUserNameId,
		HttpServletRequest request, HttpServletResponse response) throws Exception {	

	if(disableUserNameId != null && disableUserNameId >0){
		//根据ID查询要修改的数据
		DisableUserName disableUserName = userService.findDisableUserNameById(disableUserNameId);
		
		if(disableUserName != null){
			model.addAttribute("disableUserName", disableUserName);
		}
	}else{
		throw new SystemException("参数不能为空");
	}

	return "jsp/user/edit_disableUserName";
}
 
Example #5
Source File: TopicsController.java    From FlyCms with MIT License 6 votes vote down vote up
@GetMapping(value = "/topics/{shortUrl}")
public String findTopicById(@RequestParam(value = "p", defaultValue = "1") int p,@PathVariable(value = "shortUrl", required = false) String shortUrl, ModelMap modelMap){
    if (StringUtils.isBlank(shortUrl)) {
        return theme.getPcTemplate("404");
    }
    Topic topic = topicService.findTopicByShorturl(shortUrl);
    if(topic==null){
        return theme.getPcTemplate("404");
    }
    if (getUser() != null) {
        modelMap.addAttribute("user", getUser());
    }
    modelMap.addAttribute("p", p);
    modelMap.addAttribute("topic", topic);
    return theme.getPcTemplate("topics/detail");
}
 
Example #6
Source File: AgentController.java    From youkefu with Apache License 2.0 6 votes vote down vote up
@RequestMapping(value="/summary")  
	@Menu(type = "apps", subtype = "summary")
    public ModelAndView summary(ModelMap map , HttpServletRequest request , @Valid String userid , @Valid String agentserviceid, @Valid String agentuserid){ 
		if(!StringUtils.isBlank(userid) && !StringUtils.isBlank(agentuserid)){
//			AgentUser agentUser = this.agentUserRepository.findByIdAndOrgi(agentuserid, super.getOrgi(request)) ;
//			if(agentUser!=null && !StringUtils.isBlank(agentUser.getAgentserviceid())){
//				AgentServiceSummary summary = this.serviceSummaryRes.findByAgentserviceidAndOrgi(agentUser.getAgentserviceid(), super.getOrgi(request)) ;
//				if(summary!=null){
//					map.addAttribute("summary", summary) ;
//				}
//			}
			map.addAttribute("tagsSummary", tagRes.findByOrgiAndTagtype(super.getOrgi(request) , UKDataContext.ModelType.SUMMARY.toString())) ;
			map.addAttribute("userid", userid) ;
			map.addAttribute("agentserviceid", agentserviceid) ;
			map.addAttribute("agentuserid", agentuserid) ;
			
		}
		
    	return request(super.createRequestPageTempletResponse("/apps/agent/addsum")) ; 
    }
 
Example #7
Source File: ContentAct.java    From Lottery with GNU General Public License v2.0 6 votes vote down vote up
@RequestMapping("/content/o_check.do")
public String check(String queryStatus, Integer queryTypeId,
		Boolean queryTopLevel, Boolean queryRecommend,
		Integer queryOrderBy, Integer[] ids, Integer cid, Integer pageNo,
		HttpServletRequest request, ModelMap model) {
	WebErrors errors = validateCheck(ids, request);
	if (errors.hasErrors()) {
		return errors.showErrorPage(model);
	}
	CmsUser user = CmsUtils.getUser(request);
	Content[] beans = manager.check(ids, user);
	for (Content bean : beans) {
		log.info("check Content id={}", bean.getId());
	}
	return list(queryStatus, queryTypeId, queryTopLevel, queryRecommend,
			queryOrderBy, cid, pageNo, request, model);
}
 
Example #8
Source File: PeopleController.java    From FlyCms with MIT License 6 votes vote down vote up
@GetMapping(value = "/people/{shortUrl}/follow")
public String peopleFollow(@RequestParam(value = "p", defaultValue = "1") int p, @PathVariable(value = "shortUrl", required = false) String shortUrl, ModelMap modelMap){
    if (StringUtils.isBlank(shortUrl)) {
        return theme.getPcTemplate("404");
    }
    User people=userService.findUserByShorturl(shortUrl);
    if(people==null){
        return theme.getPcTemplate("404");
    }
    if (getUser() != null) {
        modelMap.addAttribute("user", getUser());
    }
    modelMap.addAttribute("p", p);
    modelMap.addAttribute("count", userService.findUserCountById(people.getUserId()));
    modelMap.addAttribute("people", people);
    return theme.getPcTemplate("/people/list_follow");
}
 
Example #9
Source File: UserCustomManageAction.java    From bbs with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * 用户自定义注册功能项  修改界面显示
 */
@RequestMapping(params="method=edit",method=RequestMethod.GET)
public String editUI(ModelMap model,Integer id,
		HttpServletRequest request, HttpServletResponse response) throws Exception {
	if(id == null){
		throw new SystemException("参数错误");
	}
	
	UserCustom userCustom = userCustomService.findUserCustomById(id);
	if(userCustom == null){
		throw new SystemException("自定义注册功能项不存在");
	}
	
	if(userCustom.getValue() != null && !"".equals(userCustom.getValue())){
		
		LinkedHashMap<String,String> itemValue_map = JsonUtils.toGenericObject(userCustom.getValue(), new TypeReference<LinkedHashMap<String,String>>(){});//key:选项值 value:选项文本
		model.addAttribute("itemValue_map", itemValue_map);
	}
	
	
	model.addAttribute("userCustom", userCustom);
	return "jsp/user/edit_userCustom";
}
 
Example #10
Source File: JformGraphreportHeadController.java    From jeecg with Apache License 2.0 6 votes vote down vote up
@RequestMapping(params = "exportXls")
public String  exportXls(JformGraphreportHeadEntity jformGraphreportHead,HttpServletRequest request,HttpServletResponse response
		, DataGrid dataGrid,ModelMap map) {
	CriteriaQuery cq = new CriteriaQuery(JformGraphreportHeadEntity.class, dataGrid);
	//查询条件组装器
	org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, jformGraphreportHead);

	List<JformGraphreportHeadEntity> dataList= this.jformGraphreportHeadService.getListByCriteriaQuery(cq,false);
	List<JformGraphreportHeadPage> pageList=new ArrayList<JformGraphreportHeadPage>();
	if(dataList!=null&&dataList.size()>0){
		String hql0 = "from JformGraphreportItemEntity where 1 = 1 AND cGREPORT_HEAD_ID = ? ";
		for(JformGraphreportHeadEntity headEntity:dataList){
			List<JformGraphreportItemEntity> itemEntities = systemService.findHql(hql0,headEntity.getId());
			pageList.add(new JformGraphreportHeadPage(itemEntities,headEntity));
		}
	}

	map.put(NormalExcelConstants.FILE_NAME,"图表配置");
	map.put(NormalExcelConstants.CLASS,JformGraphreportHeadPage.class);
	map.put(NormalExcelConstants.PARAMS,new ExportParams("图表配置","导出信息"));
	map.put(NormalExcelConstants.DATA_LIST, pageList);
	return NormalExcelConstants.JEECG_EXCEL_VIEW;
}
 
Example #11
Source File: CustomerController.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/impsave")
@Menu(type = "customer" , subtype = "customer")
public ModelAndView impsave(ModelMap map , HttpServletRequest request , @RequestParam(value = "cusfile", required = false) MultipartFile cusfile,@Valid String ekind) throws IOException {
	String msg = "upload_success";
	if(!cusfile.isEmpty()) {
		if(cusfile.getOriginalFilename().endsWith("xlsx") || cusfile.getOriginalFilename().endsWith("xls")) {
			DSDataEvent event = new DSDataEvent();
	    	String fileName = "customer/"+UKTools.getUUID()+cusfile.getOriginalFilename().substring(cusfile.getOriginalFilename().lastIndexOf(".")) ;
	    	File excelFile = new File(path , fileName) ;
	    	if(!excelFile.getParentFile().exists()){
	    		excelFile.getParentFile().mkdirs() ;
	    	}
	    	MetadataTable table = metadataRes.findByTablename("uk_entcustomer") ;
	    	if(table!=null){
		    	FileUtils.writeByteArrayToFile(new File(path , fileName), cusfile.getBytes());
		    	event.setDSData(new DSData(table,excelFile , cusfile.getContentType(), super.getUser(request)));
		    	event.getDSData().setClazz(EntCustomer.class);
		    	event.getDSData().setProcess(new EntCustomerProcess(entCustomerRes));
		    	event.setOrgi(super.getOrgi(request));
		    	/*if(!StringUtils.isBlank(ekind)){
		    		event.getValues().put("ekind", ekind) ;
		    	}*/
		    	event.getValues().put("creater", super.getUser(request).getId()) ;
		    	reporterRes.save(event.getDSData().getReport()) ;
		    	new ExcelImportProecess(event).process() ;		//启动导入任务
	    	}
		}else {
			msg = "upload_format_faild";
		}
	}else {
		msg = "upload_nochoose_faild";
	}
	
	
	
	return request(super.createRequestPageTempletResponse("redirect:/apps/customer/index.html?msg="+msg));
}
 
Example #12
Source File: Req4200Controller.java    From oslits with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Req4200 Ajax 요구사항 분류정보 목록 조회
 * @param 
 * @return 
 * @exception Exception
 */
   @SuppressWarnings({ "rawtypes", "unchecked" })
@RequestMapping(value="/req/req4000/req4200/selectReq4200ReqClsListAjax.do")
   public ModelAndView selectReq4200ReqClsListAjax(HttpServletRequest request, HttpServletResponse response, ModelMap model ) throws Exception {
   	
   	try{
       	
   		//리퀘스트에서 넘어온 파라미터를 맵으로 세팅
       	Map paramMap = RequestConvertor.requestParamToMapAddSelInfo(request, true);
       	
       	//요구사항 분류목록 가져오기
       	List<Map> reqClsList = (List) req4200Service.selectReq4200ReqClsList(paramMap);
       	
       	//조회성공메시지 세팅
       	model.addAttribute("reqClsList", reqClsList);
       	model.addAttribute("message", egovMessageSource.getMessage("success.common.select"));
       	
       	return new ModelAndView("jsonView");
   	}
   	catch(Exception ex){
   		Log.error("selectReq4200ReqClsListAjax()", ex);
   		
   		//조회실패 메시지 세팅
   		model.addAttribute("message", egovMessageSource.getMessage("fail.common.select"));
   		return new ModelAndView("jsonView");
   	}
   }
 
Example #13
Source File: TemplateAct.java    From Lottery with GNU General Public License v2.0 5 votes vote down vote up
@RequestMapping("/template/v_edit.do")
public String edit(HttpServletRequest request, ModelMap model) {
	CmsSite site = CmsUtils.getSite(request);
	String root = RequestUtils.getQueryParam(request, "root");
	String name = RequestUtils.getQueryParam(request, "name");
	String style = handerStyle(RequestUtils.getQueryParam(request, "style"));
	WebErrors errors = validateEdit(root, name,site.getTplPath(), request);
	if (errors.hasErrors()) {
		return errors.showErrorPage(model);
	}
	model.addAttribute("template", tplManager.get(name));
	model.addAttribute("root", root);
	model.addAttribute("name", name);
	return "template/edit_" + style;
}
 
Example #14
Source File: CmsConfigAct.java    From Lottery with GNU General Public License v2.0 5 votes vote down vote up
@RequestMapping("/config/o_member_update.do")
public String memberUpdate(MemberConfig bean, ConfigLogin configLogin,
		ConfigEmailSender emailSender, ConfigMessageTemplate msgTpl,
		HttpServletRequest request, ModelMap model) {
	WebErrors errors = validateMemberUpdate(bean, request);
	if (errors.hasErrors()) {
		return errors.showErrorPage(model);
	}
	manager.updateMemberConfig(bean);
	model.addAttribute("message", "global.success");
	log.info("update memberConfig of CmsConfig.");
	cmsLogMng.operating(request, "cmsConfig.log.memberUpdate", null);
	return memberEdit(request, model);
}
 
Example #15
Source File: VisionController.java    From spring-cloud-gcp with Apache License 2.0 5 votes vote down vote up
/**
 * This method downloads an image from a URL and sends its contents to the Vision API for label detection.
 *
 * @param imageUrl the URL of the image
 * @param map the model map to use
 * @return a string with the list of labels and percentage of certainty
 * @throws org.springframework.cloud.gcp.vision.CloudVisionException if the Vision API call
 *    produces an error
 */
@GetMapping("/extractLabels")
public ModelAndView extractLabels(String imageUrl, ModelMap map) {
	AnnotateImageResponse response = this.cloudVisionTemplate.analyzeImage(
			this.resourceLoader.getResource(imageUrl), Type.LABEL_DETECTION);

	// This gets the annotations of the image from the response object.
	List<EntityAnnotation> annotations = response.getLabelAnnotationsList();

	map.addAttribute("annotations", annotations);
	map.addAttribute("imageUrl", imageUrl);

	return new ModelAndView("result", map);
}
 
Example #16
Source File: RqueueViewControllerTest.java    From rqueue with Apache License 2.0 5 votes vote down vote up
public void verifyBasicData(ModelMap model, NavTab navTab) {
  assertNotNull(model.get("latestVersion"));
  assertNotNull(model.get("version"));
  assertNotNull(model.get("releaseLink"));
  assertNotNull(model.get("time"));
  assertNotNull(model.get("timeInMilli"));
  for (NavTab tab : NavTab.values()) {
    assertEquals(
        tab.name().toLowerCase() + "Active",
        tab == navTab,
        model.get(tab.name().toLowerCase() + "Active"));
  }
}
 
Example #17
Source File: IMController.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/voice/upload")
@Menu(type = "im" , subtype = "image" , access = true)
public ModelAndView voiceupload(ModelMap map,HttpServletRequest request , @RequestParam(value = "voice", required = false) MultipartFile voice , @Valid String channel, @Valid String userid, @Valid String username , @Valid String appid , @Valid String orgi, @Valid String duration) throws IOException {
	ModelAndView view = request(super.createRequestPageTempletResponse("/apps/im/upload")) ; 
	UploadStatus upload = null ;
	String fileName = null ;
	if(voice!=null && voice.getSize() >0 && !StringUtils.isBlank(userid)){
		File uploadDir = new File(path , "upload");
		if(!uploadDir.exists()){
			uploadDir.mkdirs() ;
		}
		String fileid = UKTools.md5(voice.getBytes()) ;
		if(voice.getContentType()!=null && voice.getContentType().indexOf("audio") >= 0 && !StringUtils.isBlank(duration) && duration.matches("[\\d]{1,}")){
fileName = "webim/voice/"+fileid+".mp3" ;
File file = new File(path ,fileName) ;
if(file.getParentFile().exists()){
	file.getParentFile().mkdirs() ;
}
FileUtils.writeByteArrayToFile(file , voice.getBytes());
 		
String url = "/res/voice.html?id="+fileName ;
 		upload = new UploadStatus("0" ,url);
 		if(!StringUtils.isBlank(channel)){
 			MessageUtils.uploadVoice(url ,(int)file.length() , file.getName() , channel, userid , username , appid , orgi , fileid , Integer.parseInt(duration)/1000);
 		}else{
 			MessageUtils.uploadVoice(url ,(int)file.length() , file.getName() , userid , fileid , Integer.parseInt(duration)/1000);
 		}
		}
	}else{
		upload = new UploadStatus("请选择文件");
	}
	map.addAttribute("upload", upload) ;
    return view ; 
}
 
Example #18
Source File: CallCenterResourceController.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@RequestMapping(value = "/resource/config")
  @Menu(type = "callcenter" , subtype = "callcenter" , access = false , admin = true)
  public ModelAndView config(ModelMap map , HttpServletRequest request , @Valid String hostid) {
List<PbxHost> pbxHostList = pbxHostRes.findByOrgi(super.getOrgi(request)) ;
map.addAttribute("pbxHostList" , pbxHostList);
map.addAttribute("mediaList" , mediaRes.findByHostidAndOrgi(hostid, super.getOrgi(request)));
PbxHost pbxHost = null ;
if(pbxHostList.size() > 0){
	map.addAttribute("pbxHost" , pbxHost = getPbxHost(pbxHostList, hostid));
	map.addAttribute("extentionList" , extentionRes.findByHostidAndOrgi(pbxHost.getId() , super.getOrgi(request)));
}
return request(super.createRequestPageTempletResponse("/admin/callcenter/resource/config"));
  }
 
Example #19
Source File: SystemNotifyManageAction.java    From bbs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 还原订阅系统通知
 * @param model
 * @param userId 用户Id
 * @param subscriptionSystemNotifyId 订阅系统通知Id
 * @param request
 * @param response
 * @return
 * @throws Exception
 */
@RequestMapping(params="method=reductionSubscriptionSystemNotify", method=RequestMethod.POST)
@ResponseBody//方式来做ajax,直接返回字符串
public String reductionSubscriptionSystemNotify(ModelMap model,Long userId,String subscriptionSystemNotifyId,
		HttpServletRequest request, HttpServletResponse response) throws Exception {
	if(subscriptionSystemNotifyId != null && !"".equals(subscriptionSystemNotifyId.trim())){
		int i = systemNotifyService.reductionSubscriptionSystemNotify(subscriptionSystemNotifyId);
		
		//删除缓存
		systemNotifyManage.delete_cache_findMinUnreadSystemNotifyIdByUserId(userId);
		systemNotifyManage.delete_cache_findMaxReadSystemNotifyIdByUserId(userId);
		return "1";
	}
	return "0";
}
 
Example #20
Source File: PrintOrderController.java    From Shop-for-JavaWeb with MIT License 5 votes vote down vote up
@RequestMapping("/auto-print")
public String index(ModelMap m, HttpServletRequest request){
       String token = request.getParameter("token");
       if (!token.equals(this.token)) {
           return null;
       }

       m.put("token", this.token);
       return "modules/shop/print-order/auto-print";
}
 
Example #21
Source File: Dpl1000Controller.java    From oslits with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Dpl1000 배포자 리스트를 가져온다.
 * @param 
 * @return 
 * @exception Exception
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@RequestMapping(method=RequestMethod.POST, value="/dpl/dpl1000/dpl1000/selectDpl1000DeployNmListAjax.do")
   public ModelAndView selectDpl1000DeployNmListAjax(HttpServletRequest request, HttpServletResponse response, ModelMap model ) throws Exception {
   	try{

   		//리퀘스트에서 넘어온 파라미터를 맵으로 세팅
       	Map paramMap = RequestConvertor.requestParamToMap(request, true);
       	paramMap.put("prjId", request.getSession().getAttribute("selPrjId"));

       	//배포 계획 정보 리스트 조회
       	List<Map> dplDeployNmList = (List) dpl1000Service.selectDpl1000DeployNmList(paramMap);
       	
       	model.addAttribute("dplDeployNmList", dplDeployNmList);
       	
       	//조회성공메시지 세팅
       	model.addAttribute("message", egovMessageSource.getMessage("success.common.select"));
       	
       	return new ModelAndView("jsonView", model);
   	}
   	catch(Exception ex){
   		Log.error("selectDpl1000DeployNmListAjax()", ex);
   		
   		//조회실패 메시지 세팅
   		model.addAttribute("message", egovMessageSource.getMessage("fail.common.select"));
   		return new ModelAndView("jsonView", model);
   	}
   }
 
Example #22
Source File: GenController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 修改代码生成业务
 */
@GetMapping("/edit/{tableId}")
public String edit(@PathVariable("tableId") Long tableId, ModelMap mmap)
{
    GenTable table = genTableService.selectGenTableById(tableId);
    mmap.put("table", table);
    return prefix + "/edit";
}
 
Example #23
Source File: CubeLevelController.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/delete")
@Menu(type = "report" , subtype = "cubelevel" )
public ModelAndView quickreplydelete(ModelMap map , HttpServletRequest request , @Valid String id) {
	CubeLevel cubeLevel = cubeLevelRes.findOne(id) ;
	if(cubeLevel!=null){
		cubeLevelRes.delete(cubeLevel);
	}
	return request(super.createRequestPageTempletResponse("redirect:/apps/report/cube/detail.html?id="+cubeLevel.getCubeid()+"&dimensionId="+cubeLevel.getDimid()));
}
 
Example #24
Source File: IMAgentController.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/blacklist/delete")
@Menu(type = "setting" , subtype = "tag" , admin= false)
public ModelAndView blacklistdelete(ModelMap map , HttpServletRequest request , @Valid String id) {
	if(!StringUtils.isBlank(id)){
		BlackEntity tempBlackEntity = blackListRes.findByIdAndOrgi(id, super.getOrgi(request)) ;
		if(tempBlackEntity!=null){
  	blackListRes.delete(tempBlackEntity);
  	if (!StringUtils.isBlank(tempBlackEntity.getUserid())) {
  		CacheHelper.getSystemCacheBean().delete(tempBlackEntity.getUserid(), UKDataContext.SYSTEM_ORGI) ;
}
		}
	}
	return request(super.createRequestPageTempletResponse("redirect:/setting/blacklist.html"));
}
 
Example #25
Source File: ChatServiceController.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@RequestMapping("/current/trans")
  @Menu(type = "service" , subtype = "current" , admin= true)
  public ModelAndView trans(ModelMap map , HttpServletRequest request , @Valid String id) {
if(!StringUtils.isBlank(id)){
	AgentService agentService = agentServiceRes.findByIdAndOrgi(id, super.getOrgi(request)) ;
	List<Organ> skillList = OnlineUserUtils.organ(super.getOrgi(request),true) ;
	String currentOrgan = super.getUser(request).getOrgan();
	if(StringUtils.isBlank(currentOrgan)) {
		if(!skillList.isEmpty()) {
			currentOrgan = skillList.get(0).getId();
		}
	}
	List<AgentStatus> agentStatusList = ServiceQuene.getAgentStatus(null , super.getOrgi(request));
	List<String> usersids = new ArrayList<String>();
	if(!agentStatusList.isEmpty()) {
		for(AgentStatus agentStatus:agentStatusList) {
			if(agentStatus!=null){
				usersids.add(agentStatus.getAgentno()) ;
			}
		}
		
	}
	List<User> userList = userRes.findAll(usersids);
	for(User user : userList){
		user.setAgentStatus((AgentStatus) CacheHelper.getAgentStatusCacheBean().getCacheObject(user.getId(), super.getOrgi(request)));
	}
	map.addAttribute("userList", userList) ;
	map.addAttribute("userid", agentService.getUserid()) ;
	map.addAttribute("agentserviceid", agentService.getId()) ;
	map.addAttribute("agentuserid", agentService.getAgentuserid()) ;
	map.addAttribute("agentservice", agentService) ;
	map.addAttribute("skillList", skillList) ;
	map.addAttribute("currentorgan", currentOrgan) ;
}

return request(super.createRequestPageTempletResponse("/apps/service/current/transfer"));
  }
 
Example #26
Source File: FirmwareController.java    From SI with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@RequestMapping(value="/upload.do")
    public String firmwareUpload(@ModelAttribute("parameterVO") ParameterVO po,
    		                   HttpServletRequest request,
    		                   Locale locale,
    		                   ModelMap model)
            throws Exception {

		HttpSession session = request.getSession(false);
		if(session != null){
			//페이지 권한 확인
			GroupAuthorization requestAuth = (GroupAuthorization) session.getAttribute("requestAuth");
			if(!requestAuth.getAuthorizationDBRead().equals("1")){
				model.addAttribute("authMessage", "사용자관리 메뉴는 읽기 권한이 없습니다.");
				return "forward:" + HeritProperties.getProperty("Globals.MainPage");
			}
		}
		
/*		String deviceModel = po.getDeviceModel();
		String[] tokens = deviceModel.split("\\|");
		if (tokens.length == 2) {
			po.setOui(tokens[0]);
			po.setModelName(tokens[1]);
		}
*/		

		HashMap param = new HashMap<String, Object>();
		int page = StringUtil.parseInt(request.getParameter("page"), 1);
        PagingUtil resultPagingUtil = firmwareService.getFirmwareListPaging(page, 0, po);
        List deviceModelList = deviceService.getDeviceModelListByDeviceType("TR-069");

		/**
		 * 데이터 셋팅
		 */
		model.addAttribute("page", page);
		model.addAttribute("param", po);
		model.addAttribute("deviceModelList", deviceModelList);
		model.addAttribute("resultPagingUtil", resultPagingUtil);

    	return "/v2/firmware/upload";
    }
 
Example #27
Source File: Whk2000Controller.java    From oslits with GNU General Public License v3.0 5 votes vote down vote up
/**
 * whk2000 사용자 웹훅 등록
 * @param 
 * @return 
 * @exception Exception
 */
@RequestMapping(method=RequestMethod.POST, value="/whk/whk2000/whk2000/insertWhk2000WebhookInfo.do")
public ModelAndView insertWhk2000WebhookInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model ) throws Exception {
	try{
		
		//리퀘스트에서 넘어온 파라미터를 맵으로 세팅
		Map<String, String> paramMap = RequestConvertor.requestParamToMapAddSelInfo(request, true);
		
		paramMap.put("usrId", paramMap.get("regUsrId"));
		
		//사용자 웹훅 등록
		whk2000Service.insertWhk2000UsrWhkInfo(paramMap);
		
		model.addAttribute("errorYn", "N");
   		model.addAttribute("message", egovMessageSource.getMessage("success.common.insert"));
   		
		return new ModelAndView("jsonView", model);
	}
	catch(Exception ex){
		Log.error("insertWhk2000WebhookInfo()", ex);
		
		//조회실패 메시지 세팅
		model.addAttribute("errorYn", "Y");
   		model.addAttribute("message", egovMessageSource.getMessage("fail.common.insert"));
		return new ModelAndView("jsonView", model);
	}
}
 
Example #28
Source File: MappingJackson2JsonViewTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void renderWithPrettyPrint() throws Exception {
	ModelMap model = new ModelMap("foo", new TestBeanSimple());

	view.setPrettyPrint(true);
	view.render(model, request, response);

	String result = response.getContentAsString().replace("\r\n", "\n");
	assertTrue("Pretty printing not applied:\n" + result, result.startsWith("{\n  \"foo\" : {\n    "));

	validateResult();
}
 
Example #29
Source File: UserGradeManageAction.java    From bbs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 用户等级管理 修改界面显示
 */
@RequestMapping(params="method=edit",method=RequestMethod.GET)
public String editUI(ModelMap model,Integer id,
		HttpServletRequest request, HttpServletResponse response) throws Exception {
	UserGrade userGrade = userGradeService.findGradeById(id);
	model.addAttribute("userGrade", userGrade);
	return "jsp/user/edit_grade";
}
 
Example #30
Source File: DataBaseManageAction.java    From bbs with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 查询还原进度
 * @param model
 * @return
 * @throws Exception
 */
@RequestMapping(params="method=queryResetProgress",method=RequestMethod.GET)
@ResponseBody//方式来做ajax,直接返回字符串
public String queryResetProgress(ModelMap model)
		throws Exception {
	String resetProgress = mySqlDataManage.getResetProgress();
	
	return resetProgress;
}