Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
bcf385b7
Commit
bcf385b7
authored
Jun 18, 2019
by
Md Suleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed Active and inactive condition for the resource allocated in the project
parent
00486ce3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
18 deletions
+45
-18
MyTeamApplication.java
src/main/java/com/nisum/myteam/MyTeamApplication.java
+0
-1
EmployeeSubStatus.java
...in/java/com/nisum/myteam/model/dao/EmployeeSubStatus.java
+29
-0
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+15
-16
MyTeamUtils.java
src/main/java/com/nisum/myteam/utils/MyTeamUtils.java
+1
-1
No files found.
src/main/java/com/nisum/myteam/MyTeamApplication.java
View file @
bcf385b7
...
...
@@ -14,7 +14,6 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import
org.springframework.web.filter.CorsFilter
;
@SpringBootApplication
@EnableAutoConfiguration
@EnableMongoRepositories
(
basePackages
=
{
"com.nisum.myteam.repository"
})
public
class
MyTeamApplication
extends
SpringBootServletInitializer
{
...
...
src/main/java/com/nisum/myteam/model/dao/EmployeeSubStatus.java
0 → 100644
View file @
bcf385b7
package
com
.
nisum
.
myteam
.
model
.
dao
;
import
lombok.*
;
import
org.bson.types.ObjectId
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.util.Date
;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document
(
collection
=
"employeeSubStatus"
)
public
class
EmployeeSubStatus
{
@Id
private
ObjectId
id
;
@NonNull
private
String
employeeID
;
@NonNull
private
String
subStatus
;
@NonNull
private
Date
fromDate
;
@NonNull
private
Date
toDate
;
}
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
bcf385b7
...
...
@@ -135,19 +135,19 @@ public class ResourceService implements IResourceService {
respMap
.
put
(
"statusCode"
,
811
);
respMap
.
put
(
"message"
,
"Resource is already allocated after "
+
latestAllocation
.
getBillingStartDate
());
}
else
{
if
(
resourceReq
.
getBillingEndDate
().
compareTo
(
new
Date
())
<
0
)
{
resourceReq
.
setStatus
(
MyTeamUtils
.
RELEASED_STATUS
);
//update Status of allocation
Resource
resourceBench
=
new
Resource
();
resourceBench
.
setProjectId
(
MyTeamUtils
.
BENCH_PROJECT_ID
);
resourceBench
.
setEmployeeId
(
resourceReq
.
getEmployeeId
());
resourceBench
.
setResourceRole
(
resourceReq
.
getResourceRole
());
resourceBench
.
setStatus
(
MyTeamUtils
.
RELEASED_STATUS
);
//add alocation status as Released
resourceBench
.
setBillingStartDate
(
MyTeamDateUtils
.
getDayMoreThanDate
(
resourceReq
.
getBillingEndDate
()));
resourceBench
.
setBillingEndDate
(
projectService
.
getProjectByProjectId
(
MyTeamUtils
.
BENCH_PROJECT_ID
).
getProjectEndDate
());
resourceBench
.
setBillableStatus
(
MyTeamUtils
.
BENCH_BILLABILITY_STATUS
);
resourceBench
.
setAuditFields
(
loginEmpId
,
MyTeamUtils
.
CREATE
);
resourceRepo
.
save
(
resourceBench
);
}
//
if (resourceReq.getBillingEndDate().compareTo(new Date()) < 0) {
//
resourceReq.setStatus(MyTeamUtils.RELEASED_STATUS);//update Status of allocation
//
Resource resourceBench = new Resource();
//
resourceBench.setProjectId(MyTeamUtils.BENCH_PROJECT_ID);
//
resourceBench.setEmployeeId(resourceReq.getEmployeeId());
//
resourceBench.setResourceRole(resourceReq.getResourceRole());
//
resourceBench.setStatus(MyTeamUtils.RELEASED_STATUS);//add alocation status as Released
//
resourceBench.setBillingStartDate(MyTeamDateUtils.getDayMoreThanDate(resourceReq.getBillingEndDate()));
//
resourceBench.setBillingEndDate(projectService.getProjectByProjectId(MyTeamUtils.BENCH_PROJECT_ID).getProjectEndDate());
//
resourceBench.setBillableStatus(MyTeamUtils.BENCH_BILLABILITY_STATUS);
//
resourceBench.setAuditFields(loginEmpId, MyTeamUtils.CREATE);
//
resourceRepo.save(resourceBench);
//
}
this
.
updateExistedResource
(
resourceReq
);
}
}
else
{
...
...
@@ -500,11 +500,10 @@ public class ResourceService implements IResourceService {
// Active
if
(
statusFlag
.
equals
(
ResourceStatus
.
ACTIVE
.
getStatus
())
&&
billingEndDate
.
compareTo
(
new
Date
())
>=
0
&&
!
resource
.
getStatus
().
equals
(
MyTeamUtils
.
STATUS_PROPOSED
))
{
if
(
statusFlag
.
equals
(
ResourceStatus
.
ACTIVE
.
getStatus
())
&&
resource
.
getStatus
().
equals
(
MyTeamUtils
.
STATUS_ENGAGED
))
{
resourceVO
.
setResourceStatus
(
ResourceStatus
.
ACTIVE
.
getStatus
());
resourcesList
.
add
(
resourceVO
);
}
else
if
(
statusFlag
.
equals
(
ResourceStatus
.
IN_ACTIVE
.
getStatus
())
&&
billingEndDate
.
compareTo
(
new
Date
())
<
0
)
{
}
else
if
(
statusFlag
.
equals
(
ResourceStatus
.
IN_ACTIVE
.
getStatus
())
&&
resource
.
getStatus
().
equals
(
MyTeamUtils
.
RELEASED_STATUS
)
)
{
resourceVO
.
setResourceStatus
(
ResourceStatus
.
IN_ACTIVE
.
getStatus
());
resourcesList
.
add
(
resourceVO
);
}
else
if
(
statusFlag
.
equals
(
MyTeamUtils
.
STATUS_PROPOSED
)
&&
resource
.
getStatus
().
equals
(
MyTeamUtils
.
STATUS_PROPOSED
)){
...
...
src/main/java/com/nisum/myteam/utils/MyTeamUtils.java
View file @
bcf385b7
...
...
@@ -14,7 +14,7 @@ public class MyTeamUtils {
//public final static String driverUrl = "jdbc:ucanaccess://";
//public final static String msdriveUrl ="jdbc:sqlserver://";
public
final
static
String
RELEASED_STATUS
=
"Released"
;
public
final
static
String
Engaged_STATUS
=
"Engaged"
;
public
final
static
String
STATUS_ENGAGED
=
"Engaged"
;
public
static
final
String
STATUS_PROPOSED
=
"Proposed"
;
public
final
static
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
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