243 lines
5.4 KiB
Protocol Buffer
243 lines
5.4 KiB
Protocol Buffer
|
|
syntax = "proto3";
|
||
|
|
|
||
|
|
package production;
|
||
|
|
|
||
|
|
option go_package = "./pb";
|
||
|
|
|
||
|
|
// ==================== Common ====================
|
||
|
|
|
||
|
|
message IdResp {
|
||
|
|
string id = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message Empty {}
|
||
|
|
|
||
|
|
// ==================== ProductionPlan ====================
|
||
|
|
|
||
|
|
message ProductionPlanInfo {
|
||
|
|
string plan_id = 1;
|
||
|
|
string tenant_id = 2;
|
||
|
|
string plan_code = 3;
|
||
|
|
string product_id = 4;
|
||
|
|
string product_name = 5;
|
||
|
|
string color = 6;
|
||
|
|
string fabric_code = 7;
|
||
|
|
string color_code = 8;
|
||
|
|
string target_quantity = 9;
|
||
|
|
string completed_quantity = 10;
|
||
|
|
string yarn_usage_per_meter = 11;
|
||
|
|
string production_price = 12;
|
||
|
|
string supplier_id = 13;
|
||
|
|
int64 status = 14;
|
||
|
|
string remark = 15;
|
||
|
|
string start_time = 16;
|
||
|
|
string creator = 17;
|
||
|
|
string operator = 18;
|
||
|
|
string created_at = 19;
|
||
|
|
string updated_at = 20;
|
||
|
|
repeated YarnRatioInfo yarn_ratios = 21;
|
||
|
|
repeated ProcessStepInfo process_steps = 22;
|
||
|
|
repeated InboundRecordInfo inbound_records = 23;
|
||
|
|
}
|
||
|
|
|
||
|
|
message CreateProductionPlanReq {
|
||
|
|
string tenant_id = 1;
|
||
|
|
string product_id = 2;
|
||
|
|
string product_name = 3;
|
||
|
|
string color = 4;
|
||
|
|
string fabric_code = 5;
|
||
|
|
string color_code = 6;
|
||
|
|
string target_quantity = 7;
|
||
|
|
string yarn_usage_per_meter = 8;
|
||
|
|
string production_price = 9;
|
||
|
|
string supplier_id = 10;
|
||
|
|
string remark = 11;
|
||
|
|
string start_time = 12;
|
||
|
|
string creator = 13;
|
||
|
|
repeated YarnRatioReq yarn_ratios = 14;
|
||
|
|
repeated ProcessStepReq process_steps = 15;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ListProductionPlanReq {
|
||
|
|
string tenant_id = 1;
|
||
|
|
int64 page = 2;
|
||
|
|
int64 page_size = 3;
|
||
|
|
int64 status = 4;
|
||
|
|
string product_name = 5;
|
||
|
|
string plan_code = 6;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ListProductionPlanResp {
|
||
|
|
int64 total = 1;
|
||
|
|
repeated ProductionPlanInfo list = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message GetProductionPlanReq {
|
||
|
|
string plan_id = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ConfirmPlanReq {
|
||
|
|
string plan_id = 1;
|
||
|
|
string operator = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
// ==================== YarnRatio ====================
|
||
|
|
|
||
|
|
message YarnRatioInfo {
|
||
|
|
string ratio_id = 1;
|
||
|
|
string plan_id = 2;
|
||
|
|
string yarn_name = 3;
|
||
|
|
string ratio = 4;
|
||
|
|
string amount_per_meter = 5;
|
||
|
|
string total_amount = 6;
|
||
|
|
string created_at = 7;
|
||
|
|
}
|
||
|
|
|
||
|
|
message YarnRatioReq {
|
||
|
|
string yarn_name = 1;
|
||
|
|
string ratio = 2;
|
||
|
|
string amount_per_meter = 3;
|
||
|
|
string total_amount = 4;
|
||
|
|
}
|
||
|
|
|
||
|
|
// ==================== ProcessStep ====================
|
||
|
|
|
||
|
|
message ProcessStepInfo {
|
||
|
|
string step_id = 1;
|
||
|
|
string plan_id = 2;
|
||
|
|
string step_type = 3;
|
||
|
|
int64 step_order = 4;
|
||
|
|
int64 status = 5;
|
||
|
|
string operator_id = 6;
|
||
|
|
string completed_at = 7;
|
||
|
|
string remark = 8;
|
||
|
|
string created_at = 9;
|
||
|
|
string updated_at = 10;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ProcessStepReq {
|
||
|
|
string step_type = 1;
|
||
|
|
int64 step_order = 2;
|
||
|
|
string remark = 3;
|
||
|
|
}
|
||
|
|
|
||
|
|
message CompleteStepReq {
|
||
|
|
string plan_id = 1;
|
||
|
|
string step_type = 2;
|
||
|
|
string operator_id = 3;
|
||
|
|
}
|
||
|
|
|
||
|
|
// ==================== ShareLink ====================
|
||
|
|
|
||
|
|
message ShareLinkInfo {
|
||
|
|
string link_id = 1;
|
||
|
|
string tenant_id = 2;
|
||
|
|
string plan_id = 3;
|
||
|
|
string short_code = 4;
|
||
|
|
string token = 5;
|
||
|
|
string factory_type = 6;
|
||
|
|
int64 hide_sensitive = 7;
|
||
|
|
int64 status = 8;
|
||
|
|
int64 click_count = 9;
|
||
|
|
string clicked_at = 10;
|
||
|
|
string responded_at = 11;
|
||
|
|
string reject_reason = 12;
|
||
|
|
string expires_at = 13;
|
||
|
|
string created_by = 14;
|
||
|
|
string created_at = 15;
|
||
|
|
string updated_at = 16;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ShareLinkPlanView {
|
||
|
|
ProductionPlanInfo plan = 1;
|
||
|
|
ShareLinkInfo link = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message CreateShareLinkReq {
|
||
|
|
string tenant_id = 1;
|
||
|
|
string plan_id = 2;
|
||
|
|
string factory_type = 3;
|
||
|
|
int64 hide_sensitive = 4;
|
||
|
|
int64 expires_hours = 5;
|
||
|
|
string created_by = 6;
|
||
|
|
}
|
||
|
|
|
||
|
|
message GetShareLinkReq {
|
||
|
|
string short_code = 1;
|
||
|
|
string token = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ClickShareLinkReq {
|
||
|
|
string short_code = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ConfirmShareLinkReq {
|
||
|
|
string short_code = 1;
|
||
|
|
string token = 2;
|
||
|
|
string factory_tenant_id = 3;
|
||
|
|
}
|
||
|
|
|
||
|
|
message RejectShareLinkReq {
|
||
|
|
string short_code = 1;
|
||
|
|
string token = 2;
|
||
|
|
string reject_reason = 3;
|
||
|
|
}
|
||
|
|
|
||
|
|
// ==================== Inbound ====================
|
||
|
|
|
||
|
|
message InboundRecordInfo {
|
||
|
|
string record_id = 1;
|
||
|
|
string tenant_id = 2;
|
||
|
|
string plan_id = 3;
|
||
|
|
string product_id = 4;
|
||
|
|
string batch_no = 5;
|
||
|
|
string quantity = 6;
|
||
|
|
int64 rolls = 7;
|
||
|
|
string price_per_meter = 8;
|
||
|
|
string operator_id = 9;
|
||
|
|
string remark = 10;
|
||
|
|
string created_at = 11;
|
||
|
|
}
|
||
|
|
|
||
|
|
message CreateInboundReq {
|
||
|
|
string tenant_id = 1;
|
||
|
|
string plan_id = 2;
|
||
|
|
string product_id = 3;
|
||
|
|
string batch_no = 4;
|
||
|
|
string quantity = 5;
|
||
|
|
int64 rolls = 6;
|
||
|
|
string price_per_meter = 7;
|
||
|
|
string operator_id = 8;
|
||
|
|
string remark = 9;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ListInboundReq {
|
||
|
|
string tenant_id = 1;
|
||
|
|
string plan_id = 2;
|
||
|
|
int64 page = 3;
|
||
|
|
int64 page_size = 4;
|
||
|
|
}
|
||
|
|
|
||
|
|
message ListInboundResp {
|
||
|
|
int64 total = 1;
|
||
|
|
repeated InboundRecordInfo list = 2;
|
||
|
|
}
|
||
|
|
|
||
|
|
// ==================== Service ====================
|
||
|
|
|
||
|
|
service ProductionService {
|
||
|
|
rpc CreateProductionPlan(CreateProductionPlanReq) returns (IdResp);
|
||
|
|
rpc ListProductionPlan(ListProductionPlanReq) returns (ListProductionPlanResp);
|
||
|
|
rpc GetProductionPlan(GetProductionPlanReq) returns (ProductionPlanInfo);
|
||
|
|
rpc ConfirmPlan(ConfirmPlanReq) returns (Empty);
|
||
|
|
rpc CreateShareLink(CreateShareLinkReq) returns (ShareLinkInfo);
|
||
|
|
rpc GetShareLink(GetShareLinkReq) returns (ShareLinkInfo);
|
||
|
|
rpc GetShareLinkPlanView(GetShareLinkReq) returns (ShareLinkPlanView);
|
||
|
|
rpc ClickShareLink(ClickShareLinkReq) returns (Empty);
|
||
|
|
rpc ConfirmShareLink(ConfirmShareLinkReq) returns (Empty);
|
||
|
|
rpc RejectShareLink(RejectShareLinkReq) returns (Empty);
|
||
|
|
rpc CompleteStep(CompleteStepReq) returns (Empty);
|
||
|
|
rpc CreateInbound(CreateInboundReq) returns (IdResp);
|
||
|
|
rpc ListInbound(ListInboundReq) returns (ListInboundResp);
|
||
|
|
}
|