Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synergy-api-util
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raimbek Egemberdiev
synergy-api-util
Commits
9a7aad78
Commit
9a7aad78
authored
Jan 24, 2017
by
Raimbek Egemberdiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Department and position service
parent
f6759d30
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
322 additions
and
2 deletions
+322
-2
src/main/java/kz/arta/synergy/api/Query.java
src/main/java/kz/arta/synergy/api/Query.java
+2
-2
src/main/java/kz/arta/synergy/api/pojo/SynergyDepartment.java
...main/java/kz/arta/synergy/api/pojo/SynergyDepartment.java
+54
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyDepartmentContent.java
...va/kz/arta/synergy/api/pojo/SynergyDepartmentContent.java
+57
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyManager.java
src/main/java/kz/arta/synergy/api/pojo/SynergyManager.java
+56
-0
src/main/java/kz/arta/synergy/api/pojo/SynergyPosition.java
src/main/java/kz/arta/synergy/api/pojo/SynergyPosition.java
+72
-0
src/main/java/kz/arta/synergy/api/services/DepartmentsService.java
...java/kz/arta/synergy/api/services/DepartmentsService.java
+45
-0
src/main/java/kz/arta/synergy/api/services/PositionsService.java
...n/java/kz/arta/synergy/api/services/PositionsService.java
+36
-0
No files found.
src/main/java/kz/arta/synergy/api/Query.java
View file @
9a7aad78
...
@@ -33,9 +33,9 @@ public class Query {
...
@@ -33,9 +33,9 @@ public class Query {
return
this
;
return
this
;
}
}
public
Query
queryParam
(
String
key
,
String
value
)
{
public
Query
queryParam
(
String
key
,
Object
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
queryParams
.
put
(
key
,
value
);
queryParams
.
put
(
key
,
value
.
toString
()
);
}
}
return
this
;
return
this
;
}
}
...
...
src/main/java/kz/arta/synergy/api/pojo/SynergyDepartment.java
View file @
9a7aad78
...
@@ -11,6 +11,12 @@ public class SynergyDepartment {
...
@@ -11,6 +11,12 @@ public class SynergyDepartment {
private
String
departmentID
;
private
String
departmentID
;
private
String
parentDepartmentID
;
private
String
parentDepartmentID
;
private
String
nameRu
;
private
String
nameKz
;
private
String
nameEn
;
private
String
pointersCode
;
private
String
number
;
private
SynergyManager
manager
;
public
SynergyDepartment
()
{
public
SynergyDepartment
()
{
}
}
...
@@ -30,4 +36,52 @@ public class SynergyDepartment {
...
@@ -30,4 +36,52 @@ public class SynergyDepartment {
public
void
setParentDepartmentID
(
String
parentDepartmentID
)
{
public
void
setParentDepartmentID
(
String
parentDepartmentID
)
{
this
.
parentDepartmentID
=
parentDepartmentID
;
this
.
parentDepartmentID
=
parentDepartmentID
;
}
}
public
SynergyManager
getManager
()
{
return
manager
;
}
public
void
setManager
(
SynergyManager
manager
)
{
this
.
manager
=
manager
;
}
public
String
getNameRu
()
{
return
nameRu
;
}
public
void
setNameRu
(
String
nameRu
)
{
this
.
nameRu
=
nameRu
;
}
public
String
getNameKz
()
{
return
nameKz
;
}
public
void
setNameKz
(
String
nameKz
)
{
this
.
nameKz
=
nameKz
;
}
public
String
getNameEn
()
{
return
nameEn
;
}
public
void
setNameEn
(
String
nameEn
)
{
this
.
nameEn
=
nameEn
;
}
public
String
getPointersCode
()
{
return
pointersCode
;
}
public
void
setPointersCode
(
String
pointersCode
)
{
this
.
pointersCode
=
pointersCode
;
}
public
String
getNumber
()
{
return
number
;
}
public
void
setNumber
(
String
number
)
{
this
.
number
=
number
;
}
}
}
src/main/java/kz/arta/synergy/api/pojo/SynergyDepartmentContent.java
0 → 100644
View file @
9a7aad78
package
kz.arta.synergy.api.pojo
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author raimbek
* @since 23.01.2017
*/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
SynergyDepartmentContent
{
private
List
<
Department
>
departments
=
new
ArrayList
<
Department
>();
private
List
<
Position
>
positions
=
new
ArrayList
<
Position
>();
public
static
class
Department
{
public
String
departmentId
;
public
String
departmentName
;
public
Boolean
hasChildDepartments
;
public
DepartmentHead
departmentHead
;
}
public
static
class
DepartmentHead
{
public
String
headId
;
public
String
headName
;
public
List
<
Position
>
positions
;
}
public
static
class
Position
{
public
String
positionID
;
public
String
positionName
;
public
List
<
Employee
>
employees
;
}
public
static
class
Employee
{
public
String
employeeID
;
public
String
employeeName
;
}
public
List
<
Department
>
getDepartments
()
{
return
departments
;
}
public
void
setDepartments
(
List
<
Department
>
departments
)
{
this
.
departments
=
departments
;
}
public
List
<
Position
>
getPositions
()
{
return
positions
;
}
public
void
setPositions
(
List
<
Position
>
positions
)
{
this
.
positions
=
positions
;
}
}
src/main/java/kz/arta/synergy/api/pojo/SynergyManager.java
0 → 100644
View file @
9a7aad78
package
kz.arta.synergy.api.pojo
;
import
org.codehaus.jackson.annotate.JsonIgnoreProperties
;
/**
* @author raimbek
* @since 23.01.2017
*/
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
SynergyManager
{
private
String
positionId
;
private
String
nameRu
;
private
String
nameKz
;
private
String
nameEn
;
private
String
pointersCode
;
public
String
getPositionId
()
{
return
positionId
;
}
public
void
setPositionId
(
String
positionId
)
{
this
.
positionId
=
positionId
;
}
public
String
getNameRu
()
{
return
nameRu
;
}
public
void
setNameRu
(
String
nameRu
)
{
this
.
nameRu
=
nameRu
;
}
public
String
getNameKz
()
{
return
nameKz
;
}
public
void
setNameKz
(
String
nameKz
)
{
this
.
nameKz
=
nameKz
;
}
public
String
getNameEn
()
{
return
nameEn
;
}
public
void
setNameEn
(
String
nameEn
)
{
this
.
nameEn
=
nameEn
;
}
public
String
getPointersCode
()
{
return
pointersCode
;
}
public
void
setPointersCode
(
String
pointersCode
)
{
this
.
pointersCode
=
pointersCode
;
}
}
src/main/java/kz/arta/synergy/api/pojo/SynergyPosition.java
View file @
9a7aad78
...
@@ -10,6 +10,14 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
...
@@ -10,6 +10,14 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
public
class
SynergyPosition
{
public
class
SynergyPosition
{
private
String
positionID
;
private
String
positionID
;
private
String
departmentID
;
private
String
departmentID
;
private
String
nameRu
;
private
String
nameKz
;
private
String
nameEn
;
private
String
parentDepartmentID
;
private
String
pointersCode
;
private
String
number
;
private
String
salary
;
private
String
vacancies
;
public
SynergyPosition
()
{
public
SynergyPosition
()
{
}
}
...
@@ -29,4 +37,68 @@ public class SynergyPosition {
...
@@ -29,4 +37,68 @@ public class SynergyPosition {
public
void
setDepartmentID
(
String
departmentID
)
{
public
void
setDepartmentID
(
String
departmentID
)
{
this
.
departmentID
=
departmentID
;
this
.
departmentID
=
departmentID
;
}
}
public
String
getNameRu
()
{
return
nameRu
;
}
public
void
setNameRu
(
String
nameRu
)
{
this
.
nameRu
=
nameRu
;
}
public
String
getNameKz
()
{
return
nameKz
;
}
public
void
setNameKz
(
String
nameKz
)
{
this
.
nameKz
=
nameKz
;
}
public
String
getNameEn
()
{
return
nameEn
;
}
public
void
setNameEn
(
String
nameEn
)
{
this
.
nameEn
=
nameEn
;
}
public
String
getParentDepartmentID
()
{
return
parentDepartmentID
;
}
public
void
setParentDepartmentID
(
String
parentDepartmentID
)
{
this
.
parentDepartmentID
=
parentDepartmentID
;
}
public
String
getPointersCode
()
{
return
pointersCode
;
}
public
void
setPointersCode
(
String
pointersCode
)
{
this
.
pointersCode
=
pointersCode
;
}
public
String
getNumber
()
{
return
number
;
}
public
void
setNumber
(
String
number
)
{
this
.
number
=
number
;
}
public
String
getSalary
()
{
return
salary
;
}
public
void
setSalary
(
String
salary
)
{
this
.
salary
=
salary
;
}
public
String
getVacancies
()
{
return
vacancies
;
}
public
void
setVacancies
(
String
vacancies
)
{
this
.
vacancies
=
vacancies
;
}
}
}
src/main/java/kz/arta/synergy/api/services/DepartmentsService.java
0 → 100644
View file @
9a7aad78
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
kz.arta.synergy.api.pojo.SynergyDepartment
;
import
kz.arta.synergy.api.pojo.SynergyDepartmentContent
;
import
java.io.IOException
;
/**
* @author raimbek
* @since 14.11.2016
*/
public
class
DepartmentsService
{
private
final
RestHttpQuery
restHttpQuery
;
private
DepartmentsService
(
QueryContext
context
)
{
this
.
restHttpQuery
=
new
RestHttpQuery
(
context
);
}
public
static
DepartmentsService
newInstance
(
QueryContext
queryContext
)
{
return
new
DepartmentsService
(
queryContext
);
}
public
SynergyDepartment
getDepartment
(
String
departmentId
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/departments/get"
)
.
queryParam
(
"departmentID"
,
departmentId
);
return
JsonUtils
.
read
(
restHttpQuery
.
doQuery
(
query
),
SynergyDepartment
.
class
);
}
public
SynergyDepartmentContent
getDepartmentsContent
(
String
departmentId
,
Boolean
onlyPosition
,
Boolean
onlyDepartments
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/departments/content"
)
.
queryParam
(
"onlyPosition"
,
onlyPosition
)
.
queryParam
(
"onlyDepartments"
,
onlyDepartments
)
.
queryParam
(
"departmentID"
,
departmentId
);
return
JsonUtils
.
read
(
restHttpQuery
.
doQuery
(
query
),
SynergyDepartmentContent
.
class
);
}
}
src/main/java/kz/arta/synergy/api/services/PositionsService.java
0 → 100644
View file @
9a7aad78
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.SynergyDepartment
;
import
kz.arta.synergy.api.pojo.SynergyDepartmentContent
;
import
kz.arta.synergy.api.pojo.SynergyPosition
;
import
java.io.IOException
;
/**
* @author raimbek
* @since 14.11.2016
*/
public
class
PositionsService
{
private
final
RestHttpQuery
restHttpQuery
;
private
PositionsService
(
QueryContext
context
)
{
this
.
restHttpQuery
=
new
RestHttpQuery
(
context
);
}
public
static
PositionsService
newInstance
(
QueryContext
queryContext
)
{
return
new
PositionsService
(
queryContext
);
}
public
SynergyPosition
getPosition
(
String
positionId
)
throws
IOException
{
Query
query
=
Query
.
newInstance
()
.
url
(
"/rest/api/positions/get"
)
.
queryParam
(
"positionID"
,
positionId
);
return
JsonUtils
.
read
(
restHttpQuery
.
doQuery
(
query
),
SynergyPosition
.
class
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment