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
870c4269
Commit
870c4269
authored
May 22, 2024
by
lanbaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-05-22-3 提交
parent
792c22e8
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
20 deletions
+75
-20
EcwVzController.java
...dao/module/delivery/controller/admin/EcwVzController.java
+31
-4
CalculateCustomerType.java
...yudao/module/delivery/listener/CalculateCustomerType.java
+13
-4
CalculateOrderYeJiTypeListener.java
...ule/delivery/listener/CalculateOrderYeJiTypeListener.java
+1
-1
ReceiveCustomerCalTypeListener.java
...ule/delivery/listener/ReceiveCustomerCalTypeListener.java
+2
-3
OrderExtMapper.java
.../iocoder/yudao/module/delivery/mapper/OrderExtMapper.java
+3
-0
OrderServiceExtImpl.java
...dao/module/delivery/service/Impl/OrderServiceExtImpl.java
+5
-0
OrderServiceExt.java
...ocoder/yudao/module/delivery/service/OrderServiceExt.java
+3
-0
OrderExtMapper.xml
...elivery-rest/src/main/resources/mapper/OrderExtMapper.xml
+11
-4
OrderMapper.java
...coder/yudao/module/order/dal/mysql/order/OrderMapper.java
+6
-4
No files found.
yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/controller/admin/EcwVzController.java
View file @
870c4269
package
cn
.
iocoder
.
yudao
.
module
.
delivery
.
controller
.
admin
;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.module.delivery.entity.EcwVz
;
import
cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq
;
...
...
@@ -8,9 +9,13 @@ import cn.iocoder.yudao.module.delivery.listener.TestEvent;
import
cn.iocoder.yudao.module.delivery.service.EcwVzService
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.module.delivery.service.OrderServiceExt
;
import
cn.iocoder.yudao.module.delivery.service.ZTestService
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -22,6 +27,7 @@ import javax.validation.*;
import
io.swagger.v3.oas.annotations.Operation
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -44,6 +50,12 @@ public class EcwVzController {
@Resource
private
ZTestService
zTestService
;
@Autowired
private
OrderService
orderService
;
@Resource
private
OrderServiceExt
orderServiceExt
;
@Resource
private
ApplicationContext
applicationContext
;
...
...
@@ -144,10 +156,25 @@ public class EcwVzController {
applicationContext.publishEvent(even);
*/
zTest
m
=
new
zTest
();
m
.
setTestname
(
"111"
);
m
.
setCreatedate
(
new
Date
());
zTestService
.
save
(
m
);
zTest
m
=
new
zTest
();
orderService
.
UpdateOrderYeJiType
((
long
)
1
,
1
);
orderService
.
UpdateOrderVValue
((
long
)
1
,
new
BigDecimal
(
101
),
new
Date
());
ReceiveCustomerCalTypeEvent
e
=
new
ReceiveCustomerCalTypeEvent
();
e
.
setCustomerId
((
long
)
49345
);
if
(
orderServiceExt
.
IsHavingOrder
(
e
)
==
0
)
{
m
.
setTestname
(
"无业绩"
);
m
.
setCreatedate
(
new
Date
());
zTestService
.
save
(
m
);
}
else
{
m
.
setTestname
(
"有业绩"
);
m
.
setCreatedate
(
new
Date
());
zTestService
.
save
(
m
);
}
return
success
(
true
);
}
...
...
yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/listener/CalculateCustomerType.java
View file @
870c4269
...
...
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.delivery.listener;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.delivery.entity.deptex.zTest
;
import
cn.iocoder.yudao.module.delivery.service.OrderServiceExt
;
import
cn.iocoder.yudao.module.delivery.service.ZTestService
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -26,6 +27,10 @@ public class CalculateCustomerType {
@Resource
private
ZTestService
zTestService
;
@Resource
private
OrderServiceExt
orderServiceExt
;
/**
* 客户捞取监听事件 lanbm 2024-05-07 add
* @param event
...
...
@@ -34,7 +39,7 @@ public class CalculateCustomerType {
public
void
CalculateCustomerTypePushEvent
(
CalculateCustomerTypeEvent
event
)
{
zTest
m
=
new
zTest
();
String
sMsg
=
"计算开始"
;
String
sMsg
=
"计算开始"
+
event
.
getCustomerId
()
;
if
(
event
.
getNewCustomerService
()
==
event
.
getOldCustomerService
())
{
//新客户经理和老客户经理是同一客户经理
//继续判断有无成交记录
...
...
@@ -72,9 +77,13 @@ public class CalculateCustomerType {
1.线索2.意向3.成交
*/
private
boolean
isHaving_TransactionRecords
(
CalculateCustomerTypeEvent
event
)
{
if
(
event
.
getStatus
()
==
3
)
return
true
;
else
int
c
=
orderServiceExt
.
IsHavingOrder
(
event
)
;
if
(
c
==
0
)
return
false
;
else
return
true
;
}
}
yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/listener/CalculateOrderYeJiTypeListener.java
View file @
870c4269
...
...
@@ -45,7 +45,7 @@ public class CalculateOrderYeJiTypeListener {
CalculateOrderYeJiTypeEvent
event
)
{
zTest
m
=
new
zTest
();
String
sMsg
=
"计算业绩类型"
;
String
sMsg
=
"计算业绩类型"
+
event
.
getCustomerId
()
;
OrderDO
orderDO
=
orderService
.
getById
(
event
.
getOrderId
());
if
(
orderDO
==
null
)
{
...
...
yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/listener/ReceiveCustomerCalTypeListener.java
View file @
870c4269
...
...
@@ -39,7 +39,7 @@ public class ReceiveCustomerCalTypeListener {
//CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断
//CustomerServiceImpl updateCustomer 函数中触发,完善客户信息
zTest
m
=
new
zTest
();
String
sMsg
=
"接收客户"
;
String
sMsg
=
"接收客户"
+
event
.
getCustomerId
()
;
if
(
event
.
getIsNew
()
==
true
)
{
//移交接收前是新客户
sMsg
+=
",新客户"
;
...
...
@@ -67,11 +67,10 @@ public class ReceiveCustomerCalTypeListener {
/*
判断客户是否有已入参订单
select COUNT(id) from ecw_target_log where deleted = 0 and customer_id = 17442
需要在2个表中查询数据
*/
private
boolean
IsHavingRuCanOrder
(
ReceiveCustomerCalTypeEvent
event
)
{
//判断客户是否有已入参订单
//int a = orderServiceExt.IsHavingOrderConsignee(event);//收货方客户
//int b = orderServiceExt.IsHavingOrderConsignor(event);//发货方客户
int
c
=
orderServiceExt
.
IsHavingOrder
(
event
);
if
(
c
==
0
)
return
false
;
...
...
yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/mapper/OrderExtMapper.java
View file @
870c4269
package
cn
.
iocoder
.
yudao
.
module
.
delivery
.
mapper
;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent
;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent
;
import
cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -21,4 +22,6 @@ public interface OrderExtMapper {
*/
int
IsHavingOrder
(
ReceiveCustomerCalTypeEvent
event
);
int
IsHavingOrder
(
CalculateCustomerTypeEvent
event
);
}
yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/service/Impl/OrderServiceExtImpl.java
View file @
870c4269
package
cn
.
iocoder
.
yudao
.
module
.
delivery
.
service
.
Impl
;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent
;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent
;
import
cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt
;
import
cn.iocoder.yudao.module.delivery.mapper.OrderExtMapper
;
...
...
@@ -38,4 +39,8 @@ public class OrderServiceExtImpl implements OrderServiceExt {
return
orderExtMapper
.
IsHavingOrder
(
event
);
}
public
int
IsHavingOrder
(
CalculateCustomerTypeEvent
event
)
{
return
orderExtMapper
.
IsHavingOrder
(
event
);
}
}
yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/service/OrderServiceExt.java
View file @
870c4269
package
cn
.
iocoder
.
yudao
.
module
.
delivery
.
service
;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent
;
import
cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent
;
//import cn.iocoder.yudao.module.delivery.entity.orderdata.OrderExt;
...
...
@@ -24,4 +25,6 @@ public interface OrderServiceExt {
*/
int
IsHavingOrder
(
ReceiveCustomerCalTypeEvent
event
);
int
IsHavingOrder
(
CalculateCustomerTypeEvent
event
);
}
yudao-module-delivery/yudao-module-delivery-rest/src/main/resources/mapper/OrderExtMapper.xml
View file @
870c4269
...
...
@@ -28,10 +28,17 @@
<select
id=
"IsHavingOrder"
resultType=
"java.lang.Integer"
>
select COUNT(id)
from ecw_target_log
where deleted = 0
and customer_id = #{customerId}
SELECT COUNT(*)
from (
select id as id
from ecw_target_log
where deleted = 0
and customer_id = #{customerId}
UNION
SELECT order_id as id
from ecw_order
where deleted = 0
and customer_id = #{customerId}) as a
</select>
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dal/mysql/order/OrderMapper.java
View file @
870c4269
...
...
@@ -6003,7 +6003,8 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
lanbm 2024-05-13 add
*/
@Update
(
"update ecw_order set yeji_type=#{yejiType} where order_id = #{orderId}"
)
void
UpdateOrderYeJiType
(
@Param
(
"orderId"
)
Long
orderId
,
int
yejiType
);
void
UpdateOrderYeJiType
(
@Param
(
"orderId"
)
Long
orderId
,
@Param
(
"yejiType"
)
int
yejiType
);
/*
...
...
@@ -6011,8 +6012,9 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
yeji_create_date 业绩产生时间
简单的SQL语句用SQL注解来写比较方便
*/
@Update
(
"update ecw_order set cal_v_value=#{yejiType},yeji_create_date=#{yejiCreateDate} where order_id = #{orderId}"
)
void
UpdateOrderVValue
(
@Param
(
"orderId"
)
Long
orderId
,
BigDecimal
calVvalue
,
Date
yejiCreateDate
);
@Update
(
"update ecw_order set cal_v_value=#{calVvalue},yeji_create_date=#{yejiCreateDate} where order_id = #{orderId}"
)
void
UpdateOrderVValue
(
@Param
(
"orderId"
)
Long
orderId
,
@Param
(
"calVvalue"
)
BigDecimal
calVvalue
,
@Param
(
"yejiCreateDate"
)
Date
yejiCreateDate
);
}
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