wangyingyang

update order detail

No preview for this file type
package com.infoloop.tianting.controller;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.infoloop.tianting.clientcustomerservice.BatchCreateClientCustomerLabelRefsRpcRequest;
import com.infoloop.tianting.model.dto.ClientLabelDTO;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefResponseDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.LabelDto;
import com.infoloop.tianting.model.dto.MealDbDTO;
......@@ -18,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -57,4 +61,12 @@ public class LabelController {
@PathVariable Integer enterpriseId, @PathVariable Integer customerId) {
return clientCustomerService.getCustomerLabelsByCustomerId(enterpriseId, customerId);
}
@ApiOperation(value = "批量删除用户绑定的标签")
@DeleteMapping("/customer/label/refs")
@ResponseStatus(HttpStatus.OK)
public BatchDeleteCustomerLabelRefResponseDto getCustomerLabelsByCustomerId(
@Valid@RequestBody ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto request) {
return clientCustomerService.deleteClientCustomerLabelRefsByIds(request);
}
}
......
......@@ -91,4 +91,12 @@ public class ClientLabelDTO {
private Integer enterpriseId;
}
@Data
@Builder
@ToString
@ApiModel(description = "批量删除用户标签请求 DTO")
public static class BatchDeleteCustomerLabelRefResponseDto {
private boolean isDeleted;
}
}
......
......@@ -327,6 +327,9 @@ public class OrderDbDTO {
@ApiModelProperty(value = "订单详情表主键,自增整数")
private Integer id;
@ApiModelProperty(value = "企业 ID")
private Integer enterpriseId;
@ApiModelProperty(value = "订单id")
private Integer orderId;
......
......@@ -4,6 +4,8 @@ import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.ClientCustomerDto;
import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.HospitalRecordDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefResponseDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto;
import java.util.List;
......@@ -21,6 +23,8 @@ public interface ClientCustomerService {
List<CustomerLabelRefDetailDto> getCustomerLabelsByCustomerId(
Integer enterpriseId, Integer customerId);
//deleteClientCustomerLabelRefsByIds
BatchDeleteCustomerLabelRefResponseDto deleteClientCustomerLabelRefsByIds(
BatchDeleteCustomerLabelRefRequestDto deleteRequestDto);
}
......
......@@ -89,7 +89,7 @@ public class ClientCustomerServiceRpcClient {
return clientCustomerServiceRpcBlockingStub.queryClientCustomerLabelRefsByCondition(request);
}
public DeleteClientCustomerLabelRefsRpcResponse deleteClientCustomerLabelRefsByIds(
public DeleteClientCustomerLabelRefsRpcResponse batchDeleteClientCustomerLabelRefsByIds(
BatchDeleteCustomerLabelRefRequestDto batchDeleteCustomerLabelRefRequestDto) {
final var request = DeleteClientCustomerLabelRefsByIdsRpcRequest.newBuilder()
.setEnterpriseId(batchDeleteCustomerLabelRefRequestDto.getEnterpriseId())
......
......@@ -135,6 +135,7 @@ public class OrderServiceRpcClient {
BatchCreateClientCustomerOrderDetailsRpcRequest.newBuilder()
.addAllCreations(orderDetails)
.setCreatedBy(createOrderDto.getCreatedBy())
.setEnterpriseId(createOrderDto.getEnterpriseId())
.setCreationSource(OrderSourceEnum.forNumber(createOrderDto.getCreationSource())).build());
return CreateOrderResponse.builder().id(orderResponse.getId()).isCreated(true).build();
}
......
......@@ -4,6 +4,8 @@ import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.ClientCustomerDto;
import com.infoloop.tianting.model.dto.ClientCustomerDbDTO.HospitalRecordDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchCreateCustomerLabelRefResponseDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefRequestDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.BatchDeleteCustomerLabelRefResponseDto;
import com.infoloop.tianting.model.dto.ClientLabelDTO.CustomerLabelRefDetailDto;
import com.infoloop.tianting.model.dto.InventoryDbDTO.ClientDto;
import com.infoloop.tianting.service.ClientCustomerService;
......@@ -141,4 +143,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService {
).collect(Collectors.toList());
}
@Override
public BatchDeleteCustomerLabelRefResponseDto deleteClientCustomerLabelRefsByIds(
BatchDeleteCustomerLabelRefRequestDto deleteRequestDto) {
final var response = clientCustomerServiceRpcClient.batchDeleteClientCustomerLabelRefsByIds(
deleteRequestDto);
return BatchDeleteCustomerLabelRefResponseDto.builder().isDeleted(response.getIsDeleted()).build();
}
}
......
......@@ -57,6 +57,8 @@ public class OrderServiceImpl implements OrderService {
.skus(d.getMealDetailJson().getSkusList())
.build())
.adjustSkuRemark(d.getAdjustSkuRemark())
.enterpriseId(d.getEnterpriseId())
.skuId(d.getSkuId())
.notServe(d.getNotServe())
.creationSource(d.getCreationSource().getNumber())
.createdBy(d.getCreatedBy())
......
......@@ -391,6 +391,7 @@ message SingleClientCustomerOrderDetailRpcResponse {
OrderSourceEnum updateSource = 17;
bool isDeleted = 18;
bool notServe = 19;
int32 enterpriseId = 20;
}
message GetClientCustomerOrderDetailByIdRpcRequest {
......@@ -442,6 +443,7 @@ message CreateClientCustomerOrderDetailRpcRequest {
ClientCustomerOrderDetailCreation creation = 1;
int32 createdBy = 2;
OrderSourceEnum creationSource = 3;
int32 enterpriseId = 4;
}
message CreateClientCustomerOrderDetailRpcResponse {
......@@ -453,6 +455,7 @@ message BatchCreateClientCustomerOrderDetailsRpcRequest {
repeated ClientCustomerOrderDetailCreation creations = 1;
int32 createdBy = 2;
OrderSourceEnum creationSource = 3;
int32 enterpriseId = 4;
}
message BatchCreateClientCustomerOrderDetailsRpcResponse {
......@@ -488,6 +491,7 @@ message UpdateClientCustomerOrderDetailRpcRequest {
ClientCustomerOrderDetailModification modification = 1;
int32 updatedBy = 2;
OrderSourceEnum updateSource = 3;
int32 enterpriseId = 4;
}
message UpdateClientCustomerOrderDetailRpcResponse {
......@@ -498,6 +502,7 @@ message BatchUpdateClientCustomerOrderDetailsRpcRequest {
repeated ClientCustomerOrderDetailModification modifications = 1;
int32 updatedBy = 2;
OrderSourceEnum updateSource = 3;
int32 enterpriseId = 4;
}
message BatchUpdateClientCustomerOrderDetailsRpcResponse {
......