Commit 644b7db7 authored by 332784038@qq.com's avatar 332784038@qq.com

订单中有无收货人字段值与发货人信息中区分,订单中只做是否有无收货人判断属性,客户中是是否允许设置控货无收货人

parent f0fe3503
......@@ -1891,6 +1891,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
private void updateConsignorAndConsignee(OrderConsignorDO orderConsignorDO, OrderConsigneeDO
orderConsigneeDO, OrderDO orderDO, List<String> bugList) {
orderDO.setHasConsignee(Objects.nonNull(orderConsigneeDO));
boolean flag = false;
CustomerDO consignorDO = null;
CustomerDO consigneeDO = null;
......@@ -2112,7 +2113,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 海外仓归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null && consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (order.getDrawee() == 1) {//发货人付款
......
......@@ -948,6 +948,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
public int checkOrderSalesman(OrderDO order, Long offerId, CustomerDO consignorDO, CustomerDO consigneeDO, OrderConsignorDO orderConsignorDO, OrderConsigneeDO orderConsigneeDO) {
order.setHasConsignee(Objects.nonNull(orderConsigneeDO)); // 订单是否填写了收货人
int customerType = 1; //1-业绩归属发货人,2-业绩归属收货人
if (Objects.isNull(orderConsigneeDO)) {//订单收货人
orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, order.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
......@@ -970,7 +971,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 海外仓归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null && consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (order.getDrawee() == 1) {//发货人付款
......@@ -1849,8 +1850,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (vo.getIsCargoControl() && vo.getHasConsignee() != noConsignee) {
ApplyInfoVO infoVO = new ApplyInfoVO();
infoVO.setName("控货订单发货人控货无收货人");
infoVO.setOrgValue(vo.getHasConsignee() ? "是" : "否");
infoVO.setNewValue(noConsignee ? "是" : "否");
infoVO.setOrgValue(vo.getHasConsignee() ? "有" : "无");
infoVO.setNewValue(noConsignee ? "无" : "有");
vo.setHasConsignee(noConsignee);
applyInfoList.add(infoVO);
// 发货人控货无收货人属性设置变动,需要变动客户业绩
......@@ -2558,7 +2559,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
}
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !vo.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null && consignorDO.getNoConsignee() && !vo.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
} else {
OrderAssociationOfferInfoEvent event = new OrderAssociationOfferInfoEvent(vo.getOrderId(), null, null);
......@@ -6263,6 +6264,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
consigneeDO.setCreateTime(now);
consigneeDO.setUpdateTime(now);
orderConsigneeService.save(consigneeDO);
newOrder.setHasConsignee(true);
}else {
newOrder.setHasConsignee(false);
}
if (newOrder.getIsCargoControl()) {
// 控货信息
......@@ -6431,7 +6435,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
newOrder.setIsException(null);
newOrder.setExceptionReason(null);
newOrder.setExternalWarehouseJson(null);
newOrder.setHasConsignee(null);
newOrder.setHasExitAndEntry(null);
newOrder.setHasSendRucangSms(null);
newOrder.setHasSendWarehouseInNotice(null);
......
......@@ -643,14 +643,6 @@ public class OrderQueryVO {
@ApiModelProperty(value = "是否有收货人")
private Boolean hasConsignee;
public void setHasConsignee(Boolean hasConsignee) {
if (Objects.nonNull(hasConsignee)) {
// 这里数据的条件正好相反,数据库是同步的客户信息设置,是否允许无收货人,true为允许无收货人
this.hasConsignee = !hasConsignee;
}
}
public void setStatus(Integer status) {
this.status = status;
this.asStatus = status;
......
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