Browse Source

Merge remote-tracking branch 'origin/dev' into dev

pre-production
pref_mail@163.com 2 days ago
parent
commit
7f056dbc9c
  1. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java
  2. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  3. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java
  4. 285
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java
  5. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderAllTaskVO.java
  6. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderTaskVO.java
  7. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  8. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  9. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  10. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  11. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  12. 19
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  13. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  14. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  15. 102
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSplitOrderTaskController.java

@ -6,6 +6,8 @@ import com.logpm.distribution.dto.splitOrder.*;
import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity;
import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity;
import com.logpm.distribution.service.IDistributionSplitOrderTaskService;
import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO;
import com.logpm.distribution.vo.DistributionSplitOrderTaskVO;
import com.logpm.distribution.vo.SplitPackageOrderVO;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
@ -30,7 +32,7 @@ public class DistributionSplitOrderTaskController {
}
@GetMapping("/all-task-list")
public R<IPage<DistributionSplitOrderAllTaskEntity>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
public R<IPage<DistributionSplitOrderAllTaskVO>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
return distributionSplitOrderTaskService.allTaskList(query, distributionSplitAllTaskSearchDTO);
}
@ -96,7 +98,7 @@ public class DistributionSplitOrderTaskController {
}
@GetMapping("/task-list")
public R<IPage<DistributionSplitOrderTaskEntity>> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) {
public R<IPage<DistributionSplitOrderTaskVO>> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) {
return distributionSplitOrderTaskService.taskList(query, distributionSplitTaskSearchDTO);
}

44
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -81,30 +81,36 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
String key = orderCode + warehouseId;
Boolean exists = bladeRedis.exists(key);
if(exists){
String idStr = bladeRedis.get(key);
if("1".equals(idStr)){
return 1L;
}else{
return Long.valueOf(idStr);
}
}else{
bladeRedis.setEx(key,"1",30L);
DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(ObjectUtils.isNotEmpty(distributionStockArticle)){
bladeRedis.setEx(key,distributionStockArticle.getId(),30L);
return distributionStockArticle.getId();
try{
Boolean exists = bladeRedis.exists(key);
if(exists){
String idStr = bladeRedis.get(key);
if("1".equals(idStr)){
return 1L;
}else{
return Long.valueOf(idStr);
}
}else{
boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity);
if(saveFlag){
bladeRedis.setEx(key,distributionStockArticleEntity.getId(),30L);
return distributionStockArticleEntity.getId();
bladeRedis.setEx(key,"1",30L);
DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(ObjectUtils.isNotEmpty(distributionStockArticle)){
bladeRedis.setEx(key,distributionStockArticle.getId().toString(),30L);
return distributionStockArticle.getId();
}else{
return 0L;
boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity);
if(saveFlag){
bladeRedis.setEx(key,distributionStockArticleEntity.getId().toString(),30L);
return distributionStockArticleEntity.getId();
}else{
return 0L;
}
}
}
}catch (Exception e){
log.error("#######addData: 保存订单失败",e);
return 0L;
}
}
@Override

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java

@ -6,6 +6,8 @@ import com.logpm.distribution.dto.splitOrder.DistributionSplitAllTaskSearchDTO;
import com.logpm.distribution.dto.splitOrder.DistributionSplitTaskSearchDTO;
import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity;
import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity;
import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO;
import com.logpm.distribution.vo.DistributionSplitOrderTaskVO;
import com.logpm.distribution.vo.SplitPackageOrderVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
@ -24,7 +26,7 @@ public interface IDistributionSplitOrderTaskService extends BaseService<Distribu
* @param distributionSplitTaskSearchDTO
* @return
*/
R<IPage<DistributionSplitOrderTaskEntity>> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO);
R<IPage<DistributionSplitOrderTaskVO>> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO);
/**
* 拆单总任务
@ -32,7 +34,7 @@ public interface IDistributionSplitOrderTaskService extends BaseService<Distribu
* @param distributionSplitAllTaskSearchDTO
* @return
*/
R<IPage<DistributionSplitOrderAllTaskEntity>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO);
R<IPage<DistributionSplitOrderAllTaskVO>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO);
/**
* 创建任务

285
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

@ -1,11 +1,13 @@
package com.logpm.distribution.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.SerializationUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.splitOrder.DistributionSplitAllTaskSearchDTO;
import com.logpm.distribution.dto.splitOrder.DistributionSplitTaskSearchDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
@ -21,6 +23,8 @@ import com.logpm.distribution.service.IDistributionSplitOrderDetailService;
import com.logpm.distribution.service.IDistributionSplitOrderLogService;
import com.logpm.distribution.service.IDistributionSplitOrderTaskService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO;
import com.logpm.distribution.vo.DistributionSplitOrderTaskVO;
import com.logpm.distribution.vo.SplitPackageOrderVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -30,6 +34,7 @@ import org.springblade.common.constant.order.OrderSplitStateConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -37,15 +42,17 @@ import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLockClient;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.system.cache.UserCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
@AllArgsConstructor
@ -58,10 +65,11 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
private final IDistributionSplitOrderDetailService distributionSplitOrderDetailService;
private final IDistributionSplitOrderLogService distributionSplitOrderLogService;
private final RedisLockClient redisLockClient;
private final IUserClient iUserClient;
@Override
public R<IPage<DistributionSplitOrderTaskEntity>> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) {
public R<IPage<DistributionSplitOrderTaskVO>> taskList(Query query, DistributionSplitTaskSearchDTO distributionSplitTaskSearchDTO) {
LambdaQueryWrapper<DistributionSplitOrderTaskEntity> queryWrapper = Wrappers.lambdaQuery();
if (distributionSplitTaskSearchDTO.getSplitOrderAllTaskId() != null) {
queryWrapper.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, distributionSplitTaskSearchDTO.getSplitOrderAllTaskId());
@ -83,10 +91,31 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
IPage<DistributionSplitOrderTaskEntity> page = Condition.getPage(query);
List<DistributionSplitOrderTaskEntity> list = list(page, queryWrapper);
page.setRecords(list);
IPage<DistributionSplitOrderTaskVO> pageRes = Condition.getPage(query);
List<DistributionSplitOrderTaskEntity> list = list(page, queryWrapper);
List<DistributionSplitOrderTaskVO> listVo = new ArrayList<>();
if (list != null && !list.isEmpty()) {
Map<Long, String> userIdNameMap = getUserIdNameMap(list.stream().map(DistributionSplitOrderTaskEntity::getCreateUser).collect(Collectors.toList()));
listVo = list.stream().map(item -> {
DistributionSplitOrderTaskVO distributionSplitOrderTaskVO = new DistributionSplitOrderTaskVO();
BeanUtil.copyProperties(item, distributionSplitOrderTaskVO);
distributionSplitOrderTaskVO.setCreateUserName(userIdNameMap.get(item.getCreateUser()));
return distributionSplitOrderTaskVO;
}).collect(Collectors.toList());
}
pageRes.setRecords(listVo);
pageRes.setPages(page.getPages());
pageRes.setTotal(page.getTotal());
return R.data(page);
return R.data(pageRes);
}
private Map<Long, String> getUserIdNameMap(List<Long> list) {
String createUserIds = list.stream().map((d) -> d + "").collect(Collectors.joining(","));
List<User> users = iUserClient.userInfoByIds(AuthUtil.getTenantId(), createUserIds).getData();
return users.stream().collect(Collectors.toMap(User::getId, User::getName));
}
@Transactional
@ -112,23 +141,31 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"不允许拆单");
}
long packageAllowCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
);
long packageAllCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
);
long packageAllowCount = getSplitOrderAllowCount(stockArticleId);
long packageAllCount = getSplitOrderAllCount(stockArticleId);
if (packageAllowCount == 0 || packageAllCount == 1) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"包件数量不足,不允许拆单");
}
boolean exists = exists(
Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getStockArticleId, stockArticleId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.InProgress.getValue())
);
if (exists) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"正在拆单中,不允许重复拆单");
}
int taskNumber = distributionSplitOrderTaskList
.stream()
.map(DistributionSplitOrderTaskEntity::getTaskNumber)
.mapToInt(Integer::intValue)
.sum();
if (packageAllowCount < taskNumber) {
return R.fail("拆单数大于订单包件数量,请重新填写,目前可拆单数量:" + packageAllowCount);
}
taskLock(stockArticleId, () -> {
String allTaskNo = getAllTaskNo();
DistributionSplitOrderAllTaskEntity allTask = new DistributionSplitOrderAllTaskEntity();
@ -138,10 +175,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
allTask.setNumber(distributionSplitOrderTaskList.size());
allTask.setState(OrderSplitStateConstant.InProgress.getValue());
allTask.setMallName(distributionStockArticle.getMallName());
int taskNumber = distributionSplitOrderTaskList.stream()
.map(DistributionSplitOrderTaskEntity::getTaskNumber)
.mapToInt(Integer::intValue)
.sum();
allTask.setOrderPackageNumber(taskNumber);
distributionSplitOrderAllTaskService.save(allTask);
@ -254,12 +288,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("提交包件包含不属于当前拆单订单的包件");
}
int addNumber = packageCodes.size();
try {
List<DistributionSplitOrderDetailEntity> existsList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes)
);
int addNumber = packageCodes.size();
if (!existsList.isEmpty()) {
if (existsList.stream().anyMatch(detail -> !detail.getSplitOrderTaskId().equals(taskId) && detail.getState().equals(OrderPackageSplitStateConstant.finish.getValue()))) {
return R.fail("提交包件包含其他拆单任务的包件");
@ -318,7 +352,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
log.error("添加包件系统错误", e);
throw new CustomerException("系统错误");
}
return R.success("success");
return Resp.scanSuccess("操作成功", addNumber == 0 ? "重复扫描" : task.getNumber() + "件");
}
@Deprecated
@ -530,66 +564,25 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
if (task == null) {
return R.fail("任务不存在");
}
if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) {
return R.fail("拆单任务不在进行中,无法撤销");
}
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId());
if (allTask == null) {
return R.fail("总任务不存在");
}
DistributionStockArticleEntity oldStockArticle = distributionStockArticleService.getById(task.getStockArticleId());
DistributionStockArticleEntity newStockArticle = distributionStockArticleService.getById(task.getNewStockArticleId());
if (oldStockArticle == null) {
oldStockArticle = distributionStockArticleService.getOne(Wrappers.<DistributionStockArticleEntity>lambdaQuery()
.eq(DistributionStockArticleEntity::getId, task.getStockArticleId())
.eq(DistributionStockArticleEntity::getIsDeleted, 1)
);
if (oldStockArticle == null) {
return R.fail("订单错误,无法删除");
}
oldStockArticle.setIsDeleted(0);
}
List<DistributionParcelListEntity> packageList = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>lambdaQuery()
.eq(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId()));
if (packageList.stream().anyMatch(distributionParcelListEntity -> OrderPackageReservationStatusConstant.yiyueyue.getValue().equals(distributionParcelListEntity.getOrderPackageReservationStatus()))) {
return R.fail("新的订单包件已预约,无法删除");
long count = count(
Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, task.getSplitOrderAllTaskId())
.in(DistributionSplitOrderTaskEntity::getState, Arrays.asList(OrderSplitStateConstant.InProgress.getValue(), OrderSplitStateConstant.finish.getValue()))
);
if (count == 1) {
return R.fail("总任务下只有一条任务,无法撤销");
}
try {
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>lambdaUpdate()
.eq(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId())
.set(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId())
.set(DistributionParcelListEntity::getOrderCode, task.getOrderCode())
);
if (newStockArticle != null) {
newStockArticle.setTotalNumber(0);
newStockArticle.setHandQuantity(0);
distributionStockArticleService.updateById(newStockArticle);
oldStockArticle.setTotalNumber(oldStockArticle.getTotalNumber() + newStockArticle.getTotalNumber());
oldStockArticle.setHandQuantity(oldStockArticle.getHandQuantity() + newStockArticle.getHandQuantity());
}
distributionStockArticleService.updateById(oldStockArticle);
distributionSplitOrderDetailService.update(Wrappers.<DistributionSplitOrderDetailEntity>lambdaUpdate()
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, taskId)
.set(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.cancel.getValue())
.set(DistributionSplitOrderDetailEntity::getCancelUser, AuthUtil.getUser().getUserId())
.set(DistributionSplitOrderDetailEntity::getCancelUsername, AuthUtil.getUser().getUserName())
);
distributionSplitOrderLogService.record(task, "取消拆单任务", AuthUtil.getUser().getUserName());
allTask.setNumber(allTask.getNumber() - 1);
allTask.setOrderPackageNumber(allTask.getOrderPackageNumber() - task.getTaskNumber());
distributionSplitOrderAllTaskService.updateById(allTask);
task.setIsDeleted(1);
task.setNumber(0);
updateById(task);
cancelTask(task);
return R.success("success");
} catch (Exception e) {
log.error("取消拆单任务系统错误", e);
@ -604,6 +597,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
if (task == null) {
return R.fail("拆单任务不存在");
}
if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) {
return R.fail("拆单任务不在进行中,无法取消");
}
long count = distributionSplitOrderDetailService.count(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes)
@ -618,11 +614,6 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
msg += "等" + packageCodes.size() + "个包件";
}
if (task.getNumber() == packageCodes.size()) {
distributionSplitOrderLogService.record(task, String.format("取消包件:%s", msg), AuthUtil.getUser().getUserName());
return deleteTask(taskId);
}
try{
distributionSplitOrderDetailService.update(Wrappers.<DistributionSplitOrderDetailEntity>lambdaUpdate()
@ -699,6 +690,10 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
newOrder.setTotalNumber(packageList.size());
newOrder.setHandQuantity(packageList.size());
newOrder.setIncomingNum(packageList.size());
newOrder.setCustomerAddress(task.getCustomerAddress());
newOrder.setCustomerName(task.getCustomerName());
newOrder.setCustomerTelephone(task.getCustomerTelephone());
if (newOrder.getId() != null) {
distributionStockArticleService.updateById(newOrder);
}else{
@ -723,10 +718,11 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
* @param taskId
* @return
*/
@Transactional
@Override
public R<String> cancelTask(Long taskId) {
DistributionSplitOrderTaskEntity task = getById(taskId);
if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) {
if (!task.getState().equals(OrderSplitStateConstant.finish.getValue())) {
return R.fail("任务未已完成,无法操作");
}
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId());
@ -735,28 +731,44 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
try {
task.setState(OrderSplitStateConstant.cancel.getValue());
task.setState(OrderSplitStateConstant.InProgress.getValue());
updateById(task);
distributionSplitOrderLogService.record(task, "撤消拆单任务", AuthUtil.getUser().getUserName());
} catch (Exception e) {
if (e instanceof CustomerException) {
throw new CustomerException(e.getMessage());
}
log.error("撤消拆单任务系统错误", e);
log.error("拆单任务取消完成系统错误", e);
throw new CustomerException("系统错误");
}
return R.success("操作成功");
}
/**
* 撤销任务
*/
public void cancelTask(DistributionSplitOrderTaskEntity task){
task.setState(OrderSplitStateConstant.cancel.getValue());
updateById(task);
distributionSplitOrderDetailService.update(
Wrappers.<DistributionSplitOrderDetailEntity>lambdaUpdate()
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, task.getId())
.set(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.cancel.getValue())
.set(DistributionSplitOrderDetailEntity::getCancelUser, AuthUtil.getUser().getUserId())
.set(DistributionSplitOrderDetailEntity::getCancelUsername, AuthUtil.getUser().getUserName())
);
distributionSplitOrderLogService.record(task, "撤消拆单任务", AuthUtil.getUser().getUserName());
}
@Transactional
@Override
public R<String> cancelAllTask(Long allTaskId) {
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId);
if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.finish.getValue())) {
return R.fail("拆单总任务已完成,无法操作");
return R.fail("拆单总任务完成,无法操作");
}
if (!list(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
@ -766,8 +778,19 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("拆单总任务中存在已完成拆单任务,无法操作");
}
List<DistributionSplitOrderTaskEntity> list = list(
Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId)
);
long finishCount = list.stream().filter(task -> task.getState().equals(OrderSplitStateConstant.finish.getValue())).count();
if (finishCount > 0) {
return R.fail("拆单任务中存在已完成拆单任务,无法操作");
}
allTask.setState(OrderSplitAllTaskStateConstant.cancel.getValue());
distributionSplitOrderAllTaskService.updateById(allTask);
list.forEach(this::cancelTask);
return R.success("success");
}
@ -780,11 +803,11 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("拆单总任务已完成或已取消,无法操作");
}
DistributionSplitOrderTaskEntity existsInProgress = getOne(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
boolean existsInProgress = exists(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.InProgress.getValue())
);
if (existsInProgress != null) {
if (existsInProgress) {
return R.fail("拆单总任务中存在未完成拆单任务,无法操作");
}
@ -836,8 +859,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
@Override
public R<IPage<DistributionSplitOrderAllTaskEntity>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
public R<IPage<DistributionSplitOrderAllTaskVO>> allTaskList(Query query, DistributionSplitAllTaskSearchDTO distributionSplitAllTaskSearchDTO) {
IPage<DistributionSplitOrderAllTaskEntity> page = Condition.getPage(query);
IPage<DistributionSplitOrderAllTaskVO> pageResult = Condition.getPage(query);
LambdaQueryWrapper<DistributionSplitOrderAllTaskEntity> queryWrapper = Wrappers.lambdaQuery();
@ -878,18 +902,49 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
if (splitOrderAllTaskId == 0) {
return R.data(page);
return R.data(pageResult);
}
queryWrapper.eq(DistributionSplitOrderAllTaskEntity::getId, splitOrderAllTaskId);
}
List<DistributionSplitOrderAllTaskEntity> list = distributionSplitOrderAllTaskService.list(page, queryWrapper);
page.setRecords(list);
List<DistributionSplitOrderAllTaskVO> listVo = new ArrayList<>();
if (list != null && !list.isEmpty()) {
Map<Long, String> userMap = getUserIdNameMap(list.stream().map(DistributionSplitOrderAllTaskEntity::getCreateUser).collect(Collectors.toList()));
Map<Long, Long> allTaskIdPackageNumber = getAllTaskIdPackageNumber(list.stream().map(DistributionSplitOrderAllTaskEntity::getId).collect(Collectors.toList()));
listVo = list.stream().map(d -> {
DistributionSplitOrderAllTaskVO vo = new DistributionSplitOrderAllTaskVO();
BeanUtil.copyProperties(d, vo);
vo.setCreateUserName(userMap.get(d.getCreateUser()));
vo.setSplitPackageNumber(allTaskIdPackageNumber.get(d.getId()));
return vo;
}).collect(Collectors.toList());
}
return R.data(page);
pageResult.setRecords(listVo);
pageResult.setPages(page.getPages());
pageResult.setTotal(page.getTotal());
return R.data(pageResult);
}
private Map<Long, Long> getAllTaskIdPackageNumber(List<Long> taskIds){
List<Map<String, Object>> maps = baseMapper.selectMaps(
Wrappers.<DistributionSplitOrderTaskEntity>query()
.select("split_order_all_task_id", "SUM(number) as number")
.eq("split_order_all_task_id", taskIds)
.in("state", OrderSplitStateConstant.InProgress.getValue(), OrderSplitStateConstant.finish.getValue())
.groupBy("split_order_all_task_id")
);
return maps.stream().collect(Collectors.toMap(
m -> Long.valueOf(m.get("split_order_all_task_id").toString()),
m -> Long.valueOf(m.get("number").toString())
));
}
@Override
public R<Object> getTaskDetail(Long taskId) {
R<List<SplitPackageOrderVO>> PackageOrderList = getPackageCodeByTaskId(taskId);
@ -902,20 +957,40 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
res.put("packageList", PackageOrderList.getData());
res.put("logList", logList);
res.put("info", getById(taskId));
return R.data(res);
}
public long getSplitOrderAllowCount(Long stockArticleId) {
return distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
);
}
@Override
public R<String> checkOrderCode(String orderCode) {
DistributionSplitOrderAllTaskEntity exists = distributionSplitOrderAllTaskService.getOne(
Wrappers.<DistributionSplitOrderAllTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderAllTaskEntity::getOrderCode, orderCode)
public long getSplitOrderAllCount(Long stockArticleId) {
return distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
);
}
return R.success(exists == null ? "" : exists.getNo());
@Override
public R<String> checkOrderCode(String orderCode) {
DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.getOne(Wrappers.<DistributionStockArticleEntity>lambdaQuery()
.eq(DistributionStockArticleEntity::getOrderCode, orderCode));
long splitOrderAllCount = getSplitOrderAllCount(distributionStockArticle.getId());
long splitOrderAllowCount = getSplitOrderAllowCount(distributionStockArticle.getId());
if (splitOrderAllowCount == 0 || splitOrderAllCount == 1) {
return R.success("该订单无法拆单");
}
return R.success("");
}
@Override

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderAllTaskVO.java

@ -0,0 +1,16 @@
package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionSplitOrderAllTaskEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class DistributionSplitOrderAllTaskVO extends DistributionSplitOrderAllTaskEntity {
private String createUserName;
/**
* 已拆单包件数量
*/
private Long splitPackageNumber;
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/vo/DistributionSplitOrderTaskVO.java

@ -0,0 +1,11 @@
package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class DistributionSplitOrderTaskVO extends DistributionSplitOrderTaskEntity {
private String createUserName;
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -1093,12 +1093,14 @@ public class CarsLoadController {
// return R.fail(405,"未知的发车类型");
// }
carsLoadService.unloadByLoadId(loadCarsDTO);
try{
//同步一次系统无编码数据
carsLoadService.syncNoSystemData(loadId, myCurrentWarehouse.getId(), myCurrentWarehouse.getName());
carsLoadService.unloadByLoadId(loadCarsDTO);
carsLoadService.sendStationArrivedEnter(loadCarsDTO);
}catch (Exception e){

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -93,7 +93,6 @@
<select id="selectInfoByIds" resultType="com.logpm.trunkline.vo.OpenOrderVO">
select GROUP_CONCAT(DISTINCT brand) brand,
GROUP_CONCAT(DISTINCT train_number) trainNumber,
GROUP_CONCAT(DISTINCT order_code) orderCode,
GROUP_CONCAT(DISTINCT dealer_code) dealerCode,
GROUP_CONCAT(DISTINCT dealer_name) dealerName
from logpm_trunkline_advance

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java

@ -206,5 +206,5 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
String findBrandNameByCarLoadCode(@Param("loadCode") String loadCode);
int findEntityByOrderPackageCodeAndUnloadTime(@Param("orderPackageCode") String orderPackageCode, @Param("unloadTime") Date unloadTime);
int findEntityByOrderPackageCodeAndUnloadTime(@Param("orderPackageCode") String orderPackageCode, @Param("unloadTime") Date unloadTime, @Param("warehouseId") Long warehouseId);
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -1233,6 +1233,7 @@
from logpm_trunkline_cars_load_scan ltcls
where ltcls.scan_code = #{orderPackageCode}
and ltcls.unload_time > #{unloadTime}
and ltcls.unload_node_id != #{warehouseId}
</select>

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -213,5 +213,5 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
*/
String findBrandNameByCarLoadCode(String loadCode);
int findEntityByOrderPackageCodeAndUnloadTime(String orderPackageCode, Date unloadTime);
int findEntityByOrderPackageCodeAndUnloadTime(String orderPackageCode, Date unloadTime, Long warehouseId);
}

19
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -18,6 +18,7 @@ import com.logpm.basic.entity.BasicCarModelEntity;
import com.logpm.basic.feign.IBasicCarModelClient;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.FindParamterDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
@ -548,6 +549,16 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
List<AftersalesAbnormalRecordEntity> addList = new ArrayList<>();
List<TrunklineCarsLoadScanEntity> noUnloadList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoUnloadList(loadId, warehouseId);
//把noUnloadList中所有元素的scanCode放入一个List
List<String> scanCodeList = noUnloadList.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList());
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(scanCodeList);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList转化成以orderPackageCode作为key的Map
Map<String, DistributionParcelListEntity> parcelMap = parcelListEntityList.stream()
.collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity()));
for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : noUnloadList) {
String loadCode = trunklineCarsLoadScanEntity.getLoadCode();
String waybillNo = trunklineCarsLoadScanEntity.getWaybillNo();
@ -579,6 +590,14 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
abnormalRecordEntity.setRemark("无卸车记录");
abnormalRecordEntity.setIsZero(0);
abnormalRecordEntity.setNum(1);
DistributionParcelListEntity distributionParcel = parcelMap.get(scanCode);
if(!Objects.isNull(distributionParcel)){
abnormalRecordEntity.setAbnormalStatus(1);
abnormalRecordEntity.setDealTime(new Date());
abnormalRecordEntity.setDealUserId(userId);
abnormalRecordEntity.setDealUserName(nickName);
abnormalRecordEntity.setRemark("无卸车记录,已入库,系统判定自动完结");
}
addList.add(abnormalRecordEntity);
// abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity);
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -320,6 +320,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String dealerName = null;
String dealerCode = null;
String brand = null;
Set<String> orderCodeSet = new HashSet<>();
for (TrunklineAdvanceEntity advanceEntity : list) {
if (StringUtil.isBlank(dealerName)) {
dealerName = advanceEntity.getDealerName();
@ -328,11 +329,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
if (StringUtil.isBlank(brand)) {
brand = advanceEntity.getBrand();
}
orderCodeSet.add(advanceEntity.getOrderCode());
}
OpenOrderVO openOrderVO = new OpenOrderVO();
//查询品牌 客户车次号 订单自编码
OpenOrderVO infoByIds = advanceService.selectInfoByIds(advanceIds);
BeanUtil.copy(infoByIds, openOrderVO);
openOrderVO.setOrderCode(String.join(",", orderCodeSet));
openOrderVO.setAdvanceIds(advanceIds);
BasicdataBrandEntity basicdataBrandEntity = basicdataBrandClient.findEntityByName(brand);
if (!Objects.isNull(basicdataBrandEntity)) {
@ -4051,6 +4054,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
String dealerName = null;
String brand = null;
Integer totalNum = 0;
Set<String> orderCodeSet = new HashSet<>();
for (TrunklineAdvanceEntity advanceEntity : list) {
if (StringUtil.isBlank(dealerName)) {
dealerName = advanceEntity.getDealerName();
@ -4060,11 +4064,15 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
totalNum = totalNum + advanceEntity.getTotalNum();
orderCodeSet.add(advanceEntity.getOrderCode());
}
OpenOrderVO openOrderVO = new OpenOrderVO();
//查询品牌 客户车次号 订单自编码
OpenOrderVO infoByIds = advanceService.selectInfoByIds(advanceIds);
BeanUtil.copy(infoByIds, openOrderVO);
openOrderVO.setOrderCode(String.join(",", orderCodeSet));
openOrderVO.setAdvanceIds(advanceIds);
//发站仓-----目前登录人的仓库
openOrderVO.setDepartureWarehouseName(basicdataWarehouseEntity.getName());

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -515,7 +515,7 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
}
@Override
public int findEntityByOrderPackageCodeAndUnloadTime(String orderPackageCode, Date unloadTime) {
return baseMapper.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime);
public int findEntityByOrderPackageCodeAndUnloadTime(String orderPackageCode, Date unloadTime, Long warehouseId) {
return baseMapper.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime,warehouseId);
}
}

102
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -54,10 +54,8 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.constant.*;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
@ -9768,22 +9766,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// carsLoadAsyncService.sendReportPackageSignData(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,carsLoadEntity,scanCodes);
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(scanCodes);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
parcelListEntityList.forEach(parcelListEntity -> {
PackageData packageData = new PackageData();
packageData.setWaybillNumber(parcelListEntity.getWaybillNumber());
packageData.setBrand(parcelListEntity.getBrandName());
packageData.setPackageCode(parcelListEntity.getOrderPackageCode());
packageData.setMaterialCode(parcelListEntity.getMaterialCode());
packageData.setMaterialName(parcelListEntity.getMaterialName());
packageData.setNumber(1);
packageData.setOrderCode(parcelListEntity.getOrderCode());
packageData.setPackageType(PackageTypeEnums.CMP);
packageDataList.add(packageData);
});
// FindParamterDTO findParamterDTO = new FindParamterDTO();
// findParamterDTO.setOrderPackageCodeList(scanCodes);
// findParamterDTO.setWarehouseId(warehouseId);
// List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
// parcelListEntityList.forEach(parcelListEntity -> {
// PackageData packageData = new PackageData();
// packageData.setWaybillNumber(parcelListEntity.getWaybillNumber());
// packageData.setBrand(parcelListEntity.getBrandName());
// packageData.setPackageCode(parcelListEntity.getOrderPackageCode());
// packageData.setMaterialCode(parcelListEntity.getMaterialCode());
// packageData.setMaterialName(parcelListEntity.getMaterialName());
// packageData.setNumber(1);
// packageData.setOrderCode(parcelListEntity.getOrderCode());
// packageData.setPackageType(PackageTypeEnums.CMP);
// packageDataList.add(packageData);
// });
}else{
@ -9803,19 +9801,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
TrunklineScanZeroDetailEntity entity = new TrunklineScanZeroDetailEntity();
BeanUtil.copy(zeroDetailVO, entity);
zeroDetailList.add(entity);
Long packageId = zeroDetailVO.getPackageId();
DistributionParcelListEntity parcelList = parcelListMap.get(packageId);
if(!Objects.isNull(parcelList)){
PackageData packageData = new PackageData();
packageData.setWaybillNumber(parcelList.getWaybillNumber());
packageData.setBrand(parcelList.getBrandName());
packageData.setProductId(zeroDetailVO.getGoodsId());
packageData.setProductName(zeroDetailVO.getGoodsName());
packageData.setNumber(zeroDetailVO.getUnloadNum());
packageData.setOrderCode(parcelList.getOrderCode());
packageData.setPackageType(PackageTypeEnums.LTL);
packageDataList.add(packageData);
}
// Long packageId = zeroDetailVO.getPackageId();
// DistributionParcelListEntity parcelList = parcelListMap.get(packageId);
// if(!Objects.isNull(parcelList)){
// PackageData packageData = new PackageData();
// packageData.setWaybillNumber(parcelList.getWaybillNumber());
// packageData.setBrand(parcelList.getBrandName());
// packageData.setProductId(zeroDetailVO.getGoodsId());
// packageData.setProductName(zeroDetailVO.getGoodsName());
// packageData.setNumber(zeroDetailVO.getUnloadNum());
// packageData.setOrderCode(parcelList.getOrderCode());
// packageData.setPackageType(PackageTypeEnums.LTL);
// packageDataList.add(packageData);
// }
});
@ -9830,10 +9828,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
});
NodeFanoutMsg<TripartiteVO> tripartiteVONodeFanoutMsg = buildNodeFanoutMessage(carsLoadEntity, packageDataList, warehouseId);
if(!Objects.isNull(tripartiteVONodeFanoutMsg)){
rabbitTemplate.convertAndSend(FanoutConstants.trunkline.tripartite.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(tripartiteVONodeFanoutMsg));
}
// NodeFanoutMsg<TripartiteVO> tripartiteVONodeFanoutMsg = buildNodeFanoutMessage(carsLoadEntity, packageDataList, warehouseId);
// if(!Objects.isNull(tripartiteVONodeFanoutMsg)){
// rabbitTemplate.convertAndSend(FanoutConstants.trunkline.tripartite.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(tripartiteVONodeFanoutMsg));
// }
return R.success("签收成功");
}
@ -13543,6 +13541,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<String> scanCodeList = new ArrayList<>(scanCodeSet);
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(scanCodeList);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList转化成以orderPackageCode作为key的Map
Map<String, DistributionParcelListEntity> parcelMap = parcelListEntityList.stream()
.collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity()));
List<TrunklineAdvanceDetailEntity> allAdvanceDetailList = new ArrayList<>();
int packageBatchSize = 500;
@ -13643,7 +13651,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
orderPackageCodeList.add(orderPackageCode);
//查询是否有在系统无编码后进行卸车的数据
int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime);
int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime,warehouseId);
if(unloadNum > 0){
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if(!Objects.isNull(parcelListEntity)){
@ -13666,11 +13674,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateParceList.add(updateEntity);
});
}
TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity();
updateEntity.setId(trunklineAdvanceDetailEntity.getId());
updateEntity.setNowWarehouseId(warehouseId);
updateEntity.setNowWarehouseName(warehouseName);
updateNowWarehouseList.add(updateEntity);
DistributionParcelListEntity parcelList = parcelMap.get(orderPackageCode);
if(Objects.isNull(parcelList)){
TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity();
updateEntity.setId(trunklineAdvanceDetailEntity.getId());
updateEntity.setNowWarehouseId(warehouseId);
updateEntity.setNowWarehouseName(warehouseName);
updateNowWarehouseList.add(updateEntity);
}
}
});
@ -13682,10 +13694,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList);
}
if(CollUtil.isNotEmpty(updateScanList)){
trunklineCarsLoadScanService.updateBatchById(updateScanList);
}
// List<DistributionParcelListEntity> updateParceList = new ArrayList<>();
@ -13717,6 +13725,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
if(CollUtil.isNotEmpty(updateScanList)){
trunklineCarsLoadScanService.updateBatchById(updateScanList);
}
// trunklineCarsLoadScanService.updateBatchById(updateScanList);
//完结所有包件异常列表

Loading…
Cancel
Save