xiaoyong931011
2023-08-17 d20a8aeeff847df259cb78fab8cb65c4d0630491
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
package cc.mrbird.febs;
 
import cc.mrbird.febs.common.contants.AppContants;
import cc.mrbird.febs.common.contants.SystemConstants;
import cc.mrbird.febs.dapp.entity.DataDictionaryCustom;
import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum;
import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper;
import cc.mrbird.febs.dapp.service.DappSystemService;
import cn.hutool.core.util.StrUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
 
import javax.annotation.PostConstruct;
import java.lang.reflect.Field;
 
/**
 * @author MrBird
 */
@EnableAsync
@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement
@MapperScan("cc.mrbird.febs.*.mapper")
public class FebsShiroApplication {
 
    @Autowired
    private DataDictionaryCustomMapper dataDictionaryCustomMapper;
    @Autowired
    private DappSystemService dappSystemService;
 
    @Autowired
    private SystemConstants systemConstants;
 
    public static void main(String[] args) {
        new SpringApplicationBuilder(FebsShiroApplication.class)
                .web(WebApplicationType.SERVLET)
                .run(args);
    }
 
//    @PostConstruct
//    public void systemConstantsInit() {
//        DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
//                DataDictionaryEnum.FEE_ADDRESS_KEY.getType(),
//                DataDictionaryEnum.FEE_ADDRESS_KEY.getCode());
//        String key = dataDictionaryCustom.getCode();
//        key = StrUtil.toCamelCase(key);
//        String value = dataDictionaryCustom.getValue();
//        try {
//            Field field = systemConstants.getClass().getDeclaredField(key);
//            field.set(systemConstants, value);
//            AppContants.FEE_ADDRESS_KEY.put("feeAddressKey",systemConstants.getFeeAddressKey());
//            dataDictionaryCustom.setValue("isReady");
//            dataDictionaryCustomMapper.updateById(dataDictionaryCustom);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
 
 
//    @PostConstruct
//    public void systemDicInit() {
//        dappSystemService.selectAndInsertDics();
//    }
 
}