yangle
2024-06-24 82e9899d7d6070e52052d366bcbbb8a323b1d344
斯莫尔优化
7个文件已修改
231 ■■■■■ 已修改文件
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckBillController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/条码管理/WEBSController.cs 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/StationBill.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -1927,6 +1927,10 @@
                    {
                        omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ProcessExchangeBill_SaveDeptIsNull")
                    {
                        omodel.Sc_ProcessExchangeBill_SaveDeptIsNull = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    ////=========工序进站单
@@ -3491,7 +3495,10 @@
                    {
                        omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ProcessExchangeBill_SaveDeptIsNull")
                    {
                        omodel.Sc_ProcessExchangeBill_SaveDeptIsNull = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //-======工序进站接收单
                    //自动新增
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -490,6 +490,7 @@
        public string Sc_ProcessExchangeBill_SaveAutoAddnew;               //保存后变为新增状态
        public string Sc_ProcessExchangeBill_AutoBarCode;                //工序流转卡保存自动同步条码档案
        public string Sc_ProcessExchangeBill_DeleterAndMakerMustSame;    //工序流转卡删除人必须是制单人
        public string Sc_ProcessExchangeBill_SaveDeptIsNull;    //工序流转卡 æ ¹æ®è½¦é—´åˆ¤æ–­ å­—段是否为空
        //工序进站接收单 
        public string MES_StationInBill_AutoCheck;                        //保存后是否自动审核
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -146,6 +146,8 @@
                double HWasterQty_Mater = list[0].HWasterQty_Mater;//料废数量
                double HBackWorkQty = list[0].HBackWorkQty;//返工数量
                Int64 HShiftsID = list[0].HShiftsID;//生产班次
                double HToCheckQty = list[0].HToCheckQty;//取样数量
                double HLossQty = list[0].HLossQty;//遗失数量
                LogService.Write($"1.字段赋值,用时" + sw.Elapsed );
@@ -221,7 +223,7 @@
                if (oSystemParameter.ShowBill(ref Ret))
                {
                    //判断客户不为龙山汽配
                    if (oSystemParameter.omodel.WMS_CampanyName != "龙山汽配"&& oSystemParameter.omodel.WMS_CampanyName != "瑞与祺") //系统参数
                    if (oSystemParameter.omodel.WMS_CampanyName != "龙山汽配" && oSystemParameter.omodel.WMS_CampanyName != "瑞与祺") //系统参数
                    {
                        if (HSourceID == 0)
                        {
@@ -230,7 +232,7 @@
                            objJsonResult.Message = "生产资源没有选择!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        }
                    }
                    //判断客户为龙山汽配
                    else if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配")
@@ -261,6 +263,28 @@
                            return objJsonResult;
                        }
                    }
                    //判断客户为斯莫尔
                    else if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                    {
                        if (HQty + HWasterQty + HBadCount <= 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "合格数量加报废数量加不良数量不能为0!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    else {
                        if (HQty + HWasterQty <= 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "合格数量加报废数量不能为0!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
               
                //if (HCenterID == 0)
@@ -271,14 +295,7 @@
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (HQty + HWasterQty <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "合格数量加报废数量不能为0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //if (HWorkTimes <= 0)
                //{
@@ -373,6 +390,7 @@
                    ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" +
                    ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" +
                    ",HmaterOutqty,HProcPriceRate,HTemporaryAreaID,HWasterQty_Work,HWasterQty_Mater,HBackWorkQty,HShiftsID" +
                    ",HToCheckQty,HLossQty" +
                    ") " +
                    " values('" + BillType + "','" + (OperationType == "5" ? "SUB" : HBillSubType)  + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" +
                    "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
@@ -382,8 +400,8 @@
                    "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HBadCount + "," + HCenterID + "," + HProcNo + ",'" + HOrderProcNO + "'" + ",'" + HSourceNameList + "'" +
                    "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) +
                    "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID +
                    ","+ HmaterOutqty + "," + HProcPriceRate + ","+ HTemporaryAreaID + "," + HWasterQty_Work + "," + HWasterQty_Mater + "," + HBackWorkQty +
                    "," + HShiftsID + ") ");
                    "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + "," + HWasterQty_Work + "," + HWasterQty_Mater + "," + HBackWorkQty +
                    "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ") ");
                    LogService.Write($"4.新增结束,用时" + sw.Elapsed);
                    LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",新增工序出站单据:" + HBillNo);
@@ -412,6 +430,8 @@
                    ",HWorkTimes=" + HWorkTimes +
                    ",HSaveBillFlag=0 " +
                    ",HPieceQty=" + HPieceQty +
                    ",HToCheckQty=" + HToCheckQty +
                    ",HLossQty=" + HLossQty +
                    ",HQty=" + HQty +
                    ",HDSQty=" + HDSQty +
                    ",HChongQty=" + HChongQty +
WebAPI/Controllers/WebAPIController.cs
@@ -119,7 +119,7 @@
                    //----------创建虚表------------------------
                    DataTable dt_Main = new DataTable("Json");
                    dt_Main.Columns.Add("HBillNo", typeof(string));
                    dt_Main.Columns.Add("HInterID", typeof(int));
                    dt_Main.Columns.Add("HInterID", typeof(Int64));
                    //---------创建新行------------------------
                    DataRow dr_main = dt_Main.NewRow();//创建新行 
                    dt_Main.Rows.Add(dr_main);//将新行加入到表中
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_DotCheckBillController.cs
@@ -335,7 +335,7 @@
            try
            {
                ds = oCN.RunProcReturn("select b.HItemID,b.HNumber,b.HName from  Gy_DotCheck a left  join gy_DotCheckItemClass b on a.HDotCheckItemClassID=b.HItemID", "Gy_DotCheck");
                ds = oCN.RunProcReturn("select HItemID,HNumber,HName from gy_DotCheckItemClass", "gy_DotCheckItemClass");
                List<TreeModel> treeModels = new List<TreeModel>();
                TreeModel first = new TreeModel();
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -5886,6 +5886,177 @@
        {
            try
            {
                ds = oCn.RunProcReturn("select * from Gy_BarCodeBill where HBarcode='" + HBarCode + "'", "Gy_BarCodeBill");
                if (ds.Tables[0].Rows.Count == 0) {
                    DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
                    string sErrMsg = "";
                    oSystemParameter.ShowBill(ref sErrMsg);
                    if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔")
                    {
                        if (!dal.GetInfoByNumber(HBarCode))
                        {
                            //条码解析
                            string[] str = HBarCode.Split('@');
                            if (str[0] != "CMR" && str[0] != "SRM")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "条码解析失败,请确认条码是否正确!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            int HOrgIDs = 0;
                            //查询组织
                            DataSet ds = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS where HNumber='" + str[1] + "' ", "Xt_ORGANIZATIONS");
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "条码解析失败,请确认条码组织是否正确!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            else
                            {
                                HOrgIDs = int.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString());
                            }
                            string HMaterNames = "";
                            string HMaterModels = "";
                            string HMaterIDs = "0";
                            //查询物料
                            ds = oCn.RunProcReturn("select  * from Gy_Material where HNumber='" + str[4] + "' and HUSEORGID=" + HOrgIDs, "Gy_Material");
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "条码解析失败,请确认条码物料是否正确!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            else
                            {
                                HMaterIDs = ds.Tables[0].Rows[0]["HItemID"].ToString();
                                HMaterNames = ds.Tables[0].Rows[0]["HName"].ToString();
                                HMaterModels = ds.Tables[0].Rows[0]["HModel"].ToString();
                            }
                            string HSupIDs = "0";
                            //查询供应商
                            ds = oCn.RunProcReturn("select * from Gy_Supplier where HNumber='" + str[2] + "' and HUSEORGID=" + HOrgIDs, "Gy_Supplier");
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                //sErrMsg = "条码解析失败,请确认条码供应商是否正确!";
                                //return null;
                            }
                            else
                            {
                                HSupIDs = ds.Tables[0].Rows[0]["HItemID"].ToString();
                            }
                            string HSourceInterIDs = "0";
                            string HSourceEntryIDs = "0";
                            string HSourceBillNos = "0";
                            string HUnitIDs = "0";
                            //查询采购订单
                            ds = oCn.RunProcReturn(@"select  a.HInterID,b.HEntryID,a.HBillNo,b.HUnitID from Cg_POOrderBillMain a
inner join Cg_POOrderBillSub b on a.HInterID = b.HInterID where HBillNo='" + str[3] + "' and b.HMaterID=" + HMaterIDs, "Cg_POOrderBillMain");
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                //sErrMsg = "条码解析失败,请确认条码采购订单是否正确!";
                                //return null;
                            }
                            else
                            {
                                HSourceInterIDs = ds.Tables[0].Rows[0]["HInterID"].ToString();
                                HSourceEntryIDs = ds.Tables[0].Rows[0]["HEntryID"].ToString();
                                HSourceBillNos = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                                HUnitIDs = ds.Tables[0].Rows[0]["HUnitID"].ToString();
                            }
                            string HInnerBillNos = "";
                            //查询内部采购订单号
                            ds = oCn.RunProcReturn(@" select * from h_v_IF_POInStockList where é‡‡è´­è®¢å•号= '" + str[3] + "' ", "h_v_IF_POInStockList");
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                //sErrMsg = "条码解析失败,请确认条码内部采购订单号是否正确!";
                                //return null;
                                HInnerBillNos = str[3];
                            }
                            else
                            {
                                HInnerBillNos = ds.Tables[0].Rows[0]["内部采购订单号"].ToString();
                            }
                            double HQty = double.Parse(str[6]);
                            //日期获取方式
                            string sDate = DateTime.Now.ToString();
                            string HWei = "0";      //尾数
                            string HBarCodeType = "批次条码";
                            Int64 HMaterID = int.Parse(HMaterIDs);
                            Int64 HAuxPropID = 0;
                            Int64 HUnitID = int.Parse(HUnitIDs);
                            double HQty2 = HQty;
                            string HBatchNo2 = str[5];
                            Int64 HSupID = int.Parse(HSupIDs);
                            Int64 HGroupID = 0;
                            int HPrintQty = 0;
                            Int64 HSourceInterID = int.Parse(HSourceInterIDs);
                            Int64 HSourceEntryID = int.Parse(HSourceEntryIDs);
                            string HSourceBillNo = HSourceBillNos;
                            //HSourceBillType = "1102";
                            Int64 HBarcodeNo = 0;       //托号
                            Int64 HBarcodeQtys = 0;     //总托数
                            Int64 HDeptID = 0;
                            //Int64 HWhID = 0;
                            //Int64 HSPID = 0;
                            string HRemark = "条码解析";
                            string HMaterName = HMaterNames;
                            string HMaterModel = HMaterModels;
                            string HPinfan = "";
                            string HMTONo = "";
                            Int64 HCusID = 0;
                            string HCusType = "";
                            DateTime HEndDate = DateTime.Now;
                            string HWorkLineName = "";
                            string HSeOrderBillNo = "";
                            string HInnerBillNo = HInnerBillNos;
                            bool HGiveAwayFlag = false;
                            Int64 HEntryID = 1;
                            Int64 HInterIDs = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                            int HOrgID = HOrgIDs;
                            string HSourceBillType = "";
                            oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                               ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                               ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                                               ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                                               ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                               ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
                                               ",HGiveAwayFlag " +
                                               ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" +
                                               ",HProduceDate,HExpiryDate " +
                                               ") values ("
                                               + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
                                               + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
                                               + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
                                               + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + ",0,0,'" + HRemark + "'"
                                               + ", " + 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 + "','','')");
                        }
                    }
                }
                ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_MaterToSource " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HMaker + "'", "h_p_WMS_AddBarCode_MaterToSource");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
WebAPI/Models/StationBill.cs
@@ -85,6 +85,8 @@
        public double HWasterQty_Work { get; set; }
        public double HWasterQty_Mater { get; set; }
        public double HBackWorkQty { get; set; }
        public double HToCheckQty { get; set; }
        public double HLossQty { get; set; }
        public Int64 HShiftsID { get; set; }
    }
}