From f3980edd2e4aaab0991bff2d71e0ac2e5aceb804 Mon Sep 17 00:00:00 2001 From: qiezi <15576055375@163.com> Date: Thu, 8 Aug 2024 11:25:36 +0800 Subject: [PATCH] 2024/07/02 --- .../shipment/service/impl/ShipmentRollServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/spring/modules/shipment/service/impl/ShipmentRollServiceImpl.java b/src/main/java/com/spring/modules/shipment/service/impl/ShipmentRollServiceImpl.java index eb22690..defd911 100644 --- a/src/main/java/com/spring/modules/shipment/service/impl/ShipmentRollServiceImpl.java +++ b/src/main/java/com/spring/modules/shipment/service/impl/ShipmentRollServiceImpl.java @@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.PatternMatchUtils; import org.springframework.util.StringUtils; import java.math.BigDecimal; @@ -283,8 +284,12 @@ public class ShipmentRollServiceImpl extends ServiceImpl{ - if (!item.getBoxNoStr().contains("-")){ +// if (!PatternMatchUtils.simpleMatch(reg, item.getBoxNoStr())){ +// item.setBoxNoStr(shipmentVo.getShipmentId() + "-" + String.format("%03d", Integer.parseInt(item.getBoxNoStr()))); +// } + if (!item.getBoxNoStr().contains("-")){// 如果有误使用正则表达式 item.setBoxNoStr(shipmentVo.getShipmentId() + "-" + String.format("%03d", Integer.parseInt(item.getBoxNoStr()))); } return item;