public ActionForward insert( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws AppException { License license = (License) form; String forwardPage = ""; Inform inf = new Inform(); try { License tempLicense = new License(); tempLicense.setLicenseNo(license.getLicenseNo()); tempLicense.setCompanyNo(license.getCompanyNo()); tempLicense.setIssued(new Timestamp(System.currentTimeMillis())); tempLicense.setNotafter(DateUtil.getTimestamp(license.getUpdateDate(), "yyyy-mm-dd")); tempLicense.setLicenseType(license.getLicenseType()); tempLicense.setStaffNum(license.getStaffNum()); tempLicense.setMemo(license.getMemo()); tempLicense.setStatus(license.getStatus()); tempLicense.setUpdateTime(new Timestamp(System.currentTimeMillis())); licenseBiz.save(tempLicense); request.setAttribute("license", tempLicense); inf.setMessage("您已经成功添加了授权!"); inf.setForwardPage("/right/licenseList.do"); inf.setParamId("thisAction"); inf.setParamValue("list"); } catch (Exception ex) { inf.setMessage("添加授权出错!错误信息是:" + ex.getMessage()); } return forwardInformPage(inf, mapping, request); }
public String getMaturityDate() { if (this.maturityTime != null && "".equals(maturityTime) == false) { Date tempDate = new Date(maturityTime.getTime()); String mydate = DateUtil.getDateString(tempDate, "yyyy-MM-dd"); return mydate; } return maturityDate; }
public String getBusinessDate() { String mydate = ""; if (this.businessTime != null && "".equals(businessTime) == false) { Date tempDate = new Date(businessTime.getTime()); mydate = DateUtil.getDateString(tempDate, "yyyy-MM-dd"); } return mydate; }