Commit 1b31e29f0f9d37dedc3a7cbf01d419f01889220a

Authored by shaofan
1 parent 97a8d0f6

Add support for capturing sender and receiver location coordinates in DTOs and V…

…O, and handle location data in order creation logic.
sl-express-ms-oms-domain/src/main/java/com/sl/ms/oms/dto/MailingSaveDTO.java
@@ -14,8 +14,12 @@ import java.time.LocalDateTime; @@ -14,8 +14,12 @@ import java.time.LocalDateTime;
14 public class MailingSaveDTO { 14 public class MailingSaveDTO {
15 @ApiModelProperty("发件方地址簿id") 15 @ApiModelProperty("发件方地址簿id")
16 private Long sendAddress; 16 private Long sendAddress;
  17 + @ApiModelProperty("发件方地址经纬度")
  18 + private String sendLocation;
17 @ApiModelProperty("收件方地址簿id") 19 @ApiModelProperty("收件方地址簿id")
18 private Long receiptAddress; 20 private Long receiptAddress;
  21 + @ApiModelProperty("收件方地址经纬度")
  22 + private String receiptLocation;
19 @ApiModelProperty("取件时间") 23 @ApiModelProperty("取件时间")
20 private LocalDateTime pickUpTime; 24 private LocalDateTime pickUpTime;
21 @ApiModelProperty("取件方式") 25 @ApiModelProperty("取件方式")
sl-express-ms-oms-service/src/main/java/com/sl/ms/oms/service/impl/OrderServiceImpl.java
@@ -85,6 +85,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -85,6 +85,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
85 85
86 /** 86 /**
87 * 下单 87 * 下单
  88 + *
88 * @param mailingSaveDTO 下单信息 89 * @param mailingSaveDTO 下单信息
89 * @return 下单成功信息 90 * @return 下单成功信息
90 * @throws SLException 91 * @throws SLException
@@ -101,6 +102,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -101,6 +102,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
101 102
102 // 订单位置 103 // 订单位置
103 OrderLocationEntity orderLocation = buildOrderLocation(order); 104 OrderLocationEntity orderLocation = buildOrderLocation(order);
  105 + if (StrUtil.isNotEmpty(mailingSaveDTO.getSendLocation())) {
  106 + orderLocation.setSendLocation(mailingSaveDTO.getSendLocation());
  107 + }
  108 + if (StrUtil.isNotEmpty(mailingSaveDTO.getReceiptLocation())) {
  109 + orderLocation.setReceiveLocation(mailingSaveDTO.getReceiptLocation());
  110 + }
104 log.info("订单位置为:{}", orderLocation); 111 log.info("订单位置为:{}", orderLocation);
105 112
106 // 计算运费 113 // 计算运费
@@ -132,7 +139,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -132,7 +139,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
132 139
133 /** 140 /**
134 * 获取订单地址信息 141 * 获取订单地址信息
135 - * @param sendAddressId 发送地址ID 142 + *
  143 + * @param sendAddressId 发送地址ID
136 * @param receiptAddressId 接收地址ID 144 * @param receiptAddressId 接收地址ID
137 * @return 145 * @return
138 */ 146 */
@@ -152,6 +160,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -152,6 +160,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
152 160
153 /** 161 /**
154 * 预估总价 162 * 预估总价
  163 + *
155 * @param mailingSaveDTO 下单信息 164 * @param mailingSaveDTO 下单信息
156 * @return 运费预估信息 165 * @return 运费预估信息
157 */ 166 */
@@ -170,8 +179,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -170,8 +179,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
170 179
171 /** 180 /**
172 * 运费计算 181 * 运费计算
  182 + *
173 * @param mailingSaveDTO 下单信息 183 * @param mailingSaveDTO 下单信息
174 - * @param senderCityId 发送城市ID 184 + * @param senderCityId 发送城市ID
175 * @param receiverCityId 接收城市ID 185 * @param receiverCityId 接收城市ID
176 * @return 计算结果 186 * @return 计算结果
177 */ 187 */
@@ -196,7 +206,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -196,7 +206,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
196 206
197 /** 207 /**
198 * 补充数据 208 * 补充数据
199 - * @param order 订单 209 + *
  210 + * @param order 订单
200 * @param orderLocation 订单位置 211 * @param orderLocation 订单位置
201 */ 212 */
202 private void appendOtherInfo(OrderEntity order, OrderLocationEntity orderLocation) { 213 private void appendOtherInfo(OrderEntity order, OrderLocationEntity orderLocation) {
@@ -234,7 +245,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -234,7 +245,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
234 * 构建订单 245 * 构建订单
235 * 246 *
236 * @param mailingSaveDTO 下单信息 247 * @param mailingSaveDTO 下单信息
237 - * @param sendAddress 发送地址 248 + * @param sendAddress 发送地址
238 * @param receiptAddress 接收地址 249 * @param receiptAddress 接收地址
239 * @return 250 * @return
240 */ 251 */
@@ -310,6 +321,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -310,6 +321,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
310 321
311 /** 322 /**
312 * 合并地址 323 * 合并地址
  324 + *
313 * @param entity 订单 325 * @param entity 订单
314 * @return 地址 326 * @return 地址
315 */ 327 */
@@ -326,6 +338,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -326,6 +338,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
326 338
327 /** 339 /**
328 * 合并地址 340 * 合并地址
  341 + *
329 * @param orderDTO 订单 342 * @param orderDTO 订单
330 * @return 地址 343 * @return 地址
331 */ 344 */
@@ -341,6 +354,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -341,6 +354,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
341 354
342 /** 355 /**
343 * 合并地址 356 * 合并地址
  357 + *
344 * @return 地址 358 * @return 地址
345 */ 359 */
346 private StringBuilder areaAddress(Long province, Long city, Long county) { 360 private StringBuilder areaAddress(Long province, Long city, Long county) {
@@ -378,7 +392,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -378,7 +392,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
378 cargoEntity.setWeight(mailingSaveDTO.getTotalWeight()); 392 cargoEntity.setWeight(mailingSaveDTO.getTotalWeight());
379 393
380 // 体积 394 // 体积
381 - BigDecimal volume = ObjectUtil.isEmpty(mailingSaveDTO.getTotalVolume()) ? new BigDecimal("0.0001") : mailingSaveDTO.getTotalVolume().divide(new BigDecimal("1000000.00")); 395 + BigDecimal volume = ObjectUtil.isEmpty(mailingSaveDTO.getTotalVolume()) ? new BigDecimal("0.0001") : mailingSaveDTO.getTotalVolume().divide(new BigDecimal("1000000.00"));
382 cargoEntity.setTotalVolume(volume); 396 cargoEntity.setTotalVolume(volume);
383 cargoEntity.setVolume(volume); 397 cargoEntity.setVolume(volume);
384 return cargoEntity; 398 return cargoEntity;
@@ -422,7 +436,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl @@ -422,7 +436,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl
422 /** 436 /**
423 * 取件 437 * 取件
424 * 438 *
425 - * @param orderEntity 订单 439 + * @param orderEntity 订单
426 * @param orderLocation 位置 440 * @param orderLocation 位置
427 */ 441 */
428 private void noticeOrderStatusChange(OrderEntity orderEntity, OrderLocationEntity orderLocation) { 442 private void noticeOrderStatusChange(OrderEntity orderEntity, OrderLocationEntity orderLocation) {
sl-express-ms-web-customer/src/main/java/com/sl/ms/web/customer/vo/oms/MailingSaveVO.java
@@ -12,9 +12,15 @@ public class MailingSaveVO { @@ -12,9 +12,15 @@ public class MailingSaveVO {
12 @ApiModelProperty("发件方地址簿id") 12 @ApiModelProperty("发件方地址簿id")
13 private Long sendAddress; 13 private Long sendAddress;
14 14
  15 + @ApiModelProperty("发件方地址经纬度")
  16 + private String sendLocation;
  17 +
15 @ApiModelProperty("收件方地址簿id") 18 @ApiModelProperty("收件方地址簿id")
16 private Long receiptAddress; 19 private Long receiptAddress;
17 20
  21 + @ApiModelProperty("收件方地址经纬度")
  22 + private String receiptLocation;
  23 +
18 @ApiModelProperty("取件时间") 24 @ApiModelProperty("取件时间")
19 private String pickUpTime; 25 private String pickUpTime;
20 26