Showing
2 changed files
with
32 additions
and
2 deletions
| ... | @@ -450,6 +450,19 @@ public class OrderDbDTO { | ... | @@ -450,6 +450,19 @@ public class OrderDbDTO { |
| 450 | private String phone; | 450 | private String phone; |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | + @Data | ||
| 454 | + @Builder | ||
| 455 | + @ToString | ||
| 456 | + @ApiModel(description = "订单详情操作记录") | ||
| 457 | + public static class OrderDetailOperationDto { | ||
| 458 | + private Integer id; | ||
| 459 | + private Integer skuId; | ||
| 460 | + private String skuName; | ||
| 461 | + private Integer count; | ||
| 462 | + private String adjustSkuRemark; | ||
| 463 | + private String serveStatus; | ||
| 464 | + } | ||
| 465 | + | ||
| 453 | 466 | ||
| 454 | @Data | 467 | @Data |
| 455 | @Builder | 468 | @Builder | ... | ... |
| ... | @@ -47,6 +47,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; | ... | @@ -47,6 +47,7 @@ import com.infoloop.tianting.model.dto.OrderDbDTO.CreateOrderResponse; |
| 47 | import com.infoloop.tianting.model.dto.OrderDbDTO.MealDetailDto; | 47 | import com.infoloop.tianting.model.dto.OrderDbDTO.MealDetailDto; |
| 48 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailBatchUpdateDto; | 48 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailBatchUpdateDto; |
| 49 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; | 49 | import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailDto; |
| 50 | +import com.infoloop.tianting.model.dto.OrderDbDTO.OrderDetailOperationDto; | ||
| 50 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; | 51 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByConditionDto; |
| 51 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; | 52 | import com.infoloop.tianting.model.dto.OrderDbDTO.QueryOrderByPaginationDto; |
| 52 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; | 53 | import com.infoloop.tianting.model.dto.OrderDbDTO.UpdateOrderDto; |
| ... | @@ -323,14 +324,30 @@ public class OrderServiceRpcClient { | ... | @@ -323,14 +324,30 @@ public class OrderServiceRpcClient { |
| 323 | String newDetailStr = ""; | 324 | String newDetailStr = ""; |
| 324 | final var newDetail = newOrderDetails.stream().filter(n -> n.getId().equals(orgionalDetail.getId())).findFirst(); | 325 | final var newDetail = newOrderDetails.stream().filter(n -> n.getId().equals(orgionalDetail.getId())).findFirst(); |
| 325 | if (newDetail.isPresent()) { | 326 | if (newDetail.isPresent()) { |
| 327 | + final var newOrderDetailOperation = OrderDetailOperationDto.builder() | ||
| 328 | + .id(newDetail.get().getId()) | ||
| 329 | + .skuId(newDetail.get().getSkuId()) | ||
| 330 | + .skuName(newDetail.get().getShowName()) | ||
| 331 | + .count(newDetail.get().getCount()) | ||
| 332 | + .adjustSkuRemark(newDetail.get().getAdjustSkuRemark()) | ||
| 333 | + .serveStatus(newDetail.get().getServeStatus().name()) | ||
| 334 | + .build(); | ||
| 326 | try { | 335 | try { |
| 327 | - newDetailStr = objectMapper.writeValueAsString(newDetail.get()); | 336 | + newDetailStr = objectMapper.writeValueAsString(List.of(newOrderDetailOperation)); |
| 328 | } catch (JsonProcessingException e) { | 337 | } catch (JsonProcessingException e) { |
| 329 | System.out.println("orderDetail json 转换失败"); | 338 | System.out.println("orderDetail json 转换失败"); |
| 330 | } | 339 | } |
| 331 | } | 340 | } |
| 332 | try { | 341 | try { |
| 333 | - orgionalDetailStr = objectMapper.writeValueAsString(orgionalDetail); | 342 | + final var orgionalOrderDetailOperation = OrderDetailOperationDto.builder() |
| 343 | + .id(orgionalDetail.getId()) | ||
| 344 | + .skuId(orgionalDetail.getSkuId()) | ||
| 345 | + .skuName(orgionalDetail.getShowName()) | ||
| 346 | + .count(orgionalDetail.getCount()) | ||
| 347 | + .adjustSkuRemark(orgionalDetail.getAdjustSkuRemark()) | ||
| 348 | + .serveStatus(orgionalDetail.getServeStatus().name()) | ||
| 349 | + .build(); | ||
| 350 | + orgionalDetailStr = objectMapper.writeValueAsString(List.of(orgionalOrderDetailOperation)); | ||
| 334 | } catch (JsonProcessingException e) { | 351 | } catch (JsonProcessingException e) { |
| 335 | System.out.println("orderDetail json 转换失败"); | 352 | System.out.println("orderDetail json 转换失败"); |
| 336 | } | 353 | } | ... | ... |
-
Please register or login to post a comment