/**
   * 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);
  }
Ejemplo n.º 2
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");
 }
Ejemplo n.º 3
0
  @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);
  }
 /**
  * 添加全量统计
  *
  * @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;
 }
 /**
  * 终端信息列表页面跳转
  *
  * @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");
 }
 /**
  * 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;
 }
 /**
  * 添加终端信息
  *
  * @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;
 }
  @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;
  }
Ejemplo n.º 9
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 = "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");
 }
 /**
  * 订单跟踪信息列表页面跳转
  *
  * @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");
 }
  @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");
  }
Ejemplo n.º 13
0
 /**
  * 部门列表页面跳转
  *
  * @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");
 }
Ejemplo n.º 15
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;
 }
  /**
   * 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");
 }
 /**
  * 全量统计列表页面跳转
  *
  * @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");
 }
Ejemplo n.º 19
0
 // ----------------------------------------------------------------
 // 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");
 }
Ejemplo n.º 20
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;
  }
Ejemplo n.º 21
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());
     }
   }
 }
Ejemplo n.º 22
0
  /**
   * 添加部门
   *
   * @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;
  }
  /**
   * @param terminalInfo
   * @param request
   * @param response
   * @param meetingType
   * @param excepts
   * @param appointmentStarttime
   * @param appointmentDuration
   * @return
   */
  @RequestMapping(params = "wetheruesedterminal")
  @ResponseBody
  public AjaxJson wetheruesedterminal(
      String id,
      String meetingType,
      String excepts,
      String appointmentStarttime,
      String appointmentDuration) {

    AjaxJson j = new AjaxJson();
    // 当前选择的终端分组可用
    message = "true";
    if (StringUtil.isNotEmpty(id)) {
      List<TerminalInfoEntity> terminals =
          terminalInfoService.getConflicts(
              id, meetingType, appointmentStarttime, appointmentDuration);
      if (null != terminals && terminals.size() > 0) {
        // 当前选择的终端分组不可用
        message = "false";
      }
    }
    j.setMsg(message);
    return j;
  }
  /**
   * 录入
   *
   * @param user
   * @param req
   * @return
   */
  @RequestMapping(params = "saveContent")
  @ResponseBody
  public AjaxJson save(HttpServletRequest req, ZkZhBanner ent) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(ent.getId())) {
      ZkZhBanner ent_old = systemService.getEntity(ZkZhBanner.class, ent.getId());
      ent_old.setTSFunction(ent.getTSFunction());
      ent_old.setTitleEN(ent.getTitleEN());
      ent_old.setIsshow(ent.getIsshow());
      ent_old.setFunctionOrder(ent.getFunctionOrder());
      ent_old.setPicSrc(ent.getPicSrc());
      systemService.updateEntitie(ent_old);
      message = "Banner: " + ent.getTitleEN() + "更新成功";
      systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    } else {
      ent.setCreatTime(new Date());
      systemService.save(ent);
      message = "Banner: " + ent.getTitleEN() + "添加成功";
      systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
    }
    j.setMsg(message);

    return j;
  }
 /**
  * 添加编码器录制服务器关系
  *
  * @param ids
  * @return
  */
 @RequestMapping(params = "save")
 @ResponseBody
 public AjaxJson save(ConfCodecRecordSrvEntity confCodecRecordSrv, HttpServletRequest request) {
   AjaxJson j = new AjaxJson();
   if (StringUtil.isNotEmpty(confCodecRecordSrv.getId())) {
     message = "编码器录制服务器关系更新成功";
     ConfCodecRecordSrvEntity t =
         confCodecRecordSrvService.get(ConfCodecRecordSrvEntity.class, confCodecRecordSrv.getId());
     try {
       MyBeanUtils.copyBeanNotNull2Bean(confCodecRecordSrv, t);
       confCodecRecordSrvService.saveOrUpdate(t);
       systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
     } catch (Exception e) {
       e.printStackTrace();
       message = "编码器录制服务器关系更新失败";
     }
   } else {
     message = "编码器录制服务器关系添加成功";
     confCodecRecordSrvService.save(confCodecRecordSrv);
     systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
   }
   j.setMsg(message);
   return j;
 }
  @RequestMapping(params = "whouesed")
  public ModelAndView whouesed(
      HttpServletRequest req,
      String id,
      String meetingType,
      String excepts,
      String appointmentStarttime,
      String appointmentDuration) {
    // 获取改组当中所有冲突的终端列表
    List<TerminalInfoEntity> terminals =
        terminalInfoService.getConflicts(
            id, meetingType, appointmentStarttime, appointmentDuration);
    // 直播会议
    if (SystemType.APP_MEETING_TYPE_1.equals(meetingType)) {
      List<MeetingInfoEntity> meetings = new ArrayList<MeetingInfoEntity>();
      for (TerminalInfoEntity t : terminals) {
        List<AuthGroupTerminalEntity> gts =
            systemService.findByProperty(AuthGroupTerminalEntity.class, "terminalid", t.getId());
        for (AuthGroupTerminalEntity agt : gts) {
          // 获取分组id
          String groupid = agt.getAuthid();
          if (StringUtil.isNotEmpty(groupid)) {
            List<AppointmentChannelInfoEntity> channels =
                systemService.findByProperty(
                    AppointmentChannelInfoEntity.class, "authortiyGroupCid", groupid);
            for (AppointmentChannelInfoEntity c : channels) {
              String meetingid = c.getMeetingid();
              MeetingInfoEntity meeting = systemService.get(MeetingInfoEntity.class, meetingid);
              if (null != meeting
                  && !meetings.contains(meeting)
                  && Integer.valueOf(SystemType.MEETING_STATE_4) != meeting.getMeetingstate()) {
                meetings.add(meeting);
              } else continue;
            }
          } else continue;
        }
      }
      req.setAttribute("conflictMeetings", meetings);

    } else if (SystemType.APP_MEETING_TYPE_3.equals(meetingType)
        && StringUtil.isNotEmpty(appointmentStarttime)
        && StringUtil.isNotEmpty(appointmentDuration)) { // 预约会议
      List<AppointmentMeetingInfoEntity> meetings = new ArrayList<AppointmentMeetingInfoEntity>();
      for (TerminalInfoEntity t : terminals) {
        List<AuthGroupTerminalEntity> gts =
            systemService.findByProperty(AuthGroupTerminalEntity.class, "terminalid", t.getId());
        for (AuthGroupTerminalEntity agt : gts) {
          // 获取分组id
          String groupid = agt.getAuthid();
          if (StringUtil.isNotEmpty(groupid)) {
            List<AppointmentChannelInfoEntity> channels =
                systemService.findByProperty(
                    AppointmentChannelInfoEntity.class, "authortiyGroupCid", groupid);
            for (AppointmentChannelInfoEntity c : channels) {
              String meetingid = c.getAppointmentid();
              AppointmentMeetingInfoEntity meeting =
                  systemService.get(AppointmentMeetingInfoEntity.class, meetingid);
              if (null != meeting && !meetings.contains(meeting)) {
                meetings.add(meeting);
              } else continue;
            }
          } else continue;
        }
      }
      req.setAttribute("conflictMeetings", meetings);
    }
    return new ModelAndView("vod/meetinginfo/conflictMeetingInfo");
  }