Ejemplo n.º 1
0
 /*
  * 判断是需要生效
  * 当委托处于启用状态,并且当前日期在生效日期和截至日期之间时就需要生效
  */
 public boolean needEfficient(TrustRecord dm) {
   return dm.getState() == TrustRecordState.STARTED
       && dm.getBeginTime().compareTo(new Date(System.currentTimeMillis())) <= 0
       && dm.getEndTime().compareTo(new Date(System.currentTimeMillis())) >= 0;
 }
Ejemplo n.º 2
0
 /*
  * 判断是需要结束委托
  * 当委托处于生效状态,并且当前日期大于或等于截至日期时就需要结束
  */
 public boolean needEnd(TrustRecord dm) {
   return (dm.getState() == TrustRecordState.EFFICIENT
           || dm.getState() == TrustRecordState.STARTED)
       && dm.getEndTime().compareTo(new Date(System.currentTimeMillis())) <= 0;
 }