| | |
| | | package cn.com.basic.face.service.sync.down;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | |
|
| | | import cn.com.basic.face.discern.common.ResultBean;
|
| | | import cn.com.basic.face.service.sqlite.SynchronRecordDao;
|
| | | import cn.com.basic.face.service.sync.up.BaseSync;
|
| | |
|
| | | import static cn.com.basic.face.discern.entity.VisitTableSynchronRecord.FieldNames.tableName;
|
| | |
|
| | | public abstract class BaseDownSync extends BaseSync {
|
| | | public void sync() {
|
| | |
| | | }
|
| | |
|
| | | public void syncNext() {
|
| | | //System.out.println("sync."+this.getClass().getName()+" 正在向下同步");
|
| | | setSyncComplete(true);
|
| | | if (getNext() != null) {
|
| | | getNext().sync();
|
| | | }
|
| | | }
|
| | |
|
| | | public void handleSynDate(ResultBean rb,String tableName){
|
| | | Long time=(Long)rb.getData();
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | String synTime = format.format(time);
|
| | | if(SynchronRecordDao.getInstance().getSynRecord(tableName)==null){
|
| | | SynchronRecordDao.getInstance().insertSynRecord(tableName,synTime);
|
| | | }else{
|
| | | SynchronRecordDao.getInstance().updateSynRecord(tableName,synTime);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|