shichongfu
2023-04-25 ce0b49552668d3331055e2b1a1447a743dc54939
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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});
    }
}