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
0970abdf
Commit
0970abdf
authored
Aug 22, 2019
by
Tu Bach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tubn campaign execute manual
parent
3997216c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
4437 additions
and
36 deletions
+4437
-36
log/campaign.log
log/campaign.log
+4374
-0
src/main/java/com/viettel/campaign/filter/CorsFilter.java
src/main/java/com/viettel/campaign/filter/CorsFilter.java
+21
-21
src/main/java/com/viettel/campaign/repository/acd_full/AgentsRepository.java
...iettel/campaign/repository/acd_full/AgentsRepository.java
+1
-1
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
.../com/viettel/campaign/service/CampaignExecuteService.java
+3
-1
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+25
-8
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
...va/com/viettel/campaign/web/dto/ContactCustResultDTO.java
+1
-1
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
...ava/com/viettel/campaign/web/rest/CampaignController.java
+11
-3
src/main/resources/application.yml
src/main/resources/application.yml
+1
-1
No files found.
log/campaign.log
View file @
0970abdf
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/java/com/viettel/campaign/filter/CorsFilter.java
View file @
0970abdf
...
@@ -31,27 +31,27 @@ public class CorsFilter implements Filter {
...
@@ -31,27 +31,27 @@ public class CorsFilter implements Filter {
HttpServletRequest
request
=
(
HttpServletRequest
)
req
;
HttpServletRequest
request
=
(
HttpServletRequest
)
req
;
// chain.doFilter(req, resp);
if
(
"OPTIONS"
.
equalsIgnoreCase
(
request
.
getMethod
()))
{
chain
.
doFilter
(
req
,
resp
);
return
;
}
if
(
"/"
.
equals
(
request
.
getRequestURI
()))
{
chain
.
doFilter
(
req
,
resp
);
return
;
}
String
xAuthToken
=
request
.
getHeader
(
"X-Auth-Token"
);
if
(
xAuthToken
==
null
||
""
.
equals
(
xAuthToken
))
{
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
"The token is null."
);
return
;
}
Object
obj
=
RedisUtil
.
getInstance
().
get
(
xAuthToken
);
if
(
obj
instanceof
UserSession
)
{
chain
.
doFilter
(
req
,
resp
);
chain
.
doFilter
(
req
,
resp
);
}
else
{
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
"The token is invalid."
);
// if ("OPTIONS".equalsIgnoreCase(request.getMethod())) {
}
// chain.doFilter(req, resp);
// return;
// }
// if ("/".equals(request.getRequestURI())) {
// chain.doFilter(req, resp);
// return;
// }
// String xAuthToken = request.getHeader("X-Auth-Token");
// if (xAuthToken == null || "".equals(xAuthToken)) {
// response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "The token is null.");
// return;
// }
// Object obj = RedisUtil.getInstance().get(xAuthToken);
// if (obj instanceof UserSession) {
// chain.doFilter(req, resp);
// } else {
// response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "The token is invalid.");
// }
}
}
@Override
@Override
...
...
src/main/java/com/viettel/campaign/repository/acd_full/AgentsRepository.java
View file @
0970abdf
...
@@ -17,5 +17,5 @@ public interface AgentsRepository extends JpaRepository<Agents, String> {
...
@@ -17,5 +17,5 @@ public interface AgentsRepository extends JpaRepository<Agents, String> {
@Modifying
@Modifying
@Query
(
value
=
"UPDATE Agents SET campaignSystemStatus = :campaignSystemStatus WHERE agentId = :agentId"
)
@Query
(
value
=
"UPDATE Agents SET campaignSystemStatus = :campaignSystemStatus WHERE agentId = :agentId"
)
void
updateAgentLogoutFromCampaign
(
@Param
(
"agentId"
)
Lo
ng
agentId
,
@Param
(
"campaignSystemStatus"
)
String
campaignSystemStatus
);
void
updateAgentLogoutFromCampaign
(
@Param
(
"agentId"
)
Stri
ng
agentId
,
@Param
(
"campaignSystemStatus"
)
String
campaignSystemStatus
);
}
}
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
View file @
0970abdf
...
@@ -28,7 +28,9 @@ public interface CampaignExecuteService {
...
@@ -28,7 +28,9 @@ public interface CampaignExecuteService {
ResultDTO
getExecuteCampaign
(
CampaignRequestDTO
requestDto
);
ResultDTO
getExecuteCampaign
(
CampaignRequestDTO
requestDto
);
ResultDTO
getCall
(
CampaignCustomerDTO
dto
);
ResultDTO
getCustomer
(
CampaignCustomerDTO
dto
);
ResultDTO
getCustomerComplete
(
ReceiveCustLogDTO
dto
);
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
);
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
);
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
0970abdf
...
@@ -4,6 +4,7 @@ import com.viettel.campaign.config.DataSourceQualify;
...
@@ -4,6 +4,7 @@ import com.viettel.campaign.config.DataSourceQualify;
import
com.viettel.campaign.model.acd_full.Agents
;
import
com.viettel.campaign.model.acd_full.Agents
;
import
com.viettel.campaign.model.ccms_full.CampaignCustomer
;
import
com.viettel.campaign.model.ccms_full.CampaignCustomer
;
import
com.viettel.campaign.model.ccms_full.ContactCustResult
;
import
com.viettel.campaign.model.ccms_full.ContactCustResult
;
import
com.viettel.campaign.model.ccms_full.ReceiveCustLog
;
import
com.viettel.campaign.repository.acd_full.AgentsRepository
;
import
com.viettel.campaign.repository.acd_full.AgentsRepository
;
import
com.viettel.campaign.repository.ccms_full.*
;
import
com.viettel.campaign.repository.ccms_full.*
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.service.CampaignExecuteService
;
...
@@ -245,9 +246,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -245,9 +246,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
if
(
agents
.
getUserStatus
()
!=
null
&&
agents
.
getCampaignSystemStatus
()
!=
null
)
{
if
(
agents
.
getUserStatus
()
!=
null
&&
agents
.
getCampaignSystemStatus
()
!=
null
)
{
// tạm thời bỏ qua điều kiện này vì DB ACD không thực thi update được
if
(
agents
.
getUserStatus
().
equalsIgnoreCase
(
"CALLOUT"
)
&&
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"AVAILABLE"
))
{
// if (agents.getUserStatus().equalsIgnoreCase("CALLOUT") && agents.getCampaignSystemStatus().equalsIgnoreCase("AVAILABLE")) {
if
(
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"AVAILABLE"
))
{
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
data
.
put
(
"dialModeManual"
,
"1"
);
data
.
put
(
"dialModeManual"
,
"1"
);
}
}
...
@@ -269,9 +268,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -269,9 +268,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
Agents
agents
=
agentsRepository
.
findByAgentId
(
requestDto
.
getAgentId
());
Agents
agents
=
agentsRepository
.
findByAgentId
(
requestDto
.
getAgentId
());
//TimeZoneDialMode zoneDialMode = zoneDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeZoneDialMode zoneDialMode = zoneDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
// tạm thời bỏ qua điều kiện này vì DB ACD không thực thi update được
if
(
agents
.
getUserStatus
().
equalsIgnoreCase
(
"CALLOUT"
)
&&
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"LOGOUT"
))
{
// if (agents.getUserStatus().equalsIgnoreCase("CALLOUT") && agents.getCampaignSystemStatus().equalsIgnoreCase("LOGOUT")) {
if
(
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"LOGOUT"
))
{
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
// update acd_full.agents table
// update acd_full.agents table
Agents
a
=
new
Agents
();
Agents
a
=
new
Agents
();
...
@@ -292,7 +289,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -292,7 +289,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
}
}
@Override
@Override
public
ResultDTO
getC
all
(
CampaignCustomerDTO
dto
)
{
public
ResultDTO
getC
ustomer
(
CampaignCustomerDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
//Agents agents = agentsRepository.findByAgentId(dto.getAgentId());
//Agents agents = agentsRepository.findByAgentId(dto.getAgentId());
...
@@ -442,6 +439,26 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -442,6 +439,26 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
result
;
return
result
;
}
}
@Override
public
ResultDTO
getCustomerComplete
(
ReceiveCustLogDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
try
{
ReceiveCustLog
rclResult
=
custLogRepository
.
save
(
modelMapper
.
map
(
dto
,
ReceiveCustLog
.
class
));
agentsRepository
.
updateAgentLogoutFromCampaign
(
dto
.
getAgentId
().
toString
(),
"NOT AVAILABLE"
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
rclResult
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
return
result
;
}
@Override
@Override
public
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
)
{
public
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
...
@@ -467,7 +484,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -467,7 +484,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
try
{
try
{
agentsRepository
.
updateAgentLogoutFromCampaign
(
Long
.
parseLong
(
dto
.
getAgentId
()
),
"LOGOUT"
);
agentsRepository
.
updateAgentLogoutFromCampaign
(
dto
.
getAgentId
(
),
"LOGOUT"
);
campaignAgentRepository
.
updateCampaignAgentSetStatus
(
Long
.
parseLong
(
dto
.
getAgentId
()),
Long
.
parseLong
(
dto
.
getCampaignId
()),
0
);
campaignAgentRepository
.
updateCampaignAgentSetStatus
(
Long
.
parseLong
(
dto
.
getAgentId
()),
Long
.
parseLong
(
dto
.
getCampaignId
()),
0
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
...
...
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
View file @
0970abdf
...
@@ -10,7 +10,7 @@ import java.util.Date;
...
@@ -10,7 +10,7 @@ import java.util.Date;
@Getter
@Getter
@Setter
@Setter
@NoArgsConstructor
@NoArgsConstructor
public
class
ContactCustResultDTO
extends
BaseDTO
{
public
class
ContactCustResultDTO
extends
BaseDTO
{
private
Long
contactCustResultId
;
private
Long
contactCustResultId
;
private
Long
companySiteId
;
private
Long
companySiteId
;
private
Short
callStatus
;
private
Short
callStatus
;
...
...
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
View file @
0970abdf
package
com.viettel.campaign.web.rest
;
package
com.viettel.campaign.web.rest
;
import
com.viettel.campaign.model.ccms_full.ReceiveCustLog
;
import
com.viettel.campaign.model.ccms_full.TimeRangeDialMode
;
import
com.viettel.campaign.model.ccms_full.TimeRangeDialMode
;
import
com.viettel.campaign.model.ccms_full.TimeZoneDialMode
;
import
com.viettel.campaign.model.ccms_full.TimeZoneDialMode
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.service.CampaignExecuteService
;
...
@@ -52,10 +53,17 @@ public class CampaignController {
...
@@ -52,10 +53,17 @@ public class CampaignController {
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
@PostMapping
(
"/getC
all
"
)
@PostMapping
(
"/getC
ustomer
"
)
@ResponseBody
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
getCall
(
@RequestBody
CampaignCustomerDTO
requestDto
)
{
public
ResponseEntity
<
ResultDTO
>
getCustomer
(
@RequestBody
CampaignCustomerDTO
requestDto
)
{
ResultDTO
result
=
campaignExecuteService
.
getCall
(
requestDto
);
ResultDTO
result
=
campaignExecuteService
.
getCustomer
(
requestDto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@PostMapping
(
"/getCustomerComplete"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
getCustomerComplete
(
@RequestBody
ReceiveCustLogDTO
requestDto
)
{
ResultDTO
result
=
campaignExecuteService
.
getCustomerComplete
(
requestDto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
...
...
src/main/resources/application.yml
View file @
0970abdf
server
:
server
:
port
:
9999
port
:
1111
spring
:
spring
:
application
:
application
:
name
:
campaign
name
:
campaign
...
...
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