//package com.eactive.eai.rms.common.acl.openacl;
//
//
//
//import java.util.HashMap;
//
//import javax.servlet.http.HttpServletRequest;
//
//import org.apache.log4j.Logger;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.servlet.ModelAndView;
//
//import com.eactive.eai.rms.common.acl.user.BizService;
//import com.eactive.eai.rms.common.acl.user.UserService;
//import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
//import com.eactive.eai.rms.common.datasource.DataSourceType;
//import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
//import com.eactive.eai.rms.common.interceptor.InterceptorSkipController;
//
//@Controller
//public class OpenAclForProdController implements InterceptorSkipController {
//	
//	private static final Logger logger = Logger.getLogger(OpenAclForProdController.class);
//    private static final String resultView ="common/loadResult";
//
//	@Autowired
//	@Qualifier("bizService")
//	private BizService bizService;
//	
//	@Autowired
//	@Qualifier("userService")
//	private UserService userService;
//
//	
//	@RequestMapping("/deleteUserAuthforProd.do")
//	private ModelAndView delete(HttpServletRequest request ) throws Exception {
//		
//		HashMap<String,String> result = new HashMap<String,String>();
//
//		HashMap<String, Object> paramMap = new HashMap<String, Object>();
//		for (String key : request.getParameterMap().keySet()){
//			String [] datas= request.getParameterValues(key);
//			StringBuffer resultS = new StringBuffer();
//			for(String data : datas){
//				resultS.append(data);
//			}
//			paramMap.put(key, resultS.toString());
//		}
//		
//		for(DataSourceType d : DataSourceTypeManager.getDynamicDataSourceTypes() ) {
//			DataSourceContextHolder.setDataSourceType(d);
//			paramMap.put("schemaId", d.getSchema()); 
//			if(logger.isInfoEnabled()) logger.info("deleteUserAuthforProd param : " +paramMap.toString());
//			
//			bizService.deleteUserBizCode(paramMap);
//			
//		}
//			
//		result.put("status", "success");
//		return new ModelAndView(resultView, "result", result.toString());
//	}
//	
//	@RequestMapping("/insertUserAuthforProd.do")
//	private ModelAndView insert(HttpServletRequest request) throws Exception {
//		
//		HashMap<String,String> result = new HashMap<String,String>();
//
//		HashMap<String, Object> paramMap = new HashMap<String, Object>();
//		for (String key : request.getParameterMap().keySet()){
//			String [] datas= request.getParameterValues(key);
//			StringBuffer resultS = new StringBuffer();
//			for(String data : datas){
//				resultS.append(data);
//			}
//			paramMap.put(key, resultS.toString());
//		}
//		
//		for(DataSourceType d : DataSourceTypeManager.getDynamicDataSourceTypes() ) {
//			DataSourceContextHolder.setDataSourceType(d);
//			paramMap.put("schemaId", d.getSchema()); 
//			if(logger.isInfoEnabled()) logger.info("insertAppBizforProd param : " +paramMap.toString());
//			
//			try{
//				bizService.insertUserBiz(paramMap);
//				//선택한 업무코드 + 그 업무코드로 조회되는 EAI업무구분코드  에 대해서 권한 부여  추가 2020.02.05
//				bizService.insertMergeRM06(paramMap);
//			}catch(Exception e){
//				logger.warn("중복 데이터가 존재합니다 ");
//			}
//			
//		}
//		
//		//권한 변경 (모니터링용)
//		HashMap<String, Object> uMap = new HashMap<String, Object>();
//		uMap.put("userId", paramMap.get("userId"));
//		userService.updateChangeRole(uMap);
//			
//		result.put("status", "success");
//		return new ModelAndView(resultView, "result", result.toString());
//	}
//	
//	
//}
