Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
eaedad02
Commit
eaedad02
authored
Nov 26, 2024
by
Smile
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:控货收货人自动创建客户
parent
7381d240
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
4 deletions
+68
-4
20241126lh.sql
sql/v2.3/20241126lh.sql
+2
-0
CustomerApiImpl.java
...er/yudao/module/customer/service/api/CustomerApiImpl.java
+55
-2
CustomerCreateFromEnum.java
...ocoder/yudao/module/ecw/enums/CustomerCreateFromEnum.java
+2
-1
OrderCargoControlPickServiceImpl.java
...derCargoControlPick/OrderCargoControlPickServiceImpl.java
+9
-1
No files found.
sql/v2.3/20241126lh.sql
0 → 100644
View file @
eaedad02
INSERT
INTO
jiedao
.
system_dict_data
(
sort
,
label
,
value
,
dict_type
,
status
,
color_type
,
css_class
,
remark
,
creator
,
create_time
,
updater
,
update_time
,
deleted
,
label_en
,
label_fr
)
VALUES
(
101
,
'客户放货推荐'
,
'101'
,
'customer_source'
,
0
,
'default'
,
''
,
NULL
,
'1'
,
'2024-11-19 10:34:42'
,
'1'
,
'2024-11-19 14:48:21'
,
0
,
'Shipper Release'
,
'Libération Expéditeur'
);
INSERT
INTO
jiedao
.
system_dict_data
(
sort
,
label
,
value
,
dict_type
,
status
,
color_type
,
css_class
,
remark
,
creator
,
create_time
,
updater
,
update_time
,
deleted
,
label_en
,
label_fr
)
VALUES
(
5
,
'后台放货信息获得'
,
'5'
,
'customer_from'
,
0
,
'default'
,
''
,
NULL
,
'1'
,
'2024-11-25 18:20:55'
,
'1'
,
'2024-11-25 18:21:25'
,
0
,
'Cargo'
,
NULL
);
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/api/CustomerApiImpl.java
View file @
eaedad02
...
@@ -32,10 +32,10 @@ public class CustomerApiImpl implements CustomerApi {
...
@@ -32,10 +32,10 @@ public class CustomerApiImpl implements CustomerApi {
@Resource
@Resource
private
CountryService
countryService
;
private
CountryService
countryService
;
public
void
associateCustomerAuto
(
String
areaCode
,
String
phone
,
Long
memberUserId
,
String
newName
,
String
memberCode
)
{
public
void
associateCustomerAuto
(
String
areaCode
,
String
phone
,
Long
memberUserId
,
String
newName
,
String
memberCode
)
{
//先查询此用户是否有关联老客户
//先查询此用户是否有关联老客户
CustomerContactsDO
customerContactsDO
=
customerContactsService
.
getUniqueOneAndValidate
(
areaCode
,
phone
,
null
);
CustomerContactsDO
customerContactsDO
=
customerContactsService
.
getUniqueOneAndValidate
(
areaCode
,
phone
,
null
);
if
(
customerContactsDO
!=
null
)
{
if
(
customerContactsDO
!=
null
)
{
//若有关联,直接更新userId
//若有关联,直接更新userId
customerContactsDO
.
setUserid
(
memberUserId
);
customerContactsDO
.
setUserid
(
memberUserId
);
...
@@ -95,6 +95,59 @@ public class CustomerApiImpl implements CustomerApi {
...
@@ -95,6 +95,59 @@ public class CustomerApiImpl implements CustomerApi {
}
}
public
void
associateCargoCustomerAuto
(
String
areaCode
,
String
phone
,
String
newName
,
String
email
)
{
//先查询此用户是否有关联老客户
CustomerContactsDO
customerContactsDO
=
customerContactsService
.
getUniqueOneAndValidate
(
areaCode
,
phone
,
null
);
if
(
customerContactsDO
==
null
)
{
CustomerCreateReqVO
customerCreateReqVO
=
new
CustomerCreateReqVO
();
//初始化名字为手机号
customerCreateReqVO
.
setName
(
newName
);
customerCreateReqVO
.
setNameEn
(
newName
);
//普通
customerCreateReqVO
.
setLevel
(
1
);
//会员注册
customerCreateReqVO
.
setSource
(
101
);
//注册会员是公司资源
customerCreateReqVO
.
setResourceType
(
2
);
//线索客户
customerCreateReqVO
.
setStatus
(
CustomerStatusEnum
.
CLUE
.
getValue
());
//更新 状态更新时间
customerCreateReqVO
.
setStatusUpdateTime
(
new
Date
());
//注册时自动创建
customerCreateReqVO
.
setIsAuto
(
1
);
//客户类型 默认为收货人
customerCreateReqVO
.
setType
(
"1"
);
//国家
CountryDO
countryDO
=
countryService
.
getCountry
(
areaCode
);
if
(
countryDO
!=
null
)
{
customerCreateReqVO
.
setCountry
(
countryDO
.
getId
());
}
//添加联系人
CustomerContactsCreateReqVO
customerContactsCreateReqVO
=
new
CustomerContactsCreateReqVO
();
customerContactsCreateReqVO
.
setName
(
newName
);
customerContactsCreateReqVO
.
setNameEn
(
newName
);
//默认联系人
customerContactsCreateReqVO
.
setIsDefault
(
1
);
customerContactsCreateReqVO
.
setAreaCode
(
areaCode
);
customerContactsCreateReqVO
.
setPhoneNew
(
phone
);
customerContactsCreateReqVO
.
setEmail
(
email
);
customerCreateReqVO
.
setCustomerContacts
(
Arrays
.
asList
(
customerContactsCreateReqVO
));
customerCreateReqVO
.
setCustomerOperateLogRemark
(
"控货收货人创建. 会员名称:"
+
newName
+
"; 电话:"
+
phone
);
// 控货收货人创建
customerCreateReqVO
.
setCreateFrom
(
CustomerCreateFromEnum
.
CARGO_CONSIGNOR
.
getValue
());
customerService
.
createCustomer
(
customerCreateReqVO
);
}
}
@Override
@Override
public
void
approvalCustomerDelay
(
String
approveId
,
Integer
result
)
{
public
void
approvalCustomerDelay
(
String
approveId
,
Integer
result
)
{
customerService
.
approvalCustomerDelay
(
approveId
,
result
);
customerService
.
approvalCustomerDelay
(
approveId
,
result
);
...
...
yudao-module-ecw/yudao-module-ecw-api/src/main/java/cn/iocoder/yudao/module/ecw/enums/CustomerCreateFromEnum.java
View file @
eaedad02
...
@@ -17,7 +17,8 @@ public enum CustomerCreateFromEnum {
...
@@ -17,7 +17,8 @@ public enum CustomerCreateFromEnum {
IMPORT
(
1
,
"导入"
),
IMPORT
(
1
,
"导入"
),
BACKEND
(
2
,
"后台用户创建"
),
BACKEND
(
2
,
"后台用户创建"
),
APP_REGISTER
(
3
,
"APP注册"
),
APP_REGISTER
(
3
,
"APP注册"
),
APP_CONSIGNOR
(
4
,
"APP发货人创建"
);
APP_CONSIGNOR
(
4
,
"APP发货人创建"
),
CARGO_CONSIGNOR
(
5
,
"控货收货人创建"
);
;
;
/**
/**
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderCargoControlPick/OrderCargoControlPickServiceImpl.java
View file @
eaedad02
...
@@ -15,6 +15,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
...
@@ -15,6 +15,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import
cn.iocoder.yudao.module.bpm.api.BpmCreateServiceFactory
;
import
cn.iocoder.yudao.module.bpm.api.BpmCreateServiceFactory
;
import
cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus
;
import
cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus
;
import
cn.iocoder.yudao.module.bpm.resp.TaskResp
;
import
cn.iocoder.yudao.module.bpm.resp.TaskResp
;
import
cn.iocoder.yudao.module.customer.service.api.CustomerApiImpl
;
import
cn.iocoder.yudao.module.ecw.api.internalMessage.ClientInternalMessageApi
;
import
cn.iocoder.yudao.module.ecw.api.internalMessage.ClientInternalMessageApi
;
import
cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto
;
import
cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto
;
import
cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi
;
import
cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi
;
...
@@ -27,6 +28,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.approval.OrderApprovalDO;
...
@@ -27,6 +28,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.approval.OrderApprovalDO;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControl.OrderCargoControlDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControl.OrderCargoControlDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControlPick.OrderCargoControlPickDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControlPick.OrderCargoControlPickDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderObjective.OrderObjectiveDO
;
import
cn.iocoder.yudao.module.order.dal.mysql.approval.OrderApprovalMapper
;
import
cn.iocoder.yudao.module.order.dal.mysql.approval.OrderApprovalMapper
;
import
cn.iocoder.yudao.module.order.dal.mysql.orderCargoControl.OrderCargoControlMapper
;
import
cn.iocoder.yudao.module.order.dal.mysql.orderCargoControl.OrderCargoControlMapper
;
import
cn.iocoder.yudao.module.order.dal.mysql.orderCargoControlPick.OrderCargoControlPickMapper
;
import
cn.iocoder.yudao.module.order.dal.mysql.orderCargoControlPick.OrderCargoControlPickMapper
;
...
@@ -34,6 +36,7 @@ import cn.iocoder.yudao.module.order.dal.mysql.orderPickup.OrderPickupMapper;
...
@@ -34,6 +36,7 @@ import cn.iocoder.yudao.module.order.dal.mysql.orderPickup.OrderPickupMapper;
import
cn.iocoder.yudao.module.order.dto.OrderCargoControlReleaseInfoDto
;
import
cn.iocoder.yudao.module.order.dto.OrderCargoControlReleaseInfoDto
;
import
cn.iocoder.yudao.module.order.param.OrderControlLogParam
;
import
cn.iocoder.yudao.module.order.param.OrderControlLogParam
;
import
cn.iocoder.yudao.module.order.service.order.OrderBusinessService
;
import
cn.iocoder.yudao.module.order.service.order.OrderBusinessService
;
import
cn.iocoder.yudao.module.order.service.order.OrderObjectiveService
;
import
cn.iocoder.yudao.module.order.service.order.OrderQueryService
;
import
cn.iocoder.yudao.module.order.service.order.OrderQueryService
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
import
cn.iocoder.yudao.module.order.service.orderCargoControl.OrderCargoControlService
;
import
cn.iocoder.yudao.module.order.service.orderCargoControl.OrderCargoControlService
;
...
@@ -120,7 +123,10 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
...
@@ -120,7 +123,10 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
private
DictDataApi
dictDataApi
;
private
DictDataApi
dictDataApi
;
@Resource
@Resource
private
ParamValidatorApi
paramValidatorApi
;
private
ParamValidatorApi
paramValidatorApi
;
@Resource
private
CustomerApiImpl
customerApiImpl
;
@Resource
private
OrderObjectiveService
objectiveService
;
@Override
@Override
public
Long
createOrderCargoControlPick
(
public
Long
createOrderCargoControlPick
(
OrderCargoControlPickCreateReqVO
createReqVO
)
{
OrderCargoControlPickCreateReqVO
createReqVO
)
{
...
@@ -335,6 +341,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
...
@@ -335,6 +341,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
orderService
.
updateById
(
orderDO
);
orderService
.
updateById
(
orderDO
);
// 订单控货信息日志补充
// 订单控货信息日志补充
orderBusinessService
.
createOrderControlLog
(
orderCargoControlPick
.
getOrderId
(),
4
,
"订单放货"
,
msg
,
0L
);
orderBusinessService
.
createOrderControlLog
(
orderCargoControlPick
.
getOrderId
(),
4
,
"订单放货"
,
msg
,
0L
);
//控货收货人自动创建客户
customerApiImpl
.
associateCargoCustomerAuto
(
orderCargoControlPick
.
getConsigneeCountryCode
(),
orderCargoControlPick
.
getConsigneePhone
(),
orderCargoControlPick
.
getConsigneeName
(),
orderCargoControlPick
.
getConsigneeEmail
());
// 返回
// 返回
return
orderCargoControlPick
.
getId
();
return
orderCargoControlPick
.
getId
();
}
}
...
...
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