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
|
}
|