/**
  * AJAX 示例下拉框
  *
  * @param req
  * @return
  */
 @RequestMapping(params = "getDemo")
 @ResponseBody
 public AjaxJson getDemo(HttpServletRequest req) {
   AjaxJson j = new AjaxJson();
   String id = StringUtil.getEncodePra(req.getParameter("id"));
   String floor = "";
   if (StringUtil.isNotEmpty(id)) {
     if ("ThreeLevelLinkage".equals(id)) {
       floor += "省:<select name=\"province\" id=\"provinceid\">" + "</select>" + "&nbsp;&nbsp;";
       floor += "市:<select name=\"city\" id=\"cityid\">" + "</select>" + "&nbsp;&nbsp;";
       floor += "县:<select name=\"county\" id=\"countyid\">" + "</select>" + "&nbsp;&nbsp;";
     } else {
       CriteriaQuery cq = new CriteriaQuery(TSFunction.class);
       cq.eq("TSFunction.id", id);
       cq.add();
       List<TSFunction> functions = systemService.getListByCriteriaQuery(cq, false);
       if (functions.size() > 0) {
         for (TSFunction function : functions) {
           floor +=
               "<input type=\"checkbox\"  name=\"floornum\" id=\"floornum\" value=\""
                   + function.getId()
                   + "\">"
                   + MutiLangUtil.getMutiLangInstance().getLang(function.getFunctionName())
                   + "&nbsp;&nbsp;";
         }
       } else {
         floor += "没有子项目!";
       }
     }
   }
   j.setMsg(floor);
   return j;
 }
  /**
   * easyui AJAX请求数据
   *
   * @param request
   * @param response
   * @param dataGrid
   * @param user
   * @throws Exception
   */
  @SuppressWarnings("unchecked")
  @RequestMapping(params = "datagrid")
  public void datagrid(
      TerminalInfoEntity terminalInfo,
      HttpServletRequest request,
      HttpServletResponse response,
      DataGrid dataGrid,
      String groupname)
      throws Exception {
    CriteriaQuery cq = new CriteriaQuery(TerminalInfoEntity.class, dataGrid);
    // 查询条件组装器,fuzzy search
    String name = terminalInfo.getName();
    if (StringUtil.isNotEmpty(name)) {
      terminalInfo.setName("*" + name + "*");
    }
    org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(
        cq, terminalInfo, request.getParameterMap());
    this.terminalInfoService.getDataGridReturn(cq, true);

    List<TerminalInfoEntity> terminals = dataGrid.getResults();
    List<TerminalInfoPage> results = new ArrayList<TerminalInfoPage>();
    // 添加地理位置
    for (TerminalInfoEntity t : terminals) {
      if (StringUtil.isNotEmpty(t.getGroupid())) {
        TerminalInfoPage page = new TerminalInfoPage();
        MyBeanUtils.copyBeanNotNull2Bean(t, page);
        TSTerritory self = systemService.get(TSTerritory.class, t.getGroupid());
        String territoryName = "";
        List<TSTerritory> ts = new ArrayList<TSTerritory>();
        TSTerritory parent = self.getTSTerritory();
        ts.add(self);
        String pid = parent.getId();
        // 当父组织机构不为根机构时,查找父机构
        while (!"1".equals(pid)) {
          parent = systemService.get(TSTerritory.class, pid);
          ts.add(parent);
          parent = parent.getTSTerritory();
          pid = parent.getId();
        }
        // 按照添加顺序逆序
        Collections.reverse(ts);
        for (TSTerritory te : ts) {
          territoryName += "-" + te.getTerritoryName();
        }
        page.setGroupname(territoryName.substring(1));
        results.add(page);
      }
    }
    dataGrid.setResults(results);
    TagUtil.datagrid(response, dataGrid);
  }
Esempio n. 3
0
 /**
  * 处理取值表达式
  *
  * @param result
  * @param beans
  */
 @SuppressWarnings("unchecked")
 private void dealReplace(List<Map<String, Object>> result, List<Map<String, Object>> beans) {
   for (Map<String, Object> bean : beans) {
     try {
       // 获取取值表达式
       String replace = (String) bean.get(CgReportConstant.ITEM_REPLACE);
       if (StringUtil.isEmpty(replace)) {
         continue;
       }
       String[] groups = replace.split(",");
       for (String g : groups) {
         String[] items = g.split("_");
         String v = items[0]; // 逻辑判断值
         String txt = items[1]; // 要转换的文本
         for (Map r : result) {
           String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME)));
           if (value.equalsIgnoreCase(v)) {
             r.put(bean.get(CgReportConstant.ITEM_FIELDNAME), txt);
           }
         }
       }
     } catch (Exception e) {
       // 这里出现异常原因是因为取值表达式不正确
       e.printStackTrace();
       throw new BusinessException("取值表达式不正确");
     }
   }
 }
  @Override
  public void costWorkFlowStart(CostApprovalEntity costApproval, HttpServletRequest request) {
    // 由session取到登录用户id
    String applyUserId = ResourceUtil.getSessionUserName().getId();
    this.save(costApproval);
    String processKey = request.getParameter("processKey");
    if (!StringUtil.isNotEmpty(processKey)) {
      WorkFlowSetEntity workFlowSet =
          this.findUniqueByProperty(
              WorkFlowSetEntity.class, "entityName", costApproval.getClass().getSimpleName());
      processKey = workFlowSet.getProcessKey();
    }
    String businessKey = costApproval.getId().toString();
    ProcessInstance processInstance = null;
    // 用来设置启动流程的人员ID,引擎会自动把用户ID保存到activiti:initiator中
    identityService.setAuthenticatedUserId(applyUserId);

    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put(ProcessConstantsUtil.getApplyUserId(), applyUserId);
    processInstance = runtimeService.startProcessInstanceByKey(processKey, businessKey, variables);
    String processInstanceId = processInstance.getId();
    costApproval.setProcessinstanceId(processInstanceId);

    // 获取并执行当前流程实例的下一步任务
    Task task = null;
    TaskQuery query =
        taskService.createTaskQuery().processInstanceBusinessKey(businessKey).active();
    task = query.singleResult();
    variables.put(
        ProcessConstantsUtil.getDeptLeaderId(),
        ResourceUtil.getSessionUserName().getCurrentDepart().getDepartManager().getId());
    taskService.complete(task.getId(), variables);
  }
  @RequestMapping(params = "upload", method = RequestMethod.POST)
  @ResponseBody
  public AjaxJson upload(MultipartHttpServletRequest request, HttpServletResponse response) {
    AjaxJson j = new AjaxJson();
    Map<String, Object> attributes = new HashMap<String, Object>();
    TSTypegroup tsTypegroup = systemService.getTypeGroup("fieltype", "文档分类");
    TSType tsType = systemService.getType("files", "附件", tsTypegroup);
    String fileKey = oConvertUtils.getString(request.getParameter("fileKey")); // 文件ID
    String documentTitle = oConvertUtils.getString(request.getParameter("documentTitle")); // 文件标题
    TSDocument document = new TSDocument();
    if (StringUtil.isNotEmpty(fileKey)) {
      document.setId(fileKey);
      document = systemService.getEntity(TSDocument.class, fileKey);
      document.setDocumentTitle(documentTitle);
    }
    document.setSubclassname(MyClassLoader.getPackPath(document));
    document.setCreatedate(DateUtils.gettimestamp());
    document.setTSType(tsType);
    UploadFile uploadFile = new UploadFile(request, document);
    uploadFile.setCusPath("files");
    uploadFile.setSwfpath("swfpath");
    document = systemService.uploadFile(uploadFile);
    attributes.put("url", document.getRealpath());
    attributes.put("fileKey", document.getId());
    attributes.put("name", document.getAttachmenttitle());
    attributes.put("viewhref", "commonController.do?openViewFile&fileid=" + document.getId());
    attributes.put("delurl", "commonController.do?delObjFile&fileKey=" + document.getId());
    j.setMsg("文件添加成功");
    j.setAttributes(attributes);

    return j;
  }
Esempio n. 6
0
 @RequestMapping(params = "addArticle")
 public ModelAndView addArticle(HttpServletRequest req, ItemEntity item) {
   List<ItemEntity> listEntity = commonItemService.findItemsByParentId("0");
   if (StringUtil.isNotEmpty(item.getId())) {
     item = commonItemService.getEntity(ItemEntity.class, item.getId());
     req.setAttribute("itemPage", item);
     if (item.getLevel() == 3) { // 说明有三级菜单
       /*	req.setAttribute("secondPage", commonItemService
       .findItemsByParentId(commonItemService.findParticalItemById(
       		item.getParentId()).getParentId()));*/
       req.setAttribute(
           "secondPage",
           commonItemService.findItemsCanEnitByParentId(
               commonItemService.findParticalItemById(item.getParentId()).getParentId()));
       req.setAttribute("second", item.getParentId());
       req.setAttribute(
           "first", commonItemService.findParticalItemById(item.getParentId()).getParentId());
     } else if (item.getLevel() == 2) {
       req.setAttribute("first", item.getParentId());
       req.setAttribute("secondPage", commonItemService.findItemsByParentId(item.getParentId()));
     }
   } else {
     if (listEntity.size() > 0) {
       req.setAttribute(
           "secondPage", commonItemService.findItemsCanEnitByParentId(listEntity.get(0).getId()));
       /*req.setAttribute("secondPage", commonItemService.findItemsCanEnitByParentId(commonItemService.findParticalItemById(
       listEntity.get(0).getParentId()).getParentId()));*/
     } else {
       return new ModelAndView("upperadmin/item/error");
     }
   }
   /*List<ItemEntity> listEntity = commonItemService.findItemsByParentId("0");*/
   req.setAttribute("itemReplace", listEntity);
   return new ModelAndView("commonadmin/item/article2");
 }
 /**
  * 添加全量统计
  *
  * @param ids
  * @return
  */
 @RequestMapping(params = "save")
 @ResponseBody
 public AjaxJson save(FullStatisticsMonthEntity fullStatisticsMonth, HttpServletRequest request) {
   AjaxJson j = new AjaxJson();
   if (StringUtil.isNotEmpty(fullStatisticsMonth.getId())) {
     message = "全量统计更新成功";
     FullStatisticsMonthEntity t =
         fullStatisticsMonthService.get(
             FullStatisticsMonthEntity.class, fullStatisticsMonth.getId());
     try {
       MyBeanUtils.copyBeanNotNull2Bean(fullStatisticsMonth, t);
       fullStatisticsMonthService.saveOrUpdate(t);
       systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
     } catch (Exception e) {
       e.printStackTrace();
       message = "全量统计更新失败";
     }
   } else {
     message = "全量统计添加成功";
     fullStatisticsMonthService.save(fullStatisticsMonth);
     systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
   }
   j.setMsg(message);
   return j;
 }
Esempio n. 8
0
  public String getLang(String lanKey, String langArg) {
    String langContext = StringUtil.getEmptyString();
    if (StringUtil.isEmpty(langArg)) {
      langContext = getLang(lanKey);
    } else {
      String[] argArray = langArg.split(",");
      langContext = getLang(lanKey);

      for (int i = 0; i < argArray.length; i++) {
        String langKeyArg = argArray[i].trim();
        String langKeyContext = getLang(langKeyArg);
        langContext = StringUtil.replace(langContext, "{" + i + "}", langKeyContext);
      }
    }
    return langContext;
  }
 /**
  * 终端信息列表页面跳转
  *
  * @return
  */
 @RequestMapping(params = "addorupdate")
 public ModelAndView addorupdate(TerminalInfoEntity terminalInfo, HttpServletRequest req) {
   if (StringUtil.isNotEmpty(terminalInfo.getId())) {
     try {
       terminalInfo =
           terminalInfoService.getEntity(TerminalInfoEntity.class, terminalInfo.getId());
       TerminalInfoPage page = new TerminalInfoPage();
       MyBeanUtils.copyBeanNotNull2Bean(terminalInfo, page);
       TSTerritory self = systemService.get(TSTerritory.class, page.getGroupid());
       String territoryName = "";
       List<TSTerritory> ts = new ArrayList<TSTerritory>();
       TSTerritory parent = self.getTSTerritory();
       ts.add(self);
       String pid = parent.getId();
       // 当父组织机构不为根机构时,查找父机构
       while (!"1".equals(pid)) {
         parent = systemService.get(TSTerritory.class, pid);
         ts.add(parent);
         parent = parent.getTSTerritory();
         pid = parent.getId();
       }
       // 按照添加顺序逆序
       Collections.reverse(ts);
       for (TSTerritory te : ts) {
         territoryName += "-" + te.getTerritoryName();
       }
       page.setGroupname(territoryName.substring(1));
       req.setAttribute("terminalInfoPage", page);
     } catch (Exception e) {
       logger.error("获取终端信息错误");
       e.printStackTrace();
     }
   }
   return new ModelAndView("vod/terminalinfo/terminalInfo");
 }
 /**
  * 添加终端信息
  *
  * @param ids
  * @return
  */
 @RequestMapping(params = "save")
 @ResponseBody
 public AjaxJson save(TerminalInfoEntity terminalInfo, HttpServletRequest request) {
   AjaxJson j = new AjaxJson();
   if (StringUtil.isNotEmpty(terminalInfo.getId())) {
     message = "终端信息更新成功";
     TerminalInfoEntity t =
         terminalInfoService.get(TerminalInfoEntity.class, terminalInfo.getId());
     try {
       MyBeanUtils.copyBeanNotNull2Bean(terminalInfo, t);
       terminalInfoService.saveOrUpdate(t);
       systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
     } catch (Exception e) {
       e.printStackTrace();
       message = "终端信息更新失败";
     }
   } else {
     message = "终端信息添加成功";
     terminalInfo.setStatus(Integer.valueOf(SystemType.TERMINAL_STATE_0));
     terminalInfoService.save(terminalInfo);
     systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
   }
   j.setMsg(message);
   return j;
 }
Esempio n. 11
0
 /**
  * Excel导出列表页面跳转
  *
  * @return
  */
 @RequestMapping(params = "addorupdate")
 public ModelAndView addorupdate(JpPersonEntity jpPerson, HttpServletRequest req) {
   if (StringUtil.isNotEmpty(jpPerson.getId())) {
     jpPerson = jpPersonService.getEntity(JpPersonEntity.class, jpPerson.getId());
     req.setAttribute("jpPersonPage", jpPerson);
   }
   return new ModelAndView("jeecg/demo/test/jpPerson");
 }
 /**
  * 订单跟踪信息列表页面跳转
  *
  * @return
  */
 @RequestMapping(params = "addorupdate")
 public ModelAndView addorupdate(TbOrderTrackingEntity tbOrderTracking, HttpServletRequest req) {
   if (StringUtil.isNotEmpty(tbOrderTracking.getId())) {
     tbOrderTracking =
         tbOrderTrackingService.getEntity(TbOrderTrackingEntity.class, tbOrderTracking.getId());
     req.setAttribute("tbOrderTrackingPage", tbOrderTracking);
   }
   return new ModelAndView("jeecg/test/orders/tbOrderTracking");
 }
 /**
  * 微站点信息编辑页面跳转
  *
  * @return
  */
 @RequestMapping(params = "goUpdate")
 public ModelAndView goUpdate(WeixinCmsSiteEntity weixinCmsSite, HttpServletRequest req) {
   if (StringUtil.isNotEmpty(weixinCmsSite.getId())) {
     weixinCmsSite =
         weixinCmsSiteService.getEntity(WeixinCmsSiteEntity.class, weixinCmsSite.getId());
     req.setAttribute("weixinCmsSitePage", weixinCmsSite);
   }
   return new ModelAndView("weixin/cms/site/weixinCmsSite-update");
 }
  @RequestMapping(params = "track")
  public ModelAndView track(
      TbOrderTrackingEntity tbOrderTracking,
      HttpServletRequest req,
      HttpServletResponse response,
      DataGrid dataGrid) {
    if (StringUtil.isNotEmpty(tbOrderTracking)) {}

    return new ModelAndView("jeecg/test/orders/tbOrderTrackingListWindow");
  }
 /**
  * 部门列表页面跳转
  *
  * @return
  */
 @RequestMapping(params = "update")
 public ModelAndView update(TSDepart depart, HttpServletRequest req) {
   List<TSDepart> departList = systemService.getList(TSDepart.class);
   req.setAttribute("departList", departList);
   if (StringUtil.isNotEmpty(depart.getId())) {
     depart = systemService.getEntity(TSDepart.class, depart.getId());
     req.setAttribute("depart", depart);
   }
   return new ModelAndView("system/depart/depart");
 }
 /**
  * 扩展接口管理新增页面跳转
  *
  * @return
  */
 @RequestMapping(params = "goAdd")
 public ModelAndView goAdd(WeixinExpandconfigEntity weixinExpandconfig, HttpServletRequest req) {
   if (StringUtil.isNotEmpty(weixinExpandconfig.getId())) {
     weixinExpandconfig =
         weixinExpandconfigService.getEntity(
             WeixinExpandconfigEntity.class, weixinExpandconfig.getId());
     req.setAttribute("weixinExpandconfigPage", weixinExpandconfig);
   }
   return new ModelAndView("weixin/guanjia/base/expandconfig/weixinExpandconfig-add");
 }
Esempio n. 17
0
 /**
  * 装载数据字典
  *
  * @param m 要放入freemarker的数据
  * @param bean 读取出来的动态配置数据
  */
 @SuppressWarnings("unchecked")
 private void loadDic(Map m, Map<String, Object> cgReportMap) {
   String dict_code = (String) cgReportMap.get("dict_code");
   if (StringUtil.isEmpty(dict_code)) {
     m.put(CgReportConstant.FIELD_DICTLIST, new ArrayList(0));
     return;
   }
   List<Map<String, Object>> dicDatas = queryDicBySQL(dict_code);
   m.put(CgReportConstant.FIELD_DICTLIST, dicDatas);
 }
Esempio n. 18
0
 @RequestMapping(params = "articleSave")
 @ResponseBody
 public AjaxJson articleSave(
     ItemEntity item, String content, String contentTxt, HttpServletRequest req) {
   AjaxJson j = new AjaxJson();
   if (StringUtil.isNotEmpty(item.getId())) {
     message = "内容信息添加成功";
     ItemEntity t = commonItemService.get(ItemEntity.class, item.getId());
     ArticleEntity a = t.getArticle();
     a.setContent(content);
     a.setContentTxt(contentTxt);
     t.setArticle(a);
     if (item.getParentId().equals("0")) {
       item.setLevel(1); // 设置为目录级
     } else {
       item.setLevel(
           commonItemService.findParticalItemById(item.getParentId()).getLevel() + 1); // 设置为内容级别
     }
     try {
       MyBeanUtils.copyBeanNotNull2Bean(item, t);
       commonItemService.saveOrUpdate(t);
       systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
     } catch (Exception e) {
       e.printStackTrace();
       message = "类目基本信息更新失败";
     }
   } else {
     CommonAdminSession sessionAdmin =
         (CommonAdminSession) req.getSession().getAttribute(Constant.COMMON_ADMIN_SESSION);
     Date curDate = new Date(System.currentTimeMillis());
     message = "内容信息添加成功";
     item.setCreateTime(curDate);
     item.setUpdateTime(curDate);
     item.setBelongs(sessionAdmin.getDistrict().getDistrictCode());
     item.setCreator(sessionAdmin.getId());
     item.setType(Constant.Article);
     item.setStatus(DictionaryBean.keyDict.get("item_status_normal").getValue());
     if (item.getParentId().equals("0")) {
       item.setLevel(1); // 设置为目录级
     } else {
       item.setLevel(
           commonItemService.findParticalItemById(item.getParentId()).getLevel() + 1); // 设置为内容级别
     }
     ArticleEntity article = new ArticleEntity();
     article.setContent(content);
     article.setContentTxt(contentTxt);
     article.setParentId(item.getParentId());
     article.setBelongId(DictionaryBean.keyDict.get("item_belongs_private").getValue());
     commonItemService.save(article);
     item.setArticle(article);
     commonItemService.save(item);
   }
   j.setMsg(message);
   return j;
 }
 /**
  * 全量统计列表页面跳转
  *
  * @return
  */
 @RequestMapping(params = "addorupdate")
 public ModelAndView addorupdate(
     FullStatisticsMonthEntity fullStatisticsMonth, HttpServletRequest req) {
   if (StringUtil.isNotEmpty(fullStatisticsMonth.getId())) {
     fullStatisticsMonth =
         fullStatisticsMonthService.getEntity(
             FullStatisticsMonthEntity.class, fullStatisticsMonth.getId());
     req.setAttribute("fullStatisticsMonthPage", fullStatisticsMonth);
   }
   return new ModelAndView("com/jason/ddoWeb/statistics/fullStatisticsMonth");
 }
Esempio n. 20
0
 public static SysThemesEnum toEnum(String style) {
   if (StringUtil.isEmpty(style)) {
     return SHORTCUT_STYLE;
   }
   for (SysThemesEnum item : SysThemesEnum.values()) {
     if (item.getStyle().equals(style)) {
       return item;
     }
   }
   return SHORTCUT_STYLE;
 }
  /**
   * easyuiAJAX请求数据: 用户选择角色列表
   *
   * @param request
   * @param response
   * @param dataGrid
   * @param user
   */
  @RequestMapping(params = "addorupdate")
  public ModelAndView addorupdate(ZkZhBanner ent, HttpServletRequest req) {
    if (StringUtil.isNotEmpty(ent.getId())) {
      ent = systemService.getEntity(ZkZhBanner.class, ent.getId());
      req.setAttribute("ent", ent);

      TSFunction function = systemService.getEntity(TSFunction.class, ent.getTSFunction().getId());
      req.setAttribute("function", function);
    }
    return new ModelAndView("zky/module/content");
  }
 /**
  * 编码器录制服务器关系列表页面跳转
  *
  * @return
  */
 @RequestMapping(params = "addorupdate")
 public ModelAndView addorupdate(
     ConfCodecRecordSrvEntity confCodecRecordSrv, HttpServletRequest req) {
   if (StringUtil.isNotEmpty(confCodecRecordSrv.getId())) {
     confCodecRecordSrv =
         confCodecRecordSrvService.getEntity(
             ConfCodecRecordSrvEntity.class, confCodecRecordSrv.getId());
     req.setAttribute("confCodecRecordSrvPage", confCodecRecordSrv);
   }
   return new ModelAndView("vod/confcodecrecordsrv/confCodecRecordSrv");
 }
  /**
   * 保存DEMO维护
   *
   * @param demo
   * @param request
   * @return
   * @throws Exception
   */
  @RequestMapping(params = "saveDemo")
  @ResponseBody
  public AjaxJson saveDemo(TSDemo demo, HttpServletRequest request) throws Exception {
    AjaxJson j = new AjaxJson();
    if (!StringUtil.isEmpty(demo.getId())) {
      message = "Demo维护例子: " + demo.getDemotitle() + "被更新成功";
      TSDemo entity = this.systemService.get(TSDemo.class, demo.getId());
      MyBeanUtils.copyBeanNotNull2Bean(demo, entity);

      if (demo.getTSDemo() == null || StringUtil.isEmpty(demo.getTSDemo().getId())) {
        entity.setTSDemo(null);
      }
      this.systemService.saveOrUpdate(entity);
    } else {
      message = "Demo例子: " + demo.getDemotitle() + "被添加成功";
      if (demo.getTSDemo() == null || StringUtil.isEmpty(demo.getTSDemo().getId())) {
        demo.setTSDemo(null);
      }
      this.systemService.save(demo);
    }
    j.setMsg(message);
    return j;
  }
 // ----------------------------------------------------------------
 // add-begin--Author:liutao  Date:20130405 for:部门管理的添加处理逻辑
 // ----------------------------------------------------------------
 @RequestMapping(params = "add")
 public ModelAndView add(TSDepart depart, HttpServletRequest req) {
   List<TSDepart> departList = systemService.getList(TSDepart.class);
   req.setAttribute("departList", departList);
   if (StringUtil.isNotEmpty(depart.getId())) {
     TSDepart tspDepart = new TSDepart();
     TSDepart tsDepart = new TSDepart();
     depart = systemService.getEntity(TSDepart.class, depart.getId());
     tspDepart.setId(depart.getId());
     tspDepart.setDepartname(depart.getDepartname());
     tsDepart.setTSPDepart(tspDepart);
     req.setAttribute("depart", tsDepart);
   }
   return new ModelAndView("system/depart/depart");
 }
Esempio n. 25
0
  /**
   * 添加Excel导出
   *
   * @param ids
   * @return
   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(JpPersonEntity jpPerson, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(jpPerson.getId())) {
      message = "更新成功";
      jpPersonService.saveOrUpdate(jpPerson);
      systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    } else {
      message = "添加成功";
      jpPersonService.save(jpPerson);
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }

    return j;
  }
Esempio n. 26
0
 /**
  * 加载dataTables 默认查询条件
  *
  * @param dataTables
  */
 public void addJqCriteria(DataTables dataTables) {
   String search = dataTables.getSearch(); // 查询关键字
   SortInfo[] sortInfo = dataTables.getSortColumns(); // 排序字段
   String[] sColumns = dataTables.getsColumns().split(","); // 字段
   if (StringUtil.isNotEmpty(search)) {
     for (String string : sColumns) {
       if (string.indexOf("_") == -1) {
         jqcriterionList.addPara(Restrictions.like(string, "%" + search + "%"));
       }
     }
     add(getOrCriterion(jqcriterionList));
   }
   if (sortInfo.length > 0) {
     for (SortInfo sortInfo2 : sortInfo) {
       addOrder("" + sColumns[sortInfo2.getColumnId()] + "", sortInfo2.getSortOrder());
     }
   }
 }
Esempio n. 27
0
  /** 取 o_muti_lang.lang_key 的值返回当前语言的值* */
  public String getLang(String langKey) {
    String language = BrowserUtils.getBrowserLanguage(request);

    if (request.getSession().getAttribute("lang") != null) {
      language = (String) request.getSession().getAttribute("lang");
    }

    String langContext = MutiLangEntity.mutiLangMap.get(langKey + "_" + language);

    if (StringUtil.isEmpty(langContext)) {
      langContext =
          MutiLangEntity.mutiLangMap.get(
              "common.notfind.langkey" + "_" + request.getSession().getAttribute("lang"));
      if ("null".equals(langContext) || langContext == null || langKey.startsWith("?")) {
        langContext = "";
      }
      langContext = langContext + langKey;
    }
    return langContext;
  }
  /**
   * 添加部门
   *
   * @param ids
   * @return
   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(TSDepart depart, HttpServletRequest request) {
    // 设置上级部门
    String pid = request.getParameter("TSPDepart.id");
    if (pid.equals("")) {
      depart.setTSPDepart(null);
    }
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(depart.getId())) {
      message = "部门: " + depart.getDepartname() + "被更新成功";
      userService.saveOrUpdate(depart);
      systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    } else {
      message = "部门: " + depart.getDepartname() + "被添加成功";
      userService.save(depart);
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }

    return j;
  }
  /**
   * 添加订单跟踪信息
   *
   * @param ids
   * @return
   */
  @RequestMapping(params = "save")
  @ResponseBody
  public AjaxJson save(TbOrderTrackingEntity tbOrderTracking, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(tbOrderTracking.getId())) {
      message = "更新成功";
      TbOrderTrackingEntity t =
          tbOrderTrackingService.get(TbOrderTrackingEntity.class, tbOrderTracking.getId());
      try {
        MyBeanUtils.copyBeanNotNull2Bean(tbOrderTracking, t);
        tbOrderTrackingService.saveOrUpdate(t);
        systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      message = "添加成功";
      tbOrderTrackingService.save(tbOrderTracking);
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }

    return j;
  }
Esempio n. 30
0
  /**
   * 处理数据字典
   *
   * @param result 查询的结果集
   * @param beans 字段配置
   */
  @SuppressWarnings("unchecked")
  private void dealDic(List<Map<String, Object>> result, List<Map<String, Object>> beans) {
    for (Map<String, Object> bean : beans) {
      String dict_code = (String) bean.get(CgReportConstant.ITEM_DICCODE);
      if (StringUtil.isEmpty(dict_code)) {
        // 不需要处理字典
        continue;
      } else {
        List<Map<String, Object>> dicDatas = queryDicBySQL(dict_code);

        for (Map r : result) {
          String value = String.valueOf(r.get(bean.get(CgReportConstant.ITEM_FIELDNAME)));
          for (Map m : dicDatas) {
            String typecode = String.valueOf(m.get("typecode"));
            String typename = String.valueOf(m.get("typename"));
            if (value.equalsIgnoreCase(typecode)) {
              r.put(bean.get(CgReportConstant.ITEM_FIELDNAME), typename);
            }
          }
        }
      }
    }
  }