Browse Source

Merge branch 'dev' into pre-production

master
zhenghaoyu 8 months ago
parent
commit
8e586ac6e9
  1. 28
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java
  2. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  3. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  4. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

28
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java

@ -3,10 +3,8 @@ package com.logpm.trunkline.mq;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.service.*;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
@ -27,13 +25,14 @@ import java.util.*;
@RabbitListener(queues = RabbitConstant.OPEN_ORDER_LOAD_SCAN_QUEUE)
public class OpenOrderToLoadListener {
private final ITrunklineAdvanceService advanceService;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final ITrunklineCarsLoadScanService carsLoadScanService;
private final ITrunklineCarsLoadService carsLoadService;
private final ITrunklineCarsOrderService carsOrderService;
private final ITrunklineCarsLoadLineService carsLoadLineService;
private final ITrunklineWaybillOrderService waybillOrderService;
private final IInComingService inComingService;
@RabbitHandler
@Transactional(rollbackFor = Exception.class)
@ -48,6 +47,7 @@ public class OpenOrderToLoadListener {
Set<Long> loadIds = new HashSet<>();
for (Object object : advanceIds) {
Long advanceId = (Long) object;
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = advanceDetailService.findListByAdvanceId(advanceId);
for (TrunklineAdvanceDetailEntity advanceDetailEntity : advanceDetailEntityList) {
String orderPackageCode = advanceDetailEntity.getOrderPackageCode();
@ -61,7 +61,21 @@ public class OpenOrderToLoadListener {
carsLoadScanEntity.setIsSupple(1);
carsLoadScanEntity.setLoadingAbnormal(0);
carsLoadScanEntity.setUnloadAbnormal(0);
String packageStatus = advanceDetailEntity.getPackageStatus();
if("0".equals(packageStatus)){
//未入库,强制入库
Long warehouseId = advanceDetailEntity.getWarehouseId();
InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(orderPackageCode);
inComingDTO.setIncomingType(10);
inComingDTO.setWarehouseId(warehouseId);
inComingService.incomingPackage(inComingDTO);
carsLoadScanEntity.setFromWarehouseId(warehouseId);
}else{
carsLoadScanEntity.setFromWarehouseId(advanceDetailEntity.getIncomingWarehouseId());
}
carsLoadScanService.updateById(carsLoadScanEntity);
Long loadId = carsLoadScanEntity.getLoadId();
Long warehouseId = carsLoadScanEntity.getWarehouseId();
String warehouseName = carsLoadScanEntity.getWarehouseName();
@ -87,8 +101,8 @@ public class OpenOrderToLoadListener {
trunklineCarsOrderEntity.setLoadLineId(carsLoadLineEntity.getId());
trunklineCarsOrderEntity.setOrderCode(orderCode);
trunklineCarsOrderEntity.setWaybillNo(waybillNo);
Integer totalNum = waybillOrderService.findTotalNumByWaybillNoAndOrderCode(waybillId,orderCode);
trunklineCarsOrderEntity.setTotalNum(totalNum);
// Integer totalNum = waybillOrderService.findTotalNumByWaybillNoAndOrderCode(waybillId,orderCode);
trunklineCarsOrderEntity.setTotalNum(advanceEntity.getTotalNum());
trunklineCarsOrderEntity.setPlanNum(0);
trunklineCarsOrderEntity.setIsCustomer("0");
trunklineCarsOrderEntity.setRealNum(0);

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

@ -49,7 +49,7 @@ public class InComingServiceImpl implements IInComingService {
Long warehouseId = inComingDTO.getWarehouseId();//仓库id
String warehouseName = inComingDTO.getWarehouseName();
Long billladingId = inComingDTO.getBillladingId();//提货单id
Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体
Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 10补录数据入库
String trayCode = inComingDTO.getTrayCode();//托盘码
String trayType = inComingDTO.getTrayType();//打托方式

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

@ -184,7 +184,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
String filename = QRCodeUtil.createCodeToFile(vo.getQrCode());
map.put("img", QRCodeUtil.getEmpAutograph(filename));
// 订单号 生成二维码
String fileTypeName = QRCodeUtil.createCodeToFile(vo.getOrderCode());
String fileTypeName = QRCodeUtil.createCodeToFile(vo.getQrCode());
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
data.add(map);
}

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

@ -914,7 +914,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
String loadStatus = carsLoadEntity.getLoadStatus();
if (!"80".equals(loadStatus)) {
if ("80".equals(loadStatus)) {
log.warn("#############unloadByLoadId: 配载计划已终点卸车确认 loadStatus={}", loadStatus);
throw new CustomerException(400, "配载计划已终点卸车确认");
}
@ -5327,12 +5327,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if (Objects.isNull(stockArticleEntity)) {
log.warn("##################removeCarsLoadScan: 订单信息不存在 fromWarehouseId={} orderCode={}", fromWarehouseId, orderCode);
return R.fail(405, "订单信息不存在");
}
if (!Objects.isNull(stockArticleEntity)) {
Long articleId = stockArticleEntity.getId();
distributionStockArticleClient.submitHandleNumByOrderId(-num, articleId);
}
if (type == 1) {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, fromWarehouseId);

Loading…
Cancel
Save