zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
package com.changhong.epc.form.service.table;
 
import com.changhong.autoform.mapper.fieldvalue.impl.FieldValueMapperImpl;
import com.changhong.autoform.mapper.table.impl.TableMapperImpl;
import com.iemsoft.framework.cloud.config.datasource.DynamicDataSource;
import com.iemsoft.framework.cloud.core.exception.IEMRuntimeException;
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
 
import java.sql.Connection;
import java.sql.SQLException;
 
@Service
@Slf4j
public class EpcTableMapperImpl extends TableMapperImpl {
 
    @Override
    protected Connection getConnection() {
//        MybatisTool.initDataSource();
        try {
            return SpringUtil.getBean(DynamicDataSource.class).getConnection();
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
            throw new IEMRuntimeException(e.getMessage());
        }
    }
 
}
 
@Slf4j
@Service
class EpcFieldValueMapperImpl extends FieldValueMapperImpl {
 
    @Override
    protected Connection getConnection() {
//        MybatisTool.initDataSource();
        try {
            return SpringUtil.getBean(DynamicDataSource.class).getConnection();
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
            throw new IEMRuntimeException(e.getMessage());
        }
    }
}