Exemplo n.º 1
0
 public static final boolean changeStatus(OrderInfo order) {
   OrderInfo model =
       OrderInfo.dao.findFirst(
           "select * from orderInfo where deleted=0 and uuid=?", order.getStr("uid"));
   if (model != null) {
     model.set("status", order.getStatus());
     return model.save();
   }
   return false;
 }
Exemplo n.º 2
0
 @Before(Tx.class)
 public static final boolean create(OrderInfo order) {
   ModelUtil.generateUUID(order);
   order.set("createTime", new Date());
   for (OrderInfoDetail detail : order.getDetails()) {
     ModelUtil.generateUUID(detail);
     detail.setOrderId(order.getStr("uid"));
     detail.save();
   }
   return order.save();
 }