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
import BaseController from "../baseController";
import { Post } from "egg-shell-decorators";
import { TMSLine } from "../../entity/tms/site/tmsLine";
 
/**
 * 菜单管理
 */
export default class VoyageController extends BaseController {
  //#region 校验途经点
  /**
   * 校验途经点
   */
  @Post()
  public async checkPlateCode() {
    let { ctx } = this;
    let body = ctx.request.body;
    try {
      if (!body.lineCode) {
        this.info.result = true;
        this.info.msg = "途经点不能为空";
        ctx.body = this.info;
        return;
      }
 
      var waybill = await this.dbRead.findOne(TMSLine, {
        passing: body.lineCode
      });
      if (waybill != null) {
        this.info.result = true;
      } else {
        this.info.result = false;
        this.info.msg = "该途经点不符合规则";
      }
    } catch (ex) {
      this.info.msg = ex.message;
      this.info.result = false;
    }
    ctx.body = this.info;
    return;
  }
  //#endregion
}