季铭对接T+畅捷通,看板API
yl
2023-12-25 72a27b4fd84622ebc51150a07b16d13b7135ebf9
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using VueWebApi.DLL.BLL;
using VueWebApi.Models;
using VueWebApi.Tools;
 
namespace VueWebApi.Controllers
{
    [RoutePrefix(prefix: "api/AppQualityManagement")]
    [ControllerGroup("App质量管理", "在线接口")]
    [ChannelActionFilterAttributeApp]
    public class AppQualityManagementController : ApiController
    {
        //定义全局信息返回变量
        ToMessage mes = new ToMessage();
        RedisHelper redis = new RedisHelper();
 
        #region[入厂检验,扫描采购到货生成标签]
        /// <summary>
        /// 入厂检验,扫描采购到货生成标签
        /// </summary>
        /// <param name="labcode">采购到货生成标签</param>
        /// <returns></returns>
        [Route(template: "InFactoryCheckScanLabCode")]
        [HttpGet]
        public HttpResponseMessage InFactoryCheckScanLabCode(string labcode)
        {
            mes = AppQualityManagementBLL.InFactoryCheckScanLabCode(labcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[入厂检验,根据选择的检验方案查找检验项目]
        /// <summary>
        /// 入厂检验,根据选择的检验方案查找检验项目
        /// </summary>
        /// <param name="checkstandcode">检验方案编码</param>
        /// <returns></returns>
        [Route(template: "InFactoryCheckItem")]
        [HttpGet]
        public HttpResponseMessage InFactoryCheckItem(string checkstandcode)
        {
            mes = AppQualityManagementBLL.InFactoryCheckItem(checkstandcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[入厂检验,提交]
        /// <summary>
        /// 入厂检验,提交
        /// </summary>
        /// <returns></returns>
        [Route(template: "InFactoryCheckSave")]
        [HttpPost]
        public HttpResponseMessage InFactoryCheckSave()
        {
            string hbillno = HttpContext.Current.Request["hbillno"].ToString();//采购订单号
            string labcode = HttpContext.Current.Request["labcode"].ToString();//标签编号
            string checkstandcode = HttpContext.Current.Request["checkstandcode"].ToString();//质检方案编码
            string check_type = HttpContext.Current.Request["check_type"].ToString();//检验类型(入厂检验(InCheck))
            string sampmethod = HttpContext.Current.Request["sampmethod"].ToString();//抽检方式:固定抽检(FIXED) 比例抽检(SCARE)
            string partcode = HttpContext.Current.Request["partcode"].ToString();//物料编码
            string customercode = HttpContext.Current.Request["customercode"].ToString();//往来单位(外购供方编码)
            string batchno = HttpContext.Current.Request["batchno"].ToString();//批次号
            string qualitystatus = HttpContext.Current.Request["qualitystatus"].ToString(); //质量状态(合格、不合格)
            string labqty = HttpContext.Current.Request["labqty"].ToString();//物料数量(标签数量)
            string sampleqty = HttpContext.Current.Request["sampleqty"].ToString();//样本数量
            string goodqty = HttpContext.Current.Request["goodqty"].ToString();//合格数量
            string ngqty = HttpContext.Current.Request["ngqty"].ToString();//不合格数量
            string issyncbatch = HttpContext.Current.Request["issyncbatch"].ToString();//同步相同批次
            string checkitemcont = HttpContext.Current.Request["checkitemcont"].ToString();//检验项目数据
            string username = HttpContext.Current.Request["admin"].ToString();//操作人员
            mes = AppQualityManagementBLL.InFactoryCheckSave(hbillno, labcode, checkstandcode, check_type, sampmethod, partcode, customercode, batchno, qualitystatus, labqty, sampleqty, goodqty, ngqty, issyncbatch, checkitemcont, username);
            return TJson.toJson(mes);
        }
        #endregion
 
 
 
        #region[工序检验扫码获取任务信息]
        /// <summary>
        /// 工序检验扫码获取任务信息
        /// </summary>
        /// <param name="stu_torgcode">组织编码</param>
        /// <param name="orderstepqrcode">扫描工序二维码信息</param>
        /// <param name="checktype">检验方式FirstCheck(首检) PatroCheck(巡检)  EndCheck(完工检)</param>
        /// <returns></returns>
        [Route(template: "StepCheckSearch")]
        [HttpGet]
        public HttpResponseMessage StepCheckSearch(string stu_torgcode,string orderstepqrcode,string checktype)
        {
            mes = ProductionManagementBLL.MesOrderStepCheckSearch(stu_torgcode,orderstepqrcode, checktype);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[工序检验根据选择的检验方案查找检验项目]
        /// <summary>
        /// 入厂检验,工序检验根据选择的检验方案查找检验项目
        /// </summary>
        /// <param name="checkstandcode">检验方案编码</param>
        /// <returns></returns>
        [Route(template: "StepCheckItemList")]
        [HttpGet]
        public HttpResponseMessage StepCheckItemList(string checkstandcode)
        {
            mes = ProductionManagementBLL.MesOrderStepCheckItemList(checkstandcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[工序检验,提交]
        /// <summary>
        /// 工序检验,提交
        /// </summary>
        /// <returns></returns>
        [Route(template: "SaveStepCheckItem")]
        [HttpPost]
        public HttpResponseMessage SaveStepCheckItem()
        {
            string stu_torgcode = HttpContext.Current.Request["stu_torgcode"].ToString();//组织编码
            string wocode = HttpContext.Current.Request["wocode"].ToString();//工单号
            string partcode = HttpContext.Current.Request["partcode"].ToString();//物料编码
            string stepcode = HttpContext.Current.Request["stepcode"].ToString();//工序编码
            string checkstandcode = HttpContext.Current.Request["checkstandcode"].ToString();//质检方案编码
            string check_type = HttpContext.Current.Request["check_type"].ToString();//检验方式FirstCheck(首检) PatroCheck(巡检)  EndCheck(完工检)
            string sampmethod = HttpContext.Current.Request["sampmethod"].ToString();//抽检方式:固定抽检(FIXED) 比例抽检(SCARE)
            string qualitystatus = HttpContext.Current.Request["qualitystatus"].ToString(); //质量状态(合格、不合格)
            string labqty = HttpContext.Current.Request["good_qty"].ToString();//工序任务合格数量
            string sampleqty = HttpContext.Current.Request["sampleqty"].ToString();//样本数量
            string goodqty = HttpContext.Current.Request["goodqty"].ToString();//合格数量
            string ngqty = HttpContext.Current.Request["ngqty"].ToString();//不合格数量
            string checkitemcont = HttpContext.Current.Request["checkitemcont"].ToString();//检验项目数据
            string username = HttpContext.Current.Request["admin"].ToString();//操作人员
            mes = ProductionManagementBLL.SaveMesOrderStepCheckItem(stu_torgcode,wocode, partcode,stepcode,checkstandcode,check_type,sampmethod,qualitystatus,labqty,sampleqty,goodqty,ngqty,checkitemcont,username);
            return TJson.toJson(mes);
        }
        #endregion
 
    }
}