Commit c88e39d7 authored by lanbaoming's avatar lanbaoming

2024-07-04-5提交

parent c4f717ee
......@@ -66,4 +66,6 @@ public interface OrderTimeMapper extends AbstractMapper<OrderTimeDO> {
//添加根据柜号获取卸柜时间
Date getUlboxtime(long shipmentId);
Date getCustomerOperateDate(long customerId,long newcustomerservice);
}
......@@ -16,6 +16,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
*/
public interface OrderTimeService extends IService<OrderTimeDO> {
Date getCustomerOperateDate(long customerId,long newcustomerservice);
/**
* 创建下单时间轴事件
*
......
......@@ -61,6 +61,12 @@ public class OrderTimeServiceImpl extends AbstractService<OrderTimeMapper, Order
return orderTime.getId();
}
public Date getCustomerOperateDate(long customerId,long newcustomerservice)
{
return orderTimeMapper.getCustomerOperateDate(customerId,
newcustomerservice);
}
@Override
public void updateOrderTime(OrderTimeUpdateReqVO updateReqVO) {
// 校验存在
......
......@@ -21,6 +21,7 @@ import cn.iocoder.yudao.module.order.service.order.OrderConsignorService;
import cn.iocoder.yudao.module.order.service.order.OrderQueryService;
import cn.iocoder.yudao.module.order.service.order.OrderService;
import cn.iocoder.yudao.module.order.enums.TargetLogEnum;
import cn.iocoder.yudao.module.order.service.order.impl.OrderTimeServiceImpl;
import cn.iocoder.yudao.module.order.vo.order.CustomDraweeVO;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -67,6 +68,9 @@ public class TargetLogServiceImpl extends
@Resource
ZTestMapper2 zTestMapper2;
@Resource
OrderTimeServiceImpl orderTimeService;
public List<TargetLogDO> selectList2(String sDate) {
return targetLogMapper.selectList2(sDate);
}
......@@ -354,11 +358,11 @@ public class TargetLogServiceImpl extends
return;
}
try {
//客户经理
Long customerId = 0L;
Long saleManid = info.getSalesmanId();
Date d0 = info.getRucangTime();
int loglev = 0;
String s_gsf = "n";
int n_gstype = 0;
......@@ -387,7 +391,19 @@ public class TargetLogServiceImpl extends
0L);
loglev = 11;
s_gsf += ",客户经理为空,不算奖金。";
} else {
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
}
if (consignorDO.getIsInOpenSea() == true) {
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
......@@ -395,6 +411,8 @@ public class TargetLogServiceImpl extends
loglev = 11;
s_gsf += ",客户在公海池,不算奖金。";
}
TargetLogDO targetLogDO = targetLogMapper.selectById(targetId);
//客户ID
targetLogDO.setCustomerId(customerId);
......@@ -408,6 +426,7 @@ public class TargetLogServiceImpl extends
return;
}
OrderConsigneeDO orderConsigneeDO =
orderConsigneeService.getOne(
new LambdaQueryWrapper<OrderConsigneeDO>().
......@@ -430,7 +449,7 @@ public class TargetLogServiceImpl extends
customerId = consignorDO.getId();
loglev = 2;
n_gstype = 1;
s_gsf = "归发货客户";
s_gsf = "发货人档案设置控货无收货人且订单无收获人,归发货客户";
//校验客户的客户经理
if (consignorDO.getCustomerService() == null ||
......@@ -440,6 +459,17 @@ public class TargetLogServiceImpl extends
0L);
loglev = 21;
s_gsf += ",客户经理为空,不算奖金。";
} else {
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
}
if (consignorDO.getIsInOpenSea() == true) {
......@@ -462,6 +492,7 @@ public class TargetLogServiceImpl extends
return;
}
List<TargetOfferBackVO> offerBackVOList =
targetLogMapper.getTargetOfferBackByOrerId(orderId);
......@@ -480,7 +511,19 @@ public class TargetLogServiceImpl extends
0L);
loglev = 31;
s_gsf += ",客户经理为空,不算奖金。";
} else {
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
}
if (consignorDO.getIsInOpenSea() == true) {
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
......@@ -515,7 +558,19 @@ public class TargetLogServiceImpl extends
0L);
loglev = 41;
s_gsf += ",客户经理为空,不算奖金。";
} else {
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
}
if (consignorDO.getIsInOpenSea() == true) {
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
......@@ -549,6 +604,17 @@ public class TargetLogServiceImpl extends
0L);
loglev = 51;
s_gsf += ",客户经理为空,不算奖金。";
} else {
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consigneeDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
}
if (consigneeDO.getIsInOpenSea() == true) {
......@@ -616,10 +682,21 @@ public class TargetLogServiceImpl extends
targetLogDO.setUpdateTime(new Date());
targetLogMapper.updateById(targetLogDO);
return;
} else {
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consigneeDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
}
if (consigneeDO.getSource() == 12) {
s_gsf += ",发货人带来的收货人,归收货人客户经理。";
s_gsf += ",发货人带来的收货人,有客户经理,归收货人客户经理。";
TargetLogDO targetLogDO = targetLogMapper.selectById(targetId);
//客户ID
targetLogDO.setCustomerId(customerId);
......@@ -663,6 +740,17 @@ public class TargetLogServiceImpl extends
0L);
loglev = 31;
s_gsf += ",客户经理为空,不算奖金。";
} else {
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
}
if (consignorDO.getCustomerService() == null ||
......@@ -704,6 +792,18 @@ public class TargetLogServiceImpl extends
loglev = 32;
s_gsf += ",客户经理为空,客户在公海池,不算奖金。";
}
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
TargetLogDO targetLogDO = targetLogMapper.selectById(targetId);
//客户ID
targetLogDO.setCustomerId(customerId);
......@@ -734,6 +834,18 @@ public class TargetLogServiceImpl extends
s_gsf += ",客户经理为空,客户在公海池,不算奖金。";
}
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入仓后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
TargetLogDO targetLogDO = targetLogMapper.selectById(targetId);
//客户ID
targetLogDO.setCustomerId(customerId);
......@@ -747,9 +859,9 @@ public class TargetLogServiceImpl extends
return;
} else if (consignorDO.getDefaultPay() &&
(info.getDrawee() == 3
&& clearanceFee == 1)) {
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
(info.getDrawee() == 3 && clearanceFee == 1)) {
//层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
loglev = 4;
customerId = orderConsignorDO.getCustomerId();
s_gsf += "无报价单,发货人档案设置默认付运费 且发货人付清关费,归发货客户";
......@@ -765,6 +877,18 @@ public class TargetLogServiceImpl extends
s_gsf += ",客户经理为空,客户在公海池,不算奖金。";
}
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consignorDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
TargetLogDO targetLogDO = targetLogMapper.selectById(targetId);
//客户ID
targetLogDO.setCustomerId(customerId);
......@@ -778,7 +902,6 @@ public class TargetLogServiceImpl extends
return;
} else {
customerId = orderConsigneeDO.getCustomerId();
loglev = 5;
s_gsf += ",不满足自定义付款人前面的条件,归收货人";
......@@ -793,6 +916,18 @@ public class TargetLogServiceImpl extends
loglev = 51;
s_gsf += ",客户经理为空,客户在公海池,不算奖金。";
}
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consigneeDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
TargetLogDO targetLogDO =
targetLogMapper.selectById(targetId);
//客户ID
......@@ -809,7 +944,6 @@ public class TargetLogServiceImpl extends
}
}
//业绩归属收货人
if (orderConsigneeDO == null) {
s_gsf = "前4级都不满足,归收货人,收货人为空,不算奖金";
......@@ -855,6 +989,18 @@ public class TargetLogServiceImpl extends
return;
}
Date d1 = orderTimeService.getCustomerOperateDate(customerId,
consigneeDO.getCustomerService());
if (d0 != null && d1 != null) {
if (d1.compareTo(d0) > 0) {
s_gsf += ",入参后归属客户经理,不算奖金。";
saleManid = 0L;
orderService.updateOrderSalesmanId(info.getOrderId(),
0L);
}
}
if (consigneeDO.getIsInOpenSea() == true) {
saleManid = 0L;
s_gsf += ",收货人客户在公海池,不算奖金。";
......
......@@ -16,6 +16,16 @@
ORDER BY create_time desc LIMIT 1
</select>
<select id="getCustomerOperateDate" resultType="java.util.Date">
SELECT update_time from
ecw_customer_operate_log where
customer_id=#{customerId} and
new_customer_service=#{newcustomerservice}
and operate_type in (3,5,7)
ORDER BY update_time desc LIMIT 1
</select>
<select id="newOrderTimeByContainerNumberAndStatus" resultType="cn.iocoder.yudao.module.order.dal.dataobject.orderTime.OrderTimeDO">
SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment