Browse Source

fix: syncToErp 提前校验收件人必填字段,明确提示缺失信息

- 联系人姓名、联系电话、省/市/区/详细地址在调 ERP 前校验
- 缺失时给出明确错误消息,引导用户去门店管理完善信息

Co-Authored-By: Claude <noreply@anthropic.com>
skyline 1 day ago
parent
commit
74ce7c949c

+ 14 - 0
haha-service/src/main/java/com/haha/service/impl/ReplenishmentOrderServiceImpl.java

@@ -343,6 +343,20 @@ public class ReplenishmentOrderServiceImpl extends ServiceImpl<ReplenishmentOrde
             throw new BusinessException(400, "门店信息不存在");
         }
 
+        // 校验门店必填字段(ERP 要求收件人信息完整)
+        if (!StringUtils.hasText(shop.getContactName())) {
+            throw new BusinessException(400, "门店「" + shop.getName() + "」未设置联系人姓名,请先在门店管理中完善信息");
+        }
+        if (!StringUtils.hasText(shop.getContactPhone())) {
+            throw new BusinessException(400, "门店「" + shop.getName() + "」未设置联系电话,请先在门店管理中完善信息");
+        }
+        if (!StringUtils.hasText(shop.getProvince())
+                || !StringUtils.hasText(shop.getCity())
+                || !StringUtils.hasText(shop.getDistrict())
+                || !StringUtils.hasText(shop.getAddress())) {
+            throw new BusinessException(400, "门店「" + shop.getName() + "」收件地址不完整(省/市/区/详细地址),请先在门店管理中完善信息");
+        }
+
         // 查询明细
         List<ReplenishmentOrderItem> items = orderItemMapper.selectByOrderId(id);
         if (items == null || items.isEmpty()) {