Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-cdp-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 57e081d0
authored
Sep 25, 2023
by
ThomasAdv
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改客户sop旅程阶段接口
1 parent
533de472
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
0 deletions
platform-cdp-api/src/main/java/cn/com/glsx/cdp/api/customer/CustomerSopJourneyFeignClient.java
platform-cdp-api/src/main/java/cn/com/glsx/cdp/modules/model/customer/ModifySopJourneyStageRequest.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/api/customer/CustomerSopJourneyController.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/CustomerSopJourneyService.java
platform-cdp-api/src/main/java/cn/com/glsx/cdp/api/customer/CustomerSopJourneyFeignClient.java
View file @
57e081d
...
@@ -3,6 +3,7 @@ package cn.com.glsx.cdp.api.customer;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.cdp.api.customer;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneySearch
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneySearch
;
import
cn.com.glsx.cdp.modules.model.customer.ModifySopJourneyStageRequest
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.web.Result
;
import
com.glsx.plat.core.web.Result
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
...
@@ -30,4 +31,10 @@ public interface CustomerSopJourneyFeignClient {
...
@@ -30,4 +31,10 @@ public interface CustomerSopJourneyFeignClient {
@Operation
(
description
=
"获取客户旅程详情"
)
@Operation
(
description
=
"获取客户旅程详情"
)
@GetMapping
(
"/detail"
)
@GetMapping
(
"/detail"
)
Result
<
CustomerSopJourneyDetailDTO
>
detail
(
@RequestParam
(
"orgId"
)
String
orgId
,
@RequestParam
(
"sopJourneyId"
)
String
sopJourneyId
,
@RequestParam
(
"oneId"
)
String
oneId
);
Result
<
CustomerSopJourneyDetailDTO
>
detail
(
@RequestParam
(
"orgId"
)
String
orgId
,
@RequestParam
(
"sopJourneyId"
)
String
sopJourneyId
,
@RequestParam
(
"oneId"
)
String
oneId
);
@Operation
(
description
=
"修改客户旅程"
)
@PostMapping
(
"/sopJourneyStage/modify"
)
Result
<
Boolean
>
modifyStage
(
@RequestBody
ModifySopJourneyStageRequest
request
);
}
}
platform-cdp-api/src/main/java/cn/com/glsx/cdp/modules/model/customer/ModifySopJourneyStageRequest.java
0 → 100644
View file @
57e081d
package
cn
.
com
.
glsx
.
cdp
.
modules
.
model
.
customer
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
ModifySopJourneyStageRequest
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5681594062904420438L
;
@NotEmpty
@Schema
(
description
=
"组织ID"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
String
orgId
;
@NotEmpty
@Schema
(
description
=
"客户旅程id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
String
sopJourneyId
;
@Schema
(
description
=
"客户原旅程阶段列表"
)
private
List
<
String
>
oldStages
;
@Schema
(
description
=
"oneId列表"
)
private
List
<
String
>
oneIds
;
@NotEmpty
@Schema
(
description
=
"目标客户旅程阶段"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
String
sopJourneyStage
;
@NotEmpty
@Schema
(
description
=
"操作人"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
String
oprBy
;
}
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/api/customer/CustomerSopJourneyController.java
View file @
57e081d
...
@@ -6,12 +6,14 @@ import cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO;
...
@@ -6,12 +6,14 @@ import cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneyDetailDTO
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneySearch
;
import
cn.com.glsx.cdp.modules.model.customer.CustomerSopJourneySearch
;
import
cn.com.glsx.cdp.modules.model.customer.ModifySopJourneyStageRequest
;
import
cn.com.glsx.cdp.modules.service.CustomerSopJourneyService
;
import
cn.com.glsx.cdp.modules.service.CustomerSopJourneyService
;
import
cn.com.glsx.cdp.modules.util.CommonUtils
;
import
cn.com.glsx.cdp.modules.util.CommonUtils
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
com.glsx.plat.core.enums.SysConstants
;
import
com.glsx.plat.core.web.Result
;
import
com.glsx.plat.core.web.Result
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
@@ -65,4 +67,20 @@ public class CustomerSopJourneyController implements CustomerSopJourneyFeignClie
...
@@ -65,4 +67,20 @@ public class CustomerSopJourneyController implements CustomerSopJourneyFeignClie
log
.
info
(
"获取客户旅程详情:{}"
,
customerSopJourneyDetailDTO
);
log
.
info
(
"获取客户旅程详情:{}"
,
customerSopJourneyDetailDTO
);
return
Result
.
success
(
customerSopJourneyDetailDTO
);
return
Result
.
success
(
customerSopJourneyDetailDTO
);
}
}
@Operation
(
description
=
"修改客户旅程"
)
@PostMapping
(
"/sopJourneyStage/modify"
)
public
Result
<
Boolean
>
modifyStage
(
ModifySopJourneyStageRequest
request
)
{
log
.
info
(
"修改客户旅程:{}"
,
request
);
try
{
customerSopJourneyService
.
modifyStage
(
request
);
}
catch
(
Exception
e
)
{
log
.
error
(
"修改客户旅程失败"
,
e
);
String
msg
=
e
!=
null
&&
e
.
getMessage
()
!=
null
?
e
.
getMessage
()
:
""
;
return
Result
.
failure
(
SysConstants
.
ResultStatus
.
failure
.
getCode
(),
"修改客户旅程失败:"
+
msg
);
}
log
.
info
(
"修改客户旅程成功"
);
return
Result
.
success
(
true
);
}
}
}
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/CustomerSopJourneyService.java
View file @
57e081d
package
cn
.
com
.
glsx
.
cdp
.
modules
.
service
;
package
cn
.
com
.
glsx
.
cdp
.
modules
.
service
;
import
cn.com.glsx.cdp.modules.entity.CustomerSopJourney
;
import
cn.com.glsx.cdp.modules.mapper.CustomerSopJourneyMapper
;
import
cn.com.glsx.cdp.modules.mapper.CustomerSopJourneyMapper
;
import
cn.com.glsx.cdp.modules.model.CarMaintenanceInsuranceBO
;
import
cn.com.glsx.cdp.modules.model.CarMaintenanceInsuranceBO
;
import
cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO
;
import
cn.com.glsx.cdp.modules.model.CustomerSopJourneyBO
;
import
cn.com.glsx.cdp.modules.model.customer.ModifySopJourneyStageRequest
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
...
@@ -14,8 +16,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,8 +16,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
@Slf4j
@Slf4j
...
@@ -52,4 +56,31 @@ public class CustomerSopJourneyService {
...
@@ -52,4 +56,31 @@ public class CustomerSopJourneyService {
log
.
info
(
"查询客户旅程详情结果为空,orgId:{},sopJourneyId:{},oneId:{}"
,
orgId
,
sopJourneyId
,
oneId
);
log
.
info
(
"查询客户旅程详情结果为空,orgId:{},sopJourneyId:{},oneId:{}"
,
orgId
,
sopJourneyId
,
oneId
);
return
null
;
return
null
;
}
}
/**
* 修改客户旅程阶段
*
* @param request
* @return void
* @author caiym
* @date 2023年09月25日 15:56:13
*/
public
void
modifyStage
(
ModifySopJourneyStageRequest
request
)
{
if
(
CollectionUtils
.
isEmpty
(
request
.
getOldStages
())
&&
CollectionUtils
.
isEmpty
(
request
.
getOneIds
()))
{
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATA_INVALID
,
"客户旅程阶段和oneId不能同时为空"
);
}
Example
example
=
new
Example
(
CustomerSopJourney
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
().
andEqualTo
(
"orgId"
,
request
.
getOrgId
()).
andEqualTo
(
"sopJourneyId"
,
request
.
getSopJourneyId
()).
andEqualTo
(
"delFlag"
,
0
);
if
(
CollectionUtils
.
isNotEmpty
(
request
.
getOldStages
()))
{
criteria
.
andIn
(
"sopJourneyStage"
,
request
.
getOldStages
());
}
if
(
CollectionUtils
.
isNotEmpty
(
request
.
getOneIds
()))
{
criteria
.
andIn
(
"oneId"
,
request
.
getOneIds
());
}
CustomerSopJourney
customerSopJourney
=
CustomerSopJourney
.
builder
().
sopJourneyStage
(
request
.
getSopJourneyStage
())
.
updatedBy
(
request
.
getOprBy
()).
updatedTime
(
new
Date
()).
build
();
customerSopJourneyMapper
.
updateByExampleSelective
(
customerSopJourney
,
example
);
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment