-
- }catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setCharacterEncoding("UTF-8");
- request.setCharacterEncoding("UTF-8");
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
- }
-
- @RequestMapping(value={"/settings_dictionary/remove_settings"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView removeSettingsDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException {
- try{
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- JsonNode root = mapper.readTree(request.getReader());
- DecisionSettings decisionSettings = (DecisionSettings)mapper.readValue(root.get("data").toString(), DecisionSettings.class);
- commonClassDao.delete(decisionSettings);
- response.setCharacterEncoding("UTF-8");
- response.setContentType("application / json");
- request.setCharacterEncoding("UTF-8");
-
- PrintWriter out = response.getWriter();
-
- String responseString = mapper.writeValueAsString(commonClassDao.getData(DecisionSettings.class));
- JSONObject j = new JSONObject("{settingsDictionaryDatas: " + responseString + "}");
- out.write(j.toString());
-
- return null;
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setCharacterEncoding("UTF-8");
- request.setCharacterEncoding("UTF-8");
- PrintWriter out = response.getWriter();
- out.write(e.getMessage());
- }
- return null;
- }
-
-
-
- @RequestMapping(value={"/get_RainyDayDictionaryDataByName"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getRainyDayDictionaryByNameEntityData(HttpServletRequest request, HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("rainyDayDictionaryDatas", mapper.writeValueAsString(commonClassDao.getDataByColumn(RainyDayTreatments.class, "bbid")));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- }
- }
-
-
- @RequestMapping(value={"/get_RainyDayDictionaryData"}, method={org.springframework.web.bind.annotation.RequestMethod.GET} , produces=MediaType.APPLICATION_JSON_VALUE)
- public void getRainyDayDictionaryEntityData(HttpServletResponse response){
- try{
- Map<String, Object> model = new HashMap<>();
- ObjectMapper mapper = new ObjectMapper();
- model.put("rainyDayDictionaryDatas", mapper.writeValueAsString(commonClassDao.getData(RainyDayTreatments.class)));
- JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
- JSONObject j = new JSONObject(msg);
- response.addHeader("successMapKey", "success");
- response.addHeader("operation", "getDictionary");
- response.getWriter().write(j.toString());
- }
- catch (Exception e){
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + e);
- response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- response.addHeader("error", "dictionaryDBQuery");
- }
- }
-
- @RequestMapping(value={"/decision_dictionary/save_RainyDay"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
- public ModelAndView saveRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
- try {
- boolean duplicateflag = false;
- boolean isFakeUpdate = false;
- boolean fromAPI = false;
- if (request.getParameter("apiflag")!=null && request.getParameter("apiflag").equalsIgnoreCase("api")) {
- fromAPI = true;