Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
service-campaign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Ha
service-campaign
Commits
14120134
Commit
14120134
authored
Aug 29, 2019
by
Nguyen Ha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sonar
parent
b688345d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
19 deletions
+26
-19
src/main/java/com/viettel/campaign/job/CampaignJob.java
src/main/java/com/viettel/campaign/job/CampaignJob.java
+1
-1
src/main/java/com/viettel/campaign/model/ccms_full/CustomerContact.java
...com/viettel/campaign/model/ccms_full/CustomerContact.java
+1
-1
src/main/java/com/viettel/campaign/model/ccms_full/CustomizeFields.java
...com/viettel/campaign/model/ccms_full/CustomizeFields.java
+4
-5
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
...pository/ccms_full/impl/CampaignExecuteRepositoryImp.java
+3
-3
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
...ign/repository/ccms_full/impl/CampaignRepositoryImpl.java
+17
-9
No files found.
src/main/java/com/viettel/campaign/job/CampaignJob.java
View file @
14120134
...
@@ -19,7 +19,7 @@ import java.util.List;
...
@@ -19,7 +19,7 @@ import java.util.List;
@Slf4j
@Slf4j
public
class
CampaignJob
{
public
class
CampaignJob
{
private
static
final
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"dd-MM-yyyy HH:mm:ss"
);
private
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"dd-MM-yyyy HH:mm:ss"
);
private
static
final
String
CUSTOMER_INACTIVE_DUARATION
=
"CUSTOMER_INACTIVE_DUARATION"
;
private
static
final
String
CUSTOMER_INACTIVE_DUARATION
=
"CUSTOMER_INACTIVE_DUARATION"
;
private
static
final
String
CRON_EXPRESSION_CHECK_START
=
"CRON_EXPRESSION_CHECK_START"
;
private
static
final
String
CRON_EXPRESSION_CHECK_START
=
"CRON_EXPRESSION_CHECK_START"
;
private
static
final
String
CRON_EXPRESSION_CHECK_END
=
"CRON_EXPRESSION_CHECK_END"
;
private
static
final
String
CRON_EXPRESSION_CHECK_END
=
"CRON_EXPRESSION_CHECK_END"
;
...
...
src/main/java/com/viettel/campaign/model/ccms_full/CustomerContact.java
View file @
14120134
...
@@ -15,7 +15,7 @@ import java.util.Date;
...
@@ -15,7 +15,7 @@ import java.util.Date;
public
class
CustomerContact
implements
Serializable
{
public
class
CustomerContact
implements
Serializable
{
@Id
@Id
@Basic
(
optional
=
false
)
@Basic
(
optional
=
false
)
@GeneratedValue
(
generator
=
"customer_contact_seq"
,
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
generator
=
"customer_contact_seq"
)
@SequenceGenerator
(
name
=
"customer_contact_seq"
,
sequenceName
=
"customer_contact_seq"
,
allocationSize
=
1
)
@SequenceGenerator
(
name
=
"customer_contact_seq"
,
sequenceName
=
"customer_contact_seq"
,
allocationSize
=
1
)
@NotNull
@NotNull
@Column
(
name
=
"CONTACT_ID"
)
@Column
(
name
=
"CONTACT_ID"
)
...
...
src/main/java/com/viettel/campaign/model/ccms_full/CustomizeFields.java
View file @
14120134
package
com.viettel.campaign.model.ccms_full
;
package
com.viettel.campaign.model.ccms_full
;
import
lombok.AllArgsConstructor
;
import
lombok.*
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
...
@@ -67,8 +64,10 @@ public class CustomizeFields implements Serializable {
...
@@ -67,8 +64,10 @@ public class CustomizeFields implements Serializable {
@Column
(
name
=
"ACTIVE"
)
@Column
(
name
=
"ACTIVE"
)
private
Long
active
;
private
Long
active
;
public
CustomizeFields
(
String
type
,
String
title
)
{
public
CustomizeFields
(
@NotNull
String
type
,
@NotNull
String
title
)
{
this
.
type
=
type
;
this
.
type
=
type
;
this
.
title
=
title
;
this
.
title
=
title
;
}
}
}
}
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
View file @
14120134
...
@@ -301,9 +301,9 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -301,9 +301,9 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
if
(!
"AGENT"
.
equals
(
dto
.
getRoleUser
()))
{
// ko phải nhân viên
if
(!
"AGENT"
.
equals
(
dto
.
getRoleUser
()))
{
// ko phải nhân viên
ContactCustResultDTO
.
setEnableEdit
(
true
);
ContactCustResultDTO
.
setEnableEdit
(
true
);
}
else
{
}
else
{
if
(
"2"
.
equals
(
ContactCustResultDTO
.
getRecordStatus
()
))
{
// là nhân viên thường
if
(
2
==
ContactCustResultDTO
.
getRecordStatus
(
))
{
// là nhân viên thường
ContactCustResultDTO
.
setEnableEdit
(
true
);
ContactCustResultDTO
.
setEnableEdit
(
true
);
}
else
if
(
"1"
.
equals
(
ContactCustResultDTO
.
getRecordStatus
()
)
&&
isLower24Hour
(
ContactCustResultDTO
.
getCreateTime
()))
{
}
else
if
(
1
==
ContactCustResultDTO
.
getRecordStatus
(
)
&&
isLower24Hour
(
ContactCustResultDTO
.
getCreateTime
()))
{
ContactCustResultDTO
.
setEnableEdit
(
true
);
ContactCustResultDTO
.
setEnableEdit
(
true
);
}
else
{
}
else
{
ContactCustResultDTO
.
setEnableEdit
(
false
);
ContactCustResultDTO
.
setEnableEdit
(
false
);
...
@@ -439,8 +439,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -439,8 +439,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
}
finally
{
session
.
close
();
session
.
close
();
return
list
;
}
}
return
list
;
}
}
@Override
@Override
...
...
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
View file @
14120134
...
@@ -57,8 +57,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -57,8 +57,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
null
;
session
.
beginTransaction
();
if
(
DataUtil
.
isNullOrEmpty
(
requestDto
.
getCompanySiteId
()))
{
if
(
DataUtil
.
isNullOrEmpty
(
requestDto
.
getCompanySiteId
()))
{
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
...
@@ -66,6 +65,9 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -66,6 +65,9 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
return
result
;
return
result
;
}
}
try
{
try
{
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
" SELECT"
);
sb
.
append
(
" SELECT"
);
...
@@ -256,8 +258,10 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -256,8 +258,10 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
logger
.
error
(
ex
.
getMessage
(),
ex
);
logger
.
error
(
ex
.
getMessage
(),
ex
);
}
finally
{
}
finally
{
if
(
null
!=
session
)
{
session
.
close
();
session
.
close
();
}
}
}
return
result
;
return
result
;
}
}
...
@@ -267,8 +271,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -267,8 +271,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
null
;
session
.
beginTransaction
();
if
(
DataUtil
.
isNullOrEmpty
(
requestDto
.
getCompanySiteId
()))
{
if
(
DataUtil
.
isNullOrEmpty
(
requestDto
.
getCompanySiteId
()))
{
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
...
@@ -276,6 +279,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -276,6 +279,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
return
result
;
return
result
;
}
}
try
{
try
{
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
// sb.append(" SELECT CAMPAIGN_ID campaignId, " +
// sb.append(" SELECT CAMPAIGN_ID campaignId, " +
// " CAMPAIGN_CODE campaignCode, " +
// " CAMPAIGN_CODE campaignCode, " +
...
@@ -343,7 +348,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -343,7 +348,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
finally
{
}
finally
{
session
.
close
();
if
(
session
!=
null
)
session
.
close
();
}
}
return
result
;
return
result
;
}
}
...
@@ -353,9 +358,10 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -353,9 +358,10 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
logger
.
info
(
"Start search max campaign code index::"
);
logger
.
info
(
"Start search max campaign code index::"
);
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
null
;
session
.
beginTransaction
();
try
{
try
{
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
//StringBuilder sb = new StringBuilder();
//StringBuilder sb = new StringBuilder();
//sb.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_MNG, "get-max-campaign-code-index"));
//sb.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_MNG, "get-max-campaign-code-index"));
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
...
@@ -373,6 +379,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -373,6 +379,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
logger
.
error
(
ex
.
getMessage
(),
ex
);
logger
.
error
(
ex
.
getMessage
(),
ex
);
}
finally
{
if
(
session
!=
null
)
session
.
close
();
}
}
return
null
;
return
null
;
}
}
...
@@ -779,8 +787,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -779,8 +787,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
finally
{
}
finally
{
session
.
close
();
session
.
close
();
return
resultDTO
;
}
}
return
resultDTO
;
}
}
@Override
@Override
...
...
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