Ejemplo n.º 1
0
  /** 查询 */
  public ActionForward queryAdcOvertimeItemForManage(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    BaseActionForm aForm = (BaseActionForm) form;
    Dto dto = aForm.getParamAsDto(request);
    String deptid = request.getParameter("deptid");
    if (G4Utils.isNotEmpty(deptid)) {
      setSessionAttribute(request, "deptid", deptid);
    }
    if (!G4Utils.isEmpty(request.getParameter("firstload"))) {
      dto.put("deptid", super.getSessionContainer(request).getUserInfo().getDeptid());
    } else {
      dto.put("deptid", super.getSessionAttribute(request, "deptid"));
    }
    dto.put("cascadeid", organizationService.queryCascadeidByDeptid(dto.getAsInteger("deptid")));
    dto.remove("deptid");
    super.setSessionAttribute(request, "QUERYADCOVERTIMEITEM_QUERYDTO", dto);
    List items = g4Reader.queryForPage("AdcOvertime.queryAdcOvertimeItemForManage", dto);
    Integer pageCount =
        (Integer)
            g4Reader.queryForObject("AdcOvertime.queryAdcOvertimeItemForManageForPageCount", dto);
    String jsonString =
        JsonHelper.encodeList2PageJson(items, pageCount, G4Constants.FORMAT_DateTime);
    write(jsonString, response);
    return mapping.findForward(null);
  }
Ejemplo n.º 2
0
 /**
  * 查询文件列表
  *
  * @param mapping
  * @param form
  * @param request
  * @param response
  * @return
  * @throws Exception
  */
 public ActionForward queryFileDatas(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   BaseActionForm aForm = (BaseActionForm) form;
   Dto dto = aForm.getParamAsDto(request);
   List list = g4Reader.queryForPage("Demo.queryFiles", dto);
   Integer countInteger = (Integer) g4Reader.queryForObject("Demo.countFiles", dto);
   String jsonString = JsonHelper.encodeList2PageJson(list, countInteger, null);
   super.write(jsonString, response);
   return mapping.findForward(null);
 }
Ejemplo n.º 3
0
 /**
  * 查询表格数据
  *
  * @param mapping
  * @param form
  * @param request
  * @param response
  * @return
  * @throws Exception
  */
 public ActionForward queryXsyjDatas(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm aForm = (CommonActionForm) form;
   Dto dto = aForm.getParamAsDto(request);
   List list = g4Reader.queryForPage("Demo.getFcfDataList", dto);
   String jsonString =
       JsonHelper.encodeList2PageJson(list, new Integer(12), G4Constants.FORMAT_Date);
   super.write(jsonString, response);
   return mapping.findForward(null);
 }
 /**
  * 查询部门信息生成部门树
  *
  * @param pDto
  * @return
  */
 public Dto queryDeptItems(Dto pDto) {
   Dto outDto = new BaseDto();
   List deptList = g4Dao.queryForList("Organization.queryDeptItemsByDto", pDto);
   Dto deptDto = new BaseDto();
   for (int i = 0; i < deptList.size(); i++) {
     deptDto = (BaseDto) deptList.get(i);
     if (deptDto.getAsString("leaf").equals(SystemConstants.LEAF_Y))
       deptDto.put("leaf", new Boolean(true));
     else deptDto.put("leaf", new Boolean(false));
     if (deptDto.getAsString("id").length() == 6) deptDto.put("expanded", new Boolean(true));
   }
   outDto.put("jsonString", JsonHelper.encodeObject2Json(deptList));
   return outDto;
 }
Ejemplo n.º 5
0
 /**
  * 查询参数列表
  *
  * @param
  * @return
  */
 public ActionForward queryParamsForManage(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm aForm = (CommonActionForm) form;
   Dto dto = aForm.getParamAsDto(request);
   List paramList = g4Reader.queryForPage("Param.queryParamsForManage", dto);
   Integer pageCount =
       (Integer) g4Reader.queryForObject("Param.queryParamsForManageForPageCount", dto);
   String jsonString = JsonHelper.encodeList2PageJson(paramList, pageCount, null);
   write(jsonString, response);
   return mapping.findForward(null);
 }
Ejemplo n.º 6
0
 /**
  * 内存同步
  *
  * @param
  * @return
  */
 public ActionForward synMemory(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm aForm = (CommonActionForm) form;
   List paramList = g4Reader.queryForList("Resource.getParamList");
   getServlet().getServletContext().removeAttribute("EAPARAMLIST");
   getServlet().getServletContext().setAttribute("EAPARAMLIST", paramList);
   Dto outDto = new BaseDto();
   outDto.put("success", new Boolean(true));
   write(JsonHelper.encodeObject2Json(outDto), response);
   return mapping.findForward(null);
 }
Ejemplo n.º 7
0
 /**
  * 加载当前登录用户信息
  *
  * @param
  * @return
  */
 public ActionForward loadUserInfo(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   UserInfoVo userInfoVo = getSessionContainer(request).getUserInfo();
   Dto inDto = new BaseDto();
   G4Utils.copyPropFromBean2Dto(userInfoVo, inDto);
   Dto outDto = (BaseDto) g4Reader.queryForObject("User.getUserInfoByKey", inDto);
   outDto.remove("password");
   String jsonString = JsonHelper.encodeDto2FormLoadJson(outDto, null);
   write(jsonString, response);
   return mapping.findForward(null);
 }
Ejemplo n.º 8
0
 /**
  * 保存用户自定义桌面背景
  *
  * @param
  * @return
  */
 public ActionForward saveUserBackground(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   Dto dto = new BaseDto();
   String background = request.getParameter("background");
   dto.put("userid", super.getSessionContainer(request).getUserInfo().getUserid());
   dto.put("background", background);
   Dto outDto = organizationService.saveUserBackground(dto);
   String jsonString = JsonHelper.encodeObject2Json(outDto);
   write(jsonString, response);
   return mapping.findForward(null);
 }
Ejemplo n.º 9
0
  /** 查询明细表 */
  public ActionForward queryAdcOvertimeDetailItemForManage(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    BaseActionForm aForm = (BaseActionForm) form;
    Dto dto = aForm.getParamAsDto(request);
    List items = g4Reader.queryForPage("AdcOvertime.queryAdcOvertimeDetailItemForManage", dto);
    Integer pageCount =
        (Integer)
            g4Reader.queryForObject(
                "AdcOvertime.queryAdcOvertimeDetailItemForManageForPageCount", dto);
    String jsonString = JsonHelper.encodeList2PageJson(items, pageCount, null);
    write(jsonString, response);
    return mapping.findForward(null);
  }
Ejemplo n.º 10
0
 /**
  * 保存用户自定义布局
  *
  * @param
  * @return
  */
 public ActionForward saveUserLayout(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   Dto dto = new BaseDto();
   String layout = request.getParameter("layout");
   dto.put("userid", super.getSessionContainer(request).getUserInfo().getUserid());
   dto.put("layout", layout);
   Dto outDto = organizationService.saveUserLayout(dto);
   UserInfoVo userInfoVo = getSessionContainer(request).getUserInfo();
   userInfoVo.setLayout(layout);
   getSessionContainer(request).setUserInfo(userInfoVo);
   String jsonString = JsonHelper.encodeObject2Json(outDto);
   write(jsonString, response);
   return mapping.findForward(null);
 }
Ejemplo n.º 11
0
 /**
  * 查询数据报表XML格式串
  *
  * @param mapping
  * @param form
  * @param request
  * @param response
  * @return
  * @throws Exception
  */
 public ActionForward queryReportXmlDatas(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm aForm = (CommonActionForm) form;
   Dto dto = aForm.getParamAsDto(request);
   String product = "(产品一)";
   if (dto.getAsString("product").equals("2")) {
     product = "(产品二)";
   }
   List list = g4Reader.queryForList("Demo.getFcfDataList", dto);
   // 实例化一个图形配置对象
   GraphConfig graphConfig = new GraphConfig();
   // 主标题
   graphConfig.setCaption("Google软件2010年月度销售业绩图表" + product);
   // X坐标轴名称
   graphConfig.setXAxisName("月度");
   // 数字值前缀
   graphConfig.setNumberPrefix("$");
   // 使用这种方式可以加入框架没有封装的原生报表属性,原生属可以参考《G4Studio开发指南》的相关章节
   // graphConfig.put("propertyName", "value");
   List dataList = new ArrayList();
   // 将原始数据对象转换为框架封装的Set报表数据对象
   for (int i = 0; i < list.size(); i++) {
     Dto dto1 = (BaseDto) list.get(i);
     // 实例化一个图表元数据对象
     Set set = new Set();
     set.setName(dto1.getAsString("name")); // 名称
     set.setValue(dto1.getAsString("value")); // 数据值
     set.setColor(dto1.getAsString("color")); // 柱状图颜色
     dataList.add(set);
   }
   // 将图表数据转为Flash能解析的XML资料格式
   String xmlString = FcfDataMapper.toFcfXmlData(dataList, graphConfig);
   Dto outDto = new BaseDto();
   outDto.put("success", new Boolean(true));
   outDto.put("xmlstring", xmlString);
   write(JsonHelper.encodeObject2Json(outDto), response);
   return mapping.findForward(null);
 }
Ejemplo n.º 12
0
  /** 查询 */
  public ActionForward queryAdcOvertimeItemForCheck(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    BaseActionForm aForm = (BaseActionForm) form;
    Dto dto = aForm.getParamAsDto(request);
    String deptid = request.getParameter("deptid");
    if (G4Utils.isEmpty(deptid)) {
      dto.put("deptid", super.getSessionContainer(request).getUserInfo().getDeptid());
    }
    List items = g4Reader.queryForPage("AdcOvertime.queryAdcOvertimeItemForCheck", dto);
    Integer pageCount =
        (Integer)
            g4Reader.queryForObject("AdcOvertime.queryAdcOvertimeItemForCheckForPageCount", dto);
    String jsonString = JsonHelper.encodeList2PageJson(items, pageCount, null);
    write(jsonString, response);
    return mapping.findForward(null);
  }