czt
9 天以前 db67639449287bcec461916a7dca6003ee5dd03c
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
package com.fzzy.igds;
 
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.fzzy.igds.domain.DeviceSer;
import com.fzzy.igds.service.DeviceSerService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
 
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 13:50
 */
@Component
public class DeviceSerPR {
 
    @Resource
    private DeviceSerService deviceSerService;
 
    /**
     * deviceSerPR#getAllSer
     *
     * @return
     */
    @DataProvider
    public List<DeviceSer> getAllSer() {
        return deviceSerService.getAllSer();
    }
 
    /**
     * deviceSerPR#getDataById
     *
     * @param id
     * @return
     */
    @Expose
    public DeviceSer getDataById(String id) {
        return deviceSerService.getDataById(null, id);
    }
 
    /**
     * deviceSerPR#updateSer
     *
     * @param data
     */
    @DataResolver
    public void updateSer(DeviceSer data) {
        DeviceSer deviceSer = new DeviceSer();
        BeanUtils.copyProperties(data, deviceSer);
        if(null == data.getOrderNum()){
            data.setOrderNum(1);
        }
        deviceSerService.saveSer(deviceSer);
    }
 
    /**
     * 根据分机id和名称删除分机
     */
    @Expose
    @Transactional
    public void delSerById(String id) {
 
        DeviceSer ser = deviceSerService.getDataById(null, id);
        deviceSerService.delSer(ser);
    }
 
    /**
     * deviceSerPR#refreshCache
     *
     * @throws
     * @Title: refreshCache
     * @Description: 刷新缓存 void
     */
    @Expose
    public void refreshCache() {
        deviceSerService.refreshCache(null);
    }
 
    /**
     * ${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}
     *
     * @return
     */
    @DataProvider
    public List<DeviceSer> getAllSerCache() {
        return deviceSerService.getCacheSerList(null);
    }
 
    /**
     * ${dorado.getDataProvider("deviceSerPR#getSerCacheByType").getResult("01")}
     *
     * @param type
     * @return
     */
    @DataProvider
    public List<DeviceSer> getSerCacheByType(String type) {
        return deviceSerService.getSerCacheByType(null, type);
    }
 
}