1
black-goat-me
2023-05-23 1664e7f3b3ef38ecf01afb098512c733315c4d10
1
13个文件已删除
11个文件已修改
799 ■■■■■ 已修改文件
Model/基础资料/基础资料/ClsGy_Source_Model.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/LMESController.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_ProcessMangementController.cs 536 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsGy_Source_Ctl.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220325.txt 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220408.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220411.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220413.txt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220422.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220512.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220513.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220517.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220623.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220701.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220708.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220714.txt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Vlog/webapi20220805.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Source_Model.cs
@@ -23,6 +23,7 @@
        public double HMinAdd;//        money        //最小进阶             --addnew
        public Int64 HClassCount;//    int        //每日班次                  --addnew
        public int HUSEORGID;
        public int HEmpID; //负责人
        public string HMacAddr; //mac地址
    }
}
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -386,6 +386,7 @@
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (user == "10000")//api同步方式
                {
                    oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID);
@@ -395,6 +396,7 @@
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_Material_Delete", 1, false, user))
                {
@@ -416,6 +418,7 @@
                ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
@@ -444,6 +447,7 @@
            }
            catch (Exception e)
            {
                oCN.RollBack();//回滚事务
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs
@@ -27,7 +27,21 @@
        {
            try
            {
                ds = oCN.RunProcReturn("select * from  Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'", "Xt_grdAlignment_WMES");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    ds = oCN.RunProcReturn("select * from  Xt_grdAlignment_WMES where HModName='" + HModName + "' and (HUserName='admin' or HUserName='Admin')", "Xt_grdAlignment_WMES");
                    if (ds.Tables[0].Rows.Count == 0) {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "Sucess!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -144,6 +158,48 @@
        #endregion
        #region éšè—åˆ—设置  åˆ é™¤
        [Route("Xt_grdAlignment_WMES/DelgrdAlignmentWMES")]
        [HttpGet]
        public object DelgrdAlignmentWMES(string HModName, string user)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from  Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'", "Xt_grdAlignment_WMES");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此人无模块数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("delete from Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'");
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æŒ‰é’®è®¾ç½® åˆ—表
        [Route("Xt_ModuleButtonSet_WMES/moduleButtonSetWMESList")]
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -7,6 +7,7 @@
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Models;
namespace WebAPI.Controllers
@@ -37,6 +38,7 @@
                //委外工序发出反序列化
                string msg2 = "[" + sArray[0].ToString() + "]";
                string user = sArray[1].ToString();
                string HComputerName = SystemInformation.ComputerName; //设备名称
                //判断是否有编辑权限
                if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Edit", 1, false, user))
@@ -202,6 +204,9 @@
                    "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty + ",'" + HSourceName + "'," + HCenterID +
                    ",'" + HProcNo + "','" + HOrderProcNO + "','" + HMainInterID + "'," + HPRDOrgID +
                    ","+ HmaterOutqty + ") ");
                    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 ("Modify".Equals(eventType))
                {
@@ -244,6 +249,9 @@
                    ",HProcNo='" + HProcNo + "'" +
                    ",HOrderProcNO='" + HOrderProcNO + "'" +
                    " 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);
                }
                else
                {
@@ -965,6 +973,7 @@
        {
            try
            {
                string HComputerName = SystemInformation.ComputerName; //设备名称
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Drop", 1, false, HDeleteMan))
                {
@@ -1034,8 +1043,7 @@
                        return objJsonResult;
                    }
                    //写入删除日志
                    string WorkList = "删除进站单:" + oBill.omodel.HBillNo;
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
@@ -1046,6 +1054,10 @@
                    }
                    else
                    {
                        //写入删除日志
                        LogService.Write("用户:" + HDeleteMan + ",日期:" + DateTime.Now + ",删除工序进站单据:" + oBill.omodel.HBillNo);
                        oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + HDeleteMan + "','" + HComputerName + "','" + "删除工序进站单据:" + oBill.omodel.HBillNo + "','LMES-工序进站模块','" + DBUtility.ClsPub.IPAddress + "','删除单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功!";
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -10,6 +10,7 @@
using System.IO;
using System.Web;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Models;
namespace WebAPI.Controllers
@@ -39,6 +40,7 @@
                //反序列化
                string msg2 = "[" + sArray[0].ToString() + "]";
                string user = sArray[1].ToString();//用户名
                string HComputerName = SystemInformation.ComputerName; //设备名称
                //判断是否有编辑权限
                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user))
@@ -314,6 +316,9 @@
                    "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) +
                    "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID +
                     ","+ HmaterOutqty + ") ");
                    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 ("Modify".Equals(eventType))
                {
@@ -346,6 +351,9 @@
                    ",HWasterQty=" + HWasterQty +
                    ",HLastSubProc=" + Convert.ToString(HLastSubProc ? 1 : 0) +
                    " 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);
                }
                else
                {
@@ -1612,7 +1620,7 @@
        {
            try
            {
                string HComputerName = SystemInformation.ComputerName; //设备名称
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Drop", 1, false, HDeleteMan))
                {
@@ -1682,8 +1690,6 @@
                        return objJsonResult;
                    }
                    //写入删除日志
                    string WorkList = "删除出站单:" + oBill.omodel.HBillNo;
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
@@ -1694,6 +1700,10 @@
                    }
                    else
                    {
                        //写入删除日志
                        LogService.Write("用户:" + HDeleteMan + ",日期:" + DateTime.Now + ",删除工序出站单据:" + oBill.omodel.HBillNo);
                        oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + HDeleteMan + "','" + HComputerName + "','" + "删除工序出站单据:" + oBill.omodel.HBillNo + "','LMES-工序出站模块','" + DBUtility.ClsPub.IPAddress + "','删除单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功!";
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -7,6 +7,7 @@
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Models;
namespace WebAPI.Controllers
@@ -19,6 +20,7 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        #region[新增单据-保存按钮]
        /// <summary>
@@ -37,6 +39,7 @@
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string msg5 = sArray[3].ToString();
            string HComputerName = SystemInformation.ComputerName; //设备名称
            string UserName = "";
            ListModels oListModels = new ListModels();
@@ -98,12 +101,18 @@
                bool bResult;
                if (msg5 == "xz")
                {
                    LogService.Write("用户:" + msg4 + ",日期:" + DateTime.Now + ",新增工序流转卡单据:" + oBill.omodel.HBillNo);
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg4 + "','" + HComputerName + "','" + "新增工序流转卡单据:" + oBill.omodel.HBillNo + "','LMES-工序流转卡模块','" + DBUtility.ClsPub.IPAddress + "','新增单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    LogService.Write("用户:" + msg4 + ",日期:" + DateTime.Now + ",修改工序流转卡单据:" + oBill.omodel.HBillNo);
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg4 + "','" + HComputerName + "','" + "修改工序流转卡单据:" + oBill.omodel.HBillNo + "','LMES-工序流转卡模块','" + DBUtility.ClsPub.IPAddress + "','修改单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                }
                if (bResult)
                {
@@ -391,6 +400,7 @@
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string msg5 = sArray[3].ToString();
            string HComputerName = SystemInformation.ComputerName; //设备名称
            string UserName = "";
            ListModels oListModels = new ListModels();
@@ -449,8 +459,17 @@
                            oBill.omodel.HQty = HPlanQty;
                        }
                        for (int j = 0; j < oBill.DetailColl.Count; j++)
                        {
                            oBill.DetailColl[j].HRelationQty_In = 0;
                            oBill.DetailColl[j].HRelationQty_Out = 0;
                            oBill.DetailColl[j].HRelationQty_Bad = 0;
                        }
                        //保存完毕后处理
                        bool bResult;
                        LogService.Write("用户:" + msg4 + ",日期:" + DateTime.Now + ",新增工序流转卡单据:" + oBill.omodel.HBillNo);
                        oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg4 + "','" + HComputerName + "','" + "新增工序流转卡单据:" + oBill.omodel.HBillNo + "','LMES-工序流转卡模块','" + DBUtility.ClsPub.IPAddress + "','新增单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                        bResult = oBill.AddBill(ref sReturn);
                        if (bResult)
@@ -498,6 +517,7 @@
            string msg4 = sArray[2].ToString();//工艺路线
            string msg5 = sArray[3].ToString();//类型
            string msg6 = sArray[4].ToString();//用户
            string HComputerName = SystemInformation.ComputerName; //设备名称
            ListModels oListModels = new ListModels();
@@ -571,6 +591,9 @@
                    bool bResult=false;
                    if (msg5 == "2")
                    {
                        LogService.Write("用户:" + msg6 + ",日期:" + DateTime.Now + ",新增工序流转卡单据:" + oBill.omodel.HBillNo);
                        oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg6 + "','" + HComputerName + "','" + "新增工序流转卡单据:" + oBill.omodel.HBillNo + "','LMES-工序流转卡模块','" + DBUtility.ClsPub.IPAddress + "','新增单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                        bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    }
                    oBill.DetailColl.Clear();
@@ -817,9 +840,13 @@
                return objJsonResult;
            }
            string HComputerName = SystemInformation.ComputerName; //设备名称
            DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill();
            string[] HBillNo = HInterID.Split(',');
            string HBillNo_S = "";
            foreach (var item in HBillNo)
            {
@@ -879,6 +906,7 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker != "")
                    {
                        objJsonResult.code = "0";
@@ -887,6 +915,7 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    HBillNo_S += oBill.omodel.HBillNo + ",";
                }
                else
                {
@@ -897,6 +926,12 @@
                    return objJsonResult;
                }
            }
            HBillNo_S = HBillNo_S.Substring(0, HBillNo_S.Length - 1);
            LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",删除工序流转卡单据:" + HBillNo_S);
            oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "删除工序流转卡单据:" + HBillNo_S + "','LMES-工序流转卡模块','" + DBUtility.ClsPub.IPAddress + "','删除单据'", ref DBUtility.ClsPub.sExeReturnInfo);
            foreach (var item in HBillNo)
            {
                bool IsDete = oBill.DeleteBill(long.Parse(item), ref DBUtility.ClsPub.sExeReturnInfo);
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -10,6 +10,7 @@
using System.IO;
using System.Web;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Controllers.SCGL.日计划管理;
using WebAPI.Models;
@@ -124,6 +125,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; //设备名称
            try
            {
                //判断是否有编辑权限
@@ -203,6 +205,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)
                { //修改
@@ -219,6 +224,9 @@
                    //删除子表
                    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);
WebAPI/Controllers/LMESController.cs
@@ -7,6 +7,7 @@
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Models;
namespace WebAPI.Controllers
{
@@ -73,6 +74,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -410,6 +412,7 @@
            string ModRightNameCheck = "Gy_RoutingBill_Drop";
            try
            {
                string HComputerName = SystemInformation.ComputerName; //设备名称
                //删除权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user))
                {
@@ -430,7 +433,7 @@
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from Gy_RoutingBillmain where HInterID=" + lngBillKey, "Gy_RoutingBillmain");
                ds = oCN.RunProcReturn("select * from Gy_RoutingBillMain where HInterID=" + lngBillKey, "Gy_RoutingBillmain");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -459,6 +462,10 @@
                //}
                oCN.RunProc("delete from Gy_RoutingBillmain where HInterID=" + lngBillKey);
                oCN.RunProc("delete from Gy_RoutingBillSub where HInterID=" + lngBillKey);
                LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",删除工艺路线单据:" + ds.Tables[0].Rows[0]["HBillNo"].ToString());
                oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "删除工艺路线单据:" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-工艺路线模块','" + DBUtility.ClsPub.IPAddress + "','删除单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -190,6 +190,8 @@
            }
        }
        #endregion
        #region æ–¯èޫ尔 æœ«é“工序汇报列表  æ±‡æŠ¥ å…¥åº“
        /// <summary>
        /// ç”Ÿæˆ ç”Ÿäº§æ±‡æŠ¥å•  
@@ -410,7 +412,7 @@
                string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString();
                //根据工序汇报单主ID获取工序汇报入库单的数据
                DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc");
                if(ds.Tables[0].Rows.Count <= 0)
                if (ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -419,10 +421,10 @@
                    return objJsonResult;
                }
                DataRow dr = ds.Tables[0].Rows[0];
                //保存
                oCN.BeginTran();
                DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain where HBillNo='{HBillNo}'"  , "Sc_ICMOReportBillMain");
                DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain");
                if (DsTable.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "0";
@@ -431,18 +433,18 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                    //生产汇报单主表
                    oCN.RunProc("Insert Into Sc_ICMOReportBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" +
                ",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" +
                ",HGroupID,HDeptID,HDeptNumber" +
                ",HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType" +
                ") " +
                " values('3711','3711'," + HInterID.ToString() + ",'" + BillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" +
                ",DATENAME(YEAR,GETDATE()),0,'','" + dr["HEmpID"].ToString() + "','" + dr["操作员代码"].ToString() +
                "','" + dr["HGroupID"].ToString() + "',0,''" +
                ",'" + BillNo.ToString() + "'," + InterID.ToString() + ", 0,'3791'" +
                ") ");
                //生产汇报单主表
                oCN.RunProc("Insert Into Sc_ICMOReportBillMain   " +
            "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" +
            ",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" +
            ",HGroupID,HDeptID,HDeptNumber" +
            ",HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType" +
            ") " +
            " values('3711','3711'," + HInterID.ToString() + ",'" + BillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" +
            ",DATENAME(YEAR,GETDATE()),0,'','" + dr["HEmpID"].ToString() + "','" + dr["操作员代码"].ToString() +
            "','" + dr["HGroupID"].ToString() + "',0,''" +
            ",'" + BillNo.ToString() + "'," + InterID.ToString() + ", 0,'3791'" +
            ") ");
                //生产汇报单子表
                oCN.RunProc("Insert into Sc_ICMOReportBillSub " +
                      " (HInterID,HEntryID,HMaterID,HMaterNumber" +
@@ -483,7 +485,7 @@
                model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //单据日期1
                model.Add("FHZYMESFLAG", "是");//  æ˜¯å¦ä¸ºMES同步
                model.Add("FBillNo", BillNo);
                JArray Fentity = new JArray();
                foreach (DataRow item in ds.Tables[0].Rows)
@@ -550,7 +552,7 @@
                    //["IsAutoSubmitAndAudit"] = true,//自动调用提交和审核功能
                    ["Model"] = model
                };
                string result = InvokeHelper.Save("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//保存
                //判断保存是否成功
                if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
@@ -584,7 +586,7 @@
                    return objJsonResult;
                }
                oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo+"'");
                oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo + "'");
                oCN.Commit();
                objJsonResult.code = "0";
@@ -626,7 +628,7 @@
                //DataRow dr = ds.Tables[0].Rows[0];
                //判断入库的合格数量是否为0
                var DTable = oCN.RunProcReturn("select * from  Sc_StationOutBillMain where HBillNo='"+ BillNo + "' ", "Sc_StationOutBillMain").Tables[0];
                var DTable = oCN.RunProcReturn("select * from  Sc_StationOutBillMain where HBillNo='" + BillNo + "' ", "Sc_StationOutBillMain").Tables[0];
                if (double.Parse(DTable.Rows[0]["HQty"].ToString()) == 0)
                {
@@ -708,7 +710,7 @@
                    }
                }
                if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) {
                    objJsonResult.code = "0";
@@ -788,18 +790,18 @@
                    FentityModel.Add("F_bsv_Base1", new JObject() { ["FNumber"] = item["HBZBS"].ToString() });//
                    FentityModel.Add("F_BSV_TEXT", item["HLZKH"].ToString());//  
                    FentityModel.Add("F_BSV_TEXT1", item["HWYID"].ToString());//
                                                                               //批号
                                                                               //FFLOWID FFLOWLINEID FRULEID FSTABLENAME
                                                                               //f6e6eec3 - 5267 - 4f02 - 8593 - b633da508a72    3   PRD_MO2MORPT T_PRD_MOENTRY
                                                                               //业务流程图:FEntity_Link_FFlowId
                                                                               //推进路线:FEntity_Link_FFlowLineId
                                                                               //转换规则:FEntity_Link_FRuleId
                                                                               //源单表内码:FEntity_Link_FSTableId
                                                                               //源单表:FEntity_Link_FSTableName
                                                                               //源单内码:FEntity_Link_FSBillId
                                                                               //源单分录内码:FEntity_Link_FSId
                                                                               //原始携带量:FEntity_Link_FBaseQuaQtyOld
                                                                               //修改携带量:FEntity_Link_FBaseQuaQty
                                                                              //批号
                                                                              //FFLOWID FFLOWLINEID FRULEID FSTABLENAME
                                                                              //f6e6eec3 - 5267 - 4f02 - 8593 - b633da508a72    3   PRD_MO2MORPT T_PRD_MOENTRY
                                                                              //业务流程图:FEntity_Link_FFlowId
                                                                              //推进路线:FEntity_Link_FFlowLineId
                                                                              //转换规则:FEntity_Link_FRuleId
                                                                              //源单表内码:FEntity_Link_FSTableId
                                                                              //源单表:FEntity_Link_FSTableName
                                                                              //源单内码:FEntity_Link_FSBillId
                                                                              //源单分录内码:FEntity_Link_FSId
                                                                              //原始携带量:FEntity_Link_FBaseQuaQtyOld
                                                                              //修改携带量:FEntity_Link_FBaseQuaQty
@@ -807,7 +809,7 @@
                    JObject FentityModel2 = new JObject();
                    FentityModel2.Add("FEntity_Link_FFlowId", "f6e6eec3-5267-4f02-8593-b633da508a72");
                    FentityModel2.Add("FEntity_Link_FFlowLineId", "5");
                    FentityModel2.Add("FEntity_Link_FRuleId", "PRD_MORPT2INSTOCK");
                    FentityModel2.Add("FEntity_Link_FRuleId", "PRD_MORPT2INSTOCK");
                    FentityModel2.Add("FEntity_Link_FSTableName", "T_PRD_MORPTENTRY");
                    FentityModel2.Add("FEntity_Link_FSTableId", "0");
                    FentityModel2.Add("FEntity_Link_FSBillId", item["HSourceInterID"].ToString());
@@ -925,7 +927,7 @@
                //DataRow dr = ds.Tables[0].Rows[0];
                //判断本次报废总数量是否为0
                var DTable = oCN.RunProcReturn("select isnull(sum(HWasterQty),0) HWasterQty from  Sc_StationOutBillMain where  HProcExchBillNo='"+ BillNo + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0];
                var DTable = oCN.RunProcReturn("select isnull(sum(HWasterQty),0) HWasterQty from  Sc_StationOutBillMain where  HProcExchBillNo='" + BillNo + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0];
                if (double.Parse(DTable.Rows[0]["HWasterQty"].ToString()) == 0)
                {
@@ -1150,7 +1152,7 @@
                    return objJsonResult;
                }
                 //oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo + "'");
                //oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo + "'");
                oCN.Commit();
                oCN.RunProc("update  sc_stationoutbillmain set HBFFlag =1 where HProcExchBillNo = '" + BillNo + "'");
@@ -1172,255 +1174,252 @@
        }
        ///// <summary>
        ///// ç”Ÿæˆé‡‘蝶云来料检验单
        ///// </summary>
        ///// <param name="InterID">工序汇报单主ID</param>
        ///// <returns></returns>
        //[Route("QCStockInCheckBill/set_SaveQCStockInCheckBill_Json")]
        //[HttpGet]
        //public object set_SaveQCStockInCheckBill_Json(string HZJOrgNumber, string HMaterNumber, string HUnitNumber,
        //    double HCheckQty, double HRightQty, double HBadQty,
        //    string HCheckResult, string HSupNumber,
        //    string HUseResult, Int64 HSeQ, Int64 HSourceInterID,
        //    Int64 HSourceEntryID, string HSourceBillNo, string user,
        //    Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID,
        //    Int64 HMaterID, string HSourceBillType, Int64 HSLInterID,
        //    Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID)
        //{
        //    try
        //    {
        //        //获取生产汇报单最大InterID和单据号
        //        //Int64 HInterID = DBUtility.ClsPub.CreateBillID("7503", ref DBUtility.ClsPub.sExeReturnInfo);
        //        //string HBillNo = DBUtility.ClsPub.CreateBillCode("7503", ref DBUtility.ClsPub.sExeReturnInfo, true);
        /// <summary>
        /// ç”Ÿæˆé‡‘蝶云来料检验单
        /// </summary>
        /// <param name="InterID">工序汇报单主ID</param>
        /// <returns></returns>
        [Route("QCStockInCheckBill/set_SaveQCStockInCheckBill_Json")]
        [HttpGet]
        public object set_SaveQCStockInCheckBill_Json(string HZJOrgNumber, string HMaterNumber, string HUnitNumber,
            double HCheckQty, double HRightQty, double HBadQty,
            string HCheckResult, string HSupNumber,
            string HUseResult, Int64 HSeQ, Int64 HSourceInterID,
            Int64 HSourceEntryID, string HSourceBillNo, string user,
            Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID,
            Int64 HMaterID, string HSourceBillType, Int64 HSLInterID,
            Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID)
        {
            try
            {
                //获取生产汇报单最大InterID和单据号
                //Int64 HInterID = DBUtility.ClsPub.CreateBillID("7503", ref DBUtility.ClsPub.sExeReturnInfo);
                //string HBillNo = DBUtility.ClsPub.CreateBillCode("7503", ref DBUtility.ClsPub.sExeReturnInfo, true);
        //        DataSet ds1 = oCN.RunProcReturn("select   * from MES_AccessoriesList  where  HSourceBillNo = '" + HBillNo + "'", "MES_AccessoriesList");
        //        string HFileName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFileName"]);
        //        string HFilePath = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFilePath"]);
                DataSet ds1 = oCN.RunProcReturn("select   * from MES_AccessoriesList  where  HSourceBillNo = '" + HBillNo + "'", "MES_AccessoriesList");
                string HFileName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFileName"]);
                string HFilePath = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFilePath"]);
                string path = HFilePath;
                FileInfo fi = new FileInfo(path);
                long len = fi.Length;
                byte[] buffer = new byte[len];
                FileStream fs = new FileStream(path, FileMode.Open);
                fs.Read(buffer, 0, (int)len);
                //文件IO流
                string a = Convert.ToBase64String(buffer);
                //保存
                oCN.BeginTran();
                //生产汇报单主表
                oCN.RunProc("Insert Into QC_POStockInCheckBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" +
                ",HYear,HPeriod,HRemark,HSupID,HMaterID" +
                ",HInstockQty,HCheckQty,HRightQty,HBadQty,HFirstCheckEmp" +
                ",HCheckerResult,HSteelStoveNo,HSteelCompReport,HAspect,HSize" +
                ") " +
                " values('7503','7503'," + HInterID.ToString() + ",'" + HBillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" +
                ",DATENAME(YEAR,GETDATE()),0,''," + HSupID.ToString() + "," + HMaterID.ToString() +
                ",'" + HCheckQty.ToString() + "','" + HCheckQty.ToString() + "','" + HRightQty.ToString() + "','" + HBadQty.ToString() + "','" + HKeeperID.ToString() + "'" +
                ",'" + HCheckResult.ToString() + "','', '','',''" +
                ") ");
                //生产汇报单子表
                oCN.RunProc("Insert into QC_POStockInCheckBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HCloseType" +
                      ",HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                      ",HRelationQty,HRelationMoney,HQCCheckClassID,HQCCheckItemID,HQCStd," +
                      "HResult,HQCRelValue,HProcCheckEmp,HProcCheckTime" +
                      ") values("
                      + HInterID.ToString() + ",1,'',''" +
                      ",''," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','" + HSourceBillType.ToString() + "'" +
                      ",0,0,0,0,''" +
                      ",'" + HCheckResult.ToString() + "','" + HCheckResult.ToString() + "','" + HKeeperID.ToString() + "',getdate()" +
                      ") ");
                //同步金蝶
                //访问金蝶
                var loginRet = InvokeHelper.Login();
                var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                if (isSuccess == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "操作失败,金蝶账号登录异常。" + loginRet;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                JObject model = new JObject();
                model.Add("FBillTypeID", new JObject() { ["Fnumber"] = "JYD001_SYS" }); //单据类型 æ¥æ–™æ£€éªŒå•JYD001_SYS
                model.Add("FBusinessType", "1"); //业务类型
                model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //单据日期
                model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //质检组织
                model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //来源组织
                model.Add("FISSYNCED", "false");//  æ˜¯å¦å·²åŒæ­¥
                model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));//  æŠ¥æ£€æ—¥æœŸ
                model.Add("FBillNo", HBillNo);
                JArray Fentity = new JArray();
                JObject FentityModel = new JObject();
                FentityModel.Add("FMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });//  ç‰©æ–™å†…码
                FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//计量单位内码
                FentityModel.Add("FInspectQty", HCheckQty.ToString());//  æ£€éªŒæ•°é‡
                FentityModel.Add("FQualifiedQty", HRightQty.ToString());//  åˆæ ¼æ•°é‡
                FentityModel.Add("FUnqualifiedQty", HBadQty.ToString());//  ä¸åˆæ ¼æ•°é‡
                FentityModel.Add("FInspectResult", HCheckResult.ToString());//  æ£€éªŒç»“æžœ
                FentityModel.Add("FQCStatus", "1");//  è´¨æ£€çŠ¶æ€
                FentityModel.Add("FIsRelated", false);//  ä¸è‰¯å“å…³è”标志
                FentityModel.Add("FSrcBillType0", "PUR_ReceiveBill");//  æºå•类型
                FentityModel.Add("FBaseUnitId", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//基本单位
                FentityModel.Add("FBaseInspectQty", HCheckQty.ToString());//基本单位检验数量
                FentityModel.Add("FSupplierId", new JObject() { ["Fnumber"] = HSupNumber.ToString() }); //  ä¾›åº”商
                                                                                                        //FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // ä»“库
                FentityModel.Add("FInspectTimes", "1"); // æ£€éªŒæ¬¡æ•°
                FentityModel.Add("FTimeUnit", "24");//时间单位
                FentityModel.Add("FSAMPLEDAMAGEBEARER", "2");//样本破坏承担方
                FentityModel.Add("FISFIRSTINSPECT", false);//首检
                FentityModel.Add("FBaseQualifiedQty", HRightQty.ToString());//基本单位合格数
                FentityModel.Add("FBaseAcceptQty", HRightQty.ToString());//基本单位接收数
                FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//币别
                FentityModel.Add("FIsSplitRow ", false);// æ˜¯å¦æ‹†åˆ†è¡Œ
                JArray Fentity2 = new JArray();
                JObject FentityModel2 = new JObject();
                FentityModel2.Add("FPolicyMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });//  ç‰©æ–™å†…码
                FentityModel2.Add("FPolicyStatus", "1");  //状态
                FentityModel2.Add("FPolicyQty", HRightQty.ToString());    //数量
                FentityModel2.Add("FBasePolicyQty", HRightQty.ToString()); //基本单位数量
                FentityModel2.Add("FUsePolicy", HUseResult.ToString());   //使用决策
                FentityModel2.Add("FIsCheck", false);   //是否抽检
                FentityModel2.Add("FIsDefectProcess", false);  //不良处理
                FentityModel2.Add("FCanSale", false);   //可销售
                FentityModel2.Add("FIsMRBReview", false);   //MRP评审
                FentityModel2.Add("FIsReturn", true);   //判退
                FentityModel2.Add("FIsRelatedDefect", false);   //不良品关联标志
                Fentity2.Add(FentityModel2);
                FentityModel.Add("FPolicyDetail", Fentity2);
        //        string path = HFilePath;
        //        FileInfo fi = new FileInfo(path);
        //        long len = fi.Length;
        //        byte[] buffer = new byte[len];
        //        FileStream fs = new FileStream(path, FileMode.Open);
        //        fs.Read(buffer, 0, (int)len);
        //        //文件IO流
        //        string a = Convert.ToBase64String(buffer);
                JArray Fentity3 = new JArray();
                JObject FentityModel3 = new JObject();
                FentityModel3.Add("FDetailID", "0");//
                FentityModel3.Add("FSrcBillType", "PUR_ReceiveBill");   //源单类型
                FentityModel3.Add("FSrcBillNo", HSLBillNo.ToString());    //收料通知单单号
                FentityModel3.Add("FSrcInterId", HSLInterID.ToString());      //收料通知单主ID
                FentityModel3.Add("FSrcEntryId", HSLEntryID.ToString());    //收料通知单子ID
                FentityModel3.Add("FSrcEntrySeq", HSLSeQ.ToString());    //源单行号
                FentityModel3.Add("FOrderType", new JObject() { ["FID"] = "PUR_PurchaseOrder" });  //  è®¢å•类型
                FentityModel3.Add("FOrderBillNo", HSourceBillNo.ToString());   //订单单号
                FentityModel3.Add("FOrderId", HSourceInterID.ToString());      //订单主ID
                FentityModel3.Add("FOrderEntryId", HSourceEntryID.ToString());  //订单子ID
                FentityModel3.Add("FOrderEntrySeq", HSeQ.ToString());  //订单行号
                Fentity3.Add(FentityModel3);
                FentityModel.Add("FReferDetail", Fentity3);
        //        //保存
        //        oCN.BeginTran();
        //        //生产汇报单主表
        //        oCN.RunProc("Insert Into QC_POStockInCheckBillMain   " +
        //        "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" +
        //        ",HYear,HPeriod,HRemark,HSupID,HMaterID" +
        //        ",HInstockQty,HCheckQty,HRightQty,HBadQty,HFirstCheckEmp" +
        //        ",HCheckerResult,HSteelStoveNo,HSteelCompReport,HAspect,HSize" +
        //        ") " +
        //        " values('7503','7503'," + HInterID.ToString() + ",'" + HBillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" +
        //        ",DATENAME(YEAR,GETDATE()),0,''," + HSupID.ToString() + "," + HMaterID.ToString() +
        //        ",'" + HCheckQty.ToString() + "','" + HCheckQty.ToString() + "','" + HRightQty.ToString() + "','" + HBadQty.ToString() + "','" + HKeeperID.ToString() + "'" +
        //        ",'" + HCheckResult.ToString() + "','', '','',''" +
        //        ") ");
        //        //生产汇报单子表
        //        oCN.RunProc("Insert into QC_POStockInCheckBillSub " +
        //              " (HInterID,HEntryID,HCloseMan,HCloseType" +
        //              ",HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
        //              ",HRelationQty,HRelationMoney,HQCCheckClassID,HQCCheckItemID,HQCStd," +
        //              "HResult,HQCRelValue,HProcCheckEmp,HProcCheckTime" +
        //              ") values("
        //              + HInterID.ToString() + ",1,'',''" +
        //              ",''," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','" + HSourceBillType.ToString() + "'" +
        //              ",0,0,0,0,''" +
        //              ",'" + HCheckResult.ToString() + "','" + HCheckResult.ToString() + "','" + HKeeperID.ToString() + "',getdate()" +
        //              ") ");
        //        //同步金蝶
        //        //访问金蝶
        //        var loginRet = InvokeHelper.Login();
        //        var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
        //        if (isSuccess == 0)
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "操作失败,金蝶账号登录异常。" + loginRet;
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        JObject model = new JObject();
        //        model.Add("FBillTypeID", new JObject() { ["Fnumber"] = "JYD001_SYS" }); //单据类型 æ¥æ–™æ£€éªŒå•JYD001_SYS
        //        model.Add("FBusinessType", "1"); //业务类型
        //        model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //单据日期
        //        model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //质检组织
        //        model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //来源组织
        //        model.Add("FISSYNCED", "false");//  æ˜¯å¦å·²åŒæ­¥
        //        model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));//  æŠ¥æ£€æ—¥æœŸ
        //        model.Add("FBillNo", HBillNo);
        //        JArray Fentity = new JArray();
        //            JObject FentityModel = new JObject();
        //            FentityModel.Add("FMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });//  ç‰©æ–™å†…码
        //            FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//计量单位内码
        //            FentityModel.Add("FInspectQty", HCheckQty.ToString());//  æ£€éªŒæ•°é‡
        //            FentityModel.Add("FQualifiedQty", HRightQty.ToString());//  åˆæ ¼æ•°é‡
        //            FentityModel.Add("FUnqualifiedQty", HBadQty.ToString());//  ä¸åˆæ ¼æ•°é‡
        //            FentityModel.Add("FInspectResult", HCheckResult.ToString());//  æ£€éªŒç»“æžœ
        //            FentityModel.Add("FQCStatus", "1");//  è´¨æ£€çŠ¶æ€
        //            FentityModel.Add("FIsRelated", false);//  ä¸è‰¯å“å…³è”标志
        //            FentityModel.Add("FSrcBillType0", "PUR_ReceiveBill");//  æºå•类型
        //            FentityModel.Add("FBaseUnitId", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//基本单位
        //            FentityModel.Add("FBaseInspectQty", HCheckQty.ToString());//基本单位检验数量
        //            FentityModel.Add("FSupplierId", new JObject() { ["Fnumber"] = HSupNumber.ToString() }); //  ä¾›åº”商
        //            //FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // ä»“库
        //            FentityModel.Add("FInspectTimes","1"); // æ£€éªŒæ¬¡æ•°
        //            FentityModel.Add("FTimeUnit","24");//时间单位
        //            FentityModel.Add("FSAMPLEDAMAGEBEARER","2");//样本破坏承担方
        //            FentityModel.Add("FISFIRSTINSPECT", false);//首检
        //            FentityModel.Add("FBaseQualifiedQty", HRightQty.ToString());//基本单位合格数
        //        FentityModel.Add("FBaseAcceptQty", HRightQty.ToString());//基本单位接收数
        //        FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//币别
        //            FentityModel.Add("FIsSplitRow ", false);// æ˜¯å¦æ‹†åˆ†è¡Œ
        //            JArray Fentity2 = new JArray();
        //            JObject FentityModel2 = new JObject();
        //            FentityModel2.Add("FPolicyMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });//  ç‰©æ–™å†…码
        //            FentityModel2.Add("FPolicyStatus", "1");  //状态
        //            FentityModel2.Add("FPolicyQty", HRightQty.ToString());    //数量
        //            FentityModel2.Add("FBasePolicyQty", HRightQty.ToString()); //基本单位数量
        //            FentityModel2.Add("FUsePolicy", HUseResult.ToString());   //使用决策
        //            FentityModel2.Add("FIsCheck", false);   //是否抽检
        //            FentityModel2.Add("FIsDefectProcess", false);  //不良处理
        //            FentityModel2.Add("FCanSale", false);   //可销售
        //            FentityModel2.Add("FIsMRBReview", false);   //MRP评审
        //            FentityModel2.Add("FIsReturn", true);   //判退
        //            FentityModel2.Add("FIsRelatedDefect", false);   //不良品关联标志
        //            Fentity2.Add(FentityModel2);
        //            FentityModel.Add("FPolicyDetail", Fentity2);
                JArray Fentity4 = new JArray();
                JObject FentityModel4 = new JObject();
                FentityModel4.Add("FEntity_Link_FRuleId", "QM_PURReceive2Inspect");   //单据转换规则
                FentityModel4.Add("FEntity_Link_FSTableName", "T_PUR_RECEIVEENTRY");    //收料通知单子表
                FentityModel4.Add("FEntity_Link_FSBillId", HSLInterID.ToString());      //收料通知单主内码
                FentityModel4.Add("FEntity_Link_FSId", HSLEntryID.ToString());    //收料通知单子内码
                FentityModel4.Add("FEntity_Link_FBaseAcceptQty", HRightQty.ToString());    //
                FentityModel4.Add("FEntity_Link_FBaseAcceptQtyOld", HRightQty.ToString());    //
                FentityModel4.Add("FEntity_Link_FBaseInspectQtyOld", HRightQty.ToString());    //
                FentityModel4.Add("FEntity_Link_FInspectQtyOld", HRightQty.ToString());    //
                Fentity4.Add(FentityModel4);
                FentityModel.Add("FEntity_Link", Fentity4);
        //        JArray Fentity3 = new JArray();
        //        JObject FentityModel3 = new JObject();
        //        FentityModel3.Add("FDetailID", "0");//
        //        FentityModel3.Add("FSrcBillType", "PUR_ReceiveBill");   //源单类型
        //        FentityModel3.Add("FSrcBillNo", HSLBillNo.ToString());    //收料通知单单号
        //        FentityModel3.Add("FSrcInterId", HSLInterID.ToString());      //收料通知单主ID
        //        FentityModel3.Add("FSrcEntryId",HSLEntryID.ToString());    //收料通知单子ID
        //        FentityModel3.Add("FSrcEntrySeq", HSLSeQ.ToString());    //源单行号
        //        FentityModel3.Add("FOrderType", new JObject() { ["FID"] = "PUR_PurchaseOrder" });  //  è®¢å•类型
        //        FentityModel3.Add("FOrderBillNo", HSourceBillNo.ToString());   //订单单号
        //        FentityModel3.Add("FOrderId", HSourceInterID.ToString());      //订单主ID
        //        FentityModel3.Add("FOrderEntryId", HSourceEntryID.ToString());  //订单子ID
        //        FentityModel3.Add("FOrderEntrySeq", HSeQ.ToString());  //订单行号
        //        Fentity3.Add(FentityModel3);
        //        FentityModel.Add("FReferDetail", Fentity3);
                Fentity.Add(FentityModel);
                model.Add("FEntity", Fentity); //明细信息
                JObject jsonRoot = new JObject()
                {
                    ["Creator"] = "",
                    ["NeedUpDateFields"] = new JArray(),
                    ["NeedReturnFields"] = new JArray(),
                    ["IsDeleteEntry"] = "false",
                    ["SubSystemId"] = "",
                    ["IsVerifyBaseDataField"] = "false",
                    //["IsAutoSubmitAndAudit"] = true,//自动调用提交和审核功能
                    ["Model"] = model
                };
                string result = InvokeHelper.Save("QM_InspectBill", JsonConvert.SerializeObject(jsonRoot));//保存
                //判断保存是否成功
                if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    LogService.Write("来料检验单保存错误jsonRoot:" + jsonRoot);
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = $"来料检验单同步金蝶云失败!单号:{HBillNo.ToString()}" + jsonRoot;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //提交审核
                string result1 = string.Empty;
                string result2 = string.Empty;
                var fID = JObject.Parse(result)["Result"]["Id"].ToString();
                var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
                var json = new
                {
                    Ids = fID,
                };
        //        JArray Fentity4 = new JArray();
        //        JObject FentityModel4 = new JObject();
        //        FentityModel4.Add("FEntity_Link_FRuleId", "QM_PURReceive2Inspect");   //单据转换规则
        //        FentityModel4.Add("FEntity_Link_FSTableName", "T_PUR_RECEIVEENTRY");    //收料通知单子表
        //        FentityModel4.Add("FEntity_Link_FSBillId", HSLInterID.ToString());      //收料通知单主内码
        //        FentityModel4.Add("FEntity_Link_FSId", HSLEntryID.ToString());    //收料通知单子内码
        //        FentityModel4.Add("FEntity_Link_FBaseAcceptQty", HRightQty.ToString());    //
        //        FentityModel4.Add("FEntity_Link_FBaseAcceptQtyOld", HRightQty.ToString());    //
        //        FentityModel4.Add("FEntity_Link_FBaseInspectQtyOld", HRightQty.ToString());    //
        //        FentityModel4.Add("FEntity_Link_FInspectQtyOld", HRightQty.ToString());    //
        //        Fentity4.Add(FentityModel4);
        //        FentityModel.Add("FEntity_Link", Fentity4);
                K3CloudApiClient client = new K3CloudApiClient("http://47.96.97.237/k3cloud");
                //        K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/");
        //        Fentity.Add(FentityModel);
        //        model.Add("FEntity", Fentity); //明细信息
        //        JObject jsonRoot = new JObject()
        //        {
        //            ["Creator"] = "",
        //            ["NeedUpDateFields"] = new JArray(),
        //            ["NeedReturnFields"] = new JArray(),
        //            ["IsDeleteEntry"] = "false",
        //            ["SubSystemId"] = "",
        //            ["IsVerifyBaseDataField"] = "false",
        //            //["IsAutoSubmitAndAudit"] = true,//自动调用提交和审核功能
        //            ["Model"] = model
        //        };
                result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//提交
                result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//提交
                if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = $"来料检验单号:{fBillNo},提交失败" + result;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    string jsonStr = "{" +
                       " \"FileName\":\"" + HFileName + "\"," +
                           " \"FormId\":\"QM_InspectBill\"," +
                           " \"IsLast\":\"true\"," +
                           " \"InterId\":\"" + HInterID + "\"," +
                           " \"BillNO\":\"" + HBillNo + "\"," +
                           " \"AliasFileName\":\"test\"," +
                           " \"SendByte\":\"" + a + "\"," +
                       "}";
        //        string result = InvokeHelper.Save("QM_InspectBill", JsonConvert.SerializeObject(jsonRoot));//保存
        //        //判断保存是否成功
        //        if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
        //        {
        //            LogService.Write("来料检验单保存错误jsonRoot:" + jsonRoot);
        //            oCN.RollBack();
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = $"来料检验单同步金蝶云失败!单号:{HBillNo.ToString()}" + jsonRoot;
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        //提交审核
        //        string result1 = string.Empty;
        //        string result2 = string.Empty;
        //        var fID = JObject.Parse(result)["Result"]["Id"].ToString();
        //        var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
        //        var json = new
        //        {
        //            Ids = fID,
        //        };
                    var ret = client.AttachmentUpload(jsonStr);
                }
        //        K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/");
                oCN.Commit();
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //        result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//提交
        //        result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//提交
        //        if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
        //        {
        //            oCN.RollBack();
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = $"来料检验单号:{fBillNo},提交失败" + result;
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        else
        //        {
        //            string jsonStr = "{" +
        //               " \"FileName\":\"" + HFileName + "\"," +
        //                   " \"FormId\":\"QM_InspectBill\"," +
        //                   " \"IsLast\":\"true\"," +
        //                   " \"InterId\":\"" + HInterID + "\"," +
        //                   " \"BillNO\":\"" + HBillNo + "\"," +
        //                   " \"AliasFileName\":\"test\"," +
        //                   " \"SendByte\":\"" + a + "\"," +
        //               "}";
        //            var ret = client.AttachmentUpload(jsonStr);
        //        }
        //        oCN.Commit();
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 1;
        //        objJsonResult.Message = "保存成功!";
        //        objJsonResult.data = 1;
        //        return objJsonResult;
        //    }
        //    catch (Exception e)
        //    {
        //        oCN.RollBack();
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "Exception!" + e.ToString();
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        //#endregion
@@ -1468,7 +1467,8 @@
        //        return objJsonResult;
        //    }
        //}
        #endregion
WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -9,6 +9,7 @@
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Models;
namespace WebAPI.Controllers
@@ -412,6 +413,7 @@
            int OperationType = int.Parse(sArray[1].ToString()); // æ•°æ®ç±»åž‹ 1添加 3修改
            string user = sArray[2].ToString();
            int HEntryID = int.Parse(sArray[3].ToString());
            string HComputerName = SystemInformation.ComputerName; //设备名称
            try
            {
@@ -461,6 +463,10 @@
                    ",'" + HSeOrderBillNo + "'," + HSeOrderInterID + "," + HSeOrderEntryID + "," + HEmpID + "," + HCusID +
                    "," + HCenterID + ",0,0,0,0," + HBomID + ",'',''" +
                    ",'"+ HIsStockQty + "','"+ HRemark3 + "') ");
                    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)
                {
@@ -481,6 +487,9 @@
                    //删除子表
                    oCN.RunProc("delete from Sc_ICMOBillSub where HInterID='" + HInterID + "' and HEntryID='" + HEntryID + "'");
                    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_NoTable(msg3, HInterID, OperationType, HEntryID);
@@ -820,6 +829,8 @@
        {
            try
            {
                string HComputerName = SystemInformation.ComputerName; //设备名称
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Drop", 1, false, user))
                {
@@ -865,8 +876,6 @@
                    }
                }
                if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
                {
                    objJsonResult.code = "0";
@@ -876,8 +885,47 @@
                    return objJsonResult; ;
                }
               var DataSet = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HICMOBillNo='" + ds.Tables[0].Rows[0]["HBillNo"].ToString() +"'", "Sc_ProcessExchangeBillMain");
                if (DataSet.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已下推工序流转卡,不允许删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                 DataSet = oCN.RunProcReturn("select * from h_v_IF_ProductInBillList where æºå•单号='" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "'", "h_v_IF_ProductInBillList");
                if (DataSet.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已下推生产入库单,不允许删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                DataSet = oCN.RunProcReturn("select * from h_v_IF_MateOutBillList where æºå•单号='" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "'", "h_v_IF_MateOutBillList");
                if (DataSet.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已下推生产领料单,不允许删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete from Sc_ICMOBillMain  where HInterID=" + HInterID);
                oCN.RunProc("delete from Sc_ICMOBillSub  where HInterID=" + HInterID);
                LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",删除生产订单单据:" + ds.Tables[0].Rows[0]["HBillNo"].ToString());
                oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "删除生产订单单据:" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-生产订单模块','" + DBUtility.ClsPub.IPAddress + "','删除单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
WebAPI/DLL/ClsGy_Source_Ctl.cs
@@ -22,12 +22,12 @@
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HType,HRelationID,HCenterID,HEquipFileID_K3,HDeptID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HProcID,HOverTimes " +
                    ",HWorkTimes,HMaxWorkTimes,HMinAdd,HClassCount,HGroupID,HGroupK3ID,HUSEORGID,HMacAddr)" +
                    ",HWorkTimes,HMaxWorkTimes,HMinAdd,HClassCount,HGroupID,HGroupK3ID,HUSEORGID,HMacAddr,HEmpID)" +
                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                    ",'" + oModel.HType + "'," + oModel.HRelationID.ToString() + "," + oModel.HCenterID.ToString() + "," + oModel.HEquipFileID_K3.ToString() + "," + oModel.HDeptID.ToString() +
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",'" + oModel.HRemark + "'," + oModel.HProcID + "," + oModel.HOverTimes + "," + oModel.HWorkTimes + "," + oModel.HMaxWorkTimes +
                    "," + oModel.HMinAdd + "," + oModel.HClassCount + "," + oModel.HGroupID.ToString() + "," + oModel.HGroupK3ID.ToString() + "," + oModel.HUSEORGID + ",'" + oModel.HMacAddr + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                    "," + oModel.HMinAdd + "," + oModel.HClassCount + "," + oModel.HGroupID.ToString() + "," + oModel.HGroupK3ID.ToString() + "," + oModel.HUSEORGID + ",'" + oModel.HMacAddr + "',"+oModel.HEmpID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
@@ -58,6 +58,7 @@
                    ",HRelationID=" + oModel.HRelationID.ToString() +
                    ",HCenterID=" + oModel.HCenterID.ToString() +
                    ",HType='" + oModel.HType + "'" +
                    ",HEmpID='" + oModel.HEmpID + "'" +
                    ",HOverTimes=" + oModel.HOverTimes +
                    ",HWorkTimes=" + oModel.HWorkTimes +
                    ",HMaxWorkTimes=" + oModel.HMaxWorkTimes +
WebAPI/Vlog/webapi20220325.txt
File was deleted
WebAPI/Vlog/webapi20220408.txt
File was deleted
WebAPI/Vlog/webapi20220411.txt
File was deleted
WebAPI/Vlog/webapi20220413.txt
File was deleted
WebAPI/Vlog/webapi20220422.txt
File was deleted
WebAPI/Vlog/webapi20220512.txt
File was deleted
WebAPI/Vlog/webapi20220513.txt
File was deleted
WebAPI/Vlog/webapi20220517.txt
File was deleted
WebAPI/Vlog/webapi20220623.txt
File was deleted
WebAPI/Vlog/webapi20220701.txt
File was deleted
WebAPI/Vlog/webapi20220708.txt
File was deleted
WebAPI/Vlog/webapi20220714.txt
File was deleted
WebAPI/Vlog/webapi20220805.txt
File was deleted