1. 程式人生 > >獲取HR快捷流程 讓後臺的資料字典統一管理hr流程申請的資料

獲取HR快捷流程 讓後臺的資料字典統一管理hr流程申請的資料

/**
 * 獲取HR快捷流程
 * @return
 * @Description:
 * @author xietongjian 2017 上午2:22:27
 */
@RequestMapping("/getQuickProcess")
public String getQuickProcess(ModelMap model, HttpServletRequest request, HttpServletResponse response){
   // start 快捷流程 引數
   try {
      List<Dictionary> commonProcessDicts = dictionaryService.getBaseDataByType(readProperty.getValue("type_hrcommonprocess"));
      List<Dictionary> dataList= new ArrayList<>();
      for(Dictionary item : commonProcessDicts) {
         String hrefStr = item.getRemark();

         JSONObject jsonHref = null;
         try {
            jsonHref = JSONObject.fromObject(hrefStr);
                   Object urlObj = jsonHref.get("url");
                   String url = urlObj + "";
                   item.setRemark(url);
                   dataList.add(item);

         } catch (Exception e) {
            e.printStackTrace();
                   logger.error("後臺資料字典的對應的備註欄位資料格式不正確"+e);
         }




      }

      model.put("DictionaryDataList", dataList);
   } catch (Exception e) {
      logger.error("獲取HR快捷流程異常!" +e);
      e.printStackTrace();
   }
   //end 快捷流程 引數
   return "/hr/hr-index-quickprocess";
}
<#if DictionaryDataList??&&DictionaryDataList?size gt 0>
   <#list DictionaryDataList as item>
      <li title="${item.name}" ><nobr><i></i><a class="jsProcessWin" href="${(item.remark)!'#'}?dictionaryId=${item.id}" target="_blank" flowId="${item.id}">${(item.name)!''}</a></nobr></li>
   </#list>
<#else>
   <li style="text-align:center;"> 暫無資料!</li>
</#if>