예제 #1
0
 /**
  * 增加罚款信息
  *
  * @param map
  * @param request
  */
 public void addFine(Map map, HttpServletRequest request) {
   Object tmxxdm = map.get("tmxxdm");
   String dm = tmxxdm == null ? "" : tmxxdm.toString();
   Ts0603 ts0603 = new Ts0603();
   ts0603.setTmxxdm(dm);
   Ts0601 ts0601 = new Ts0601();
   ts0601.setDzbh(map.get("dzbh").toString());
   ts0603.setTs0601(ts0601);
   ts0603.setRq(new Date());
   ts0603.setJe(Double.valueOf(map.get("je").toString()));
   ZzdDzzmlb dzzmlb = new ZzdDzzmlb();
   dzzmlb.setDm(map.get("zmlb").toString());
   ts0603.setZzdDzzmlb(dzzmlb); // 读者账目类别
   this.singleGenericHibernateDAO.save(ts0603, request);
 }
예제 #2
0
 /**
  * 执行借书
  *
  * @param map
  * @param request
  */
 public void execBorrowBook(Map map, HttpServletRequest request) {
   String dzbh = map.get("dzbh").toString();
   Ts0501 ts0501 = new Ts0501();
   Ts0402 ts0402 = new Ts0402();
   ts0402.setTmxxdm(map.get("tmxxdm").toString());
   ts0501.setTs0402(ts0402);
   Ts0601 ts0601 = new Ts0601();
   ts0601.setDzbh(dzbh);
   ts0501.setTs0601(ts0601);
   ts0501.setJcsj(new Date());
   ts0501.setYhsj(getAfterDate(new Date(), 30));
   ts0501.setXhsj(getAfterDate(new Date(), 31));
   ts0501.setJhzt("i"); // 借
   ts0501.setXjcs(0);
   ts0501.setChcs(0);
   this.singleGenericHibernateDAO.save(ts0501); // 登记流通信息
   this.singleGenericHibernateDAO.updateByHql(
       "update Ts0601 set kjcs=kjcs-1,yjcs=NVL(yjcs,0)+1 where dzbh='" + dzbh + "'", null); // 可借册数
   this.singleGenericHibernateDAO.updateByHql("", null); // 库存量
 }