Commit 0a0e4cba authored by Raimbek Egemberdiev's avatar Raimbek Egemberdiev

перенесены вызовы api synergy документов

parent 9fc2c4b3
package kz.arta.synergy.api.pojo;
import java.util.ArrayList;
import java.util.List;
/**
* @author raimbek
* @since 10.08.2016
*/
public class DocSend {
private String documentID;
private List<String> users = new ArrayList<String>();
private List<String> groups = new ArrayList<String>();
private List<String> emails = new ArrayList<String>();
public DocSend() {
}
public String getDocumentID() {
return documentID;
}
public void setDocumentID(String documentID) {
this.documentID = documentID;
}
public List<String> getUsers() {
return users;
}
public void setUsers(List<String> users) {
this.users = users;
}
public List<String> getGroups() {
return groups;
}
public void setGroups(List<String> groups) {
this.groups = groups;
}
public List<String> getEmails() {
return emails;
}
public void setEmails(List<String> emails) {
this.emails = emails;
}
}
package kz.arta.synergy.api.pojo;
/**
* @author raimbek
* @since 17.11.2016
*/
public class DocumentInfo {
private String name;
private String content;
private String documentID;
private String number;
private String author;
private String docTypeID;
private String user;
private String regUser;
private String resUsers;
private String to;
private String from;
private String correspondent;
private String correspondentOrg;
private String type;
private String createDate;
private String regDate;
private String statusID;
private String isExpired;
private String isSoonExpired;
private String hasChildren;
private String hasResolution;
private String isNew;
private String hidden;
private String registered;
private String finished;
private String inProgress;
private String controlled;
private String hasAttachments;
private String defective;
private String wasOpened;
private String actions;
private String bases;
private String registryID;
private String registryName;
private String formName;
private String formID;
private String formCode;
private String asfDataID;
private String processing;
private String activate;
private String rawdata;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getDocumentID() {
return documentID;
}
public void setDocumentID(String documentID) {
this.documentID = documentID;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getDocTypeID() {
return docTypeID;
}
public void setDocTypeID(String docTypeID) {
this.docTypeID = docTypeID;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getRegUser() {
return regUser;
}
public void setRegUser(String regUser) {
this.regUser = regUser;
}
public String getResUsers() {
return resUsers;
}
public void setResUsers(String resUsers) {
this.resUsers = resUsers;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getCorrespondent() {
return correspondent;
}
public void setCorrespondent(String correspondent) {
this.correspondent = correspondent;
}
public String getCorrespondentOrg() {
return correspondentOrg;
}
public void setCorrespondentOrg(String correspondentOrg) {
this.correspondentOrg = correspondentOrg;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getRegDate() {
return regDate;
}
public void setRegDate(String regDate) {
this.regDate = regDate;
}
public String getStatusID() {
return statusID;
}
public void setStatusID(String statusID) {
this.statusID = statusID;
}
public String getIsExpired() {
return isExpired;
}
public void setIsExpired(String isExpired) {
this.isExpired = isExpired;
}
public String getIsSoonExpired() {
return isSoonExpired;
}
public void setIsSoonExpired(String isSoonExpired) {
this.isSoonExpired = isSoonExpired;
}
public String getHasChildren() {
return hasChildren;
}
public void setHasChildren(String hasChildren) {
this.hasChildren = hasChildren;
}
public String getHasResolution() {
return hasResolution;
}
public void setHasResolution(String hasResolution) {
this.hasResolution = hasResolution;
}
public String getIsNew() {
return isNew;
}
public void setIsNew(String isNew) {
this.isNew = isNew;
}
public String getHidden() {
return hidden;
}
public void setHidden(String hidden) {
this.hidden = hidden;
}
public String getRegistered() {
return registered;
}
public void setRegistered(String registered) {
this.registered = registered;
}
public String getFinished() {
return finished;
}
public void setFinished(String finished) {
this.finished = finished;
}
public String getInProgress() {
return inProgress;
}
public void setInProgress(String inProgress) {
this.inProgress = inProgress;
}
public String getControlled() {
return controlled;
}
public void setControlled(String controlled) {
this.controlled = controlled;
}
public String getHasAttachments() {
return hasAttachments;
}
public void setHasAttachments(String hasAttachments) {
this.hasAttachments = hasAttachments;
}
public String getDefective() {
return defective;
}
public void setDefective(String defective) {
this.defective = defective;
}
public String getWasOpened() {
return wasOpened;
}
public void setWasOpened(String wasOpened) {
this.wasOpened = wasOpened;
}
public String getActions() {
return actions;
}
public void setActions(String actions) {
this.actions = actions;
}
public String getBases() {
return bases;
}
public void setBases(String bases) {
this.bases = bases;
}
public String getRegistryID() {
return registryID;
}
public void setRegistryID(String registryID) {
this.registryID = registryID;
}
public String getRegistryName() {
return registryName;
}
public void setRegistryName(String registryName) {
this.registryName = registryName;
}
public String getFormName() {
return formName;
}
public void setFormName(String formName) {
this.formName = formName;
}
public String getFormID() {
return formID;
}
public void setFormID(String formID) {
this.formID = formID;
}
public String getFormCode() {
return formCode;
}
public void setFormCode(String formCode) {
this.formCode = formCode;
}
public String getAsfDataID() {
return asfDataID;
}
public void setAsfDataID(String asfDataID) {
this.asfDataID = asfDataID;
}
public String getProcessing() {
return processing;
}
public void setProcessing(String processing) {
this.processing = processing;
}
public String getActivate() {
return activate;
}
public void setActivate(String activate) {
this.activate = activate;
}
public String getRawdata() {
return rawdata;
}
public void setRawdata(String rawdata) {
this.rawdata = rawdata;
}
}
...@@ -31,6 +31,9 @@ public class SynergyUser { ...@@ -31,6 +31,9 @@ public class SynergyUser {
@JsonIgnore @JsonIgnore
private String password; private String password;
@JsonIgnore
private String privateFolder;
public SynergyUser() { public SynergyUser() {
} }
...@@ -153,4 +156,12 @@ public class SynergyUser { ...@@ -153,4 +156,12 @@ public class SynergyUser {
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
public String getPrivateFolder() {
return privateFolder;
}
public void setPrivateFolder(String privateFolder) {
this.privateFolder = privateFolder;
}
} }
package kz.arta.synergy.api.services;
import kz.arta.synergy.api.JsonUtils;
import kz.arta.synergy.api.Query;
import kz.arta.synergy.api.QueryContext;
import kz.arta.synergy.api.RestHttpQuery;
import kz.arta.synergy.api.pojo.DocSend;
import kz.arta.synergy.api.pojo.DocumentInfo;
import java.io.IOException;
/**
* @author raimbek
* @since 14.11.2016
*/
public class DocflowService {
private final RestHttpQuery restHttpQuery;
private DocflowService(QueryContext context) {
this.restHttpQuery = new RestHttpQuery(context);
}
public static DocflowService newInstance(QueryContext queryContext) {
return new DocflowService(queryContext);
}
public DocumentInfo documentInfo(String documentId) throws IOException {
Query query = Query.newInstance()
.url("/rest/api/docflow/doc/document_info")
.queryParam("documentID", documentId);
return JsonUtils.read(restHttpQuery.doQuery(query), DocumentInfo.class);
}
public String createDocAttachment(String documentID, String fileName, String filePath) throws IOException {
Query query = Query.newInstance()
.methodPost()
.url("/rest/api/docflow/doc/attachment/create")
.formParam("documentID", documentID)
.formParam("fileName", fileName)
.formParam("filePath", filePath);
return restHttpQuery.doQuery(query);
}
public String docSend(DocSend docSend) throws IOException {
Query query = Query.newInstance()
.methodPost()
.url("/rest/api/docflow/doc/send")
.header("Content-Type", "application/json;charset=utf-8")
.body(JsonUtils.toJson(docSend));
return restHttpQuery.doQuery(query);
}
}
package kz.arta.synergy.api.services; package kz.arta.synergy.api.services;
import kz.arta.synergy.api.JsonUtils;
import kz.arta.synergy.api.Query;
import kz.arta.synergy.api.QueryContext; import kz.arta.synergy.api.QueryContext;
import kz.arta.synergy.api.RestHttpQuery; import kz.arta.synergy.api.RestHttpQuery;
import kz.arta.synergy.api.pojo.SynergyUser;
import java.io.IOException;
/** /**
* @author raimbek * @author raimbek
...@@ -18,4 +23,24 @@ public class UserService { ...@@ -18,4 +23,24 @@ public class UserService {
public static UserService newInstance(QueryContext queryContext) { public static UserService newInstance(QueryContext queryContext) {
return new UserService(queryContext); return new UserService(queryContext);
} }
public String saveUser(SynergyUser synergyUser) throws IOException {
Query query = Query.newInstance()
.methodPost()
.url("/rest/api/filecabinet/user/save")
.formParam("userID", synergyUser.getUserid())
.formParam("lastname", synergyUser.getLastname())
.formParam("firstname", synergyUser.getFirstname())
.formParam("patronymic", synergyUser.getPatronymic())
.formParam("pointersCode", synergyUser.getCode())
.formParam("email", synergyUser.getMail())
.formParam("privateFolder", synergyUser.getPrivateFolder())
.formParam("hasAccess", synergyUser.getAccess());
return restHttpQuery.doQuery(query);
}
public SynergyUser getUserInfo(String userID) throws IOException {
String result = restHttpQuery.doQuery(Query.newInstance().url("/rest/api/filecabinet/user/" + userID));
return JsonUtils.read(result, SynergyUser.class);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment