示例#1
0
  private User setEntity(HttpServletRequest request) throws Exception {
    User user = (User) ParamUtil.getSessionAttr(request, "LOGIN_USER");
    if (user == null) throw new Exception(MessageConsts.MSG_COMMON_SESSION_TIMEOUT);
    String userId = user.getxLOGIN_ID();
    User entity = new User();

    DeptHelper deptHelper = AppContextUtil.getAppContext().getBean("deptHelper", DeptHelper.class);
    String deptId = ParamUtil.getString(request, "deptId");
    Dept dept = deptHelper.getByXID(Integer.valueOf(deptId), true);
    // ParamUtil.setSessionAttr(request, "dept", dept);
    String createUserLoginId = ParamUtil.getString(request, "createUserLoginId");
    String createUserDisplayName = ParamUtil.getString(request, "createUserDisplayName");
    String createUserPWD = ParamUtil.getString(request, "createUserPWD");
    String sourcexID = ParamUtil.getString(request, "xID");

    if (!StringUtil.isEmpty(sourcexID)) {
      entity.setxID(Integer.valueOf(sourcexID));
      entity.setxUPDATE_ID(userId);
    } else {
      entity.setxCREATER_ID(userId);
    }

    entity.setxDEPT_xID(Integer.valueOf(deptId));
    entity.setxPRIVILEGE_xID(dept.getPrivilege().getxID());
    entity.setxPRIVILEGE_xNAME(dept.getPrivilege().getxPRIVILEGE_NAME());
    entity.setxLOGIN_ID(createUserLoginId);
    entity.setxDISPLAY_NAME(createUserDisplayName);
    entity.setxPWD(createUserPWD);

    return entity;
  }
示例#2
0
 public List<CompanyPrincipal> getCompanyPrincipalByCompanyID(
     String companyPrincipalText, int companyId) {
   CompanyPrincipalDao companyPrincipalDao =
       AppContextUtil.getAppContext().getBean("companyPrincipalDao", CompanyPrincipalDao.class);
   Map<String, Object> param = new HashMap<String, Object>();
   if (!StringUtil.isEmpty(companyPrincipalText)) {
     param.put("xNAME_TEXT", companyPrincipalText);
   }
   if (companyId > 0) {
     param.put("xCOMPANY_xID", companyId);
   }
   return companyPrincipalDao.select(param);
 }
示例#3
0
  private Payment setEntity(HttpServletRequest request) throws Exception {
    User user = (User) ParamUtil.getSessionAttr(request, "LOGIN_USER");
    if (user == null) throw new Exception(MessageConsts.MSG_COMMON_SESSION_TIMEOUT);
    String userId = user.getxLOGIN_ID();
    Payment entity = new Payment();
    int companyPrincipleId = ParamUtil.getInt(request, "companyPrincipleId");
    int projectId = ParamUtil.getInt(request, "projectId");
    int companyId = -1;

    CompanyPrincipalHelper companyPrincipalHelper =
        AppContextUtil.getAppContext()
            .getBean("companyPrincipalHelper", CompanyPrincipalHelper.class);
    CompanyPrincipal companyPrincipal =
        companyPrincipalHelper.getCompanyPrincipal(companyPrincipleId);
    if (companyPrincipal != null) {
      companyId = companyPrincipal.getxCOMPANY_xID();
    }

    double payAmt = ParamUtil.getDouble(request, "payAmt");
    Date payDate = ParamUtil.getDate(request, "payDate");
    String sourcexID = ParamUtil.getString(request, "xID");
    /*		String paymentWhat = URLDecoder.decode(ParamUtil.getString(request, "paymentWhat"), "utf-8");
    String remark = URLDecoder.decode(ParamUtil.getString(request, "remark"), "utf-8");*/

    String paymentWhat = ParamUtil.getString(request, "paymentWhat");
    String remark = ParamUtil.getString(request, "remark");

    if (!StringUtil.isEmpty(sourcexID)) {
      entity.setxID(Integer.valueOf(sourcexID));
      entity.setxUPDATE_ID(userId);
    } else {
      entity.setxCREATER_ID(userId);
    }
    entity.setxPAY_AMT(payAmt);
    entity.setxPAY_DATE(payDate);
    entity.setxPAY_REASON(paymentWhat);
    entity.setxREMARK(remark);
    entity.setxCOMPANY_PRINCIPAL_xID(companyPrincipleId);
    entity.setxPROJECT_xID(projectId);
    entity.setxCOMPANY_xID(companyId);

    return entity;
  }