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
adbc0add
Commit
adbc0add
authored
Aug 29, 2019
by
Nguyen Ha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sonar
parent
554d9852
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
src/main/java/com/viettel/campaign/service/impl/CampaignCfgServiceImpl.java
...viettel/campaign/service/impl/CampaignCfgServiceImpl.java
+13
-10
No files found.
src/main/java/com/viettel/campaign/service/impl/CampaignCfgServiceImpl.java
View file @
adbc0add
...
@@ -44,8 +44,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -44,8 +44,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
null
;
session
.
beginTransaction
();
if
(
DataUtil
.
isNullOrZero
(
companySiteId
))
{
if
(
DataUtil
.
isNullOrZero
(
companySiteId
))
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
...
@@ -54,6 +53,8 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -54,6 +53,8 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
}
}
try
{
try
{
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
// StringBuilder sqlStrBuilder = new StringBuilder();
// StringBuilder sqlStrBuilder = new StringBuilder();
// sqlStrBuilder.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_STATUS_MNG, "findAll-CampaignCompleteCode"));
// sqlStrBuilder.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_STATUS_MNG, "findAll-CampaignCompleteCode"));
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
...
@@ -132,7 +133,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -132,7 +133,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
}
finally
{
session
.
close
();
if
(
session
!=
null
)
session
.
close
();
}
}
return
resultDTO
;
return
resultDTO
;
...
@@ -278,8 +279,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -278,8 +279,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
null
;
session
.
beginTransaction
();
if
(
DataUtil
.
isNullOrZero
(
completeCodeDTO
.
getCompanySiteId
()))
{
if
(
DataUtil
.
isNullOrZero
(
completeCodeDTO
.
getCompanySiteId
()))
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
...
@@ -288,6 +288,8 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -288,6 +288,8 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
}
}
try
{
try
{
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
// StringBuilder sqlStrBuilder = new StringBuilder();
// StringBuilder sqlStrBuilder = new StringBuilder();
// sqlStrBuilder.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_STATUS_MNG, "get-max-value-completevalue"));
// sqlStrBuilder.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_STATUS_MNG, "get-max-value-completevalue"));
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
...
@@ -323,9 +325,9 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -323,9 +325,9 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
}
finally
{
session
.
close
();
if
(
session
!=
null
)
session
.
close
();
return
resultDTO
;
}
}
return
resultDTO
;
}
}
@Override
@Override
...
@@ -367,8 +369,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -367,8 +369,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
null
;
session
.
beginTransaction
();
if
(
DataUtil
.
isNullOrZero
(
campaignCompleteCodeId
))
{
if
(
DataUtil
.
isNullOrZero
(
campaignCompleteCodeId
))
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
...
@@ -377,6 +378,8 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -377,6 +378,8 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
}
}
try
{
try
{
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
// StringBuilder sqlStrBuilder = new StringBuilder();
// StringBuilder sqlStrBuilder = new StringBuilder();
// sqlStrBuilder.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_STATUS_MNG,"findCampaignCodeById"));
// sqlStrBuilder.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_STATUS_MNG,"findCampaignCodeById"));
...
@@ -437,7 +440,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -437,7 +440,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
}
finally
{
session
.
close
();
if
(
session
!=
null
)
session
.
close
();
}
}
return
resultDTO
;
return
resultDTO
;
...
...
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