| | |
| | | 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 abstract class ISignService{ |
| | | |
| | | public List<Signer> getSigners(Entity entity) throws Exception; |
| | | 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); |
| | | } |
| | | } |
| | | } |