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