111
cjs
4 天以前 99004292e20a9e1efa4e3b11b8c319bfd796912c
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
 
using HH.WCS.Mobox3.NFLZ.device;
using Newtonsoft.Json;
using SqlSugar;
using System.Web.Http;
using static HH.WCS.Mobox3.NFLZ.api.ApiHelper;
using static HH.WCS.Mobox3.NFLZ.api.ApiModel;
using static HH.WCS.Mobox3.NFLZ.api.OtherModel;
using static HH.WCS.Mobox3.NFLZ.device.S7Helper;
 
namespace HH.WCS.Mobox3.NFLZ.api {
    /// <summary>
    /// 测试用,如果项目中要和设备对接,前期设备无法测试,用接口模拟
    /// </summary>
    [RoutePrefix("api")]
    public class DebugController : System.Web.Http.ApiController {
 
 
        [HttpPost]
        [Route("s7SetInt")]
        public SimpleResult s7SetInt(DBWModel model) {
            S7Helper.s7SetInt(model);
            return new SimpleResult();
 
        }
 
 
        [HttpPost]
        [Route("s7SetBit")]
        public SimpleResult s7SetBit(DBXModel model) {
            S7Helper.s7SetBit(model);
            return new SimpleResult();
 
        }
        [HttpPost]
        [Route("s7SetString")]
        public SimpleResult s7SetString(DBBModel model) {
            S7Helper.s7SetStr(model);
            return new SimpleResult();
 
        }
 
        [HttpPost]
        [Route("bindCntr")]
        public ReturnResult bindCntr(bindModel model)
        {
            ReturnResult result = new ReturnResult();
            LogHelper.Info($"bindCntr requst:{JsonConvert.SerializeObject(model)}");
            result =  ApiHelper.bindCntr(model);
            return result;
 
        }
 
        [HttpPost]
        [Route("unBindCntr")]
        public ReturnResult unBindCntr(unBindModel model)
        {
            ReturnResult result = new ReturnResult();
            LogHelper.Info($"unBindCntr requst:{JsonConvert.SerializeObject(model)}");
            result = ApiHelper.unBindCntr(model);
            return result;
 
        }
 
        /// <summary>
        /// 外调接驳入库
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("JBIn")]
        public ReturnResult JBIn(JBInModel model)
        {
            ReturnResult result = new ReturnResult();
            LogHelper.Info($"JBIn requst:{JsonConvert.SerializeObject(model)}");
            result = ApiHelper.JBIn(model);
            return result;
        }
 
        /// <summary>
        /// 点到点转运
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("PtpTask")]
        public ReturnResult PtpTask(PtpTaskModel model)
        {
            ReturnResult result = new ReturnResult();
            LogHelper.Info($"PtpTask requst:{JsonConvert.SerializeObject(model)}");
            result = ApiHelper.PtpTask(model, result);
            return result;
        }
    }
}