wangyingyang

update order detail

No preview for this file type
1 package com.infoloop.tianting.controller; 1 package com.infoloop.tianting.controller;
2 2
3 import com.github.xiaoymin.knife4j.annotations.ApiSupport; 3 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
4 +import com.infoloop.tianting.clientcustomerservice.BatchCreateClientCustomerLabelRefsRpcRequest;
4 import com.infoloop.tianting.model.dto.ClientLabelDTO; 5 import com.infoloop.tianting.model.dto.ClientLabelDTO;
5 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto; 6 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto;
7 +import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto;
8 +import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefResponseDto;
6 import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto; 9 import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto;
7 import com.infoloop.tianting.model.dto.ClientLabelDTO.LabelDto; 10 import com.infoloop.tianting.model.dto.ClientLabelDTO.LabelDto;
8 import com.infoloop.tianting.model.dto.MealDbDTO; 11 import com.infoloop.tianting.model.dto.MealDbDTO;
...@@ -18,6 +21,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -18,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
18 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
19 import org.springframework.http.HttpStatus; 22 import org.springframework.http.HttpStatus;
20 import org.springframework.validation.annotation.Validated; 23 import org.springframework.validation.annotation.Validated;
24 +import org.springframework.web.bind.annotation.DeleteMapping;
21 import org.springframework.web.bind.annotation.PathVariable; 25 import org.springframework.web.bind.annotation.PathVariable;
22 import org.springframework.web.bind.annotation.PostMapping; 26 import org.springframework.web.bind.annotation.PostMapping;
23 import org.springframework.web.bind.annotation.RequestBody; 27 import org.springframework.web.bind.annotation.RequestBody;
...@@ -57,4 +61,12 @@ public class LabelController { ...@@ -57,4 +61,12 @@ public class LabelController {
57 @PathVariable Integer enterpriseId, @PathVariable Integer customerId) { 61 @PathVariable Integer enterpriseId, @PathVariable Integer customerId) {
58 return clientCustomerService.getCustomerLabelsByCustomerId(enterpriseId, customerId); 62 return clientCustomerService.getCustomerLabelsByCustomerId(enterpriseId, customerId);
59 } 63 }
64 +
65 + @ApiOperation(value = "批量删除用户绑定的标签")
66 + @DeleteMapping("/customer/label/refs")
67 + @ResponseStatus(HttpStatus.OK)
68 + public BatchDeleteCustomerLabelRefResponseDto getCustomerLabelsByCustomerId(
69 + @Valid@RequestBody ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto request) {
70 + return clientCustomerService.deleteClientCustomerLabelRefsByIds(request);
71 + }
60 } 72 }
......
...@@ -91,4 +91,12 @@ public class ClientLabelDTO { ...@@ -91,4 +91,12 @@ public class ClientLabelDTO {
91 private Integer enterpriseId; 91 private Integer enterpriseId;
92 } 92 }
93 93
94 + @Data
95 + @Builder
96 + @ToString
97 + @ApiModel(description = "批量删除用户标签请求 DTO")
98 + public static class BatchDeleteCustomerLabelRefResponseDto {
99 + private boolean isDeleted;
100 + }
101 +
94 } 102 }
......
...@@ -327,6 +327,9 @@ public class OrderDbDTO { ...@@ -327,6 +327,9 @@ public class OrderDbDTO {
327 @ApiModelProperty(value = "订单详情表主键,自增整数") 327 @ApiModelProperty(value = "订单详情表主键,自增整数")
328 private Integer id; 328 private Integer id;
329 329
330 + @ApiModelProperty(value = "企业 ID")
331 + private Integer enterpriseId;
332 +
330 @ApiModelProperty(value = "订单id") 333 @ApiModelProperty(value = "订单id")
331 private Integer orderId; 334 private Integer orderId;
332 335
......
...@@ -4,6 +4,8 @@ import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.ClientCustomerDto; ...@@ -4,6 +4,8 @@ import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.ClientCustomerDto;
4 import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.HospitalRecordDto; 4 import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.HospitalRecordDto;
5 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefDto; 5 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefDto;
6 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto; 6 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto;
7 +import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto;
8 +import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefResponseDto;
7 import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto; 9 import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto;
8 import java.util.List; 10 import java.util.List;
9 11
...@@ -21,6 +23,8 @@ public interface ClientCustomerService { ...@@ -21,6 +23,8 @@ public interface ClientCustomerService {
21 23
22 List<CustomerLabelRefDetailDto> getCustomerLabelsByCustomerId( 24 List<CustomerLabelRefDetailDto> getCustomerLabelsByCustomerId(
23 Integer enterpriseId, Integer customerId); 25 Integer enterpriseId, Integer customerId);
24 - //deleteClientCustomerLabelRefsByIds 26 +
27 + BatchDeleteCustomerLabelRefResponseDto deleteClientCustomerLabelRefsByIds(
28 + BatchDeleteCustomerLabelRefRequestDto deleteRequestDto);
25 29
26 } 30 }
......
...@@ -89,7 +89,7 @@ public class ClientCustomerServiceRpcClient { ...@@ -89,7 +89,7 @@ public class ClientCustomerServiceRpcClient {
89 return clientCustomerServiceRpcBlockingStub.queryClientCustomerLabelRefsByCondition(request); 89 return clientCustomerServiceRpcBlockingStub.queryClientCustomerLabelRefsByCondition(request);
90 } 90 }
91 91
92 - public DeleteClientCustomerLabelRefsRpcResponse deleteClientCustomerLabelRefsByIds( 92 + public DeleteClientCustomerLabelRefsRpcResponse batchDeleteClientCustomerLabelRefsByIds(
93 BatchDeleteCustomerLabelRefRequestDto batchDeleteCustomerLabelRefRequestDto) { 93 BatchDeleteCustomerLabelRefRequestDto batchDeleteCustomerLabelRefRequestDto) {
94 final var request = DeleteClientCustomerLabelRefsByIdsRpcRequest.newBuilder() 94 final var request = DeleteClientCustomerLabelRefsByIdsRpcRequest.newBuilder()
95 .setEnterpriseId(batchDeleteCustomerLabelRefRequestDto.getEnterpriseId()) 95 .setEnterpriseId(batchDeleteCustomerLabelRefRequestDto.getEnterpriseId())
......
...@@ -135,6 +135,7 @@ public class OrderServiceRpcClient { ...@@ -135,6 +135,7 @@ public class OrderServiceRpcClient {
135 BatchCreateClientCustomerOrderDetailsRpcRequest.newBuilder() 135 BatchCreateClientCustomerOrderDetailsRpcRequest.newBuilder()
136 .addAllCreations(orderDetails) 136 .addAllCreations(orderDetails)
137 .setCreatedBy(createOrderDto.getCreatedBy()) 137 .setCreatedBy(createOrderDto.getCreatedBy())
138 + .setEnterpriseId(createOrderDto.getEnterpriseId())
138 .setCreationSource(OrderSourceEnum.forNumber(createOrderDto.getCreationSource())).build()); 139 .setCreationSource(OrderSourceEnum.forNumber(createOrderDto.getCreationSource())).build());
139 return CreateOrderResponse.builder().id(orderResponse.getId()).isCreated(true).build(); 140 return CreateOrderResponse.builder().id(orderResponse.getId()).isCreated(true).build();
140 } 141 }
......
...@@ -4,6 +4,8 @@ import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.ClientCustomerDto; ...@@ -4,6 +4,8 @@ import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.ClientCustomerDto;
4 import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.HospitalRecordDto; 4 import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.HospitalRecordDto;
5 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefDto; 5 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefDto;
6 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto; 6 import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto;
7 +import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto;
8 +import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefResponseDto;
7 import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto; 9 import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto;
8 import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto; 10 import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto;
9 import com.infoloop.tianting.service.ClientCustomerService; 11 import com.infoloop.tianting.service.ClientCustomerService;
...@@ -141,4 +143,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { ...@@ -141,4 +143,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService {
141 ).collect(Collectors.toList()); 143 ).collect(Collectors.toList());
142 } 144 }
143 145
146 + @Override
147 + public BatchDeleteCustomerLabelRefResponseDto deleteClientCustomerLabelRefsByIds(
148 + BatchDeleteCustomerLabelRefRequestDto deleteRequestDto) {
149 + final var response = clientCustomerServiceRpcClient.batchDeleteClientCustomerLabelRefsByIds(
150 + deleteRequestDto);
151 + return BatchDeleteCustomerLabelRefResponseDto.builder().isDeleted(response.getIsDeleted()).build();
152 + }
153 +
144 } 154 }
......
...@@ -57,6 +57,8 @@ public class OrderServiceImpl implements OrderService { ...@@ -57,6 +57,8 @@ public class OrderServiceImpl implements OrderService {
57 .skus(d.getMealDetailJson().getSkusList()) 57 .skus(d.getMealDetailJson().getSkusList())
58 .build()) 58 .build())
59 .adjustSkuRemark(d.getAdjustSkuRemark()) 59 .adjustSkuRemark(d.getAdjustSkuRemark())
60 + .enterpriseId(d.getEnterpriseId())
61 + .skuId(d.getSkuId())
60 .notServe(d.getNotServe()) 62 .notServe(d.getNotServe())
61 .creationSource(d.getCreationSource().getNumber()) 63 .creationSource(d.getCreationSource().getNumber())
62 .createdBy(d.getCreatedBy()) 64 .createdBy(d.getCreatedBy())
......
...@@ -391,6 +391,7 @@ message SingleClientCustomerOrderDetailRpcResponse { ...@@ -391,6 +391,7 @@ message SingleClientCustomerOrderDetailRpcResponse {
391 OrderSourceEnum updateSource = 17; 391 OrderSourceEnum updateSource = 17;
392 bool isDeleted = 18; 392 bool isDeleted = 18;
393 bool notServe = 19; 393 bool notServe = 19;
394 + int32 enterpriseId = 20;
394 } 395 }
395 396
396 message GetClientCustomerOrderDetailByIdRpcRequest { 397 message GetClientCustomerOrderDetailByIdRpcRequest {
...@@ -442,6 +443,7 @@ message CreateClientCustomerOrderDetailRpcRequest { ...@@ -442,6 +443,7 @@ message CreateClientCustomerOrderDetailRpcRequest {
442 ClientCustomerOrderDetailCreation creation = 1; 443 ClientCustomerOrderDetailCreation creation = 1;
443 int32 createdBy = 2; 444 int32 createdBy = 2;
444 OrderSourceEnum creationSource = 3; 445 OrderSourceEnum creationSource = 3;
446 + int32 enterpriseId = 4;
445 } 447 }
446 448
447 message CreateClientCustomerOrderDetailRpcResponse { 449 message CreateClientCustomerOrderDetailRpcResponse {
...@@ -453,6 +455,7 @@ message BatchCreateClientCustomerOrderDetailsRpcRequest { ...@@ -453,6 +455,7 @@ message BatchCreateClientCustomerOrderDetailsRpcRequest {
453 repeated ClientCustomerOrderDetailCreation creations = 1; 455 repeated ClientCustomerOrderDetailCreation creations = 1;
454 int32 createdBy = 2; 456 int32 createdBy = 2;
455 OrderSourceEnum creationSource = 3; 457 OrderSourceEnum creationSource = 3;
458 + int32 enterpriseId = 4;
456 } 459 }
457 460
458 message BatchCreateClientCustomerOrderDetailsRpcResponse { 461 message BatchCreateClientCustomerOrderDetailsRpcResponse {
...@@ -488,6 +491,7 @@ message UpdateClientCustomerOrderDetailRpcRequest { ...@@ -488,6 +491,7 @@ message UpdateClientCustomerOrderDetailRpcRequest {
488 ClientCustomerOrderDetailModification modification = 1; 491 ClientCustomerOrderDetailModification modification = 1;
489 int32 updatedBy = 2; 492 int32 updatedBy = 2;
490 OrderSourceEnum updateSource = 3; 493 OrderSourceEnum updateSource = 3;
494 + int32 enterpriseId = 4;
491 } 495 }
492 496
493 message UpdateClientCustomerOrderDetailRpcResponse { 497 message UpdateClientCustomerOrderDetailRpcResponse {
...@@ -498,6 +502,7 @@ message BatchUpdateClientCustomerOrderDetailsRpcRequest { ...@@ -498,6 +502,7 @@ message BatchUpdateClientCustomerOrderDetailsRpcRequest {
498 repeated ClientCustomerOrderDetailModification modifications = 1; 502 repeated ClientCustomerOrderDetailModification modifications = 1;
499 int32 updatedBy = 2; 503 int32 updatedBy = 2;
500 OrderSourceEnum updateSource = 3; 504 OrderSourceEnum updateSource = 3;
505 + int32 enterpriseId = 4;
501 } 506 }
502 507
503 message BatchUpdateClientCustomerOrderDetailsRpcResponse { 508 message BatchUpdateClientCustomerOrderDetailsRpcResponse {
......