From 38e5627134a81c831d4867ef4085b2bda9291b24 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期五, 15 三月 2024 10:40:17 +0800
Subject: [PATCH] 获取信息修改
---
/dev/null | 101 --------------------
api/v1/product.go | 56 +++++++++++
api/v1/salesDetails.go | 110 ----------------------
model/response/salesDetails.go | 7
router/salesDetails.go | 5
main.go | 2
model/grpc_init/crm_aps_init.go | 16 ---
7 files changed, 62 insertions(+), 235 deletions(-)
diff --git a/api/v1/product.go b/api/v1/product.go
index 8f11a30..df16bb8 100644
--- a/api/v1/product.go
+++ b/api/v1/product.go
@@ -156,6 +156,31 @@
ctx.Ok()
return
}
+ first, err := model.NewSalesDetailsSearch().SetPreload(true).SetNumber(number).First()
+ if err != nil {
+ ctx.FailWithMsg(ecode.DBErr, "鏌ヨ閿�鍞槑缁嗗嚭閿�")
+ return
+ }
+ productInfo := make([]response.SalesDetailsProductInfo, 0)
+ amountMap := make(map[string]int64)
+ overMap := make(map[string]int64)
+ for _, p := range first.Products {
+ amountMap[p.Number] = 0
+ overMap[p.Number] = 0
+ var sdpi response.SalesDetailsProductInfo
+ sdpi.ProductId = p.Number
+ sdpi.ProductName = p.Name
+ sdpi.Specs = p.Specs
+ sdpi.Unit = p.Unit
+ sdpi.Amount = p.Amount
+ sdpi.Cost = p.Cost
+ sdpi.Price = p.Price
+ sdpi.Total = p.Total
+ sdpi.Profit = p.Profit
+ sdpi.Margin = p.Margin
+ productInfo = append(productInfo, sdpi)
+ }
+
client := product.NewProductServiceClient(grpc_init.CrmApsGrpcServiceConn)
info, err := client.GetProductOrder(ctx.GetCtx(), &product.GetProductOrderRequest{SalesDetailsNumber: number})
if err != nil {
@@ -164,6 +189,7 @@
return
}
var result response.Info
+ //鍒堕�犱俊鎭�
var list []response.WorkOrderInfo
for _, orderInfo := range info.List {
var wo response.WorkOrderInfo
@@ -179,10 +205,20 @@
wo.Unit = orderInfo.Unit
wo.Amount = orderInfo.Amount
wo.FinishAmount = orderInfo.FinishAmount
+ amountMap[orderInfo.ProductId] = amountMap[orderInfo.ProductId] + orderInfo.Amount
+ overMap[orderInfo.ProductId] = overMap[orderInfo.ProductId] + orderInfo.FinishAmount
list = append(list, wo)
+ }
+ for i := 0; i < len(productInfo); i++ {
+ productInfo[i].MakeAmount = amountMap[productInfo[i].ProductId]
+ amountMap[productInfo[i].ProductId] = 0
+ productInfo[i].MakeFinishAmount = overMap[productInfo[i].ProductId]
+ productInfo[i].FinishAmount = productInfo[i].FinishAmount + overMap[productInfo[i].ProductId]
+ overMap[productInfo[i].ProductId] = 0
}
result.MakeInfo = list
+ //閲囪喘淇℃伅
var purchaseInfo []response.Purchase
for _, pl := range info.PurchaseList {
var p response.Purchase
@@ -197,10 +233,20 @@
p.Unit = pl.Unit
p.Amount = pl.Amount
p.FinishAmount = pl.FinishAmount
+ amountMap[pl.ProductId] = amountMap[pl.ProductId] + pl.Amount
+ overMap[pl.ProductId] = overMap[pl.ProductId] + pl.FinishAmount
purchaseInfo = append(purchaseInfo, p)
+ }
+ for i := 0; i < len(productInfo); i++ {
+ productInfo[i].PurchaseAmount = amountMap[productInfo[i].ProductId]
+ amountMap[productInfo[i].ProductId] = 0
+ productInfo[i].PurchaseFinishAmount = overMap[productInfo[i].ProductId]
+ productInfo[i].FinishAmount = productInfo[i].FinishAmount + overMap[productInfo[i].ProductId]
+ overMap[productInfo[i].ProductId] = 0
}
result.PurchaseInfo = purchaseInfo
+ //濮斿淇℃伅
var outsourcingList []response.OutsourcingInfo
for _, outsourcingInfo := range info.OutsourcingList {
var oi response.OutsourcingInfo
@@ -215,8 +261,18 @@
oi.Unit = outsourcingInfo.Unit
oi.Amount = outsourcingInfo.Amount
oi.FinishAmount = outsourcingInfo.FinishAmount
+ amountMap[outsourcingInfo.ProductId] = amountMap[outsourcingInfo.ProductId] + outsourcingInfo.Amount
+ overMap[outsourcingInfo.ProductId] = overMap[outsourcingInfo.ProductId] + outsourcingInfo.FinishAmount
outsourcingList = append(outsourcingList, oi)
}
+ for i := 0; i < len(productInfo); i++ {
+ productInfo[i].OutsourcingAmount = amountMap[productInfo[i].ProductId]
+ amountMap[productInfo[i].ProductId] = 0
+ productInfo[i].OutsourcingFinishAmount = overMap[productInfo[i].ProductId]
+ productInfo[i].FinishAmount = productInfo[i].FinishAmount + overMap[productInfo[i].ProductId]
+ overMap[productInfo[i].ProductId] = 0
+ }
result.OutsourcingInfo = outsourcingList
+ result.ProductInfo = productInfo
ctx.OkWithDetailed(result)
}
diff --git a/api/v1/salesDetails.go b/api/v1/salesDetails.go
index 9f94f9e..874d2c4 100644
--- a/api/v1/salesDetails.go
+++ b/api/v1/salesDetails.go
@@ -11,7 +11,6 @@
"aps_crm/pkg/logx"
"aps_crm/pkg/structx"
"aps_crm/proto/crm_aps"
- "aps_crm/proto/crm_srm"
"aps_crm/proto/product_inventory"
"aps_crm/utils"
"github.com/gin-gonic/gin"
@@ -385,113 +384,4 @@
return
}
ctx.Ok()
-}
-
-// GetSalesDetailsProductInfo
-//
-// @Tags SalesDetails
-// @Summary 鑾峰彇閿�鍞槑缁嗕骇鍝佷俊鎭�
-// @Produce application/json
-// @Param number path string true "鏄庣粏缂栫爜"
-// @Success 200 {object} response.ListResponse
-//
-// @Router /api/salesDetails/getSalesDetailsProductInfo/{number} [get]
-func (s *SalesDetailsApi) GetSalesDetailsProductInfo(c *gin.Context) {
- ctx, ok := contextx.NewContext(c, nil)
- if !ok {
- return
- }
- number := c.Param("number")
- first, err := model.NewSalesDetailsSearch().SetPreload(true).SetNumber(number).First()
- if err != nil {
- ctx.FailWithMsg(ecode.DBErr, "鏌ヨ閿�鍞槑缁嗗嚭閿�")
- return
- }
- resp := make([]response.SalesDetailsProductInfo, 0)
- amountMap := make(map[string]int64)
- overMap := make(map[string]int64)
- for _, product := range first.Products {
- amountMap[product.Number] = 0
- overMap[product.Number] = 0
- var sdpi response.SalesDetailsProductInfo
- sdpi.ProductId = product.Number
- sdpi.ProductName = product.Name
- sdpi.Specs = product.Specs
- sdpi.Unit = product.Unit
- sdpi.Amount = product.Amount
- sdpi.Cost = product.Cost
- sdpi.Price = product.Price
- sdpi.Total = product.Total
- sdpi.Profit = product.Profit
- sdpi.Margin = product.Margin
- resp = append(resp, sdpi)
- }
- srmClient := crm_srm.NewCrmAndSrmServiceClient(grpc_init.CrmSrmGrpcServiceConn)
- info, err := srmClient.CrmGetPurchaseInfo(c, &crm_srm.CrmGetPurchaseInfoRequest{SalesDetailsNumber: number})
- if err != nil {
- logx.Errorf("grpc CrmGetPurchaseInfo err: %v", err.Error())
- ctx.FailWithMsg(ecode.UnknownErr, "鍐呴儴閿欒")
- return
- }
- //閲囪喘鏁伴噺
- for _, purchaseInfo := range info.Info {
- amount := amountMap[purchaseInfo.ProductId]
- amount += purchaseInfo.Amount
- amountMap[purchaseInfo.ProductId] = amount
- over := overMap[purchaseInfo.ProductId]
- over += purchaseInfo.FinishAmount
- overMap[purchaseInfo.ProductId] = over
- }
- for i := 0; i < len(resp); i++ {
- resp[i].PurchaseAmount = amountMap[resp[i].ProductId]
- amountMap[resp[i].ProductId] = 0
- resp[i].PurchaseFinishAmount = overMap[resp[i].ProductId]
- resp[i].FinishAmount = resp[i].FinishAmount + overMap[resp[i].ProductId]
- overMap[resp[i].ProductId] = 0
- }
-
- apsClient := crm_aps.NewCrmAndApsGrpcServiceClient(grpc_init.CrmApsGrpcServiceConn)
- productInfo, err := apsClient.CrmGetMakeAndOutsourcingProductInfo(c, &crm_aps.CrmGetMakeAndOutsourcingProductInfoRequest{SalesDetailsNumber: number})
- if err != nil {
- logx.Errorf("grpc CrmGetMakeAndOutsourcingProductInfo err: %v", err.Error())
- ctx.FailWithMsg(ecode.UnknownErr, "鍐呴儴閿欒")
- return
- }
- //鍒堕�犳暟閲�
- for _, makeInfo := range productInfo.Info {
- if makeInfo.Type == 2 {
- amount := amountMap[makeInfo.ProductId]
- amount += makeInfo.Amount
- amountMap[makeInfo.ProductId] = amount
- over := overMap[makeInfo.ProductId]
- over += makeInfo.FinishAmount
- overMap[makeInfo.ProductId] = over
- }
- }
- for i := 0; i < len(resp); i++ {
- resp[i].MakeAmount = amountMap[resp[i].ProductId]
- amountMap[resp[i].ProductId] = 0
- resp[i].MakeFinishAmount = overMap[resp[i].ProductId]
- resp[i].FinishAmount = resp[i].FinishAmount + overMap[resp[i].ProductId]
- overMap[resp[i].ProductId] = 0
- }
- //濮斿鏁伴噺
- for _, outsourcingInfo := range productInfo.Info {
- if outsourcingInfo.Type == 3 {
- amount := amountMap[outsourcingInfo.ProductId]
- amount += outsourcingInfo.Amount
- amountMap[outsourcingInfo.ProductId] = amount
- over := overMap[outsourcingInfo.ProductId]
- over += outsourcingInfo.FinishAmount
- overMap[outsourcingInfo.ProductId] = over
- }
- }
- for i := 0; i < len(resp); i++ {
- resp[i].OutsourcingAmount = amountMap[resp[i].ProductId]
- amountMap[resp[i].ProductId] = 0
- resp[i].OutsourcingFinishAmount = overMap[resp[i].ProductId]
- resp[i].FinishAmount = resp[i].FinishAmount + overMap[resp[i].ProductId]
- overMap[resp[i].ProductId] = 0
- }
- ctx.OkWithDetailed(resp)
}
diff --git a/main.go b/main.go
index 29c7af1..04c6993 100644
--- a/main.go
+++ b/main.go
@@ -54,7 +54,6 @@
go middleware.InitUserConn()
go grpc_init.InitProductInventoryServiceConn()
go grpc_init.InitCrmApsGrpcServiceConn()
- go grpc_init.InitCrmSrmGrpcServiceConn()
//鍚姩grpc鏈嶅姟
go func() {
ln, err := net.Listen("tcp", ":"+conf.Conf.System.GrpcPort)
@@ -89,7 +88,6 @@
grpc_init.CloseProductInventoryServiceConn()
middleware.CloseUserConn()
grpc_init.CloseCrmApsGrpcServiceConn()
- grpc_init.CloseCrmSrmGrpcServiceConn()
logx.Infof("aps-crm exited...")
os.Exit(0)
diff --git a/model/grpc_init/crm_aps_init.go b/model/grpc_init/crm_aps_init.go
index 68958d2..233b851 100644
--- a/model/grpc_init/crm_aps_init.go
+++ b/model/grpc_init/crm_aps_init.go
@@ -10,7 +10,6 @@
var (
ProductInventoryServiceConn *grpc.ClientConn
CrmApsGrpcServiceConn *grpc.ClientConn
- CrmSrmGrpcServiceConn *grpc.ClientConn
)
func InitCrmApsGrpcServiceConn() {
@@ -40,20 +39,5 @@
func CloseProductInventoryServiceConn() {
if ProductInventoryServiceConn != nil {
ProductInventoryServiceConn.Close()
- }
-}
-
-func InitCrmSrmGrpcServiceConn() {
- var err error
- CrmSrmGrpcServiceConn, err = grpc.Dial(conf.Conf.GrpcServiceAddr.SRM, grpc.WithTransportCredentials(insecure.NewCredentials()))
- if err != nil {
- logx.Errorf("grpc dial product service error: %v", err.Error())
- return
- }
-}
-
-func CloseCrmSrmGrpcServiceConn() {
- if CrmSrmGrpcServiceConn != nil {
- CrmSrmGrpcServiceConn.Close()
}
}
diff --git a/model/response/salesDetails.go b/model/response/salesDetails.go
index 5485a8a..ec7d90f 100644
--- a/model/response/salesDetails.go
+++ b/model/response/salesDetails.go
@@ -3,9 +3,10 @@
import "github.com/shopspring/decimal"
type Info struct {
- MakeInfo []WorkOrderInfo `json:"makeInfo"`
- PurchaseInfo []Purchase `json:"purchaseInfo"`
- OutsourcingInfo []OutsourcingInfo `json:"outsourcingInfo"`
+ MakeInfo []WorkOrderInfo `json:"makeInfo"`
+ PurchaseInfo []Purchase `json:"purchaseInfo"`
+ OutsourcingInfo []OutsourcingInfo `json:"outsourcingInfo"`
+ ProductInfo []SalesDetailsProductInfo `json:"productInfo"`
}
type WorkOrderInfo struct {
diff --git a/proto/crm_srm.proto b/proto/crm_srm.proto
deleted file mode 100644
index be954c9..0000000
--- a/proto/crm_srm.proto
+++ /dev/null
@@ -1,21 +0,0 @@
-syntax = "proto3";
-
-option go_package = "./crm_srm";
-
-service CrmAndSrmService {
- rpc CrmGetPurchaseInfo(CrmGetPurchaseInfoRequest) returns(CrmGetPurchaseInfoResponse) {}
-}
-
-message CrmGetPurchaseInfoRequest{
- string SalesDetailsNumber = 1;
-}
-
-message CrmGetPurchaseInfo {
- int64 Amount = 1;
- int64 FinishAmount = 2;
- string ProductId = 3;
-}
-
-message CrmGetPurchaseInfoResponse{
- repeated CrmGetPurchaseInfo Info = 1;
-}
\ No newline at end of file
diff --git a/proto/crm_srm/crm_srm.pb.go b/proto/crm_srm/crm_srm.pb.go
deleted file mode 100644
index ec0f7e6..0000000
--- a/proto/crm_srm/crm_srm.pb.go
+++ /dev/null
@@ -1,300 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.26.0
-// protoc v4.24.0
-// source: crm_srm.proto
-
-package crm_srm
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type CrmGetPurchaseInfoRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- SalesDetailsNumber string `protobuf:"bytes,1,opt,name=SalesDetailsNumber,proto3" json:"SalesDetailsNumber,omitempty"`
-}
-
-func (x *CrmGetPurchaseInfoRequest) Reset() {
- *x = CrmGetPurchaseInfoRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_crm_srm_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CrmGetPurchaseInfoRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CrmGetPurchaseInfoRequest) ProtoMessage() {}
-
-func (x *CrmGetPurchaseInfoRequest) ProtoReflect() protoreflect.Message {
- mi := &file_crm_srm_proto_msgTypes[0]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CrmGetPurchaseInfoRequest.ProtoReflect.Descriptor instead.
-func (*CrmGetPurchaseInfoRequest) Descriptor() ([]byte, []int) {
- return file_crm_srm_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *CrmGetPurchaseInfoRequest) GetSalesDetailsNumber() string {
- if x != nil {
- return x.SalesDetailsNumber
- }
- return ""
-}
-
-type CrmGetPurchaseInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Amount int64 `protobuf:"varint,1,opt,name=Amount,proto3" json:"Amount,omitempty"`
- FinishAmount int64 `protobuf:"varint,2,opt,name=FinishAmount,proto3" json:"FinishAmount,omitempty"`
- ProductId string `protobuf:"bytes,3,opt,name=ProductId,proto3" json:"ProductId,omitempty"`
-}
-
-func (x *CrmGetPurchaseInfo) Reset() {
- *x = CrmGetPurchaseInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_crm_srm_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CrmGetPurchaseInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CrmGetPurchaseInfo) ProtoMessage() {}
-
-func (x *CrmGetPurchaseInfo) ProtoReflect() protoreflect.Message {
- mi := &file_crm_srm_proto_msgTypes[1]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CrmGetPurchaseInfo.ProtoReflect.Descriptor instead.
-func (*CrmGetPurchaseInfo) Descriptor() ([]byte, []int) {
- return file_crm_srm_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *CrmGetPurchaseInfo) GetAmount() int64 {
- if x != nil {
- return x.Amount
- }
- return 0
-}
-
-func (x *CrmGetPurchaseInfo) GetFinishAmount() int64 {
- if x != nil {
- return x.FinishAmount
- }
- return 0
-}
-
-func (x *CrmGetPurchaseInfo) GetProductId() string {
- if x != nil {
- return x.ProductId
- }
- return ""
-}
-
-type CrmGetPurchaseInfoResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Info []*CrmGetPurchaseInfo `protobuf:"bytes,1,rep,name=Info,proto3" json:"Info,omitempty"`
-}
-
-func (x *CrmGetPurchaseInfoResponse) Reset() {
- *x = CrmGetPurchaseInfoResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_crm_srm_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CrmGetPurchaseInfoResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CrmGetPurchaseInfoResponse) ProtoMessage() {}
-
-func (x *CrmGetPurchaseInfoResponse) ProtoReflect() protoreflect.Message {
- mi := &file_crm_srm_proto_msgTypes[2]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use CrmGetPurchaseInfoResponse.ProtoReflect.Descriptor instead.
-func (*CrmGetPurchaseInfoResponse) Descriptor() ([]byte, []int) {
- return file_crm_srm_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *CrmGetPurchaseInfoResponse) GetInfo() []*CrmGetPurchaseInfo {
- if x != nil {
- return x.Info
- }
- return nil
-}
-
-var File_crm_srm_proto protoreflect.FileDescriptor
-
-var file_crm_srm_proto_rawDesc = []byte{
- 0x0a, 0x0d, 0x63, 0x72, 0x6d, 0x5f, 0x73, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0x4b, 0x0a, 0x19, 0x43, 0x72, 0x6d, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73,
- 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x12,
- 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4e, 0x75, 0x6d, 0x62,
- 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44,
- 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x6e, 0x0a, 0x12,
- 0x43, 0x72, 0x6d, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e,
- 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x03, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x46, 0x69,
- 0x6e, 0x69, 0x73, 0x68, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
- 0x52, 0x0c, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c,
- 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x09, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x1a,
- 0x43, 0x72, 0x6d, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e,
- 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x49, 0x6e,
- 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x43, 0x72, 0x6d, 0x47, 0x65,
- 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49,
- 0x6e, 0x66, 0x6f, 0x32, 0x63, 0x0a, 0x10, 0x43, 0x72, 0x6d, 0x41, 0x6e, 0x64, 0x53, 0x72, 0x6d,
- 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x12, 0x43, 0x72, 0x6d, 0x47, 0x65,
- 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e,
- 0x43, 0x72, 0x6d, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e,
- 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x43, 0x72, 0x6d, 0x47,
- 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x63, 0x72,
- 0x6d, 0x5f, 0x73, 0x72, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
- file_crm_srm_proto_rawDescOnce sync.Once
- file_crm_srm_proto_rawDescData = file_crm_srm_proto_rawDesc
-)
-
-func file_crm_srm_proto_rawDescGZIP() []byte {
- file_crm_srm_proto_rawDescOnce.Do(func() {
- file_crm_srm_proto_rawDescData = protoimpl.X.CompressGZIP(file_crm_srm_proto_rawDescData)
- })
- return file_crm_srm_proto_rawDescData
-}
-
-var file_crm_srm_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
-var file_crm_srm_proto_goTypes = []interface{}{
- (*CrmGetPurchaseInfoRequest)(nil), // 0: CrmGetPurchaseInfoRequest
- (*CrmGetPurchaseInfo)(nil), // 1: CrmGetPurchaseInfo
- (*CrmGetPurchaseInfoResponse)(nil), // 2: CrmGetPurchaseInfoResponse
-}
-var file_crm_srm_proto_depIdxs = []int32{
- 1, // 0: CrmGetPurchaseInfoResponse.Info:type_name -> CrmGetPurchaseInfo
- 0, // 1: CrmAndSrmService.CrmGetPurchaseInfo:input_type -> CrmGetPurchaseInfoRequest
- 2, // 2: CrmAndSrmService.CrmGetPurchaseInfo:output_type -> CrmGetPurchaseInfoResponse
- 2, // [2:3] is the sub-list for method output_type
- 1, // [1:2] is the sub-list for method input_type
- 1, // [1:1] is the sub-list for extension type_name
- 1, // [1:1] is the sub-list for extension extendee
- 0, // [0:1] is the sub-list for field type_name
-}
-
-func init() { file_crm_srm_proto_init() }
-func file_crm_srm_proto_init() {
- if File_crm_srm_proto != nil {
- return
- }
- if !protoimpl.UnsafeEnabled {
- file_crm_srm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CrmGetPurchaseInfoRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_crm_srm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CrmGetPurchaseInfo); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_crm_srm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CrmGetPurchaseInfoResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_crm_srm_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 3,
- NumExtensions: 0,
- NumServices: 1,
- },
- GoTypes: file_crm_srm_proto_goTypes,
- DependencyIndexes: file_crm_srm_proto_depIdxs,
- MessageInfos: file_crm_srm_proto_msgTypes,
- }.Build()
- File_crm_srm_proto = out.File
- file_crm_srm_proto_rawDesc = nil
- file_crm_srm_proto_goTypes = nil
- file_crm_srm_proto_depIdxs = nil
-}
diff --git a/proto/crm_srm/crm_srm_grpc.pb.go b/proto/crm_srm/crm_srm_grpc.pb.go
deleted file mode 100644
index 6ed2547..0000000
--- a/proto/crm_srm/crm_srm_grpc.pb.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-
-package crm_srm
-
-import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
-)
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.32.0 or later.
-const _ = grpc.SupportPackageIsVersion7
-
-// CrmAndSrmServiceClient is the client API for CrmAndSrmService service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
-type CrmAndSrmServiceClient interface {
- CrmGetPurchaseInfo(ctx context.Context, in *CrmGetPurchaseInfoRequest, opts ...grpc.CallOption) (*CrmGetPurchaseInfoResponse, error)
-}
-
-type crmAndSrmServiceClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewCrmAndSrmServiceClient(cc grpc.ClientConnInterface) CrmAndSrmServiceClient {
- return &crmAndSrmServiceClient{cc}
-}
-
-func (c *crmAndSrmServiceClient) CrmGetPurchaseInfo(ctx context.Context, in *CrmGetPurchaseInfoRequest, opts ...grpc.CallOption) (*CrmGetPurchaseInfoResponse, error) {
- out := new(CrmGetPurchaseInfoResponse)
- err := c.cc.Invoke(ctx, "/CrmAndSrmService/CrmGetPurchaseInfo", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// CrmAndSrmServiceServer is the server API for CrmAndSrmService service.
-// All implementations must embed UnimplementedCrmAndSrmServiceServer
-// for forward compatibility
-type CrmAndSrmServiceServer interface {
- CrmGetPurchaseInfo(context.Context, *CrmGetPurchaseInfoRequest) (*CrmGetPurchaseInfoResponse, error)
- mustEmbedUnimplementedCrmAndSrmServiceServer()
-}
-
-// UnimplementedCrmAndSrmServiceServer must be embedded to have forward compatible implementations.
-type UnimplementedCrmAndSrmServiceServer struct {
-}
-
-func (UnimplementedCrmAndSrmServiceServer) CrmGetPurchaseInfo(context.Context, *CrmGetPurchaseInfoRequest) (*CrmGetPurchaseInfoResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method CrmGetPurchaseInfo not implemented")
-}
-func (UnimplementedCrmAndSrmServiceServer) mustEmbedUnimplementedCrmAndSrmServiceServer() {}
-
-// UnsafeCrmAndSrmServiceServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to CrmAndSrmServiceServer will
-// result in compilation errors.
-type UnsafeCrmAndSrmServiceServer interface {
- mustEmbedUnimplementedCrmAndSrmServiceServer()
-}
-
-func RegisterCrmAndSrmServiceServer(s grpc.ServiceRegistrar, srv CrmAndSrmServiceServer) {
- s.RegisterService(&CrmAndSrmService_ServiceDesc, srv)
-}
-
-func _CrmAndSrmService_CrmGetPurchaseInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CrmGetPurchaseInfoRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(CrmAndSrmServiceServer).CrmGetPurchaseInfo(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/CrmAndSrmService/CrmGetPurchaseInfo",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(CrmAndSrmServiceServer).CrmGetPurchaseInfo(ctx, req.(*CrmGetPurchaseInfoRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-// CrmAndSrmService_ServiceDesc is the grpc.ServiceDesc for CrmAndSrmService service.
-// It's only intended for direct use with grpc.RegisterService,
-// and not to be introspected or modified (even as a copy)
-var CrmAndSrmService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "CrmAndSrmService",
- HandlerType: (*CrmAndSrmServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "CrmGetPurchaseInfo",
- Handler: _CrmAndSrmService_CrmGetPurchaseInfo_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "crm_srm.proto",
-}
diff --git a/router/salesDetails.go b/router/salesDetails.go
index 4f273c5..7d7db0c 100644
--- a/router/salesDetails.go
+++ b/router/salesDetails.go
@@ -19,8 +19,7 @@
salesDetailsRouter.POST("list", salesDetailsApi.List) // 鑾峰彇閿�鍞槑缁嗗崟鍒楄〃
salesDetailsRouter.GET("getProductInventoryInfo/:number", salesDetailsApi.GetProductInventoryInfo) // 鑾峰彇浜у搧搴撳瓨淇℃伅
//salesDetailsRouter.POST("createOperation", salesDetailsApi.CreateOperation) // 鍒涘缓浜у搧鍑哄簱淇℃伅
- salesDetailsRouter.GET("getApsProjectList", salesDetailsApi.GetApsProjectList) // 鑾峰彇aps椤圭洰鍒楄〃
- salesDetailsRouter.POST("sendSalesDetailsToOtherSystem", salesDetailsApi.SendSalesDetailsToOtherSystem) // 鎺ㄩ�侀攢鍞槑缁嗕俊鎭埌鍏朵粬绯荤粺 // 鍒涘缓浜у搧鍑哄簱淇℃伅
- salesDetailsRouter.GET("getSalesDetailsProductInfo/:number", salesDetailsApi.GetSalesDetailsProductInfo) // 鑾峰彇閿�鍞槑缁嗕骇鍝佷俊鎭� // 鍒涘缓浜у搧鍑哄簱淇℃伅
+ salesDetailsRouter.GET("getApsProjectList", salesDetailsApi.GetApsProjectList) // 鑾峰彇aps椤圭洰鍒楄〃
+ salesDetailsRouter.POST("sendSalesDetailsToOtherSystem", salesDetailsApi.SendSalesDetailsToOtherSystem) // 鎺ㄩ�侀攢鍞槑缁嗕俊鎭埌鍏朵粬绯荤粺 // 鍒涘缓浜у搧鍑哄簱淇℃伅
}
}
--
Gitblit v1.8.0