You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

package com.fr.plugin.xx.zyjn.dao;
import com.fr.plugin.xx.zyjn.SyncDBAccessProvider;
import com.fr.plugin.xx.zyjn.entity.SyncOrgEntity;
import com.fr.plugin.xx.zyjn.entity.SyncUserEntity;
import com.fr.plugin.xx.zyjn.utils.LogUtils;
import com.fr.stable.db.action.DBAction;
/**
* @Author xx
* @Date 2022/10/12
* @Description
**/
public class SyncService {
public static void saveUser(SyncUserEntity entity) {
try {
SyncDBAccessProvider.getDbAccessor().runDMLAction((DBAction) daoContext -> {
daoContext.getDAO(SyncUserDao.class).addOrUpdate(entity);
return null;
});
} catch (Exception e) {
LogUtils.error(e.getMessage(), e);
}
}
public static void saveOrg(SyncOrgEntity entity) {
try {
SyncDBAccessProvider.getDbAccessor().runDMLAction((DBAction) daoContext -> {
daoContext.getDAO(SyncOrgDao.class).addOrUpdate(entity);
return null;
});
} catch (Exception e) {
LogUtils.error(e.getMessage(), e);
}
}
}