CZT
2023-11-27 c206acfaedc69c390fb67daa81bc686f58a212ef
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
package com.ld.igds.n2.view;
 
import com.bstek.dorado.annotation.Expose;
import com.ld.igds.n2.manager.BasicSystemManager;
import com.ld.igds.util.ContextUtil;
 
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.util.Map;
 
/**
 * 系统管理页面中
 *
 * @author andy.jia
 */
@Component
public class BasicSystemService {
 
    @Autowired
    private BasicSystemManager basicSystemManager;
 
 
    /**
     * basicSystemService#pullDeviceBySer
     * 根据分机ID获取远程控制柜的设备列表,并更新到数据库
     *
     * @param serId
     * @return
     */
    @Expose
    public String pullDeviceBySer(String serId) {
        return basicSystemManager.pullDevice(ContextUtil.getCompanyId(), serId);
    }
 
 
    /**
     * basicSystemService#pullDepotBySer
     * 根据分机ID获取远程控制柜的仓库列表,并更新到数据库
     *
     * @param serId
     * @return
     */
    @Expose
    public String pullDepotBySer(String serId) {
        return basicSystemManager.pullDepot(ContextUtil.getCompanyId(), serId);
    }
 
 
    /**
     * 远程授权
     * basicSystemService#pullAccess
     *
     * @param param
     * @return
     */
    @Expose
    public String pullAccess(Map<String, Object> param) {
        String serId = (String) param.get("serId");
        String accessCode = (String) param.get("accessCode");
        if (StringUtils.isEmpty(serId) || StringUtils.isEmpty(accessCode)) {
            return "授权参数不完整,无法授权!";
        }
 
        return basicSystemManager.pullAccess(ContextUtil.getCompanyId(), serId, accessCode);
    }
 
    /**
     *
     * basicSystemService#updateDepotStatus
     *
     * @param param
     * @return
     */
    @Expose
    public String updateDepotStatus(Map<String, Object> param) {
        String depotId = (String) param.get("depotId");
        String depotStatus = (String) param.get("depotStatus");
 
        if(null == depotId || null == depotStatus) return "当前修改状态为空,不支持修改!";
 
        return basicSystemManager.updateDepotStatus(ContextUtil.getCompanyId(),depotId,depotStatus);
    }
}