Package org.g4studio.core.metatype

Examples of org.g4studio.core.metatype.Dto


   * @throws Exception
   */
  public ActionForward saveTheSubmitInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    BaseActionForm aForm = (BaseActionForm)form;
    Dto dto = aForm.getParamAsDto(request);
    System.out.println("接收到的表单提交参数:\n" + dto);
    setOkTipMsg("数据提交成功:" + dto.toString(), response);
    return mapping.findForward(null);
  }
View Full Code Here


   * @throws Exception
   */
  public ActionForward saveTheSubmitInfoBasedAjaxRequest(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    BaseActionForm aForm = (BaseActionForm)form;
    Dto dto = aForm.getParamAsDto(request);
    System.out.println("接收到的表单提交参数:\n" + dto);
    setOkTipMsg("数据提交成功:" + dto.toString(), response);
    return mapping.findForward(null);
  }
View Full Code Here

   * @return
   * @throws Exception
   */
  public ActionForward loadCallBack(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    Dto outDto = new BaseDto();
    outDto.put("text1", "熊春");
    outDto.put("text2", "托尼贾");
    String jsonString = JsonHelper.encodeDto2FormLoadJson(outDto, null);
    super.write(jsonString, response);
    return mapping.findForward(null);
  }
View Full Code Here

   * @return
   */
  public ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    super.removeSessionAttribute(request, "deptid");
    Dto inDto = new BaseDto();
    String deptid = super.getSessionContainer(request).getUserInfo().getDeptid();
    inDto.put("deptid", deptid);
    Dto outDto = organizationService.queryDeptinfoByDeptid(inDto);
    request.setAttribute("rootDeptid", outDto.getAsString("deptid"));
    request.setAttribute("rootDeptname", outDto.getAsString("deptname"));
    Dto dto = (Dto)g4Reader.queryForObject("Resource.queryEamenuByMenuID", "01");
    request.setAttribute("rootMenuName", dto.getAsString("menuname"));
    return mapping.findForward("initView");
  }
View Full Code Here

   * @param
   * @return
   */
  public ActionForward doUpload(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    Dto outDto = new BaseDto();
    BaseActionForm cForm = (BaseActionForm) form;
    // 单个文件,如果是多个就cForm.getFile2()....支持最多5个文件
    FormFile myFile = cForm.getFile1();
    // 获取web应用根路径,也可以直接指定服务器任意盘符路径
    String savePath = getServlet().getServletContext().getRealPath("/") + "/upload/demo/";
    //String savePath = "d:/upload/";
    // 检查路径是否存在,如果不存在则创建之
    File file = new File(savePath);
    if (!file.exists()) {
      file.mkdir();
    }
    String type = myFile.getFileName().substring(myFile.getFileName().lastIndexOf("."));
    // 文件真实文件名
    String fileName = getSessionContainer(request).getUserInfo().getUserid();
    fileName = fileName + "_" + G4Utils.getCurrentTime("yyyyMMddhhmmss") + type;
    // 我们一般会根据某种命名规则对其进行重命名
    // String fileName = ;
    File fileToCreate = new File(savePath, fileName);
    if (myFile.getFileSize() > 204800) {
      outDto.put("success", new Boolean(true));
      outDto.put("msg", "文件上传失败,你只能上传小于100KB的图片文件");
      outDto.put("state", "error");
    }else {
      // 检查同名文件是否存在,不存在则将文件流写入文件磁盘系统
      if (!fileToCreate.exists()) {
        FileOutputStream os = new FileOutputStream(fileToCreate);
        os.write(myFile.getFileData());
        os.flush();
        os.close();
      }
      outDto.put("success", new Boolean(true));
      outDto.put("msg", "文件上传成功");
      outDto.put("state", "ok");
      outDto.put("aUrl", request.getContextPath() + "/upload/demo/" + fileName);
    }
    write(outDto.toJson(), response);
    return mapping.findForward(null);
  }
View Full Code Here

   * @param
   * @return
   */
  public ActionForward departmentTreeInit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    Dto dto = new BaseDto();
    String nodeid = request.getParameter("node");
    dto.put("parentid", nodeid);
    Dto outDto = organizationService.queryDeptItems(dto);
    write(outDto.getAsString("jsonString"), response);
    return mapping.findForward(null);
  }
View Full Code Here

   * @return
   */
  public ActionForward queryParts(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    BaseActionForm cForm = (BaseActionForm)form;
    Dto dto = cForm.getParamAsDto(request);
    List list = g4Reader.queryForPage("Part.queryParts", dto);
    Integer countInteger = (Integer) g4Reader.queryForObject("Part.queryPartsForPageCount", dto);
    for (int i = 0; i < list.size(); i++) {
      Dto partDto = (BaseDto)list.get(i);
      dto.put("partid", partDto.getAsString("partid"));
      Dto outDto = (BaseDto)g4Reader.queryForObject("Part.queryPart4RoleGrant", dto);
      if (G4Utils.isEmpty(outDto)) {
        partDto.put("partauthtype", SystemConstants.PARTAUTHTYPE_NOGRANT);
      }else {
        partDto.putAll(outDto);
      }
View Full Code Here

   */
  public ActionForward savePartUserGrantDatas(ActionMapping mapping, ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    BaseActionForm aForm = (BaseActionForm) form;
    List list  = aForm.getGridDirtyData(request);
    Dto inDto = new BaseDto();
    inDto.setDefaultAList(list);
    if (!isDemoMode(response)) {
      partService.savePartRoleGrantDatas(inDto);
      setOkTipMsg("授权数据保存成功", response);
    }
    return mapping.findForward(null);
View Full Code Here

   *
   * @param pDto
   * @return
   */
  public Dto saveDirtyDatas(Dto pDto){
    Dto outDto = new BaseDto();
    List list = pDto.getDefaultAList();
    if(!checkUniqueIndex(list)){
      outDto.setSuccess(G4Constants.FALSE);
      return outDto;
    }
    for (int i = 0; i < list.size(); i++) {
      Dto dto = (BaseDto)list.get(i);
      if (dto.getAsString("remark").equals("null")) {
        dto.put("remark", "");
      }
      if (dto.getAsString("dirtytype").equalsIgnoreCase("1")) {
        dto.put("partid", IDHelper.getPartID());
        g4Dao.insert("Part.savePartItem", dto);
      }else {
        g4Dao.update("Part.updatePartItem", dto);
      }
    }
View Full Code Here

   * @return
   */
  public Dto savePartUserGrantDatas(Dto pDto){
    List list = pDto.getDefaultAList();
    for (int i = 0; i < list.size(); i++) {
      Dto lDto = (BaseDto)list.get(i);
      if (G4Utils.isEmpty(lDto.getAsString("authorizeid"))) {
        if (!lDto.getAsString("partauthtype").equals(SystemConstants.PARTAUTHTYPE_NOGRANT)) {
          lDto.put("authorizeid", IDHelper.getAuthorizeid4Eauserauthorize());
          g4Dao.insert("Part.insertEausermenupartItem", lDto);
        }
      }else {
        if (lDto.getAsString("partauthtype").equals(SystemConstants.PARTAUTHTYPE_NOGRANT)) {
          g4Dao.delete("Part.deleteEausermenupartItem", lDto);
        }else {
          g4Dao.update("Part.updateEausermenupartItem", lDto);
        }
      }
View Full Code Here

TOP

Related Classes of org.g4studio.core.metatype.Dto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.