예제 #1
0
 /*     */ public Integer add(EopUser user, EopSite site, String domain) {
   /*  86 */ int userid = user.getId().intValue();
   /*  87 */ site.setUserid(Integer.valueOf(userid));
   /*     */
   /*  89 */ if (site.getIcofile() == null) {
     /*  90 */ site.setIcofile(EopSetting.IMG_SERVER_DOMAIN + "/images/default/favicon.ico");
     /*     */ }
   /*  92 */ if (site.getLogofile() == null) {
     /*  93 */ site.setLogofile(EopSetting.IMG_SERVER_DOMAIN + "/images/default/logo.gif");
     /*     */ }
   /*     */
   /*  96 */ site.setPoint(1000);
   /*     */
   /*  99 */ site.setCreatetime(Long.valueOf(DateUtil.getDateline()));
   /* 100 */ site.setLastlogin(Long.valueOf(0L));
   /* 101 */ site.setLastgetpoint(DateUtil.getDateline());
   /*     */
   /* 104 */ this.daoSupport.insert("eop_site", site);
   /* 105 */ Integer siteid = Integer.valueOf(this.daoSupport.getLastId("eop_site"));
   /*     */
   /* 107 */ EopSiteDomain eopSiteDomain = new EopSiteDomain();
   /* 108 */ eopSiteDomain.setDomain(domain);
   /* 109 */ eopSiteDomain.setSiteid(siteid);
   /* 110 */ eopSiteDomain.setUserid(Integer.valueOf(userid));
   /*     */
   /* 113 */ addDomain(eopSiteDomain);
   /*     */
   /* 115 */ return siteid;
   /*     */ }
예제 #2
0
 /*     */ public static void main(String[] args) {
   /* 692 */ int one =
       (int) (DateUtil.toDate("2010-09-14 12:00:01", "yyyy-MM-dd HH:mm:ss").getTime() / 1000L);
   /*     */
   /* 694 */ int two =
       (int) (DateUtil.toDate("2010-09-14 14:00:01", "yyyy-MM-dd HH:mm:ss").getTime() / 1000L);
   /*     */
   /* 696 */ int three =
       (int) (DateUtil.toDate("2010-09-15 16:00:01", "yyyy-MM-dd HH:mm:ss").getTime() / 1000L);
   /*     */
   /* 699 */ System.out.println(one / 86400);
   /* 700 */ System.out.println(two / 86400);
   /* 701 */ System.out.println(three / 86400);
   /*     */ }
예제 #3
0
 /*    */ public void onAfterOrderCreate(Order order, List<CartItem> itemList, String sessionid)
       /*    */ {
   /* 41 */ IUserService userService = UserServiceFactory.getUserService();
   /* 42 */ Member member = userService.getCurrentMember();
   /* 43 */ if (member != null)
   /*    */ {
     /* 46 */ EopSite site = EopContext.getContext().getCurrentSite();
     /*    */
     /* 48 */ HttpServletRequest request = ThreadContextHolder.getHttpRequest();
     /*    */
     /* 50 */ String domain = RequestUtil.getDomain();
     /*    */
     /* 52 */ EmailModel emailModel = new EmailModel();
     /* 53 */ emailModel.getData().put("username", member.getUname());
     /* 54 */ emailModel.getData().put("sn", order.getSn());
     /* 55 */ emailModel
         .getData()
         .put("createtime", DateUtil.toString(order.getCreate_time(), "yyyy-MM-dd HH:mm:ss"));
     /* 56 */ emailModel.getData().put("sitename", site.getSitename());
     /* 57 */ emailModel.getData().put("logo", site.getLogofile());
     /* 58 */ emailModel.getData().put("domain", domain);
     /*    */
     /* 60 */ emailModel.setTitle("订单提交成功--" + site.getSitename());
     /* 61 */ emailModel.setTo(member.getEmail());
     /* 62 */ emailModel.setTemplate("order_create_email_template.html");
     /* 63 */ this.mailMessageProducer.send(emailModel);
     /*    */ }
   /*    */ }
예제 #4
0
 /*     */ public int getPoint(Integer id, int point) /*     */ {
   /* 489 */ EopSite site = EopContext.getContext().getCurrentSite();
   /* 490 */ long lastgetpoint = site.getLastgetpoint();
   /* 491 */ long now = (int) (System.currentTimeMillis() / 1000L);
   /* 492 */ int onemonth = 2592000;
   /* 493 */ if (now - lastgetpoint > onemonth) {
     /* 494 */ this.daoSupport.execute(
         "update eop_site set point=point+? where id=?",
         new Object[] {Integer.valueOf(point), id});
     /*     */
     /* 496 */ site.setPoint(site.getPoint() + point);
     /* 497 */ site.setLastgetpoint(DateUtil.getDateline());
     /* 498 */ this.daoSupport.execute(
         "update eop_site set lastgetpoint=? where id=?",
         new Object[] {Integer.valueOf(DateUtil.getDateline()), id});
     /*     */
     /* 502 */ return 1;
     /*     */ }
   /* 504 */ return 0;
   /*     */ }
예제 #5
0
 /*     */ public String onReturn() /*     */ {
   /* 107 */ HttpServletRequest request = ThreadContextHolder.getHttpRequest();
   /* 108 */ String ordersn = request.getParameter("ordersn");
   /*     */ try
   /*     */ {
     /* 111 */ paySuccess(ordersn, "" + DateUtil.getDateline());
     /*     */ } catch (RuntimeException e) {
     /* 113 */ if (this.logger.isDebugEnabled()) {
       /* 114 */ this.logger.debug(e.getMessage(), e);
       /*     */ }
     /* 116 */ return e.getMessage();
     /*     */ }
   /*     */
   /* 119 */ return ordersn;
   /*     */ }
예제 #6
0
 /*     */ public String onCallBack() /*     */ {
   /*  36 */ HttpServletRequest request = ThreadContextHolder.getHttpRequest();
   /*  37 */ String ordersn = request.getParameter("ordersn");
   /*     */ try
   /*     */ {
     /*  40 */ paySuccess(ordersn, "" + DateUtil.getDateline());
     /*     */ } catch (RuntimeException e) {
     /*  42 */ if (this.logger.isDebugEnabled()) {
       /*  43 */ this.logger.debug(e.getMessage(), e);
       /*     */ }
     /*  45 */ return e.getMessage();
     /*     */ }
   /*     */
   /*  48 */ return "支付成功";
   /*     */ }