1
duhe
2023-07-10 b8c2edb43cf778ca0203a3a592815aeeb6bcdcde
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -128,6 +128,7 @@
            //int hentryid = int.Parse(sArray[2].ToString());//子表的顺序id
            int OperationType = int.Parse(sArray[2].ToString());//数据类型 1添加 3修改 2 复制
            string user = sArray[3].ToString();//用户名
            string HComputerName = SystemInformation.ComputerName; //设备名称
            user_LongShan = sArray[3].ToString();//用户名
            try
            {
@@ -209,6 +210,9 @@
                    "," + HMainGroupID + "," + HMainProcID + "," + HMainCenterID + ",'" + HMainTimeUnit + "'," + HMainUnitTime + "," + HMainWorkQty +
                    "," + HMainPrice + "," + HStdSourceQty + "," + HAddSourceRate + "," + HPRDORGID + "," + HDelSourceRate +
                    ",'" + HPicNumVer + "','" + HPicNumAssemble + "','" + HMaterTexture + "','" + HProductNum + "','" + HVerNum + "'," + HOrgID + ") ");
                    LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",新增工艺路线单据:" + HBillNo);
                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "新增工艺路线单据:" + HBillNo + "','LMES-工艺路线模块','" + DBUtility.ClsPub.IPAddress + "','新增单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
                { //修改
@@ -224,7 +228,10 @@
                        ",HProductNum='" + HProductNum + "',HVerNum='" + HVerNum + "' where HInterID='" + HInterID + "'");
                    //删除子表
                    oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'");
                    oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'");
                    LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",修改工艺路线单据:" + HBillNo);
                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "修改工艺路线单据:" + HBillNo + "','LMES-工艺路线模块','" + DBUtility.ClsPub.IPAddress + "','修改单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, HInterID, OperationType);
@@ -336,13 +343,16 @@
            foreach (Gy_RoutingBillSub oSub in DetailColl)
            {
                i++;
                if (oSub.HWorkQty <= 0)
                if (oSystemParameter.omodel.WMS_CampanyName != "龙山汽配")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "第" + i + "行,加工数量不能为0或者小于0";
                    objJsonResult.data = null;
                    return objJsonResult;
                    if (oSub.HWorkQty <= 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "第" + i + "行,加工数量不能为0或者小于0";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                
                //如果工价为0,则工价字段不做为必填字段
@@ -432,20 +442,13 @@
        {
            try
            {
                string flag = "flase";
                string sErrMsg = "";
                if (oSystemParameter.ShowBill(ref sErrMsg))
                {
                    if (oSystemParameter.omodel.Gy_RoutingBill_SaveAutoLastProc == "Y")
                    {
                        flag = "true";
                    }
                }
                oSystemParameter.ShowBill(ref sErrMsg);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "";
                objJsonResult.data = flag;
                objJsonResult.data = oSystemParameter.omodel;
                return objJsonResult;
            }
            catch (Exception e)