@SuppressWarnings("deprecation") protected void spFixOnline(Map params) { try { int branchId = ((Integer) params.get("branch.id")).intValue(); String departNo = (String) params.get("depart.no"); String type = (String) params.get("type"); String personNo = (String) params.get("person.no"); String itemNo = (String) params.get("item.no"); String date = CommonUtil.formatCalendar("yyyy/MM/dd", ObjectUtil.toCalendar(params.get("date"))); double value = ((Double) params.get("value")).doubleValue(); String doPerson = (String) params.get("doPerson"); String doDate = CommonUtil.formatCalendar("yyyy/MM/dd", ObjectUtil.toCalendar(params.get("doDate"))); Connection conn = getSession().connection(); CallableStatement cs = conn.prepareCall("{call SP_HRSAL_FIXONLINE(?, ?, ?, ?, ?, ?, ?, ?, ?)}"); int index = 1; cs.setInt(index++, branchId); cs.setString(index++, departNo); cs.setString(index++, type); cs.setString(index++, personNo); cs.setString(index++, itemNo); cs.setString(index++, date); cs.setDouble(index++, value); cs.setString(index++, doPerson); cs.setString(index++, doDate); cs.execute(); } catch (Exception e) { throw new HibernateException(e); } /* Query q = getSession().getNamedQuery("HRSAL_FIXONLINE") .setParameter("branchId", params.get("branch.id")) .setParameter("departNo", params.get("depart.no")) .setParameter("type", params.get("type")) .setParameter("personNo", params.get("person.no")) .setParameter("itemNo", params.get("item.no")) .setParameter("date", CommonUtil.formatCalendar("yyyy/MM/dd", ObjectUtil.toCalendar(params.get("date")))) .setParameter("value", params.get("value")) .setParameter("doPerson", params.get("doPerson")) .setParameter("doDate", CommonUtil.formatCalendar("yyyy/MM/dd", ObjectUtil.toCalendar(params.get("doDate")))); q.uniqueResult(); */ }
public static final void test9() { String HD_TRANSGRESS = "A"; String head = CommonUtil.formatCalendar("'" + HD_TRANSGRESS + "'yy'-'", Calendar.getInstance()); String ret = CommonServiceUtil.getSafetyAccNo(4, HD_TRANSGRESS, head); System.out.println("transgress' ref no: " + ret); System.out.println(CommonServiceUtil.class.getSimpleName()); List ret1 = CommonServiceUtil.getCloseList(4); System.out.println(ret1.size()); }
public static final void test10() { SecurityLimit limit = new SecurityLimit(); limit.setId(new SecurityLimitPK(4, 8)); Calendar cal = Calendar.getInstance(); cal.set(2009, 0, 1, 0, 0, 0); cal.set(Calendar.HOUR, -12); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); System.out.println("date from :" + CommonUtil.formatCalendar("yyyy-MM-dd", cal)); Date date = cal.getTime(); System.out.println("date :" + date); String[] order = {"depart.id", "line.id", "equipment.id", "downDate"}; List a = BaseServiceUtil.getEquOnlinesForSafetyTree(limit, cal, order); System.out.println("EquOnlines List size: " + a.size()); for (int i = 0; i < a.size(); i++) { EquOnline obj = (EquOnline) a.get(i); if (obj.getLine() == null) { System.out.println( "dept:" + obj.getDepart().getName() + " bus:" + obj.getEquipment().getUseId() + " ondate:" + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getOnDate()) + " downdate:" + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getDownDate())); } else { System.out.println( "dept:" + obj.getDepart().getName() + " line:" + obj.getLine().getNo() + " bus:" + obj.getEquipment().getUseId() + " ondate:" + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getOnDate()) + " downdate:" + CommonUtil.formatCalendar("yyyy-MM-dd", obj.getDownDate())); } } }