package com.anbtech.anbframe.anbweb;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.anbtech.anbframe.entities.AnbEmployee;
import com.anbtech.anbframe.entities.AnbRank;
import com.anbtech.anbframe.rank.service.RankManageService;

@Controller
@RequestMapping(value="/rank")
public class RankManageController {

	@Autowired
	private RankManageService service;
	
	@RequestMapping(value="/manage_rank", method=RequestMethod.GET)
	public String manageRankMain(){
		return "admin/manage_rank";
	}
	/*
	
	{
	    "dataSet": {
	      "message": {
	          "result": "OK",
	          "messageId": "M3000000",
	          "messageName": "정상처리입니다."
	        },
	        "recordSets": {
	            "grid_todolist": {
	                "nc_list": [{"number":"1","todo":"Check Email"},
	                {"number":"2","todo":"Dentist's appoinment"},
	                {"number":"3","todo":"Wash car"},
	                {"number":"4","todo":"Pick up kids"},
	                {"number":"5","todo":"pay bills"}]
	            }
	        }
	    }
	}
	*/
	@ResponseBody
	@RequestMapping(value="/rank_list", method=RequestMethod.GET)
	public Map selectRankInfo(){
		
		Map<String,Object> map = new HashMap<String,Object>();
		
		Map<String,Object> key_map = new HashMap<String,Object>();
		
		Map<String,Object> grid_map = new HashMap<String,Object>();
		
		List<AnbRank> list = new ArrayList<AnbRank>();
		
		try {
			list = service.selectRankInfo(new AnbRank());
			
			for(AnbRank vo : list){
				vo.setAnbEmployees(null);
			}
			
			Map<String,Object> list_map = new HashMap<String,Object>();
			list_map.put("nc_list", list);
			
			grid_map.put("grid_todolist", list_map);
			
			key_map.put("message", "");
			key_map.put("recordSets", grid_map);
			
			map.put("dataSet", key_map);
			
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return map;
	}
	
}

@@ -31,16 +31,44 @@
 nbweb;%0A%0A
+import java.net.URLEncoder;%0A
 import j
@@ -83,24 +83,24 @@
 .ArrayList;%0A
-
 import java.
@@ -207,16 +207,73 @@
 l.Set;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -502,16 +502,77 @@
 Method;%0A
+import org.springframework.web.bind.annotation.RequestParam;%0A
 import o
@@ -860,16 +860,106 @@
 roller %7B
+%0A%09%0A%09private static final Logger LOG = LoggerFactory.getLogger(RankManageController.class);
 %0A%0A%09@Auto
@@ -1781,16 +1781,70 @@
 ankInfo(
+@RequestParam(required=false,value=%22name%22) String name
 )%7B%0A%09%09%0A%09%09
@@ -2090,16 +2090,245 @@
 %09%09try %7B%0A
+%09%09%09AnbRank pojo = new AnbRank();%0A%09%09%09%0A%09%09%09if(name!=null)%7B%0A%09%09%09%09%0A%09%09%09%09String ko_name = new String(name.getBytes(%228859_1%22), %22UTF-8%22);%0A%09%09%09%09LOG.info(%22%5B%EB%84%98%EC%96%B4%EC%98%A8 %EC%A7%81%EA%B8%89%EB%AA%85%5D : %7B%7D, %EB%B3%80%ED%99%98%EB%90%9C %EC%A7%81%EA%B8%89%EB%AA%85 : %7B%7D%22, name, ko_name);%0A%09%09%09%09pojo.setRankName(ko_name);%0A%09%09%09%7D%0A%09%09%09%0A
 %09%09%09list 
@@ -2352,29 +2352,20 @@
 ankInfo(
-new AnbRank()
+pojo
 );%0A%09%09%09%0A%09

test commit