import BaseController from "../baseController";
|
import { Post } from "egg-shell-decorators";
|
|
/**
|
* 上架 - 扫描操作
|
*/
|
export default class ShelveScanController extends BaseController {
|
//#region 上架单信息
|
@Post()
|
public async getData() {
|
let shelveCode = this.body.shelveCode;
|
|
if (!shelveCode) {
|
this.info.result = false;
|
this.info.msg = "待上架单号不能为空!";
|
this.ctx.body = this.info;
|
return;
|
}
|
|
try {
|
this.info = await this.ctx.service.inbound.shevlveScan.getData();
|
if (!this.info.result) {
|
this.ctx.body = this.info;
|
return;
|
}
|
|
await this.ctx.service.inbound.shevlveScan.getShelvePositionName(this.info.data, shelveCode);
|
} catch (error) {
|
this.info.result = false;
|
this.info.msg = "错误:" + error.message;
|
}
|
this.ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region 获取最近上架货位
|
@Post()
|
public async getShelvePositionName() {
|
let shelveCode = this.body.shelveCode;
|
let shelveList_Id = this.body.shelveList_Id;
|
|
try {
|
this.info = await this.ctx.service.inbound.shevlveScan.getShelvePositionName(shelveCode, shelveList_Id);
|
} catch (error) {
|
this.info.result = false;
|
this.info.msg = "错误:" + error.message;
|
}
|
this.ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region 常规上架保存 ShelveSave
|
@Post()
|
public async shelveSave() {
|
let shelveCode = this.body.shelveCode;
|
let productModelList = this.body.productModelList;
|
|
try {
|
this.info = await this.ctx.service.inbound.shevlveScan.shelveSave(shelveCode, productModelList);
|
} catch (error) {
|
this.info.result = false;
|
this.info.msg = "错误:" + error.message;
|
}
|
|
this.ctx.body = this.info;
|
}
|
//#endregion
|
|
/* *****************************************************
|
* 无单扫描上架
|
* *****************************************************/
|
//#region 无单扫描上架 - 获取无单数据
|
/// <summary>
|
/// 无单扫描上架 - 获取无单数据
|
/// </summary>
|
/// <param name="data"></param>
|
/// <returns></returns>
|
@Post()
|
public async getShelveNoBillData() {
|
let storage_Id: number = this.body.storage_Id;
|
let positionName: string = this.body.positionName;
|
let productModel: string = this.body.productModel;
|
this.info = await this.ctx.service.inbound.shevlveScan.getShelveNoBillData(storage_Id, positionName, productModel);
|
|
this.ctx.body = this.info;
|
}
|
//#endregion
|
|
//#region 无单扫描上架 - 保存无单数据
|
/**
|
* 无单扫描上架 - 保存无单数据
|
*/
|
@Post()
|
public async shelveNoBillSave() {
|
this.info = await this.ctx.service.inbound.shevlveScan.shelveNoBillSave(this.body.dataList);
|
|
this.ctx.body = this.info;
|
}
|
//#endregion
|
}
|