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
import BaseController from "../../baseController";
import { Post } from "egg-shell-decorators";
import { TMSPort } from "../../../entity/express/tms/tmsPort";
 
/**
 * 基础信息 - 口岸
 */
export default class PortController extends BaseController {
  //#region getList 获得口岸列表
  /**
   * 获得口岸列表
   */
  @Post()
  public async getList() {
    let { ctx } = this;
    let body = ctx.request.body;
    console.log(body);
    try {
      let whereStr = "";
      var where: any = {};
 
      let fields = ["port_Id", "portName"];
      if (body.appendField === "*") {
        fields = [];
      }
      let builder = this.dbRead.createQueryBuilder(TMSPort, "t").where(whereStr, where);
      if (fields.length) {
        builder.select(fields);
      }
      let dataList = await builder.getRawMany();
 
      this.info.result = true;
      this.info.data = dataList;
 
      ctx.body = this.info;
    } catch (ex) {
      let msg = "异常错误信息:" + ex.message;
      this.info.result = false;
      this.info.msg = msg;
      ctx.body = this.info;
    }
  }
  //#endregion
}