Commit 7a7a791c authored by 332784038@qq.com's avatar 332784038@qq.com

对添加业绩日志时业务经理为null的数据给默认值0

parent 131b816c
......@@ -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