diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java index 4dba2cf6b7..7d5ac9ea46 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/orderCatch/DouDianOrderCatchServiceImpl.java @@ -348,7 +348,9 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService { ordersDO.setAddressCityCode(city.getId()); // 区 ordersDO.setAddressDistrict(town.getName()); - ordersDO.setAddressDistrictCode(town.getId()); + if(town.getId().length() >= 6){ + ordersDO.setAddressDistrictCode(town.getId().substring(0,6)); + } // 街道/镇 ordersDO.setTown(street.getName()); // 详细地址 @@ -546,7 +548,9 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService { ordersDO.setAddressCityCode(city.getId()); // 区 ordersDO.setAddressDistrict(town.getName()); - ordersDO.setAddressDistrictCode(town.getId()); + if(town.getId().length() >= 6){ + ordersDO.setAddressDistrictCode(town.getId().substring(0,6)); + } // 街道/镇 ordersDO.setTown(street.getName()); // 详细地址