import BaseController from "../baseController";
|
import { Post } from "egg-shell-decorators";
|
import * as sql from "mssql";
|
/**
|
* 要货管理
|
*/
|
export default class GoodsController extends BaseController {
|
//#region 转到预到货单
|
@Post()
|
public async toAllocation() {
|
let userInfo = await this.ctx.helper.userInfo();
|
try {
|
const connection: any = await this.dbWrite.connection;
|
let request = new sql.Request(connection.driver.master);
|
request.input("goods_Id", this.body.goods_Id);
|
request.input("user_Id", userInfo.user_Id);
|
request.input("userTrueName", userInfo.userTrueName);
|
request.input("userProduct_Id", userInfo.userProduct_Id);
|
request.output("outMsg", sql.NVarChar(2000));
|
let result = await request.execute("sp_Require_Goods_ToAllocation");
|
let outMsg = result.output.outMsg;
|
if (outMsg) {
|
this.info.msg = outMsg;
|
this.info.result = false;
|
this.ctx.body = this.info;
|
} else {
|
this.info.msg = "生成调拨单成功!";
|
this.info.result = true;
|
this.ctx.body = this.info;
|
}
|
} catch (error) {
|
this.info.msg = error.message;
|
this.info.result = false;
|
this.ctx.body = this.info;
|
}
|
}
|
//#endregion
|
}
|