黄潞潞
2024-06-07 482f807361c9bc0dce2db949a29c755cf858548b
esign_weaver/src/weaver/ISignService.java
@@ -3,10 +3,48 @@
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 interface ISignService{
   public List<Signer> getSigners(Entity entity) throws Exception;
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);
      }
   }
}