Commit dcf977b6 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'master-fix' into dev

parents c7f2a341 c385c3e0
...@@ -200,6 +200,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -200,6 +200,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId()); AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId());
if (Objects.nonNull(adminUserRespDTO)) { if (Objects.nonNull(adminUserRespDTO)) {
order.setDeptId(adminUserRespDTO.getDeptId()); order.setDeptId(adminUserRespDTO.getDeptId());
}else {
order.setDeptId(0L);
} }
} else if (CollectionUtil.isEmpty(orderExceptionDOList) && } else if (CollectionUtil.isEmpty(orderExceptionDOList) &&
Objects.nonNull(customerDO) Objects.nonNull(customerDO)
...@@ -2048,6 +2050,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -2048,6 +2050,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(customerDO.getCustomerService()); AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(customerDO.getCustomerService());
if (Objects.nonNull(adminUserRespDTO)) { if (Objects.nonNull(adminUserRespDTO)) {
orderDO.setDeptId(adminUserRespDTO.getDeptId()); orderDO.setDeptId(adminUserRespDTO.getDeptId());
}else {
orderDO.setDeptId(0L);
} }
} else { } else {
orderDO.setSalesmanId(0L); orderDO.setSalesmanId(0L);
......
...@@ -103,7 +103,7 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -103,7 +103,7 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
public void addTargetLog(Long orderId, Date achievementTime, TargetLogEnum targetLogEnum) { public void addTargetLog(Long orderId, Date achievementTime, TargetLogEnum targetLogEnum) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
if (targetLogEnum.getType() == 1 || targetLogEnum.getType() == 3) {//装柜和合单 if (targetLogEnum.getType() == 1 || targetLogEnum.getType() == 3) {//装柜和合单
dealTargetLog(orderId, achievementTime,targetLogEnum.getType()); dealTargetLog(orderId, achievementTime, targetLogEnum.getType());
} else if (targetLogEnum.getType() == 2 || targetLogEnum.getType() == 4) {//退仓和拆单 } else if (targetLogEnum.getType() == 2 || targetLogEnum.getType() == 4) {//退仓和拆单
targetLogMapper.delete(new LambdaQueryWrapperX<TargetLogDO>() targetLogMapper.delete(new LambdaQueryWrapperX<TargetLogDO>()
.eq(TargetLogDO::getOrderId, orderId)); .eq(TargetLogDO::getOrderId, orderId));
...@@ -116,12 +116,12 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -116,12 +116,12 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
orderIds.stream().forEach(item -> targetLogMapper.delete(new LambdaQueryWrapperX<TargetLogDO>() orderIds.stream().forEach(item -> targetLogMapper.delete(new LambdaQueryWrapperX<TargetLogDO>()
.eq(TargetLogDO::getOrderId, item))); .eq(TargetLogDO::getOrderId, item)));
} else if (targetLogEnum.getType() == 4) {//拆单,分别计算每个订单的业绩归属 } else if (targetLogEnum.getType() == 4) {//拆单,分别计算每个订单的业绩归属
orderIds.stream().forEach(item -> dealTargetLog(item, achievementTime,targetLogEnum.getType())); orderIds.stream().forEach(item -> dealTargetLog(item, achievementTime, targetLogEnum.getType()));
} }
} }
@Override @Override
public List<TargetLogDO> getTargetLogListByUserIds(List<Long> collect, Date startTime,Date endTime) { public List<TargetLogDO> getTargetLogListByUserIds(List<Long> collect, Date startTime, Date endTime) {
List<TargetLogDO> targetLogDOS = targetLogMapper.selectList(new LambdaQueryWrapperX<TargetLogDO>() List<TargetLogDO> targetLogDOS = targetLogMapper.selectList(new LambdaQueryWrapperX<TargetLogDO>()
.betweenIfPresent(TargetLogDO::getAchievementTime, startTime, endTime) .betweenIfPresent(TargetLogDO::getAchievementTime, startTime, endTime)
.in(TargetLogDO::getUserId, collect)); .in(TargetLogDO::getUserId, collect));
...@@ -136,19 +136,19 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -136,19 +136,19 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
if (targetLogDO == null) { if (targetLogDO == null) {
Date time = targetLogMapper.selectCabinetSealingTime(orderDO.getOrderId()); Date time = targetLogMapper.selectCabinetSealingTime(orderDO.getOrderId());
if (time != null) { if (time != null) {
dealTargetLog(orderDO.getOrderId(),time,TargetLogEnum.LOADING.getType()); dealTargetLog(orderDO.getOrderId(), time, TargetLogEnum.LOADING.getType());
} }
} }
}); });
} }
private void dealTargetLog(Long orderId, Date achievementTime,Integer type) { private void dealTargetLog(Long orderId, Date achievementTime, Integer type) {
long selectCount = targetLogMapper.selectCount(TargetLogDO::getOrderId, orderId); long selectCount = targetLogMapper.selectCount(TargetLogDO::getOrderId, orderId);
if (selectCount > 0L) { if (selectCount > 0L) {
return; return;
} }
OrderBackInfoDto info = orderQueryService.info(orderId); OrderBackInfoDto info = orderQueryService.info(orderId);
if (info.getIsInOpenSea()){ if (info.getIsInOpenSea()) {
// 订单归属客户产生业绩时在公海池,不添加业绩日志 // 订单归属客户产生业绩时在公海池,不添加业绩日志
return; return;
} }
...@@ -167,21 +167,21 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -167,21 +167,21 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
// } // }
// } // }
// } // }
TargetLogDO targetLogDO = new TargetLogDO(); TargetLogDO targetLogDO = new TargetLogDO();
targetLogDO.setOrderId(orderId); targetLogDO.setOrderId(orderId);
targetLogDO.setCustomerId(info.getCustomerId()); targetLogDO.setCustomerId(info.getCustomerId());
targetLogDO.setUserId(info.getSalesmanId()); targetLogDO.setUserId(Objects.isNull(info.getSalesmanId()) ? 0L : info.getSalesmanId());
targetLogDO.setAchievementTime(achievementTime); targetLogDO.setAchievementTime(achievementTime);
if (info.getTransportId() == 3) { if (info.getTransportId() == 3) {
targetLogDO.setLdBoxTime(achievementTime); targetLogDO.setLdBoxTime(achievementTime);
} else { } else {
targetLogDO.setLdBoxTime(targetLogMapper.selectCabinetLoadTime(orderId)); targetLogDO.setLdBoxTime(targetLogMapper.selectCabinetLoadTime(orderId));
} }
targetLogDO.setCompleteVolume(info.getWVolume()); targetLogDO.setCompleteVolume(info.getWVolume());
targetLogDO.setCompleteWeight(info.getVWeight()); targetLogDO.setCompleteWeight(info.getVWeight());
targetLogDO.setType(type); targetLogDO.setType(type);
targetLogMapper.insert(targetLogDO); targetLogMapper.insert(targetLogDO);
// customerService.updateCustomerIsNewToOld(customerId); // customerService.updateCustomerIsNewToOld(customerId);
// } // }
} }
} }
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