WYB
2021-04-08 6731f533b1abf47aec884cc10d66a2d6e790fd13
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
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using WebAPI.Models;
 
namespace WebAPI.Service
{
    public class LuBaoSevice
    {
 
        /// <summary>
        /// 扫码方法 
        /// </summary>
        public static ApiResult<DataSet> GetHbarCodeDetail(string sBillBarCode)
        {
            if (string.IsNullOrEmpty(sBillBarCode))
                return new ApiResult<DataSet> { code = -1, msg = "条码不能为空" };
            sBillBarCode = sBillBarCode.CompareTo("#") > 0 ? sBillBarCode.Split(Convert.ToChar("#"))[0] : sBillBarCode;
            var dataSet = GetBarCodeDb(sBillBarCode);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在派工单号" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
 
        public static DataSet GetBarCodeDb(string billBarCode)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessSendWorkList  where 单据号= '" + billBarCode + "'", "h_v_Sc_ProcessSendWorkList");
            return dataSet;
        }
 
        /// <summary>
        /// PDA汇报单回车方法 
        /// </summary>
        public static ApiResult<DataSet> GetProcDetail(string sBillNo, string sProcNo)
        {
            if (string.IsNullOrEmpty(sBillNo) || string.IsNullOrEmpty(sProcNo))
                return new ApiResult<DataSet> { code = -1, msg = "条码和流转卡不能为空" };
            var dataSet = GetProcDb(sBillNo, sProcNo);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "流水号或流转卡号为空" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
 
        public static DataSet GetProcDb(string sBillNo, string sProcNo)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessSendWorkList  where 单据号= '" + sBillNo + "' and HprocID='" + sProcNo + "'", "h_v_Sc_ProcessSendWorkList");
            return dataSet;
        }
 
 
    }
}