黄潞潞
2024-06-07 482f807361c9bc0dce2db949a29c755cf858548b
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
package weaver;
 
import java.util.List;
 
import foundation.data.entity.Entity;
import foundation.data.object.DataObject;
import foundation.org.Employee;
import foundation.user.OnlineUser;
import weaver.dao.Signer;
 
public abstract class ISignService{
 
    public List<Signer> getSigners(Entity entity) throws Exception {
        return null;
    }
 
    public String getContracePhone(String sourceCode, String orgId, String accountId) throws Exception {
        int pos = sourceCode.indexOf("@{");
        
        if (pos == -1){
            return sourceCode;
        }
        
        sourceCode = sourceCode.substring(pos + 2, sourceCode.length());
        pos = sourceCode.indexOf(".");
        
        if (pos == -1) {
            OnlineUser user = OnlineUser.getInstance();
            Employee employee = user.getEmployee();
            if (employee != null) {
                return employee.getPhone();
            }
            return null;
        }
        
        String dataName = sourceCode.substring(0, pos);
        String field = sourceCode.substring(pos + 1);
        
        DataObject dataObject = DataObject.getInstance(dataName);
        
        if (dataName.equalsIgnoreCase("md_org")) {
            Entity entity = dataObject.getTableEntity(orgId);
            return entity.getString(field);
        }
        else {
            Entity entity = dataObject.getTableEntity(accountId);
            return entity.getString(field);
        }
    }
}