Commit 1219be5a authored by Smile's avatar Smile

feat:取消未分配客户经理异常

parent 56a99e29
......@@ -1165,37 +1165,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 如果客户正在移交新客户经理,但是未接收,并且老客户经理不为null,
// 则不创建客户经理未分配异常
//web下单,业绩为收货人,不产生未分配客户经理异常
if (order.getUserId() != null && order.getUserId() > 0 &&
customerType == 2) {
order.setSalesmanId(0L);
order.setDeptId(0L);
log.info("web下单,业绩为收货人,不产生未分配客户经理异常 orderNo={}", order.getOrderNo());
} else {
// 只有客户的客户经理为空时
String descZh = "归属客户:%s 客户编号:%s";
String descEn = "Customer: %s Customer No.: %s";
// 该客户没有客户经理, 需要生成异常,判断当前客户是发货人还是收货人
if (customerType == 1) {
// 发货人
descZh = String.format(descZh, "发货人", customerDO.getNumber());
descEn = String.format(descEn, "consignor", customerDO.getNumber());
} else {
// 收货人
descZh = String.format(descZh, "收货人", customerDO.getNumber());
descEn = String.format(descEn, "consignee", customerDO.getNumber());
}
OrderExceptionCreateReqVO orderExceptionCreateReqVO =
this.genOrderException(order.getOrderId(),
order, null,
order.getCustomerId(),
OrderExceptionEnum.NOT_CUSTOMER_SERVICE_EXCEPTION,
descZh,
descEn);
orderExceptionService.createOrderException(
orderExceptionCreateReqVO);
}
//订单下单,业绩为收货人,不产生未分配客户经理异常
order.setSalesmanId(0L);
order.setDeptId(0L);
log.info("订单下单,业绩为收货人,不产生未分配客户经理异常 orderNo={}", order.getOrderNo());
} else {
// 该订单存在该客户未分配客户经理异常,或者该客户的客户经理待接收,
// 则不再生成未分配客户经理异常,且该订单不产生业绩归属
......@@ -1237,30 +1210,11 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
infoVO.setName("订单业务经理变动/Change in Order Business Manager");
infoVO.setOrgValue(Objects.nonNull(orgAdminUserRespDTO) ? orgAdminUserRespDTO.getNickname() : "无");
infoVO.setNewValue("无");
//web下单,业绩为收货人,不产生未分配客户经理异常
if (vo.getUserId() != null && customerType == 2) {
vo.setSalesmanId(0L);
vo.setDeptId(0L);
vo.setIsCreateCustomerServiceException(Boolean.FALSE);
log.info("web下单,业绩为收货人,不产生未分配客户经理异常 orderNo={}", vo.getOrderNo());
} else {
vo.setIsCreateCustomerServiceException(Boolean.TRUE);
// 只有客户的客户经理为空时
String descZh = "归属客户:%s 客户编号:%s";
String descEn = "Customer: %s Customer No.: %s";
// 该客户没有客户经理, 需要生成异常,判断当前客户是发货人还是收货人
if (customerType == 1) {
// 发货人
descZh = String.format(descZh, "发货人", customerDO.getNumber());
descEn = String.format(descEn, "consignor", customerDO.getNumber());
} else {
// 收货人
descZh = String.format(descZh, "收货人", customerDO.getNumber());
descEn = String.format(descEn, "consignee", customerDO.getNumber());
}
vo.setDescZh(descZh);
vo.setDescEn(descEn);
}
//订单下单,业绩为收货人,不产生未分配客户经理异常
vo.setSalesmanId(0L);
vo.setDeptId(0L);
vo.setIsCreateCustomerServiceException(Boolean.FALSE);
log.info("订单下单,业绩为收货人,不产生未分配客户经理异常 orderNo={}", vo.getOrderNo());
} else {
// 该订单存在该客户未分配客户经理异常,或者该客户的客户经理待接收,则不再生成未分配客户经理异常,且该订单不产生业绩归属
vo.setSalesmanId(0L);
......@@ -5912,6 +5866,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.isNull(warehouseInDO)) {
throw exception(ORDER_NOT_WAREHOUSE_IN);
}
// 这里不会产生异常,因为不会有True的时候,只有在创建的时候产生客户经理异常的时候才会为True,但创建订单时产生客户经理异常取消了
if (orderBackVO.getIsCreateCustomerServiceException()) {
// TODO 这里会有一个问题,当审批通过时,该客户分配了客户经理并接收了,或者未接收的客户经理被接收了是否还产生异常
String descZh = orderBackVO.getDescZh();
......
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