zhangqian
2023-11-10 ae4076a20e4b93703028dc1af321f6920290375f
Merge branch 'master' of http://192.168.5.5:10010/r/aps/crm
1个文件已添加
16个文件已修改
988 ■■■■■ 已修改文件
api/v1/product.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/salesDetails.go 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
conf/aps-crm.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
conf/config.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.go 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/request/salesDetails.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product.proto 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product/product.pb.go 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product_inventory.proto 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product_inventory/product_inventory.pb.go 197 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product_inventory/product_inventory_grpc.pb.go 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product_inventory/server.go 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/product.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/salesDetails.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/product.go
@@ -147,10 +147,11 @@
    }
    params := make([]*product.Info, 0)
    for _, p := range first.Products {
        var pa *product.Info
        var pa product.Info
        pa.ProductId = p.Number
        pa.Time = utils.TimeToString(first.UpdatedAt)
        params = append(params, pa)
        pa.StartTime = utils.TimeToString(first.UpdatedAt)
        pa.EndTime = first.DeliveryDate
        params = append(params, &pa)
    }
    client := product.NewProductServiceClient(productServiceConn)
    info, err := client.GetProductOrder(ctx.GetCtx(), &product.GetProductOrderRequest{Params: params})
api/v1/salesDetails.go
@@ -209,18 +209,18 @@
//    @Tags        SalesDetails
//    @Summary    更新销售明细状态
//    @Produce    application/json
//    @Param        object    body        request.UpdateSalesDetails    true    "查询参数"
//    @Param        object    body        request.UpdateSalesDetailsStatus    true    "查询参数"
//    @Success    200        {object}    contextx.Response{}
//    @Router        /api/salesDetails/update [post]
//    @Router        /api/salesDetails/updateStatus [post]
func (s *SalesDetailsApi) UpdateStatus(c *gin.Context) {
    var params request.UpdateSalesDetails
    var params request.UpdateSalesDetailsStatus
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    m := make(map[string]interface{})
    m["status"] = params.SalesDetails.Status
    m["status"] = params.Status
    err := model.NewSalesDetailsSearch().SetId(params.Id).UpdateByMap(m)
    if err != nil {
        ctx.FailWithMsg(ecode.UnknownErr, "更新失败")
@@ -289,6 +289,13 @@
    if !ok {
        return
    }
    m := make(map[string]interface{})
    m["status"] = params.Status
    err := model.NewSalesDetailsSearch().SetNumber(params.Number).UpdateByMap(m)
    if err != nil {
        ctx.FailWithMsg(ecode.UnknownErr, "状态更新失败")
        return
    }
    client := product_inventory.NewProductInventoryServiceClient(ProductInventoryServiceConn)
    products := make([]*product_inventory.InventoryProduct, 0)
@@ -298,7 +305,7 @@
        p.Amount = product.Amount.String()
        products = append(products, &p)
    }
    _, err := client.CreateOperation(ctx.GetCtx(), &product_inventory.CreateOperationRequest{
    _, err = client.CreateOperation(ctx.GetCtx(), &product_inventory.CreateOperationRequest{
        Number:      params.Number,
        Addressee:   params.Addressee,
        Address:     params.Address,
conf/aps-crm.json
@@ -2,6 +2,7 @@
  "system": {
    "env": "develop",
    "port": 8002,
    "grpcPort": "9092",
    "UseMultipoint": false,
    "UseRedis": false,
    "LimitCountIP": 15000,
conf/config.go
@@ -49,6 +49,7 @@
    System struct {
        Env           string // 环境值 develop test public
        Port          int    // 端口
        GrpcPort      string //grpc端口
        DbType        string // 数据库类型
        UseMultipoint bool   // 多点登录拦截
        UseRedis      bool   // 使用redis
docs/docs.go
@@ -4917,6 +4917,49 @@
                }
            }
        },
        "/api/product/getProductOrderInfo/{number}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "产品"
                ],
                "summary": "获取产品订单信息",
                "parameters": [
                    {
                        "type": "string",
                        "description": "明细编码",
                        "name": "number",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/contextx.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/product.WorkOrderInfo"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/product/info": {
            "get": {
                "produces": [
@@ -6919,6 +6962,36 @@
                }
            }
        },
        "/api/salesDetails/createOperation": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "SalesDetails"
                ],
                "summary": "创建产品出库信息",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.SalesDetails"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.ListResponse"
                        }
                    }
                }
            }
        },
        "/api/salesDetails/delete": {
            "delete": {
                "produces": [
@@ -6972,6 +7045,34 @@
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/salesDetails/getProductInventoryInfo/{number}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "SalesDetails"
                ],
                "summary": "获取产品库存信息",
                "parameters": [
                    {
                        "type": "string",
                        "description": "明细编码",
                        "name": "number",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.ListResponse"
                        }
                    }
                }
@@ -7036,6 +7137,36 @@
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateSalesDetails"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/salesDetails/updateStatus": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "SalesDetails"
                ],
                "summary": "更新销售明细状态",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateSalesDetailsStatus"
                        }
                    }
                ],
@@ -10361,6 +10492,27 @@
                "SalesDetailsKeywordTypeProductName"
            ]
        },
        "constvar.SalesDetailsStatus": {
            "type": "integer",
            "enum": [
                1,
                2,
                3,
                4
            ],
            "x-enum-comments": {
                "OverCLose": "已关闭",
                "OverOutbound": "出库完成",
                "WaitConfirmed": "待确认",
                "WaitOutbound": "待出库"
            },
            "x-enum-varnames": [
                "WaitConfirmed",
                "WaitOutbound",
                "OverOutbound",
                "OverCLose"
            ]
        },
        "constvar.SalesRefundKeywordType": {
            "type": "string",
            "enum": [
@@ -12235,6 +12387,12 @@
                "signTime": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                },
                "updateTime": {
                    "type": "string"
                },
@@ -13278,6 +13436,32 @@
                    "type": "string"
                },
                "Unit": {
                    "type": "string"
                }
            }
        },
        "product.WorkOrderInfo": {
            "type": "object",
            "properties": {
                "EndTime": {
                    "type": "string"
                },
                "OrderId": {
                    "type": "string"
                },
                "OrderStatus": {
                    "type": "string"
                },
                "ProductName": {
                    "type": "string"
                },
                "StartTime": {
                    "type": "string"
                },
                "WorkOrderId": {
                    "type": "string"
                },
                "WorkOrderStatus": {
                    "type": "string"
                }
            }
@@ -14374,6 +14558,12 @@
                },
                "signTime": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                },
                "wechatOrderStatusId": {
                    "type": "integer"
@@ -15571,7 +15761,7 @@
                    "$ref": "#/definitions/constvar.SalesDetailsKeywordType"
                },
                "number": {
                    "description": "销售子单号",
                    "description": "销售明细单号",
                    "type": "string"
                },
                "page": {
@@ -15937,6 +16127,12 @@
                },
                "signTime": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                },
                "wechatOrderStatusId": {
                    "type": "integer"
@@ -17617,6 +17813,17 @@
                }
            }
        },
        "request.UpdateSalesDetailsStatus": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                }
            }
        },
        "request.UpdateSalesLeads": {
            "type": "object",
            "properties": {
docs/swagger.json
@@ -4905,6 +4905,49 @@
                }
            }
        },
        "/api/product/getProductOrderInfo/{number}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "产品"
                ],
                "summary": "获取产品订单信息",
                "parameters": [
                    {
                        "type": "string",
                        "description": "明细编码",
                        "name": "number",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/contextx.Response"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/definitions/product.WorkOrderInfo"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        },
        "/api/product/info": {
            "get": {
                "produces": [
@@ -6907,6 +6950,36 @@
                }
            }
        },
        "/api/salesDetails/createOperation": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "SalesDetails"
                ],
                "summary": "创建产品出库信息",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.SalesDetails"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.ListResponse"
                        }
                    }
                }
            }
        },
        "/api/salesDetails/delete": {
            "delete": {
                "produces": [
@@ -6960,6 +7033,34 @@
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/salesDetails/getProductInventoryInfo/{number}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "SalesDetails"
                ],
                "summary": "获取产品库存信息",
                "parameters": [
                    {
                        "type": "string",
                        "description": "明细编码",
                        "name": "number",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/response.ListResponse"
                        }
                    }
                }
@@ -7024,6 +7125,36 @@
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateSalesDetails"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/contextx.Response"
                        }
                    }
                }
            }
        },
        "/api/salesDetails/updateStatus": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "SalesDetails"
                ],
                "summary": "更新销售明细状态",
                "parameters": [
                    {
                        "description": "查询参数",
                        "name": "object",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/request.UpdateSalesDetailsStatus"
                        }
                    }
                ],
@@ -10349,6 +10480,27 @@
                "SalesDetailsKeywordTypeProductName"
            ]
        },
        "constvar.SalesDetailsStatus": {
            "type": "integer",
            "enum": [
                1,
                2,
                3,
                4
            ],
            "x-enum-comments": {
                "OverCLose": "已关闭",
                "OverOutbound": "出库完成",
                "WaitConfirmed": "待确认",
                "WaitOutbound": "待出库"
            },
            "x-enum-varnames": [
                "WaitConfirmed",
                "WaitOutbound",
                "OverOutbound",
                "OverCLose"
            ]
        },
        "constvar.SalesRefundKeywordType": {
            "type": "string",
            "enum": [
@@ -12223,6 +12375,12 @@
                "signTime": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                },
                "updateTime": {
                    "type": "string"
                },
@@ -13266,6 +13424,32 @@
                    "type": "string"
                },
                "Unit": {
                    "type": "string"
                }
            }
        },
        "product.WorkOrderInfo": {
            "type": "object",
            "properties": {
                "EndTime": {
                    "type": "string"
                },
                "OrderId": {
                    "type": "string"
                },
                "OrderStatus": {
                    "type": "string"
                },
                "ProductName": {
                    "type": "string"
                },
                "StartTime": {
                    "type": "string"
                },
                "WorkOrderId": {
                    "type": "string"
                },
                "WorkOrderStatus": {
                    "type": "string"
                }
            }
@@ -14362,6 +14546,12 @@
                },
                "signTime": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                },
                "wechatOrderStatusId": {
                    "type": "integer"
@@ -15559,7 +15749,7 @@
                    "$ref": "#/definitions/constvar.SalesDetailsKeywordType"
                },
                "number": {
                    "description": "销售子单号",
                    "description": "销售明细单号",
                    "type": "string"
                },
                "page": {
@@ -15925,6 +16115,12 @@
                },
                "signTime": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                },
                "wechatOrderStatusId": {
                    "type": "integer"
@@ -17605,6 +17801,17 @@
                }
            }
        },
        "request.UpdateSalesDetailsStatus": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "status": {
                    "$ref": "#/definitions/constvar.SalesDetailsStatus"
                }
            }
        },
        "request.UpdateSalesLeads": {
            "type": "object",
            "properties": {
docs/swagger.yaml
@@ -187,6 +187,23 @@
    - SalesDetailsKeywordTypeSignTime
    - SalesDetailsKeywordTypePrincipal
    - SalesDetailsKeywordTypeProductName
  constvar.SalesDetailsStatus:
    enum:
    - 1
    - 2
    - 3
    - 4
    type: integer
    x-enum-comments:
      OverCLose: 已关闭
      OverOutbound: 出库完成
      WaitConfirmed: 待确认
      WaitOutbound: 待出库
    x-enum-varnames:
    - WaitConfirmed
    - WaitOutbound
    - OverOutbound
    - OverCLose
  constvar.SalesRefundKeywordType:
    enum:
    - 销售退货单编号
@@ -1477,6 +1494,10 @@
        type: integer
      signTime:
        type: string
      source:
        type: string
      status:
        $ref: '#/definitions/constvar.SalesDetailsStatus'
      updateTime:
        type: string
      wechatOrderStatus:
@@ -2179,6 +2200,23 @@
        description: 型号
        type: string
      Unit:
        type: string
    type: object
  product.WorkOrderInfo:
    properties:
      EndTime:
        type: string
      OrderId:
        type: string
      OrderStatus:
        type: string
      ProductName:
        type: string
      StartTime:
        type: string
      WorkOrderId:
        type: string
      WorkOrderStatus:
        type: string
    type: object
  request.AddAccountId:
@@ -2914,6 +2952,10 @@
        type: integer
      signTime:
        type: string
      source:
        type: string
      status:
        $ref: '#/definitions/constvar.SalesDetailsStatus'
      wechatOrderStatusId:
        type: integer
    type: object
@@ -3755,7 +3797,7 @@
      keywordType:
        $ref: '#/definitions/constvar.SalesDetailsKeywordType'
      number:
        description: 销售子单号
        description: 销售明细单号
        type: string
      page:
        description: 页码
@@ -4008,6 +4050,10 @@
        type: integer
      signTime:
        type: string
      source:
        type: string
      status:
        $ref: '#/definitions/constvar.SalesDetailsStatus'
      wechatOrderStatusId:
        type: integer
    type: object
@@ -5133,6 +5179,13 @@
        type: integer
      salesDetails:
        $ref: '#/definitions/request.SalesDetails'
    type: object
  request.UpdateSalesDetailsStatus:
    properties:
      id:
        type: integer
      status:
        $ref: '#/definitions/constvar.SalesDetailsStatus'
    type: object
  request.UpdateSalesLeads:
    properties:
@@ -9304,6 +9357,31 @@
      summary: 更新优先级别
      tags:
      - 优先级别管理
  /api/product/getProductOrderInfo/{number}:
    get:
      parameters:
      - description: 明细编码
        in: path
        name: number
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: 成功
          schema:
            allOf:
            - $ref: '#/definitions/contextx.Response'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/product.WorkOrderInfo'
                  type: array
              type: object
      summary: 获取产品订单信息
      tags:
      - 产品
  /api/product/info:
    get:
      parameters:
@@ -10540,6 +10618,25 @@
      summary: 添加销售明细
      tags:
      - SalesDetails
  /api/salesDetails/createOperation:
    post:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.SalesDetails'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/response.ListResponse'
      summary: 创建产品出库信息
      tags:
      - SalesDetails
  /api/salesDetails/delete:
    delete:
      parameters:
@@ -10575,6 +10672,24 @@
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 删除销售明细
      tags:
      - SalesDetails
  /api/salesDetails/getProductInventoryInfo/{number}:
    get:
      parameters:
      - description: 明细编码
        in: path
        name: number
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/response.ListResponse'
      summary: 获取产品库存信息
      tags:
      - SalesDetails
  /api/salesDetails/list:
@@ -10620,6 +10735,25 @@
      summary: 更新销售明细
      tags:
      - SalesDetails
  /api/salesDetails/updateStatus:
    post:
      parameters:
      - description: 查询参数
        in: body
        name: object
        required: true
        schema:
          $ref: '#/definitions/request.UpdateSalesDetailsStatus'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/contextx.Response'
      summary: 更新销售明细状态
      tags:
      - SalesDetails
  /api/salesLeads/add:
    post:
      parameters:
main.go
@@ -7,8 +7,11 @@
    "aps_crm/middleware"
    "aps_crm/model"
    "aps_crm/pkg/logx"
    "aps_crm/proto/product_inventory"
    "aps_crm/router"
    "fmt"
    "google.golang.org/grpc"
    "net"
    "net/http"
    "os"
    "os/signal"
@@ -46,11 +49,27 @@
        WriteTimeout: 5 * time.Second,
    }
    //启动grpc客户端
    go v1.InitProductServiceConn()
    go middleware.InitUserConn()
    go v1.InitCodeServiceConn()
    go v1.InitProductInventoryServiceConn()
    //启动grpc服务
    go func() {
        ln, err := net.Listen("tcp", ":"+conf.Conf.System.GrpcPort)
        if err != nil {
            logx.Errorf("grpc server init error: %v", err.Error())
            panic(fmt.Sprintf("grpc server init error: %v", err.Error()))
        }
        s := grpc.NewServer()
        //todo 添加具体服务
        product_inventory.RegisterProductInventoryServiceServer(s, &product_inventory.Server{})
        err = s.Serve(ln)
        if err != nil {
            logx.Errorf("grpc server init error: %v", err.Error())
            panic(fmt.Sprintf("grpc server init error: %v", err.Error()))
        }
    }()
    //c := cron.New()
    //c.AddFunc("@every 15s", service.SyncUserInfo) // 每15秒同步一次
    //c.Start()
model/request/salesDetails.go
@@ -39,6 +39,11 @@
    SalesDetails SalesDetails `json:"salesDetails"`
}
type UpdateSalesDetailsStatus struct {
    Id     int                         `json:"id"`
    Status constvar.SalesDetailsStatus `json:"status" gorm:"column:status;type:int;comment:状态"`
}
type GetSalesDetailsList struct {
    PageInfo
    KeywordType  constvar.SalesDetailsKeywordType `json:"keywordType"`
proto/product.proto
@@ -51,7 +51,8 @@
message Info {
  string ProductId = 1;
  string Time = 2;
  string StartTime = 2;
  string EndTime = 3;
}
message GetProductOrderRequest {
proto/product/product.pb.go
@@ -421,7 +421,8 @@
    unknownFields protoimpl.UnknownFields
    ProductId string `protobuf:"bytes,1,opt,name=ProductId,proto3" json:"ProductId,omitempty"`
    Time      string `protobuf:"bytes,2,opt,name=Time,proto3" json:"Time,omitempty"`
    StartTime string `protobuf:"bytes,2,opt,name=StartTime,proto3" json:"StartTime,omitempty"`
    EndTime   string `protobuf:"bytes,3,opt,name=EndTime,proto3" json:"EndTime,omitempty"`
}
func (x *Info) Reset() {
@@ -463,9 +464,16 @@
    return ""
}
func (x *Info) GetTime() string {
func (x *Info) GetStartTime() string {
    if x != nil {
        return x.Time
        return x.StartTime
    }
    return ""
}
func (x *Info) GetEndTime() string {
    if x != nil {
        return x.EndTime
    }
    return ""
}
@@ -727,51 +735,53 @@
    0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x50,
    0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,
    0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x6f, 0x74,
    0x61, 0x6c, 0x22, 0x38, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x72,
    0x61, 0x6c, 0x22, 0x5c, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x72,
    0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x50,
    0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65,
    0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x37, 0x0a, 0x16,
    0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52,
    0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
    0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x50,
    0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x0d, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72,
    0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
    0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
    0x64, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65,
    0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e,
    0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74,
    0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53,
    0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64,
    0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x57, 0x6f, 0x72, 0x6b,
    0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x4f,
    0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
    0x52, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75,
    0x73, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06,
    0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12,
    0x18, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
    0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x17, 0x47, 0x65, 0x74,
    0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
    0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
    0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18,
    0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69,
    0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x4f,
    0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x32, 0xe2,
    0x01, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
    0x65, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49,
    0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
    0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65,
    0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
    0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f,
    0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72,
    0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
    0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73,
    0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47,
    0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x17,
    0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72,
    0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f,
    0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
    0x65, 0x22, 0x00, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
    0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
    0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72,
    0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61,
    0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d,
    0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
    0x22, 0x37, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72,
    0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x06, 0x50, 0x61,
    0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x49, 0x6e, 0x66,
    0x6f, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x0d, 0x57, 0x6f,
    0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x4f,
    0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72,
    0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
    0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64,
    0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72,
    0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x72,
    0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x57, 0x6f, 0x72,
    0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
    0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x57,
    0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05,
    0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53,
    0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69,
    0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54,
    0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07,
    0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x63, 0x0a,
    0x17, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72,
    0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65,
    0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03,
    0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x22,
    0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x57,
    0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69,
    0x73, 0x74, 0x32, 0xe2, 0x01, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x65,
    0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64,
    0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f,
    0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
    0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f,
    0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65,
    0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x47,
    0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
    0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63,
    0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
    0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64,
    0x65, 0x72, 0x12, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f,
    0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x47, 0x65,
    0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73,
    0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x70, 0x72, 0x6f,
    0x64, 0x75, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
proto/product_inventory.proto
@@ -5,6 +5,7 @@
service productInventoryService {
  rpc CreateOperation(CreateOperationRequest) returns(CreateOperationResponse) {}
  rpc GetInventoryProductInfo(GetInventoryProductInfoRequest) returns (GetInventoryProductInfoResponse) {}
  rpc UpdateSalesDetailStatus(UpdateSalesDetailStatusRequest) returns (UpdateSalesDetailStatusResponse) {}
}
message CreateOperationRequest{
@@ -52,3 +53,15 @@
  string  Msg = 2;
  repeated ProductInfo ProductList = 3;
}
//------------------------------------------------------------
message UpdateSalesDetailStatusRequest {
  string Number = 1;//明细单编码
  string SalesDetailStatus = 2;
}
message UpdateSalesDetailStatusResponse{
  int32   Code = 1;
  string  Msg = 2;
}
proto/product_inventory/product_inventory.pb.go
@@ -462,6 +462,116 @@
    return nil
}
type UpdateSalesDetailStatusRequest struct {
    state         protoimpl.MessageState
    sizeCache     protoimpl.SizeCache
    unknownFields protoimpl.UnknownFields
    Number            string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"` //明细单编码
    SalesDetailStatus string `protobuf:"bytes,2,opt,name=SalesDetailStatus,proto3" json:"SalesDetailStatus,omitempty"`
}
func (x *UpdateSalesDetailStatusRequest) Reset() {
    *x = UpdateSalesDetailStatusRequest{}
    if protoimpl.UnsafeEnabled {
        mi := &file_product_inventory_proto_msgTypes[6]
        ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
        ms.StoreMessageInfo(mi)
    }
}
func (x *UpdateSalesDetailStatusRequest) String() string {
    return protoimpl.X.MessageStringOf(x)
}
func (*UpdateSalesDetailStatusRequest) ProtoMessage() {}
func (x *UpdateSalesDetailStatusRequest) ProtoReflect() protoreflect.Message {
    mi := &file_product_inventory_proto_msgTypes[6]
    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 UpdateSalesDetailStatusRequest.ProtoReflect.Descriptor instead.
func (*UpdateSalesDetailStatusRequest) Descriptor() ([]byte, []int) {
    return file_product_inventory_proto_rawDescGZIP(), []int{6}
}
func (x *UpdateSalesDetailStatusRequest) GetNumber() string {
    if x != nil {
        return x.Number
    }
    return ""
}
func (x *UpdateSalesDetailStatusRequest) GetSalesDetailStatus() string {
    if x != nil {
        return x.SalesDetailStatus
    }
    return ""
}
type UpdateSalesDetailStatusResponse struct {
    state         protoimpl.MessageState
    sizeCache     protoimpl.SizeCache
    unknownFields protoimpl.UnknownFields
    Code int32  `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
    Msg  string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"`
}
func (x *UpdateSalesDetailStatusResponse) Reset() {
    *x = UpdateSalesDetailStatusResponse{}
    if protoimpl.UnsafeEnabled {
        mi := &file_product_inventory_proto_msgTypes[7]
        ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
        ms.StoreMessageInfo(mi)
    }
}
func (x *UpdateSalesDetailStatusResponse) String() string {
    return protoimpl.X.MessageStringOf(x)
}
func (*UpdateSalesDetailStatusResponse) ProtoMessage() {}
func (x *UpdateSalesDetailStatusResponse) ProtoReflect() protoreflect.Message {
    mi := &file_product_inventory_proto_msgTypes[7]
    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 UpdateSalesDetailStatusResponse.ProtoReflect.Descriptor instead.
func (*UpdateSalesDetailStatusResponse) Descriptor() ([]byte, []int) {
    return file_product_inventory_proto_rawDescGZIP(), []int{7}
}
func (x *UpdateSalesDetailStatusResponse) GetCode() int32 {
    if x != nil {
        return x.Code
    }
    return 0
}
func (x *UpdateSalesDetailStatusResponse) GetMsg() string {
    if x != nil {
        return x.Msg
    }
    return ""
}
var File_product_inventory_proto protoreflect.FileDescriptor
var file_product_inventory_proto_rawDesc = []byte{
@@ -520,21 +630,38 @@
    0x67, 0x12, 0x2e, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74,
    0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
    0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73,
    0x74, 0x32, 0xc1, 0x01, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x76,
    0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a,
    0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
    0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
    0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x43, 0x72, 0x65, 0x61,
    0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
    0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65,
    0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f,
    0x12, 0x1f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50,
    0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
    0x74, 0x1a, 0x20, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79,
    0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
    0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75,
    0x63, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72,
    0x6f, 0x74, 0x6f, 0x33,
    0x74, 0x22, 0x66, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73,
    0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75,
    0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20,
    0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x11, 0x53,
    0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
    0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74,
    0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x47, 0x0a, 0x1f, 0x55, 0x70, 0x64,
    0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74,
    0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04,
    0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65,
    0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d,
    0x73, 0x67, 0x32, 0xa1, 0x02, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e,
    0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46,
    0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
    0x6e, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
    0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x43, 0x72, 0x65,
    0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
    0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76,
    0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66,
    0x6f, 0x12, 0x1f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79,
    0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
    0x73, 0x74, 0x1a, 0x20, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72,
    0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
    0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
    0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75,
    0x73, 0x12, 0x1f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44,
    0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
    0x73, 0x74, 0x1a, 0x20, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73,
    0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70,
    0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64,
    0x75, 0x63, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70,
    0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -549,7 +676,7 @@
    return file_product_inventory_proto_rawDescData
}
var file_product_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_product_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_product_inventory_proto_goTypes = []interface{}{
    (*CreateOperationRequest)(nil),          // 0: CreateOperationRequest
    (*InventoryProduct)(nil),                // 1: InventoryProduct
@@ -557,16 +684,20 @@
    (*GetInventoryProductInfoRequest)(nil),  // 3: GetInventoryProductInfoRequest
    (*ProductInfo)(nil),                     // 4: ProductInfo
    (*GetInventoryProductInfoResponse)(nil), // 5: GetInventoryProductInfoResponse
    (*UpdateSalesDetailStatusRequest)(nil),  // 6: UpdateSalesDetailStatusRequest
    (*UpdateSalesDetailStatusResponse)(nil), // 7: UpdateSalesDetailStatusResponse
}
var file_product_inventory_proto_depIdxs = []int32{
    1, // 0: CreateOperationRequest.ProductList:type_name -> InventoryProduct
    4, // 1: GetInventoryProductInfoResponse.ProductList:type_name -> ProductInfo
    0, // 2: productInventoryService.CreateOperation:input_type -> CreateOperationRequest
    3, // 3: productInventoryService.GetInventoryProductInfo:input_type -> GetInventoryProductInfoRequest
    2, // 4: productInventoryService.CreateOperation:output_type -> CreateOperationResponse
    5, // 5: productInventoryService.GetInventoryProductInfo:output_type -> GetInventoryProductInfoResponse
    4, // [4:6] is the sub-list for method output_type
    2, // [2:4] is the sub-list for method input_type
    6, // 4: productInventoryService.UpdateSalesDetailStatus:input_type -> UpdateSalesDetailStatusRequest
    2, // 5: productInventoryService.CreateOperation:output_type -> CreateOperationResponse
    5, // 6: productInventoryService.GetInventoryProductInfo:output_type -> GetInventoryProductInfoResponse
    7, // 7: productInventoryService.UpdateSalesDetailStatus:output_type -> UpdateSalesDetailStatusResponse
    5, // [5:8] is the sub-list for method output_type
    2, // [2:5] is the sub-list for method input_type
    2, // [2:2] is the sub-list for extension type_name
    2, // [2:2] is the sub-list for extension extendee
    0, // [0:2] is the sub-list for field type_name
@@ -650,6 +781,30 @@
                return nil
            }
        }
        file_product_inventory_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*UpdateSalesDetailStatusRequest); i {
            case 0:
                return &v.state
            case 1:
                return &v.sizeCache
            case 2:
                return &v.unknownFields
            default:
                return nil
            }
        }
        file_product_inventory_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*UpdateSalesDetailStatusResponse); 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{
@@ -657,7 +812,7 @@
            GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
            RawDescriptor: file_product_inventory_proto_rawDesc,
            NumEnums:      0,
            NumMessages:   6,
            NumMessages:   8,
            NumExtensions: 0,
            NumServices:   1,
        },
proto/product_inventory/product_inventory_grpc.pb.go
@@ -20,6 +20,7 @@
type ProductInventoryServiceClient interface {
    CreateOperation(ctx context.Context, in *CreateOperationRequest, opts ...grpc.CallOption) (*CreateOperationResponse, error)
    GetInventoryProductInfo(ctx context.Context, in *GetInventoryProductInfoRequest, opts ...grpc.CallOption) (*GetInventoryProductInfoResponse, error)
    UpdateSalesDetailStatus(ctx context.Context, in *UpdateSalesDetailStatusRequest, opts ...grpc.CallOption) (*UpdateSalesDetailStatusResponse, error)
}
type productInventoryServiceClient struct {
@@ -48,12 +49,22 @@
    return out, nil
}
func (c *productInventoryServiceClient) UpdateSalesDetailStatus(ctx context.Context, in *UpdateSalesDetailStatusRequest, opts ...grpc.CallOption) (*UpdateSalesDetailStatusResponse, error) {
    out := new(UpdateSalesDetailStatusResponse)
    err := c.cc.Invoke(ctx, "/productInventoryService/UpdateSalesDetailStatus", in, out, opts...)
    if err != nil {
        return nil, err
    }
    return out, nil
}
// ProductInventoryServiceServer is the server API for ProductInventoryService service.
// All implementations must embed UnimplementedProductInventoryServiceServer
// for forward compatibility
type ProductInventoryServiceServer interface {
    CreateOperation(context.Context, *CreateOperationRequest) (*CreateOperationResponse, error)
    GetInventoryProductInfo(context.Context, *GetInventoryProductInfoRequest) (*GetInventoryProductInfoResponse, error)
    UpdateSalesDetailStatus(context.Context, *UpdateSalesDetailStatusRequest) (*UpdateSalesDetailStatusResponse, error)
    mustEmbedUnimplementedProductInventoryServiceServer()
}
@@ -66,6 +77,9 @@
}
func (UnimplementedProductInventoryServiceServer) GetInventoryProductInfo(context.Context, *GetInventoryProductInfoRequest) (*GetInventoryProductInfoResponse, error) {
    return nil, status.Errorf(codes.Unimplemented, "method GetInventoryProductInfo not implemented")
}
func (UnimplementedProductInventoryServiceServer) UpdateSalesDetailStatus(context.Context, *UpdateSalesDetailStatusRequest) (*UpdateSalesDetailStatusResponse, error) {
    return nil, status.Errorf(codes.Unimplemented, "method UpdateSalesDetailStatus not implemented")
}
func (UnimplementedProductInventoryServiceServer) mustEmbedUnimplementedProductInventoryServiceServer() {
}
@@ -117,6 +131,24 @@
    return interceptor(ctx, in, info, handler)
}
func _ProductInventoryService_UpdateSalesDetailStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    in := new(UpdateSalesDetailStatusRequest)
    if err := dec(in); err != nil {
        return nil, err
    }
    if interceptor == nil {
        return srv.(ProductInventoryServiceServer).UpdateSalesDetailStatus(ctx, in)
    }
    info := &grpc.UnaryServerInfo{
        Server:     srv,
        FullMethod: "/productInventoryService/UpdateSalesDetailStatus",
    }
    handler := func(ctx context.Context, req interface{}) (interface{}, error) {
        return srv.(ProductInventoryServiceServer).UpdateSalesDetailStatus(ctx, req.(*UpdateSalesDetailStatusRequest))
    }
    return interceptor(ctx, in, info, handler)
}
// ProductInventoryService_ServiceDesc is the grpc.ServiceDesc for ProductInventoryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -132,6 +164,10 @@
            MethodName: "GetInventoryProductInfo",
            Handler:    _ProductInventoryService_GetInventoryProductInfo_Handler,
        },
        {
            MethodName: "UpdateSalesDetailStatus",
            Handler:    _ProductInventoryService_UpdateSalesDetailStatus_Handler,
        },
    },
    Streams:  []grpc.StreamDesc{},
    Metadata: "product_inventory.proto",
proto/product_inventory/server.go
New file
@@ -0,0 +1,27 @@
package product_inventory
import (
    "aps_crm/constvar"
    "aps_crm/model"
    "context"
    "errors"
)
type Server struct {
    UnimplementedProductInventoryServiceServer
}
func (s *Server) UpdateSalesDetailStatus(ctx context.Context, req *UpdateSalesDetailStatusRequest) (*UpdateSalesDetailStatusResponse, error) {
    if req.Number == "" {
        return nil, errors.New("编码不能为空")
    }
    _, err := model.NewSalesDetailsSearch().SetNumber(req.Number).First()
    if err != nil {
        return nil, err
    }
    m := make(map[string]interface{})
    m["status"] = constvar.OverOutbound
    err = model.NewSalesDetailsSearch().SetNumber(req.Number).UpdateByMap(m)
    resp := new(UpdateSalesDetailStatusResponse)
    return resp, err
}
router/product.go
@@ -11,5 +11,6 @@
    {
        productRouter.GET("info", productApi.Info) // 产品详情
        productRouter.GET("list", productApi.List) // 产品列表
        productRouter.GET("getProductOrderInfo/:number", productApi.GetProductOrderInfo) // 获取产品订单信息
    }
}
router/salesDetails.go
@@ -15,6 +15,7 @@
        salesDetailsRouter.DELETE("delete/:id", salesDetailsApi.Delete)                                    // 删除销售明细
        salesDetailsRouter.DELETE("delete", salesDetailsApi.BatchDelete)                                   // 批量删除销售明细
        salesDetailsRouter.PUT("update", salesDetailsApi.Update)                                           // 更新销售明细
        salesDetailsRouter.POST("updateStatus", salesDetailsApi.UpdateStatus)                              // 更新销售明细状态
        salesDetailsRouter.POST("list", salesDetailsApi.List)                                              // 获取销售明细单列表
        salesDetailsRouter.GET("getProductInventoryInfo/:number", salesDetailsApi.GetProductInventoryInfo) // 获取产品库存信息
        salesDetailsRouter.POST("createOperation", salesDetailsApi.CreateOperation)                        // 创建产品出库信息