333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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
}