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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.product.admin.service;
 
import com.product.admin.config.CmnConst;
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.permission.PermissionService;
import com.product.core.service.support.AbstractBaseService;
import com.product.core.service.support.QueryFilterService;
import com.product.core.spring.context.SpringMVCContextHolder;
import com.product.core.transfer.Transactional;
import com.product.util.BaseUtil;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.util.Date;
 
/**
 * Copyright LX-BASE
 * @Title: CodeLogicService
 * @Project: LX-BASE-SERVICE
 * @Date: 2020-9-9 13:55
 * @Author: ZhouJie
 * @Description: 代码逻辑配置
 */
@Component
public class CodeLogicService extends AbstractBaseService {
 
    @Autowired
    public BaseDao baseDao;
    @Autowired
    PermissionService permissionService;
    @Autowired
    QueryFilterService queryFilterService;
 
    /**
     *     代码逻辑查询列表
     * @param cpage
     * @param pagesize
     * @return
     * @throws BaseException
     */
    public DataTableEntity getCodeLogicList(FieldSetEntity fse) throws BaseException{
        String queryFilter;
        if(BaseUtil.dataTableIsEmpty(fse.getSubDataTable("systemSeniorQueryString"))){
            queryFilter = "";
        }else {
            queryFilter    = " WHERE " + queryFilterService.getQueryFilter(fse);
        }
        String sql="SELECT * FROM product_sys_org_levels_change_process"+queryFilter;    
        DataTableEntity dTableEntity = baseDao.listTable(sql, new Object[] {},fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE));
        if (dTableEntity!=null && dTableEntity.getRows()>0) {
            baseDao.listInternationDataTable(dTableEntity, null);
        }
        baseDao.loadPromptData(dTableEntity);
        return dTableEntity;
    }
 
    /**
     *     代码逻辑配置详情
     * @param uuid
     * @return
     * @throws BaseException
     */
    public FieldSetEntity getCodeLogicInfo(String uuid) throws BaseException{
        return baseDao.listInternationDataTable(baseDao.getFieldSetEntity(CmnConst.PRODUCT_SYS_ORG_LEVELS_CHANGE_PROCESS, uuid, true),null);
    }
 
    /**
     * 新增代码逻辑配置
     * @param fse
     * @return
     * @throws BaseException
     */
    @Transactional
    public String addCodeLogic(FieldSetEntity fse)throws BaseException{
        fse.setValue(CmnConst.CREATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());
        fse.setValue(CmnConst.PRODUCT_SYS_ORG_LEVELS_CHANGE_PROCESS, new Date());
        return baseDao.add(fse);
    }
 
    /**
     * 修改代码逻辑配置
     * @param fse
     * @return
     * @throws BaseExceptionz
     */
    @Transactional
    public boolean updateCodeLogic(FieldSetEntity fse)throws BaseException{
        fse.setValue(CmnConst.UPDATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());
        fse.setValue(CmnConst.PRODUCT_SYS_ORG_LEVELS_CHANGE_PROCESS, new Date());
        return update(fse);
    }
 
    /**
     * 删除代码逻辑配置
     * @param fse
     * @return
     * @throws BaseException
     */
    @Transactional
    public boolean deleteCodeLogic(FieldSetEntity fse) throws BaseException {
        return baseDao.delete(CmnConst.PRODUCT_SYS_ORG_LEVELS_CHANGE_PROCESS, "uuid=?", new Object[] {fse.getString("uuid")});
    }
 
 
}