yxj
2024-11-26 cfe575cc5ae76e14cd6e218d5a3d014de67f0b4a
Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-WEBS
1个文件已修改
47 ■■■■ 已修改文件
CLOUDWEB/WebService1.asmx.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CLOUDWEB/WebService1.asmx.cs
@@ -6,6 +6,7 @@
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Globalization;
namespace CLOUDWEB
{
@@ -52914,8 +52915,11 @@
                string HMaterNames = "";
                string HMaterModels = "";
                string HMaterIDs = "0";
                string HISKFPERIOD = "0";// 保质期启用标记
                string HUnitIDs = "0";
                //查询物料
                ds = oCn.RunProcReturn("select  * from Gy_Material with(nolock) where HNumber='" + str[4] + "' and HUSEORGID=" + HOrgIDs, "Gy_Material");
                ds = oCn.RunProcReturn("select  HUnitID,HItemID,HName,HModel,case HISKFPERIOD when 1 then '1' else '0' end HISKFPERIOD from Gy_Material a with(nolock) where HNumber='" + str[4] + "' and HUSEORGID=" + HOrgIDs + " order by a.HISKFPERIOD desc", "Gy_Material");
                if (ds.Tables[0].Rows.Count == 0)
                {
@@ -52927,7 +52931,40 @@
                    HMaterIDs = ds.Tables[0].Rows[0]["HItemID"].ToString();
                    HMaterNames = ds.Tables[0].Rows[0]["HName"].ToString();
                    HMaterModels = ds.Tables[0].Rows[0]["HModel"].ToString();
                    HISKFPERIOD = ds.Tables[0].Rows[0]["HISKFPERIOD"].ToString();
                    HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString();
                }
                DateTime HDate=DateTime.Now;//日期
                string HProduceDate = "";//生产日期
                string HExpiryDate = "";//保质期至
                if (str.Length == 8 && HISKFPERIOD == "1")
                {
                    if (!string.IsNullOrWhiteSpace(str[7]))
                    {
                        try
                        {
                            HDate = DateTime.ParseExact(str[7], "yyyyMMdd", CultureInfo.InvariantCulture);
                        }
                        catch
                        {
                            sErrMsg = "条码解析失败," + str[7] + ",生产日期格式不正确!";
                            return false;
                        }
                    }
                    HProduceDate = HDate.ToString();
                    //if (!DateTime.TryParse(str[8], out HDate))
                    //{
                    //    sErrMsg = "条码解析失败," + str[8] + ",保质期格式不正确!";
                    //    return false;
                    //}
                    //HExpiryDate = HDate.ToString();
                    //HISKFPERIOD = 1;
                }
                string HSupIDs = "0";
                //查询供应商
                ds = oCn.RunProcReturn("select * from Gy_Supplier with(nolock) where HNumber='" + str[2] + "' and HUSEORGID=" + HOrgIDs, "Gy_Supplier");
@@ -52960,7 +52997,7 @@
                string HSourceInterIDs = "0";
                string HSourceEntryIDs = "0";
                string HUnitIDs = "0";
                //查询采购订单
                ds = oCn.RunProcReturn(@"select  a.HInterID,b.HEntryID,a.HBillNo,b.HUnitID from Cg_POOrderBillMain a with(nolock) inner join Cg_POOrderBillSub b with(nolock) on a.HInterID = b.HInterID where HBillNo='" + HSourceBillNos + "' and b.HMaterID=" + HMaterIDs, "Cg_POOrderBillMain");
                if (ds.Tables[0].Rows.Count == 0)
@@ -52972,7 +53009,7 @@
                {
                    HSourceInterIDs = ds.Tables[0].Rows[0]["HInterID"].ToString();
                    HSourceEntryIDs = ds.Tables[0].Rows[0]["HEntryID"].ToString();
                    HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString();
                    //HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString();
                }
@@ -53023,7 +53060,7 @@
                            ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
                            ",HGiveAwayFlag " +
                            ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
                            ",HProduceDate,HExpiryDate " +
                            ",HProduceDate,HExpiryDate,HISKFPERIOD " +
                            ") values ("
                            + "'" + sBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
                            + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'admin',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
@@ -53032,7 +53069,7 @@
                            + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
                            + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterIDs.ToString() + "," + HEntryID.ToString() + ""
                            + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
                            + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','','')");
                            + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "','"+ HProduceDate + "','"+ HExpiryDate + "',"+ HISKFPERIOD + ")");
                return true;
            }