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
101
102
103
104
105
106
107
import BaseController from "../../baseController";
import { Post } from "egg-shell-decorators";
import { CmsContent } from "../../../entity/cms/module/cmsContent";
 
/**
 * 客户端
 */
export default class ClientController extends BaseController {
  //#region 获取新闻列表
  /**
   * 获取新闻列表
   */
  @Post()
  public async getNewsList() {
    try {
      var newsList = await this.dbRead.find(CmsContent, {
        order: { createDate: "DESC" }
      });
      this.info.result = true;
      this.info.data = newsList;
      this.ctx.body = this.info;
      return;
    } catch (ex) {
      let msg = "异常错误信息:" + ex.message;
      this.info.result = false;
      this.info.msg = msg;
      this.ctx.body = this.info;
      return;
    }
  }
  //#endregion
 
  //#region 获取新闻明细
  /**
   * 获取新闻明细
   */
  @Post()
  public async getNewsInfo() {
    try {
      var newInfo = await this.dbRead.findOne(CmsContent, {
        content_Id: this.body.content_Id
      });
      this.info.result = true;
      this.info.data = newInfo;
    } catch (ex) {
      this.info.msg = ex.message;
      this.info.result = false;
    }
    this.ctx.body = this.info;
    return;
  }
  //#endregion
 
  //#region IdCardDistinguish_Inner 身份证识别
  @Post()
  public async idCardUpload() {
    try {
      this.info = await this.ctx.service.tms.idCard.idCardUpload();
    } catch (ex) {
      this.info.result = false;
      this.info.msg = "错误信息:" + ex.message;
    }
    this.ctx.body = this.info;
  }
  //#endregion
 
  //#region addIdCard 上传身份证
  @Post()
  public async addIdCard() {
    try {
      this.info = await this.ctx.service.tms.idCard.addIdCard();
    } catch (ex) {
      this.info.result = false;
      this.info.msg = "错误信息:" + ex.message;
    }
    this.ctx.body = this.info;
  }
  //#endregion
 
  //#region getRouterList
  /**
   * 获取路由
   */
  @Post()
  public async getRouterList() {
    let { ctx } = this;
    let body = ctx.request.body;
    if (!body.wayBillCode) {
      this.info.result = false;
      this.info.msg = "传递数据不正确";
      this.info.statusCode = 301;
 
      ctx.body = this.info;
      return;
    }
 
    let _info = await this.service.tms.wayBillHelper.getWayBillInfo(body.wayBillCode);
    this.logger.info("PC物流轨迹查询接口 - data:", body.wayBillCode, _info.result, _info.msg);
 
    // 将数据转完小写
    let info = ctx.helper.objectToCase(_info);
 
    ctx.body = info;
  }
 
  //#endregion
}