Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
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
Muhammad Usman
PERFORMA_REPLICA
Commits
074780d8
Commit
074780d8
authored
Jun 04, 2019
by
nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
S21277914 # Client - Incoming Issues (raised by Client) #Allow Cancel Job
parent
e5d5d80f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
109 additions
and
9 deletions
+109
-9
HiringTeam.xml
cmsWebApp/sql/HiringTeam.xml
+1
-0
HiringTeam.sql
cmsWebApp/sql/ms/HiringTeam.sql
+1
-0
HiringTeam.sql
cmsWebApp/sql/oracle/HiringTeam.sql
+1
-0
HiringTeam.sql
cmsWebApp/sql/postgres/HiringTeam.sql
+1
-0
CloseJobBatch.java
cmsWebApp/src/performa/batch/CloseJobBatch.java
+35
-0
ExtendJobFP.java
cmsWebApp/src/performa/form/ExtendJobFP.java
+1
-4
MakePaymentFP.java
cmsWebApp/src/performa/form/MakePaymentFP.java
+1
-1
SaveJobFP.java
cmsWebApp/src/performa/form/SaveJobFP.java
+29
-2
BaseHiringTeam.java
cmsWebApp/src/performa/orm/BaseHiringTeam.java
+0
-0
HiringTeam.java
cmsWebApp/src/performa/orm/HiringTeam.java
+22
-0
HiringTeam.xml
cmsWebApp/src/performa/orm/HiringTeam.xml
+1
-0
HiringTeamPersistenceMgr.java
cmsWebApp/src/performa/orm/HiringTeamPersistenceMgr.java
+0
-0
StripeUtils.java
cmsWebApp/src/performa/utils/StripeUtils.java
+0
-2
20190603_Alter_HiringTeam.xml
...nsions/adminportal/upgrades/20190603_Alter_HiringTeam.xml
+16
-0
No files found.
cmsWebApp/sql/HiringTeam.xml
View file @
074780d8
...
...
@@ -27,6 +27,7 @@
<column
name=
"card_post_code"
type=
"String"
nullable=
"true"
length=
"10"
/>
<column
name=
"card_id"
type=
"String"
nullable=
"true"
length=
"100"
/>
<column
name=
"plan_renewed_on"
type=
"Date"
nullable=
"true"
/>
<column
name=
"ppj_credits"
type=
"Long"
nullable=
"true"
/>
<column
name=
"used_credits"
type=
"Long"
nullable=
"true"
/>
<column
name=
"available_credits"
type=
"Long"
nullable=
"true"
/>
<column
name=
"is_ppj"
type=
"Boolean"
nullable=
"true"
/>
...
...
cmsWebApp/sql/ms/HiringTeam.sql
View file @
074780d8
...
...
@@ -27,6 +27,7 @@ CREATE TABLE tl_hiring_team (
card_post_code
varchar
(
10
)
NULL
,
card_id
varchar
(
100
)
NULL
,
plan_renewed_on
datetime
NULL
,
ppj_credits
numeric
(
12
)
NULL
,
used_credits
numeric
(
12
)
NULL
,
available_credits
numeric
(
12
)
NULL
,
is_ppj
char
(
1
)
NULL
,
...
...
cmsWebApp/sql/oracle/HiringTeam.sql
View file @
074780d8
...
...
@@ -28,6 +28,7 @@ CREATE TABLE tl_hiring_team (
card_post_code
varchar2
(
10
)
NULL
,
card_id
varchar2
(
100
)
NULL
,
plan_renewed_on
date
NULL
,
ppj_credits
number
(
12
)
NULL
,
used_credits
number
(
12
)
NULL
,
available_credits
number
(
12
)
NULL
,
is_ppj
char
(
1
)
NULL
,
...
...
cmsWebApp/sql/postgres/HiringTeam.sql
View file @
074780d8
...
...
@@ -28,6 +28,7 @@ CREATE TABLE tl_hiring_team (
card_post_code
varchar
(
10
)
NULL
,
card_id
varchar
(
100
)
NULL
,
plan_renewed_on
timestamp
NULL
,
ppj_credits
numeric
(
12
)
NULL
,
used_credits
numeric
(
12
)
NULL
,
available_credits
numeric
(
12
)
NULL
,
is_ppj
char
(
1
)
NULL
,
...
...
cmsWebApp/src/performa/batch/CloseJobBatch.java
View file @
074780d8
...
...
@@ -6,7 +6,9 @@ import oneit.objstore.ObjectTransaction;
import
oneit.objstore.StorageException
;
import
oneit.objstore.rdbms.filters.LessThanFilter
;
import
oneit.utils.DateDiff
;
import
oneit.utils.math.NullArith
;
import
oneit.utils.parsers.FieldException
;
import
performa.orm.HiringTeam
;
import
performa.orm.Job
;
import
performa.orm.types.JobStatus
;
...
...
@@ -30,7 +32,39 @@ public class CloseJobBatch extends ORMBatch
job
.
setIsManuallyClosed
(
Boolean
.
FALSE
);
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
PROCESSING1
,
"Setting Job Status to Closed in job : "
,
job
);
if
(
job
.
getJobApplicationsCount
()
==
0
)
{
HiringTeam
hiringTeam
=
job
.
getHiringTeam
();
HiringTeam
billingTeam
=
hiringTeam
.
getManageOwnBilling
()
?
hiringTeam
:
hiringTeam
.
getBilledByTeam
();
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
PROCESSING1
,
"No Applicants for job: "
,
job
,
" hence crediting account : "
,
billingTeam
);
if
(
billingTeam
.
isTrue
(
billingTeam
.
getOnTrial
()))
{
billingTeam
.
setTrialJobCount
(
billingTeam
.
getTrialJobCount
()
-
1
);
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
PROCESSING1
,
"Reducing trail job count of hiring team : "
,
billingTeam
);
}
else
{
if
(
billingTeam
.
getIsPPJ
())
{
billingTeam
.
setPPJCredits
(
NullArith
.
add
(
billingTeam
.
getPPJCredits
(),
1
).
intValue
());
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
PROCESSING1
,
"Increasing PPJ Credits of hiring team : "
,
billingTeam
);
}
else
{
if
(
billingTeam
.
getUsedCredits
()
>
billingTeam
.
getAvailableCredits
())
{
billingTeam
.
setAvailableCredits
(
NullArith
.
add
(
billingTeam
.
getAvailableCredits
(),
1
).
intValue
());
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
PROCESSING1
,
"Increasing Available Credits of hiring team (to recover usage records on stripe) : "
,
billingTeam
);
}
billingTeam
.
setUsedCredits
(
NullArith
.
subtract
(
billingTeam
.
getUsedCredits
(),
1
).
intValue
());
LogMgr
.
log
(
CLOSE_JOB_BATCH
,
LogLevel
.
PROCESSING1
,
"Reducing used credits of hiring team "
,
billingTeam
);
}
}
}
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/form/ExtendJobFP.java
View file @
074780d8
...
...
@@ -16,7 +16,6 @@ import oneit.servlets.process.SaveFP;
import
oneit.utils.BusinessException
;
import
oneit.utils.DateDiff
;
import
oneit.utils.math.NullArith
;
import
performa.orm.CompanyUser
;
import
performa.orm.HiringTeam
;
import
performa.orm.Job
;
import
performa.utils.StripeUtils
;
...
...
@@ -34,11 +33,9 @@ public class ExtendJobFP extends SaveFP
HiringTeam
hiringTeam
=
job
.
getHiringTeam
();
HiringTeam
billingTeam
=
hiringTeam
.
getManageOwnBilling
()
?
hiringTeam
:
hiringTeam
.
getBilledByTeam
();
SecUser
secUser
=
SecUser
.
getTXUser
(
process
.
getTransaction
());
CompanyUser
companyUser
=
secUser
.
getExtension
(
CompanyUser
.
REFERENCE_CompanyUser
);
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Start of Extend job : "
,
job
);
job
.
setApplyBy
(
DateDiff
.
add
(
job
.
getApplyBy
(),
Calendar
.
DATE
,
30
));
job
.
setLastEdited
(
new
Date
());
...
...
@@ -53,7 +50,7 @@ public class ExtendJobFP extends SaveFP
}
else
if
(
billingTeam
.
getIsPPJ
())
{
StripeUtils
.
makePayment
(
hiringTeam
,
job
);
hiringTeam
.
makePayment
(
job
);
}
LogMgr
.
log
(
LOG
,
LogLevel
.
PROCESSING1
,
"Job Extended. Apply by date : "
,
job
.
getApplyBy
());
...
...
cmsWebApp/src/performa/form/MakePaymentFP.java
View file @
074780d8
...
...
@@ -59,7 +59,7 @@ public class MakePaymentFP extends SaveFP
if
(
hiringTeam
.
getCardID
()
!=
null
&&
hiringTeam
.
isTrue
(
hiringTeam
.
getIsPPJ
()))
{
StripeUtils
.
makePayment
(
hiringTeam
,
job
);
hiringTeam
.
makePayment
(
job
);
}
if
(
hiringTeam
.
getCardID
()
==
null
)
...
...
cmsWebApp/src/performa/form/SaveJobFP.java
View file @
074780d8
...
...
@@ -35,7 +35,34 @@ public class SaveJobFP extends SaveFP
LogMgr
.
log
(
Job
.
LOG
,
LogLevel
.
PROCESSING1
,
"In SaveJobFP saving job : "
,
job
);
if
(
job
.
getJobStatus
()
==
JobStatus
.
DRAFT
&&
status
!=
null
&&
status
==
JobStatus
.
OPEN
)
if
(
job
.
getJobStatus
()
==
JobStatus
.
OPEN
&&
status
!=
null
&&
status
==
JobStatus
.
CANCELLED
)
{
if
(
billingTeam
.
isTrue
(
billingTeam
.
getOnTrial
()))
{
billingTeam
.
setTrialJobCount
(
billingTeam
.
getTrialJobCount
()
-
1
);
LogMgr
.
log
(
Job
.
LOG
,
LogLevel
.
PROCESSING1
,
"Cancelling job: "
,
job
,
" hence reducing trial job count : "
,
billingTeam
);
}
else
{
if
(
billingTeam
.
getIsPPJ
())
{
billingTeam
.
setPPJCredits
(
NullArith
.
add
(
billingTeam
.
getPPJCredits
(),
1
).
intValue
());
LogMgr
.
log
(
Job
.
LOG
,
LogLevel
.
PROCESSING1
,
"Cancelling job: "
,
job
,
" hence increasing PPJ credits : "
,
billingTeam
);
}
else
{
if
(
billingTeam
.
getUsedCredits
()
>
billingTeam
.
getAvailableCredits
())
{
billingTeam
.
setAvailableCredits
(
NullArith
.
add
(
billingTeam
.
getAvailableCredits
(),
1
).
intValue
());
LogMgr
.
log
(
Job
.
LOG
,
LogLevel
.
PROCESSING1
,
"Cancelling job: "
,
job
,
" hence increasing available credits (to recover usage records on stripe) : "
,
billingTeam
);
}
billingTeam
.
setUsedCredits
(
NullArith
.
subtract
(
billingTeam
.
getUsedCredits
(),
1
).
intValue
());
LogMgr
.
log
(
Job
.
LOG
,
LogLevel
.
PROCESSING1
,
"Cancelling job: "
,
job
,
" hence reducing used credits : "
,
billingTeam
);
}
}
}
else
if
(
job
.
getJobStatus
()
==
JobStatus
.
DRAFT
&&
status
!=
null
&&
status
==
JobStatus
.
OPEN
)
{
job
.
setApplyBy
(
DateDiff
.
add
(
DateDiff
.
getToday
(),
Calendar
.
DATE
,
30
));
job
.
setOpenDate
(
new
Date
());
...
...
@@ -55,7 +82,7 @@ public class SaveJobFP extends SaveFP
}
else
if
(
billingTeam
.
getIsPPJ
())
{
StripeUtils
.
makePayment
(
hiringTeam
,
job
);
billingTeam
.
makePayment
(
job
);
}
LogMgr
.
log
(
Job
.
LOG
,
LogLevel
.
PROCESSING1
,
"Job status changed as Open. "
,
job
);
...
...
cmsWebApp/src/performa/orm/BaseHiringTeam.java
View file @
074780d8
This diff is collapsed.
Click to expand it.
cmsWebApp/src/performa/orm/HiringTeam.java
View file @
074780d8
...
...
@@ -9,10 +9,12 @@ import oneit.objstore.FieldWriteability;
import
oneit.objstore.ValidationContext
;
import
oneit.objstore.rdbms.filters.EqualsFilter
;
import
oneit.security.SecUser
;
import
oneit.utils.BusinessException
;
import
oneit.utils.CollectionUtils
;
import
oneit.utils.DateDiff
;
import
oneit.utils.StringUtils
;
import
oneit.utils.filter.Filter
;
import
oneit.utils.math.NullArith
;
import
oneit.utils.parsers.FieldException
;
import
performa.orm.types.CurrencyType
;
import
performa.orm.types.RoleType
;
...
...
@@ -114,6 +116,13 @@ public class HiringTeam extends BaseHiringTeam
@Override
public
Integer
getPPJCredits
()
{
return
super
.
getPPJCredits
()
!=
null
?
super
.
getPPJCredits
()
:
0
;
}
@Override
public
Integer
getAvailableCredits
()
{
return
super
.
getAvailableCredits
()!=
null
?
super
.
getAvailableCredits
()
:
0
;
...
...
@@ -307,4 +316,16 @@ public class HiringTeam extends BaseHiringTeam
{
return
super
.
getTrialJobCount
()
!=
null
?
super
.
getTrialJobCount
()
:
0
;
}
public
void
makePayment
(
Job
job
)
throws
BusinessException
{
if
(
getPPJCredits
()
>
0
)
{
setPPJCredits
(
NullArith
.
subtract
(
getPPJCredits
(),
1
).
intValue
());
}
else
{
StripeUtils
.
makePayment
(
this
,
job
);
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/HiringTeam.xml
View file @
074780d8
...
...
@@ -37,6 +37,7 @@
<ATTRIB
name=
"CardPostCode"
type=
"String"
dbcol=
"card_post_code"
length=
"10"
/>
<ATTRIB
name=
"CardID"
type=
"String"
dbcol=
"card_id"
length=
"100"
/>
<ATTRIB
name=
"PlanRenewedOn"
type=
"Date"
dbcol=
"plan_renewed_on"
mandatory=
"false"
/>
<ATTRIB
name=
"PPJCredits"
type=
"Integer"
dbcol=
"ppj_credits"
/>
<ATTRIB
name=
"UsedCredits"
type=
"Integer"
dbcol=
"used_credits"
/>
<ATTRIB
name=
"AvailableCredits"
type=
"Integer"
dbcol=
"available_credits"
/>
<ATTRIB
name=
"IsPPJ"
type=
"Boolean"
dbcol=
"is_ppj"
/>
...
...
cmsWebApp/src/performa/orm/HiringTeamPersistenceMgr.java
View file @
074780d8
This diff is collapsed.
Click to expand it.
cmsWebApp/src/performa/utils/StripeUtils.java
View file @
074780d8
...
...
@@ -490,8 +490,6 @@ public class StripeUtils
LogMgr
.
log
(
LoggingArea
.
ALL
,
LogLevel
.
PROCESSING1
,
"Setting hiring team with reset plan details : "
,
hiringTeam
);
}
}
}
}
...
...
cmsWebApp/webroot/extensions/adminportal/upgrades/20190603_Alter_HiringTeam.xml
0 → 100644
View file @
074780d8
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS
name=
""
xmlns:oneit=
"http://www.1iT.com.au"
>
<NODE
name=
"Script"
factory=
"Vector"
>
<NODE
name=
"DDL"
factory=
"Participant"
class=
"oneit.sql.transfer.RedefineTableOperation"
>
<tableName
factory=
"String"
>
tl_hiring_team
</tableName>
<column
name=
"ppj_credits"
type=
"Long"
nullable=
"true"
/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
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