Forráskód Böngészése

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

huangbin 4 éve
szülő
commit
5b4ffe3445

+ 38 - 0
public/proto/mtp.proto

@@ -743,3 +743,41 @@ message WRSConvertDetailEx {
 		optional uint64 unitid = 2; // uint64 单位ID
 		optional double convertratio = 3; // double 套保系数
 }
+
+// 仓库申请请求 0 29 141
+message WarehouseApplyReq {
+	optional MessageHead Header = 1; // MessageHead
+		optional uint64 userid = 2; // uint64 用户ID
+		optional int32 type = 3; // int32 类型 1 新增 2 修改
+		optional uint64 warehouseid = 4; // uint64 仓库ID
+		optional string warehousecode = 5; // string 仓库代码
+		optional string warehousename = 6; // string 仓库名称
+		optional int32 warehousetype = 7; // int32 仓库类型 - 1 厂库  2 自有库  3 合作库
+		optional uint64 provinceid = 8; // uint64 省
+		optional uint64 cityid = 9; // uint64 市
+		optional int32 districtid = 10; // int32 区
+		optional string address = 11; // string 详细地址
+		optional string contactname = 12; // string 联系人
+		optional string contactnum = 13; // string 联系电话
+}
+// 仓库申请请求 0 29 142
+message WarehouseApplyRsp {
+	optional MessageHead Header = 1; // MessageHead 消息头
+	optional int32 RetCode = 2; // int32 返回码
+	optional string RetDesc = 3; // string 描述信息
+	optional uint64 warehouseid = 4; // uint64 仓库ID
+}
+
+// 仓库状态修改请求 0 29 143
+message WarehouseStateChangeReq {
+	optional MessageHead Header = 1; // MessageHead
+	optional uint64 warehouseid = 2; // uint64 仓库ID
+	optional int32 warehousestatus = 3; // int32 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+}
+// 仓库状态修改请求 0 29 144
+message WarehouseStateChangeRsp {
+	optional MessageHead Header = 1; // MessageHead 消息头
+	optional int32 RetCode = 2; // int32 返回码
+	optional string RetDesc = 3; // string 描述信息
+	optional uint64 warehouseid = 4; // uint64 仓库ID
+}

+ 8 - 0
src/funcode/index.ts

@@ -67,4 +67,12 @@ export const funCode: Code = {
     DeliveryGoodsApplyRsp: 1900672, //  现货品种申请响应
     DeliveryGoodsCancelReq: 1900673, // 现货品种停用请求
     DeliveryGoodsCancelRsp: 1900674, // 现货品种停用响应
+
+    // 仓库信息
+    WareHouseApplyReq: 1900685,     /// 仓库申请请求
+    WareHouseApplyRsp: 1900686,    /// 仓库申请响应
+    WareHouseStateChangeReq: 1900687,    /// 仓库状态修改请求
+    WareHouseStateChangeRsp: 1900688,    /// 仓库状态修改响应
+
+
 };

+ 71 - 0
src/protoService/warehouse/index.ts

@@ -0,0 +1,71 @@
+import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
+import APP from "@/services";
+import {Callback} from "@/utils/websocket";
+import {WarehouseApplyReq, WarehouseStateChangeReq} from "@/protoService/warehouse/interface";
+
+/**
+ * 新增 / 修改 仓库信息请求  修改需要传仓库id
+ * @param param.type (必填)   类型 1 新增 2 修改
+ * @param param.warehousecode (必填)   仓库代码
+ * @param param.warehousename (必填)   仓库名称
+ * @param param.warehousetype (必填)   仓库类型
+ */
+export const addWarehouseApply = (param: WarehouseApplyReq): Promise<any> => {
+    return new Promise((resolve, reject) => {
+        const params = {
+            protobufName: 'WareHouseApplyReq',
+            funCodeName: 'WareHouseApplyReq',
+            reqParams: param,
+            msgHeadParams: {
+                AccountID: param.accountid,
+                MarketID: 18,
+                GoodsID: 0,
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'WareHouseApplyRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}
+
+/**
+ * 仓库状态修改请求
+ * @param param.warehouseid  仓库ID
+ * @param param.warehousestatus 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+ */
+export const warehouseStateChangeReq = (param: WarehouseStateChangeReq): Promise<any> => {
+    return new Promise((resolve, reject) => {
+        const params = {
+            protobufName: 'WareHouseStateChangeReq',
+            funCodeName: 'WareHouseStateChangeReq',
+            reqParams: param,
+            msgHeadParams: {
+                AccountID: param.accountid,
+                MarketID: 18,
+                GoodsID: 0,
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'WareHouseStateChangeRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}
+

+ 23 - 0
src/protoService/warehouse/interface.ts

@@ -0,0 +1,23 @@
+// 仓库申请请求 0 29 141
+export interface WarehouseApplyReq {
+    accountid: number
+    userid: number// uint64 用户ID
+    type: number // int32 类型 1 新增 2 修改
+    warehouseid?: number // uint64 仓库ID
+    warehousecode: string // string 仓库代码
+    warehousename: string // string 仓库名称
+    warehousetype: number  // int32 仓库类型 - 1 厂库  2 自有库  3 合作库
+    provinceid?: number  // uint64 省
+    cityid?: number  // uint64 市
+    districtid?: number  // int32 区
+    address?: string // string 详细地址
+    contactname?: string // string 联系人
+    contactnum?: string // string 联系电话
+}
+
+// 仓库状态修改请求 0 29 143
+export interface WarehouseStateChangeReq {
+    accountid: number
+    warehouseid: number // uint64 仓库ID
+    warehousestatus: number // int32 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
+}