public Map getMachineInfo(String machineId) { if (!WebUtil.isNumeric(machineId)) { return null; } List<Machine> l = this.getHibernateTemplate().find("from Machine m where m.id = ?", new Integer(machineId)); if (WebUtil.isNullForList(l)) return null; Map<String, String> status = getMachineStatus(); Machine m = l.get(0); Map<String, String> result = new HashMap(); result.put("MachineId", m.getId().toString()); result.put("MachineNo", m.getMachineNo()); result.put("PpsNo", m.getPpsNo()); result.put("ServiceFromDate", WebUtil.formatDateString(m.getServiceFromDate(), "yyyy-MM-dd")); result.put("ServiceEndDate", WebUtil.formatDateString(m.getServiceEndDate(), "yyyy-MM-dd")); result.put("OutDate", WebUtil.formatDateString(m.getOutDate(), "yyyy-MM-dd")); result.put("InvoiceDate", WebUtil.formatDateString(m.getInvoiceDate(), "yyyy-MM-dd")); result.put("PaymentStatus", m.getPaymentStatus()); result.put("PaymentCompany", m.getPaymentCompany()); result.put("PaymentCompanyCd", m.getPaymentCompanyCd()); result.put("PaymentDate", WebUtil.formatDateString(m.getPaymentDate(), "yyyy-MM-dd")); if (WebUtil.isNotNull(m.getPaymentAmt())) result.put("PaymentAmt", m.getPaymentAmt().toString()); result.put("LastTime", WebUtil.formatDateString(m.getLastTime(), "yyyy-MM-dd")); if (WebUtil.isNotNull(m.getLastCompanyId())) { List<Company> cl = this.getHibernateTemplate() .find("from Company where Status = 'NORMAL' and id = " + m.getLastCompanyId()); if (!WebUtil.isNullForList(cl)) { Company c = cl.get(0); result.put("LastCompanyName", c.getCompanyName()); result.put("LastCompanyId", m.getLastCompanyId().toString()); } } result.put("MachineStatus", m.getStatus()); result.put("MachineStatusName", status.get(m.getStatus())); if (m.getMachineTypeId() != null) { List<MachineType> mtList = this.getHibernateTemplate() .find("from MachineType where Status = 'NORMAL' and id = " + m.getMachineTypeId()); if (!WebUtil.isNullForList(mtList)) { MachineType mt = mtList.get(0); result.put("MachineTypeId", m.getMachineTypeId().toString()); result.put("MachineType", mt.getMachineType()); result.put("MachineCd", mt.getMachineCd()); } } result.put("Origin", m.getOrigin()); result.put("CustomerNo", m.getCustomerNo()); result.put("CustomerName", m.getCustomerName()); return result; }