Browse Source

feat(all): 我乐工厂

1 修改我乐工厂重复包条导致数据丢失问题
fix-sign
zhaoqiaobo 5 months ago
parent
commit
89e56c3c00
  1. 6
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java

6
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java

@ -52,6 +52,7 @@ import java.math.BigDecimal;
import java.nio.file.Files;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -131,7 +132,9 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
}
// 组装暂存单数据
List<JSONObject> advances = new ArrayList<>();
int num = 0;
for (Map.Entry<String, List<DeliveryNoteEntity>> stringListEntry : advanceMap.entrySet()) {
num = num + 1;
List<DeliveryNoteEntity> value = stringListEntry.getValue();
// 计算数量
BigDecimal totalQty = value.stream().map(i -> Convert.toBigDecimal(i.getQty())).reduce(BigDecimal.ZERO, BigDecimal::add);
@ -177,6 +180,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
advanceEntity.setCustomerAddress(orderPackageDTO.getZgkdz());
Integer anInt = Convert.toInt(orderPackageDTO.getQty());
for (int i = 0; i < anInt; i++) {
// 封装包件
TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity();
advanceDetailEntity.setWarehouseId(startWarehouseId);
@ -206,7 +210,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
advanceDetailEntity.setQuantity(1);
// 按老系统生成新的逻辑的包件号 OLO2312064418-20231226010129-1-001
if (anInt > 1) {
advanceDetailEntity.setOrderPackageCode("OLO" + orderPackageDTO.getSn() + "-" + (i + 1) + "-" + StrUtil.padPre(String.valueOf(i + 1), 3, "0"));
advanceDetailEntity.setOrderPackageCode("OLO" + orderPackageDTO.getSn() + "-" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + "-" + num + "-" + StrUtil.padPre(String.valueOf(i + 1), 3, "0"));
} else {
advanceDetailEntity.setOrderPackageCode(orderPackageDTO.getSn());
}

Loading…
Cancel
Save