package com.product.admin.service;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
import com.product.admin.config.CmnConst;
|
import com.product.common.lang.StringUtils;
|
import com.product.core.dao.BaseDao;
|
import com.product.core.entity.DataTableEntity;
|
import com.product.core.entity.FieldSetEntity;
|
import com.product.core.exception.BaseException;
|
import com.product.core.service.support.AbstractBaseService;
|
import com.product.core.spring.context.SpringMVCContextHolder;
|
import com.product.util.BaseUtil;
|
|
@Component
|
public class DocumentSearchConfigService extends AbstractBaseService{
|
|
|
@Autowired
|
BaseDao baseDao;
|
|
/**
|
* 文档检索配置列表
|
* @param fse
|
* @return
|
* @throws BaseException
|
*/
|
public DataTableEntity listConfig(FieldSetEntity fse) throws BaseException{
|
DataTableEntity dt=baseDao.listTable(CmnConst.PRODUCT_SYS_DOCUMENT_SEARCH, null, null, null, null, fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE));
|
baseDao.loadPromptData(dt);
|
return dt;
|
}
|
|
/**
|
* 文档检索配置详情
|
* @param uuid
|
* @return
|
* @throws BaseException
|
*/
|
public FieldSetEntity findConfig(String uuid) throws BaseException{
|
return baseDao.getFieldSetEntity(CmnConst.PRODUCT_SYS_DOCUMENT_SEARCH, uuid, false);
|
}
|
|
/**
|
* 文档检索配置保存
|
* @param fse
|
* @return
|
* @throws BaseException
|
*/
|
public String saveConfig(FieldSetEntity fse) throws BaseException{
|
BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fse);
|
if (StringUtils.isEmpty(fse.getUUID())) {
|
baseDao.add(fse);
|
}else {
|
baseDao.update(fse);
|
}
|
return fse.getUUID();
|
}
|
|
/**
|
* 文档检索配置删除
|
* @param uuid
|
* @return
|
* @throws BaseException
|
*/
|
public boolean deleteConfig(String uuid) throws BaseException{
|
return baseDao.delete(CmnConst.PRODUCT_SYS_DOCUMENT_SEARCH, "uuid=?", new Object[] {uuid});
|
}
|
}
|