use of cn.cerc.jdb.core.TDateTime in project summer-bean by cn-cerc.
the class BookDataList method check.
public void check(IBookData data) {
TDateTime dateFrom = section.getDateFrom();
TDateTime dateTo = section.getDateTo();
String s1 = dateFrom.getDate();
String s2 = dateTo.getDate();
String s3 = data.getDate().getDate();
if (s1.compareTo(s3) > 0)
throw new RuntimeException(String.format("日期错误:对象日期 %s 不能小于起始日期 %s", data.getDate(), dateFrom));
if (s2.compareTo(s3) < 0)
throw new RuntimeException(String.format("日期错误:对象日期 %s 不能大于结束日期 %s", data.getDate(), dateTo));
if (!data.check())
throw new RuntimeException("对象记录有误,无法作业:" + new Gson().toJson(data));
}
use of cn.cerc.jdb.core.TDateTime in project summer-bean by cn-cerc.
the class BookDataList method main.
public static void main(String[] args) {
TDateTime dateFrom = TDateTime.Now().incDay(1);
System.out.println(TDateTime.Now().compareDay(dateFrom));
}
use of cn.cerc.jdb.core.TDateTime in project summer-mis by cn-cerc.
the class AbstractField method getDate.
public TDate getDate() {
String val = this.getString();
if (val == null)
return null;
TDateTime obj = TDateTime.fromDate(val);
if (obj == null)
return null;
return new TDate(obj.getData());
}