1
duhe
2023-08-22 b3ad142f680ba6365e5dcf1a382c3fe5d2035f24
1
30个文件已修改
4个文件已添加
1477 ■■■■■ 已修改文件
DAL/DAL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/ClsGy_SourceWorkStationSet.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/ClsSc_ICMOBill.cs 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/ClsSc_ICMOReportBill.cs 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_FirstPieceCheckBill.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_ProcessCheckBill.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/车间管理/ClsSc_ProcessExchangeBill.cs 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/车间管理/ClsSc_StationInBill.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/ClsGy_SourceWorkStationSet.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_FirstPieceCheckBillMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_FirstPieceCheckBillSub.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_FirstPieceCheckBillSub_ValueGrid.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_ProcessCheckBillMain.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_ProcessCheckBillSub.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_ProcessCheckBillSub_ValueGrid.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BLL/Xt_UserController.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Gy_SourceWorkStationSetController.cs 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_Cg_PODemandPlanBillController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_AssemblyBillController.cs 252 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_ProcessMangementController.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/报工台工序/Sc_MESBeginStepWorkBillController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSc_AssemblyBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -576,6 +576,7 @@
    <Compile Include="源单\金蝶源单\Cls_S_Sc_ICMOBillList_K3.cs" />
    <Compile Include="源单\金蝶源单\Cls_S_K3_EntrustInBillList.cs" />
    <Compile Include="源单\金蝶源单\Cls_S_KF_ChangeBoxBillList.cs" />
    <Compile Include="生产管理\ClsGy_SourceWorkStationSet.cs" />
    <Compile Include="生产管理\ClsSc_ChangeNoteBill.cs" />
    <Compile Include="生产管理\ClsSc_WIPStockChangeBill.cs" />
    <Compile Include="生产管理\ClsSc_WIPStockCheckBill.cs" />
DAL/Éú²ú¹ÜÀí/ClsGy_SourceWorkStationSet.cs
New file
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsGy_SourceWorkStationSet : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        public Model.ClsGy_SourceWorkStationSet oModel = new Model.ClsGy_SourceWorkStationSet();
        //构造函数
        public ClsGy_SourceWorkStationSet()
        {
            MvarItemKey = "Gy_SourceWorkStationSet";
            MvarReportTitle = "产线工位";
            oModel = new Model.ClsGy_SourceWorkStationSet();
        }
        //新增
        public override bool AddNew()
        {
            try
            {
                string ssql = "Insert into " + MvarItemKey + " " +
                    "(HMacAddr,HSourceID,HProdOrgID,HWorkStationID,HProcID," +
                    " HType,HVideo,HRemark,HCreateDate,HCreator)" +
                    " Values('" + oModel.HMacAddr + "'," + oModel.HSourceID + "," + oModel.HProdOrgID + "," + oModel.HWorkStationID + ","
                                + oModel.HProcID + ",'" + oModel.HType + "'," + oModel.HVideo + ",'" + oModel.HRemark + "','"
                                + oModel.HCreateDate + "','" + oModel.HCreator + "')";
                oCn.BeginTran();
                oCn.RunProc(ssql, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                string ssql = "Update " + MvarItemKey + " set " +
                            "HMacAddr='" + oModel.HMacAddr + "'" +
                            ",HSourceID='" + oModel.HSourceID + "'" +
                            ",HProdOrgID='" + oModel.HProdOrgID + "'" +
                            ",HWorkStationID= '" + oModel.HWorkStationID + "'" +
                            ",HProcID='" + oModel.HProcID + "'" +
                            ",HType='" + oModel.HType + "'" +
                            ",HVideo='" + oModel.HVideo +"' Where  HItemID = " + sItemID;
                oCn.BeginTran();
                oCn.RunProc(ssql, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
    }
}
DAL/Éú²ú¹ÜÀí/ClsSc_ICMOBill.cs
@@ -34,6 +34,21 @@
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_ICMOBill_BeforeSaveCtrl " + lngBillKey.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Sc_ICMOBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //
                oCn.BeginTran();
                //更新主表
@@ -90,6 +105,25 @@
                //      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                //      ") ");
                //}
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_ICMOBill_AfterSaveCtrl " + lngBillKey.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Sc_ICMOBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -101,6 +135,9 @@
                throw (e);
            }
        }
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
@@ -108,7 +145,22 @@
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                //保存前控制=========================h_p_Sc_ICMOBill_BeforeDeleteCtrl
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_ICMOBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '"+ omodel.HBillNo +"','" + HBillNote + "','1' ", "h_p_Sc_ICMOBill_BeforeSaveCtrl");
                if(ds==null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"])!= "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]) ;
                    return false;
                }
                //=========================================================
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sc_ICMOBillMain   " +
@@ -137,6 +189,25 @@
                //      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                //      ") ");
                //}
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_ICMOBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_ICMOBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
@@ -148,6 +219,8 @@
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
@@ -256,9 +329,10 @@
                //有关联数量则不允许删除
                DataSet ds;
                ds = oCn.RunProcReturn("exec h_p_Mes_ICMODeleteCtrl " + lngBillKey.ToString(), "h_p_Mes_ICMODeleteCtrl");
                if(ds==null || ds.Tables[0].Rows.Count==0)
                //ds = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_BeforeDeleteCtrl " + lngBillKey.ToString(), "h_p_Sc_ICMOBill_BeforeDeleteCtrl");
                if (ds==null || ds.Tables[0].Rows.Count==0)
                {
                    sReturn = "判断关联数量失败,260行!  ";
                    sReturn = "判断关联数量失败!  ";
                    return false;
                }
                if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
DAL/Éú²ú¹ÜÀí/ClsSc_ICMOReportBill.cs
@@ -38,6 +38,22 @@
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_ICMOReportBill_BeforeSaveCtrl " + lngBillKey.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Sc_ICMOReport_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //
                DataSet Ds;
                oCn.BeginTran();
@@ -125,6 +141,25 @@
                //        return false;
                //    }
                //}
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_ICMOReportBill_AfterSaveCtrl " + lngBillKey.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Sc_ICMOReportBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -143,7 +178,21 @@
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_ICMOReportBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_ICMOReport_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sc_ICMOReportBillMain   " +
@@ -189,6 +238,24 @@
                //    }
                //}
                //
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_ICMOReportBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_ICMOReportBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
@@ -306,7 +373,7 @@
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            try
            {
                oCn.BeginTran();
                oCn.BeginTran();//h_p_Sc_ICMOReportBill_BeforeDeleteCtrl
                DataSet Ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_Delete " + lngBillKey + ",'" + HBillNo + "','" + BillType + "','" + HERPMode + "','" + HUpdateSourceInterID + "'", "h_p_Sc_ICMOReportBill_Delete");
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
DAL/Öʼì¹ÜÀí/ClsQC_FirstPieceCheckBill.cs
@@ -14,7 +14,7 @@
        public ClsQC_FirstPieceCheckBill()
        {
            base.MvarItemKeySub = "QC_FirstPieceCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub2 = "QC_FirstPieceCheckBillSub_ValueGrid";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="QC_FirstPieceCheckBillMain";
@@ -152,13 +152,13 @@
                ",HYear,HPeriod,HRemark" +
                ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
                ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
                "," + omodel.HSourceID.ToString() + "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HICMOQty.ToString() + "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() +
                ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + ", " + DBUtility.ClsPub.BoolToString(omodel.HLastResult) +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType  + "'," + omodel.HICMOEntryID +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType  + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID +
                ") ");
                //插入子表
                foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in DetailColl)
@@ -170,7 +170,7 @@
                      ",HQCCheckItemID,HQCStd,HUnit,HQCNote,HResult" +
                      ",HMax,HMin,HAvg,HSampleSchemeID,HSampleQty,HSampleDamageQty,HAcceptQty" +
                      ",HRejectQty,HSampleUnRightQty,HStatus,HUnitID,HInspectVal,HTargetVal" +
                      ",HUpLimit,HDownLimit,HUpOffSet,HDownOffSet" +
                      ",HUpLimit,HDownLimit,HUpOffSet,HDownOffSet,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" +
                      ") values("
                      + omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
                      ",getdate()," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'," + oSub.HSourceInterID.ToString() +
@@ -179,8 +179,7 @@
                      ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "'" + "," + oSub.HSampleSchemeID + "," + oSub.HSampleQty + 
                      "," + oSub.HSampleDamageQty + "," + oSub.HAcceptQty + "," + oSub.HRejectQty + "," + oSub.HSampleUnRightQty + ",'" + oSub.HStatus +
                      "'," + oSub.HUnitID + ",'" + oSub.HInspectVal + "','" + oSub.HTargetVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit +
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'" +
                      ") ");
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
    }
                //foreach (Model.ClsQC_FirstPieceCheckBillSub_Item oSub2 in DetailColl1)
                //{
DAL/Öʼì¹ÜÀí/ClsQC_ProcessCheckBill.cs
@@ -9,11 +9,11 @@
    {
        public Model.ClsQC_ProcessCheckBillMain omodel = new Model.ClsQC_ProcessCheckBillMain();
        public List<Model.ClsQC_ProcessCheckBillSub> DetailColl = new List<Model.ClsQC_ProcessCheckBillSub>();
        public List<Model.ClsQC_ProcessCheckBillSub_ValueGrid> DetailColl_Value = new List<Model.ClsQC_ProcessCheckBillSub_ValueGrid>();
        public ClsQC_ProcessCheckBill()
        {
            base.MvarItemKeySub = "QC_ProcessCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub2 = "QC_ProcessCheckBillSub_ValueGrid";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="QC_ProcessCheckBillMain";
@@ -156,7 +156,7 @@
                ",HBarCode,HLBatchNo,HCusID,HSortBillNo,HContrctBatchNo" +
                ",HProdAreaID,HProdTypeID,HProdStoveNo,HRecipeID,HDiameter1" +
                ",HDiameter2,HRoutingInterID,HDrawingDireID,HPackTypeID" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
@@ -166,7 +166,7 @@
                ",'" + omodel.HBarCode + "','" + omodel.HLBatchNo + "'," + omodel.HCusID.ToString() + ",'" + omodel.HSortBillNo + "','" + omodel.HContrctBatchNo + "'" +
                "," + omodel.HProdAreaID.ToString() + "," + omodel.HProdTypeID.ToString() + ",'" + omodel.HProdStoveNo + "'," + omodel.HRecipeID.ToString() + "," + omodel.HDiameter1.ToString() +
                "," + omodel.HDiameter2.ToString() + "," + omodel.HRoutingInterID.ToString() + ",'" + omodel.HDrawingDireID + "'," + omodel.HPackTypeID.ToString() +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID +
                ") ");
                //插入子表
                foreach (Model.ClsQC_ProcessCheckBillSub oSub in DetailColl)
@@ -176,13 +176,18 @@
                      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
                      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue,HResult" +
                      ",HProcCheckEmp,HProcCheckTime" +
                      ",HProcCheckEmp,HProcCheckTime,  HSampleSchemeID,HSampleQty,HSampleDamageQty,HAcceptQty" +
                      ",HRejectQty,HSampleUnRightQty,HStatus,HUnitID,HInspectVal,HTargetVal" +
                      ",HUpLimit,HDownLimit,HUpOffSet,HDownOffSet,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" +
                      ") values("
                      + omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
                      ",getdate()," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'," + oSub.HSourceInterID.ToString() +
                      "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      "," + oSub.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "','" + oSub.HResult + "'" +
                      "," + oSub.HProcCheckEmp.ToString() + ",'" + oSub.HProcCheckTime + "'" +
                      "," + oSub.HProcCheckEmp.ToString() + ",'" + oSub.HProcCheckTime + "'," + oSub.HSampleSchemeID + "," + oSub.HSampleQty +
                      "," + oSub.HSampleDamageQty + "," + oSub.HAcceptQty + "," + oSub.HRejectQty + "," + oSub.HSampleUnRightQty + ",'" + oSub.HStatus +
                      "'," + oSub.HUnitID + ",'" + oSub.HInspectVal + "','" + oSub.HTargetVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit +
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" +
                      ") ");
                }
                
@@ -209,6 +214,39 @@
                throw (e);
            }
        }
        //新增检验值
        public virtual bool AddValue(ref string sReturn, ref long HInterID, ref long HEntryID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("delete from QC_ProcessCheckBillSub_ValueGrid where HInterID = " + HInterID + " and HEntryID = " + HEntryID);
                //插入子表
                foreach (Model.ClsQC_ProcessCheckBillSub_ValueGrid value in DetailColl_Value)
                {
                    oCn.RunProc("Insert into QC_ProcessCheckBillSub_ValueGrid " +
                      " (HInterID,HEntryID,HSEQ,HInSpectResult" +
                      ",HInSpectValue,HInSpectValueB,HInSpectValueT" +
                      ") values("
                      + HInterID + "," + HEntryID + "," + value.HSEQ + ",'" + value.HInSpectResult + "'," +
                      value.HInSpectValue + "," + value.HInSpectValueB + ",'" + value.HInSpectValueT + "'" +
                      ") ");
                }
                sReturn = "新增检验值成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
DAL/³µ¼ä¹ÜÀí/ClsSc_ProcessExchangeBill.cs
@@ -57,6 +57,22 @@
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_ProcessExchangeBill_BeforeSaveCtrl " + lngBillKey.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Sc_ProcessExchangeBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //
                oCn.BeginTran();
                string sql = string.Format(@"UpDate Sc_ProcessExchangeBillMain set  " +
@@ -204,7 +220,7 @@
                //oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_SetDate " + omodel.HInterID.ToString());  //回填 å¼€å·¥å®Œå·¥æ—¥æœŸ 
                //oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_RelationQty " + omodel.HInterID.ToString() + ",1"); //返工流转卡 åå†™ æ‹†åˆ†æ•°é‡  å›žå¡«ä»»åŠ¡å• æµè½¬å¡æ•°é‡  å›žå¡«ä»»åŠ¡å•ä¸Šé™æ•°é‡
                //控制关联数量
                DataSet ds = new DataSet();
                //DataSet ds = new DataSet();
                ds = oCn.RunProcReturn("exec h_p_Sc_ProcessExchangeBill_Checkqty " + omodel.HInterID.ToString(), "h_p_Sc_ProcessExchangeBill_Checkqty");
                if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
                {
@@ -213,6 +229,24 @@
                    return false;
                }
                //
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_ProcessExchangeBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Sc_ProcessExchangeBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -302,11 +336,22 @@
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                //根据内码 ç”Ÿæˆé¡¹ç›®å·å¹¶å†™å…¥æ•°æ®åº“
                //omodel.HProjectNum = "";
                //omodel.HProjectNum = GetNewCodeByNum(omodel.HInterID, 1, 3).ToString();
                //
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_ProcessExchangeBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_ProcessExchangeBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sc_ProcessExchangeBillMain   " +
@@ -400,7 +445,7 @@
                sErr = sErr + "4;";
                oCn.RunProc("exec h_p_Sc_ProcessExchangeBill_SetUpdate " + omodel.HInterID.ToString()); //设置 æœ«é“ é¦–道 è½¬ ç­‰ä¿¡æ¯   å™¨å…·æ¸…单  å·¥è‰ºå‚数清单;
                sErr = sErr + "5;";
                DataSet ds = new DataSet();
                //DataSet ds = new DataSet();
                //设置条码号  å›žå¡« é¢†æ–™æ‰¹æ¬¡
                ds = oCn.RunProcReturn("exec h_p_Mes_ProcessExchangeBackBarCode " + omodel.HInterID.ToString(), "h_p_Mes_ProcessExchangeBackBarCode");
                if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
@@ -424,6 +469,9 @@
                    oCn.RollBack();
                    return false;
                }
                sErr = sErr + "7;";
@@ -457,6 +505,24 @@
                    oCn.RollBack();
                    return false;
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_ProcessExchangeBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_ProcessExchangeBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                //
                sReturn = "新增单据成功!";
@@ -672,9 +738,10 @@
                //有关联数量则不允许删除
                DataSet ds;
                ds = oCn.RunProcReturn("exec h_p_Mes_ProcExchDeleteCtrl " + lngBillKey.ToString(), "h_p_Mes_ProcExchDeleteCtrl");
                //ds = oCn.RunProcReturn("exec h_p_Sc_ProcessExchangeBill_BeforeDeleteCtrl " + lngBillKey.ToString(), "h_p_Sc_ProcessExchangeBill_BeforeDeleteCtrl");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "判断关联数量失败,260行!  ";
                    sReturn = "判断关联数量失败!  ";
                    return false;
                }
                if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
DAL/³µ¼ä¹ÜÀí/ClsSc_StationInBill.cs
@@ -329,7 +329,7 @@
                {
                    omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //若MAINDI重复则重新获取
                //
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sc_StationInBillMain " +
Model/Model.csproj
@@ -449,6 +449,7 @@
    <Compile Include="基础资料\基础资料\ClsGy_TechnologyParameter_Model.cs" />
    <Compile Include="成本管理\ClsKf_ICBal.cs" />
    <Compile Include="成本管理\ClsKf_WIPBal.cs" />
    <Compile Include="生产管理\ClsGy_SourceWorkStationSet.cs" />
    <Compile Include="生产管理\ClsSc_ChangeNoteBillMain.cs" />
    <Compile Include="生产管理\ClsSc_ChangeNoteBillSub.cs" />
    <Compile Include="生产管理\ClsSc_MateWasterRequestBillMain.cs" />
@@ -581,6 +582,7 @@
    <Compile Include="生产管理\设备管理\ClsSb_EquipConkBookBillMain.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipConkBookBillSub.cs" />
    <Compile Include="质检管理\ClsQC_FirstPieceCheckBillSub_ValueGrid.cs" />
    <Compile Include="质检管理\ClsQC_ProcessCheckBillSub_ValueGrid.cs" />
    <Compile Include="车间管理\ClsSc_ProcExchRecordBackBillMain.cs" />
    <Compile Include="车间管理\ClsSc_ProcExchRecordBackBillSub.cs" />
    <Compile Include="车间管理\ClsSc_ProcExchSendWorkBillMain.cs" />
Model/Éú²ú¹ÜÀí/ClsGy_SourceWorkStationSet.cs
New file
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsGy_SourceWorkStationSet : DBUtility.ClsGy_Base_Model
    {
        public string HMacAddr; //MAC号
        public Int64 HSourceID; //生产资源(Gy_Source)
        public Int64 HProdOrgID; //生产组织()
        public Int64 HWorkStationID; //工位(Gy_WorkStation)
        public Int64 HProcID; //工序(Gy_Process)
        public string HType; //匹配类型(按工位匹配,按工序匹配,按工位+工序匹配)
        public Int64 HVideo; //是否默认播放视频
        public DateTime HCreateDate; //创建日期
        public string HCreator; //创建人(和HUserName ä¸€è‡´ï¼‰
    }
}
Model/Öʼì¹ÜÀí/ClsQC_FirstPieceCheckBillMain.cs
@@ -20,6 +20,7 @@
        public String HBackRemark;
        public Int64 HPrintQty;
        public Int64 HICMOEntryID;
        public Int64 HQCSchemeID;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_FirstPieceCheckBillSub.cs
@@ -31,6 +31,10 @@
        public String HDownLimit;
        public String HUpOffSet;
        public String HDownOffSet;
        public String HAnalysisMethod;
        public Int64 HKeyInspect;
        public Int64 HInspectInstruMentID;
        public String HInspectResult;
        //public HSamplingType;
        //public HInspectionLevel;
        //public HStrictness;
Model/Öʼì¹ÜÀí/ClsQC_FirstPieceCheckBillSub_ValueGrid.cs
@@ -9,7 +9,7 @@
        public Int64 HItemID;
        public Int64 HSEQ;
        public String HInSpectResult;
        public decimal HInSpectValue;
        public double HInSpectValue;
        public Int64 HInSpectValueB;
        public String HInSpectValueT;
    }
Model/Öʼì¹ÜÀí/ClsQC_ProcessCheckBillMain.cs
@@ -38,6 +38,7 @@
        public String HDrawingDireID;
        public Int64 HPackTypeID;
        public Int64 HICMOEntryID;
        public Int64 HQCSchemeID;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_ProcessCheckBillSub.cs
@@ -15,5 +15,29 @@
        public String HResult;
        public Int64 HProcCheckEmp;
        public DateTime HProcCheckTime;
        public Int64 HSampleSchemeID;
        public Int64 HSampleQty;
        public double HSampleDamageQty;
        public Int64 HAcceptQty;
        public Int64 HRejectQty;
        public double HSampleUnRightQty;
        public String HStatus;
        public Int64 HUnitID;
        public String HInspectVal;
        public String HTargetVal;
        public String HUpLimit;
        public String HDownLimit;
        public String HUpOffSet;
        public String HDownOffSet;
        public String HAnalysisMethod;
        public Int64 HKeyInspect;
        public Int64 HInspectInstruMentID;
        public String HInspectResult;
        //public HSamplingType;
        //public HInspectionLevel;
        //public HStrictness;
        //public HAQL;
        //public xxx;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_ProcessCheckBillSub_ValueGrid.cs
New file
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_ProcessCheckBillSub_ValueGrid : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HItemID;
        public Int64 HSEQ;
        public String HInSpectResult;
        public double HInSpectValue;
        public Int64 HInSpectValueB;
        public String HInSpectValueT;
    }
}
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -1646,6 +1646,78 @@
                        omodel.MES_StationEntrustOutBill_SaveAutoAddnew = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //=============================首件检验单
                    //保存后是否自动审核
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_FirstPieceCheckBill_AutoCheck")
                    {
                        omodel.QC_FirstPieceCheckBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //保存后变为新增状态
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_FirstPieceCheckBill_SaveAutoAddnew")
                    {
                        omodel.QC_FirstPieceCheckBill_SaveAutoAddnew = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //删除人必须是制单人
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_FirstPieceCheckBill_DeleterAndMakerMustSame")
                    {
                        omodel.QC_FirstPieceCheckBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //质检方案来源
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_FirstPieceCheckBill_QCSchemeSource")
                    {
                        omodel.QC_FirstPieceCheckBill_QCSchemeSource = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //=============================巡检单
                    //保存后是否自动审核
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_PatrolProcCheckBill_AutoCheck")
                    {
                        omodel.QC_PatrolProcCheckBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //保存后变为新增状态
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_PatrolProcCheckBill_SaveAutoAddnew")
                    {
                        omodel.QC_PatrolProcCheckBill_SaveAutoAddnew = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //删除人必须是制单人
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_PatrolProcCheckBill_DeleterAndMakerMustSame")
                    {
                        omodel.QC_PatrolProcCheckBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //质检方案来源
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_PatrolProcCheckBill_QCSchemeSource")
                    {
                        omodel.QC_PatrolProcCheckBill_QCSchemeSource = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //=============================工序转序检验单
                    //保存后是否自动审核
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_ProcessCheckBill_AutoCheck")
                    {
                        omodel.QC_ProcessCheckBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //保存后变为新增状态
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_ProcessCheckBill_SaveAutoAddnew")
                    {
                        omodel.QC_ProcessCheckBill_SaveAutoAddnew = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //删除人必须是制单人
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_ProcessCheckBill_DeleterAndMakerMustSame")
                    {
                        omodel.QC_ProcessCheckBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //质检方案来源
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "QC_ProcessCheckBill_QCSchemeSource")
                    {
                        omodel.QC_ProcessCheckBill_QCSchemeSource = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //报工台,工序汇报自动审核参数
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MESProceReportWorkBill_AutoCheck")
                    {
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -525,6 +525,25 @@
        public string QC_FirstPieceCheckBill_AutoCheck;                     //保存后是否自动审核  
        public string QC_FirstPieceCheckBill_SaveAutoAddnew;               //保存后变为新增状态
        public string QC_FirstPieceCheckBill_DeleterAndMakerMustSame;      //删除人必须是制单人
        public string QC_FirstPieceCheckBill_QCSchemeSource;               //质检方案来源
        //巡检单
        public string QC_PatrolProcCheckBill_AutoCheck;                     //保存后是否自动审核
        public string QC_PatrolProcCheckBill_SaveAutoAddnew;               //保存后变为新增状态
        public string QC_PatrolProcCheckBill_DeleterAndMakerMustSame;      //删除人必须是制单人
        public string QC_PatrolProcCheckBill_QCSchemeSource;               //质检方案来源
        //工序转序检验单
        public string QC_ProcessCheckBill_AutoCheck;                     //保存后是否自动审核
        public string QC_ProcessCheckBill_SaveAutoAddnew;               //保存后变为新增状态
        public string QC_ProcessCheckBill_DeleterAndMakerMustSame;      //删除人必须是制单人
        public string QC_ProcessCheckBill_QCSchemeSource;               //质检方案来源
WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -22,10 +22,18 @@
        #region[用户列表查询]
        [Route("Xt_User/list")]
        [HttpGet]
        public object list(string sWhere)
        public object list(string sWhere,string user)
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log_second("Xt_User_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_UserList " + sWhere, "h_v_IF_UserList");
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -121,6 +121,8 @@
        public json AddBillMain(string msg1)
        {
            string sErrMsg = "";
            oSystemParameter.ShowBill(ref sErrMsg);
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
@@ -180,6 +182,50 @@
                int IsProNo = mainList[0].IsProNo;//是否转工序                     
                HName_LongShan = mainList[0].HName;//工艺路线名称
                if (oSystemParameter.omodel.WMS_CampanyName == "")
                {
                    if (HPicNumVer == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "图号版本不能为空!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (HPicNumAssemble == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "总装图号不能为空!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (HMaterTexture == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "材质不能为空!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (HProductNum == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "成品编号不能为空!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (HVerNum == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "版本不能为空!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (OperationType == 2)
                {
                    ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where  å•据号='" + HBillNo + "'", "h_v_Gy_RoutingBillList");
@@ -244,29 +290,9 @@
                    return objJsonResult;
                }
                string sErrMsg = "";
                if (oSystemParameter.ShowBill(ref sErrMsg))
                if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺")
                {
                    if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺")
                    {
                        if (oSystemParameter.omodel.Gy_RoutingBill_SaveAutoLastProc == "Y" && OperationType == 1)
                        {
                            ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
                            if (ds.Tables[0].Rows.Count == 0)
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "未设置转工序!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                            //设置转工序
                            oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                        }
                    }
                    else if (IsProNo == 1 && OperationType == 1)
                    if (oSystemParameter.omodel.Gy_RoutingBill_SaveAutoLastProc == "Y" && OperationType == 1)
                    {
                        ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
@@ -283,6 +309,23 @@
                        oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                    }
                }
                else if (IsProNo == 1 && OperationType == 1)
                {
                    ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "未设置转工序!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //设置转工序
                    oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                }
                //是否勾选默认工艺路线
WebAPI/Controllers/SCGL/Gy_SourceWorkStationSetController.cs
New file
@@ -0,0 +1,175 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class Gy_SourceWorkStationSetController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        /// <summary>
        /// è¿”回生产工位列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_SourceWorkStationSet/list")]
        [HttpGet]
        public object list(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_SourceWorkStationSet_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = string.Format(@"select * from h_v_Gy_SourceWorkStationSetList where 1 = 1");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "h_v_Gy_SourceWorkStationSetList");
                }
                else
                {
                    string sql = sql1 + sWhere + " order by HItemID ";
                    ds = oCN.RunProcReturn(sql, "h_v_Gy_SourceWorkStationSetList");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #region äº§çº¿å·¥ä½ä¿å­˜
        [Route("Gy_SourceWorkStationSet/Save")]
        [HttpPost]
        public object set_SaveBill([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            //保存单据
            return objJsonResult = AddBillMain(msg1);
        }
        public json AddBillMain(string msg1)
        {
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string user = sArray[1].ToString(); //用户
            bool bResult;
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SourceWorkStationSet_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                msg2 = "[" + msg2.ToString() + "]";
                List<Model.ClsGy_SourceWorkStationSet> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SourceWorkStationSet>>(msg2);
                DAL.ClsGy_SourceWorkStationSet BillNew = new DAL.ClsGy_SourceWorkStationSet();
                //判断会计期是否合理
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = mainList[0].HCreateDate;//日期
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = s;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //固定赋值=================================
                BillNew.oModel.HMacAddr = mainList[0].HMacAddr;
                BillNew.oModel.HSourceID = mainList[0].HSourceID;
                BillNew.oModel.HProdOrgID = mainList[0].HProdOrgID;
                BillNew.oModel.HWorkStationID = mainList[0].HWorkStationID;
                BillNew.oModel.HProcID = mainList[0].HProcID;
                BillNew.oModel.HType = ClsPub.isStrNull(mainList[0].HType);
                BillNew.oModel.HVideo = ClsPub.isLong(mainList[0].HVideo);
                BillNew.oModel.HCreateDate = ClsPub.isDate(mainList[0].HCreateDate);
                BillNew.oModel.HCreator = ClsPub.isStrNull(mainList[0].HCreator);
                //保存完毕后处理
                if (mainList[0].HItemID == 0)
                {
                    bResult = BillNew.AddNew();
                }
                else
                {
                    bResult = BillNew.ModifyByID(mainList[0].HItemID);
                }
                //提示
                if (bResult == true)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    //objJsonResult.Message = "单据存盘完毕!单据号:" + mainList[0].HBillNo.Trim();
                    objJsonResult.Message = "保存成功!" + ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!原因:" + ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs
@@ -783,32 +783,26 @@
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                List<object> columnNameList = new List<object>();
                string sql1 = "select * from h_v_Sc_AssemblyBillList where 1 = 1 ";
                string sql = sql1 + sWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Sc_AssemblyBillList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_AssemblyBillList " + sWhere, "h_v_Sc_AssemblyBillList");
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_AssemblyBillList where 1 = 1 ";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_AssemblyBillList");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_Cg_PODemandPlanBillController.cs
@@ -433,7 +433,7 @@
        #region ææ–™è®¡åˆ’单 ææ–™è®¡åˆ’报表
        [Route("JIT_Cg_PODemandPlanBill/ReportPODemandPlanBillList_S")]
        [HttpGet]
        public object ReportPODemandPlanBillList_S(string sWhere, string user)
        public object ReportPODemandPlanBillList_S(string sWhere, string user,string HBEGINDATE,string HENDDATE)
        {
            try
            {
@@ -447,7 +447,7 @@
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn($"exec h_p_JIT_PODemandPlanBill_S_ReportList '{sWhere.ToString()}' ", "h_p_JIT_PODemandPlanBill_S_ReportList");
                ds = oCN.RunProcReturn($"exec h_p_JIT_PODemandPlanBill_S_ReportList '{sWhere.ToString()}','{HBEGINDATE}','{HENDDATE}' ", "h_p_JIT_PODemandPlanBill_S_ReportList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -300,12 +300,11 @@
                        {
                            SumCount += 1;
                            ////保存子表
                            objJsonResult = AddBillSub(HInterID == 0 ? list[i]["hmainid"].ToString() : HInterID.ToString()
                                , HBillNo == "" ? list[i]["单据号"].ToString() : HBillNo
                                 , DateTime.Parse(DateTime.Now.AddDays(j).ToString("yyyy-MM-dd").ToString())
                                 , int.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()));
                                 , int.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString())
                                 , list[i]);
                            if (objJsonResult.count == 1)
                            {
                                TrueCount += 1;
@@ -314,7 +313,7 @@
                        //主表有数据 å­è¡¨æ— æ•°æ®
                        if (j == 30 && SumCount == 0 && HInterID != 0 && HBillNo != "")
                        {
                            objJsonResult = AddBillSub(HInterID.ToString(), HBillNo, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0);
                            objJsonResult = AddBillSub(HInterID.ToString(), HBillNo, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0, list[i]);
                        }
                    }
                }
@@ -347,11 +346,10 @@
            }
        }
        public json AddBillSub(string HInterID, string HBillNo, DateTime date, int HQTY)
        public json AddBillSub(string HInterID, string HBillNo, DateTime date, int HQTY, Dictionary<string, string> dic)
        {
            //获取表格数据
            ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBillList where å•据号='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
            int count = 0;
            if (ds.Tables[0].Rows.Count > 0)
            {
@@ -360,7 +358,7 @@
                {
                    if (DateTime.Parse(ds.Tables[0].Rows[i]["日计划生产日期"].ToString()) == date)
                    {
                        oCN.RunProc($"update Sc_WorkBillSortBillSub set HMasterDate='{date}',HQty={HQTY}" +
                        oCN.RunProc($"update Sc_WorkBillSortBillSub set HMasterDate='{date}',HQty={HQTY},HUseTimes={(dic["小时产能"]=="0"?0: HQTY / float.Parse(dic["小时产能"].ToString()))}" +
                            $"  where HInterID={HInterID} and HEntryID={ds.Tables[0].Rows[i]["hsubid"].ToString()}");
                        count += 1;
                    }
@@ -371,9 +369,9 @@
            {
                //插入子表
                oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," +
                    "HMasterDate,HQty)" +
                    "HMasterDate,HQty,HUseTimes)" +
                            $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," +
                            $" '{date}', {HQTY})");
                            $" '{date}', {HQTY},{(dic["小时产能"] == "0" ? 0 : HQTY / float.Parse(dic["小时产能"].ToString()))})");
            }
            objJsonResult.code = "1";
WebAPI/Controllers/Sc_AssemblyBillController.cs
@@ -1,4 +1,6 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
@@ -24,6 +26,7 @@
        Int64 sCPMaterID = 0;
        string sCPMaterName = "";
        private json objjson = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        //扫描成品条码
        [Route("Assembly/Get_Assembly_CPBarCode_Json")]
@@ -174,13 +177,258 @@
        }
        #region  äº§çº¿ç»„装追溯单
        [Route("Sc_AssemblyBill/HBardCodeList")]
        [HttpGet]
        public object HBardCodeList(string HBarCode, string user,string HICMOBillNo)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Sc_AssemblyBill_Edit", 1, false, user))
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "无保存权限!";
                    objjson.data = null;
                    return objjson;
                }
                if (HICMOBillNo == "" || HICMOBillNo == null)
                {
                    ds = oCN.RunProcReturn(@"select  bard.HSourceInterID,bard.HSourceEntryID,b.FMUSTQTY,a.FMOBILLNO,FERPCLSID,t5.FNAME HMaterName_z,t5.FSPECIFICATION HMaterModel_z ,m.HItemID,b.FMATERIALID,m.HName HMaterName,m.HNumber HMaterNumber,m.HModel HMaterModel,m1.HItemID HMaterID
from AIS20210811135644..T_PRD_PPBOM a
join AIS20210811135644..T_PRD_PPBOMENTRY b on a.FID = b.FID
join AIS20210811135644..T_BD_MATERIAL t3 on a.FMATERIALID = t3.FMATERIALID
join AIS20210811135644..T_BD_MATERIAL t31 on b.FMATERIALID = t31.FMATERIALID
join AIS20210811135644..T_BD_MATERIAL_L t5 on b.FMATERIALID = t5.FMATERIALID and FLOCALEID=2052
join AIS20210811135644..t_BD_MaterialBase t4 on t5.FMATERIALID = t4.FMATERIALID
join Gy_BarCodeBill bard on a.FMOBILLNO=bard.HSourceBillNo
join Gy_Material m on bard.HMaterID=m.HItemID and t3.FNUMBER=m.HNumber
join Gy_Material m1 on t31.FNUMBER=m1.HNumber and t31.FUSEORGID=m1.HUSEORGID
where bard.HBarCode='" + HBarCode + "'  AND t4.FERPCLSID in ('1', '3')", "Gy_BarCodeBill");
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objjson.code = "0";
                        objjson.count = 0;
                        objjson.Message = "请先扫产品条码!";
                        objjson.data = null;
                        return objjson;
                    }
                    else
                    {
                        objjson.code = "1";
                        objjson.count = 1;
                        objjson.Message = "";
                        objjson.data = ds.Tables[0];
                    }
                }
                else
                {
                    ds = oCN.RunProcReturn(@"select  a.FMOBILLNO,FERPCLSID ,t4.FMATERIALID, a.FMATERIALID from AIS20210811135644..T_PRD_PPBOM a
                    join AIS20210811135644..T_PRD_PPBOMENTRY b on a.FID=b.FID
                    JOIN AIS20210811135644..T_BD_MATERIAL T6 ON b.FMATERIALID = T6.FMATERIALID
                    join AIS20210811135644..t_BD_MaterialBase t4 on b.FMATERIALID = t4.FMATERIALID
                    left join Gy_Material m on t6.FNUMBER=m.HNumber and m.HUSEORGID=a.FPRDORGID
                    where a.FMOBILLNO ='" + HICMOBillNo + "' and m.HItemID=(select HMaterID from Gy_BarCodeBill where HBarCode = '" + HBarCode + "' )", "ds2");
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objjson.code = "0";
                        objjson.count = 0;
                        objjson.Message = "配件不属于该生产订单!";
                        objjson.data = null;
                        return objjson;
                    }
                    ds = oCN.RunProcReturn(@"select  HQty,HSourceBillNo,m.HName HMaterName,m.HItemID HMaterID from Gy_BarCodeBill bard
join Gy_Material m on bard.HMaterID=m.HItemID
where  HBarCode='" + HBarCode + "'", "ds3");
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "";
                    objjson.data = ds.Tables[0];
                }
                return objjson;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "没有返回任何记录!" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        #region äº§çº¿ç»„装追溯单保存
        [Route("Sc_AssemblyBill/AddBill")]
        [HttpPost]
        public object AddBill([FromBody] JObject sMainSub)
        {
            var _value = sMainSub["sMainSub"].ToString();
            string msg1 = _value.ToString();
            oCN.BeginTran();
            //保存主表
            objjson = AddBillMain(msg1);
            if (objjson.code == "0")
            {
                oCN.RollBack();
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = objjson.Message;
                objjson.data = null;
                return objjson;
            }
            oCN.Commit();
            objjson.code = "1";
            objjson.count = 1;
            objjson.Message = "新增单据成功!";
            objjson.data = null;
            return objjson;
        }
        Models.ClsSc_AssemblyBillMain omodel = new Models.ClsSc_AssemblyBillMain();//基本资料
        public json AddBillMain(string msg1)
        {
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            int OperationType = int.Parse(sArray[2].ToString());//类型
            string user = sArray[3].ToString();//用户名
            try
            {
                //判断是否有编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_AssemblyBill_Edit", 1, false, user))
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "无权限编辑!";
                    objjson.data = null;
                    return objjson;
                }
                omodel = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsSc_AssemblyBillMain>(msg2);
                //JSON序列化转换字典集合
                List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
                List<object> jb = JsonConvert.DeserializeObject<List<object>>(msg3);
                foreach (JObject item in jb)
                {
                    Dictionary<string, string> dic = new Dictionary<string, string>();
                    foreach (var itm in item.Properties())
                    {
                        dic.Add(itm.Name, itm.Value.ToString());
                    }
                    list.Add(dic);
                }
                if (OperationType == 1)//新增临时表源单表
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        //临时配件表
                        oCN.RunProc("Insert Into Sc_AssemblyBill_BindSourceTemp   " +
                        "(HInterID,HEntryID,HBillNo_bak,HSourceBillNo,HSourceInterID,HMaterID" +
                        ",HQtyMust,HProdOrgID,HSourceEntryID,HSourceBillType,HAuxPropID,HProcID,HQty,HBatchNo,HMTONo,HPlanMode) " +
                        " values(" + omodel.HInterID.ToString() + "," + (i+1) + ",'" + omodel.HBillNo.ToString() + "','" + omodel.HICMOBillNo.ToString() + "',0," + list[i]["HMaterID"].ToString() +
                        ",'" + list[i]["HQty"].ToString() + "','" + list[i]["HPRDORGID"].ToString() + "',0,'',0,0,0,'','','') ");
                    }
                }
                else if (OperationType == 2)//新增配件扫码表
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (list[i]["HBarCode"].ToString() != "")
                        {
                            ds = oCN.RunProcReturn("select * from Sc_AssemblyBill_BindBarCodeTemp where HSourceBillNo='" + omodel.HICMOBillNo.ToString() + "' and HBarCode='" + list[i]["HBarCode"].ToString() + "' and HBillNo_bak='" + omodel.HBillNo.ToString() + "'", "Sc_AssemblyBill_BindBarCodeTemp");
                            if (ds.Tables[0].Rows.Count > 0) {
                                objjson.code = "0";
                                objjson.count = 0;
                                objjson.Message ="该条码已扫入,无须再扫!";
                                objjson.data = null;
                                return objjson;
                            }
                            //临时记录表
                            oCN.RunProc("Insert Into Sc_AssemblyBill_BindBarCodeTemp   " +
                            "(HInterID,HEntryID,HBillNo_bak,HSourceBillNo,HSourceInterID,HMaterID" +
                            ",HBarCode,HQty,HProdOrgID,HSourceEntryID,HSourceBillType,HAuxPropID,HProcID,HBatchNo,HMTONo,HPlanMode) " +
                            " values(" + omodel.HInterID.ToString() + "," + (i + 1) + ",'" + omodel.HBillNo.ToString() + "','" + omodel.HICMOBillNo.ToString() + "',0," + list[i]["HMaterID"].ToString() +
                            ",'" + list[i]["HBarCode"].ToString() + "','" + list[i]["HEQty"].ToString() + "','" + list[i]["HPRDORGID"].ToString() + "',0,'',0,0,'','','') ");
                        }
                    }
                }
                else if (OperationType == 3)//新增主子表
                {
                    //保存生产组装单主表
                    string sql = $@"Insert Into Sc_AssemblyBillMain(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate
,HBillNo,HBillStatus,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo
,HICMOInterID,HICMOBillNo,HBarCode_P,HMaterID,HUnitID,HAssemblyStatus,HProdOrgID)
values('{DateTime.Now.Year}','{DateTime.Now.Month}','3727','3727',{omodel.HInterID.ToString()},getdate()
,'{omodel.HBillNo.ToString()}','1','{user}',getdate(),{omodel.HICMOInterID.ToString()},{omodel.HICMOEntryID.ToString()},'{omodel.HICMOBillNo.ToString()}'
,{omodel.HICMOInterID.ToString()},'{omodel.HICMOBillNo.ToString()}','{omodel.HBarCode_P.ToString()}',{omodel.HMaterID},0,'{omodel.HAssemblyStatus}',{omodel.HProdOrgID})";
                    oCN.RunProc(sql);
                    ds = oCN.RunProcReturn("select * from Sc_AssemblyBill_BindBarCodeTemp where HSourceBillNo='" + omodel.HICMOBillNo.ToString() + "' and HInterID='" + omodel.HInterID + "' and HBillNo_bak='" + omodel.HBillNo.ToString() + "'", "Sc_AssemblyBill_BindBarCodeTemp");
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        int HMaterID = int.Parse(ds.Tables[0].Rows[i]["HMaterID"].ToString());
                        double HQty = double.Parse(ds.Tables[0].Rows[i]["HQty"].ToString());
                        string HBarCode = ds.Tables[0].Rows[i]["HBarCode"].ToString();
                        string sq2 = $@"Insert Into Sc_AssemblyBillSub(HInterID,HBillNo_bak,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo
,HSourceBillType,HMaterID,HSourceID,HEquipID,HUnitID,HQty
,HGroupID,HWorkerID,HScanDate,HBarCode,HBarCode_P,HSNNumber)
values({omodel.HInterID},'{omodel.HBillNo}',{(i + 1)},0,0,''
,'',{HMaterID},0,0,0,{HQty}
,0,0,getdate(),'{HBarCode}','{omodel.HBarCode_P}','') ";
                        oCN.RunProc(sq2);
                    }
                }
                objjson.code = "1";
                objjson.count = 1;
                objjson.Message = null;
                objjson.data = null;
                return objjson;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "Exception!" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        #region äº§çº¿ç»„装追溯单 æŸ¥è¯¢
        [Route("Sc_AssemblyBill/Sc_AssemblyBillAddList")]
        [HttpGet]
        public object Sc_AssemblyBillAddList(string sWhere)
        {
            try
            {
                ds = oCN.RunProcReturn(@"select * from  h_v_Sc_AssemblyBillList where 1=1  " + sWhere, "h_v_Sc_AssemblyBillList");
                objjson.code = "1";
                objjson.count = 1;
                objjson.Message = "";
                objjson.data = ds.Tables[0];
                return objjson;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "没有返回任何记录!" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        [Route("Assembly/Delete_Json")]
        [HttpGet]
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -405,6 +405,10 @@
        {
            try
            {
                string sErr = "";
                oSystemParameter.ShowBill(ref sErr);
                //获取生产汇报单最大InterID和单据号
                Int64 HInterID = DBUtility.ClsPub.CreateBillID("3711", ref DBUtility.ClsPub.sExeReturnInfo);
                string HBillNo = DBUtility.ClsPub.CreateBillCode("3711", ref DBUtility.ClsPub.sExeReturnInfo, true);
@@ -521,7 +525,10 @@
                    FentityModel.Add("FCostRate", dr1["FCostRate"].ToString());// æˆæœ¬æƒé‡
                    FentityModel.Add("FISBACKFLUSH", dr1["FISBACKFLUSH"].ToString() == "1" ? true : false);// å€’冲领料
                    FentityModel.Add("FMOMAINENTRYID", dr1["FMOENTRYID"].ToString());//
                    //FentityModel.Add("F_bsv_Base1", new JObject() { ["Fnumber"] = dr1["FPREBDONENUMBER"].ToString() }); //包装标识
                    if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺")
                    {
                        FentityModel.Add("F_bsv_Base1", new JObject() { ["Fnumber"] = dr1["FPREBDONENUMBER"].ToString() });//包装标识
                    }
                    FentityModel.Add("FLot", new JObject() { ["FNumber"] = dr1["FBATCHNO"].ToString() }); //批号
                    FentityModel.Add("F_bsv_Text", dr1["工序流转卡号"].ToString()); //流转卡号
                    JArray Fentity2 = new JArray();
WebAPI/Controllers/WebAPIController.cs
@@ -3410,7 +3410,7 @@
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.Message = "获取失败" + ",没有查询到数据";
                    objjson.data = null;
                    return objjson;
                }
@@ -3466,7 +3466,63 @@
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.Message = "获取失败" + ",没有查询到数据";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    objjson.list = columnNameList;
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// èŽ·å–æ£€ä»ªå™¨åˆ—è¡¨
        /// </summary>
        /// <returns></returns>
        [Route("Web/GetGy_InspectInstruMent")]
        [HttpGet]
        public object GetGy_InspectInstruMent(string InspectInstruMent, int OrganizationID)
        {
            if (InspectInstruMent != "")
            {
                sWhere = " and ( æ£€éªŒä»ªå™¨ä»£ç  like '%" + InspectInstruMent + "%' or æ£€éªŒä»ªå™¨åç§° like '%" + InspectInstruMent + "%' ) ";
            }
            try
            {
                List<object> columnNameList = new List<object>();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = "Select * from h_v_Gy_InspectInstruMent where 1 = 1 " + sWhere + "Order by HItemID ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_InspectInstruMent");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + ",没有查询到数据";
                    objjson.data = null;
                    return objjson;
                }
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÌõÂëÉú³É/Sc_BarCodeController.cs
@@ -887,7 +887,10 @@
                                //物料代码-包装标识-日期-供应商代码-八位流水号
                                LSHlen = 8;//流水号是8位
                                DataSet dataDs = oCN.RunProcReturn($"select  b.F_TEZV_BASE from  AIS20220308151944..T_PUR_Receive a inner join AIS20220308151944..T_PUR_RECEIVEENTRY b on a.FID = b.FID where a.FID={ordrlist[j].HMainID} and b.FENTRYID={ordrlist[j].HSubID}", "T_PUR_Receive");
                                DataSet dataDs = oCN.RunProcReturn($@"select  isnull(pr.FNUMBER,'') F_TEZV_BASE from  AIS20220308151944..T_PUR_Receive a
inner join AIS20220308151944..T_PUR_RECEIVEENTRY b on a.FID = b.FID
left join AIS20220308151944..T_BAS_PREBDONE pr on b.F_TEZV_BASE=pr.FID
where a.FID={ordrlist[j].HMainID} and b.FENTRYID={ordrlist[j].HSubID}", "T_PUR_Receive");
                                if (dataDs.Tables[0].Rows.Count == 0)
                                {
                                    objJsonResult.code = "0";
@@ -906,8 +909,13 @@
                            {
                                //物料代码-包装标识-日期-组织代码-八位流水号
                                LSHlen = 8;//流水号是8位
                                DataSet dataDs = oCN.RunProcReturn($"select  b.F_bsv_Base1,a.FPRDORGID from  AIS20220308151944..T_PRD_INSTOCK a inner join AIS20220308151944..T_PRD_INSTOCKENTRY b on a.FID = b.FID where a.FID={ordrlist[j].HMainID} and b.FENTRYID={ordrlist[j].HSubID}", "T_PRD_INSTOCK");
                                DataSet dataDs = oCN.RunProcReturn($@"select  isnull(pr.FNUMBER,'') F_bsv_Base1,a.FPRDORGID from  AIS20220308151944..T_PRD_INSTOCK a
inner join AIS20220308151944..T_PRD_INSTOCKENTRY b on a.FID = b.FID
join(
select HERPInterID, HERPEntryID, HInterID, HEntryID from Kf_ICStockBillSub
)kf on b.FID = kf.HERPInterID and b.FENTRYID = kf.HERPEntryID
left join AIS20220308151944..T_BAS_PREBDONE pr on b.F_bsv_Base1=pr.FID
where kf.HInterID = {ordrlist[j].HMainID} and kf.HEntryID = {ordrlist[j].HSubID}", "T_PRD_INSTOCK");
                                if (dataDs.Tables[0].Rows.Count == 0)
                                {
                                    objJsonResult.code = "0";
WebAPI/Controllers/Æ·ÖʹÜÀí/¹¤Ðò¼ìÑéµ¥/QC_ProcessCheckBillController.cs
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
@@ -95,6 +96,7 @@
                BillNew.omodel.HMainSourceEntryID = ClsPub.isLong(mainList[0].HMainSourceEntryID);
                BillNew.omodel.HMainSourceBillNo = ClsPub.isStrNull(mainList[0].HMainSourceBillNo);
                BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType);
                BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID);
                BillNew.omodel.HBillStatus = 1;
                BillNew.omodel.HProcID = ClsPub.isLong(mainList[0].HProcID);
                List<Model.ClsQC_ProcessCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub>>(msg3);
@@ -121,6 +123,25 @@
                        oSub.HProcCheckTime = HDate;
                        oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo); 
                        oSub.HProcCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp);
                        oSub.HSampleSchemeID = DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID);
                        oSub.HSampleQty = DBUtility.ClsPub.isLong(subList[i].HSampleQty);
                        oSub.HSampleDamageQty = DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty);
                        oSub.HAcceptQty = DBUtility.ClsPub.isLong(subList[i].HAcceptQty);
                        oSub.HRejectQty = DBUtility.ClsPub.isLong(subList[i].HRejectQty);
                        oSub.HSampleUnRightQty = DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty);
                        oSub.HStatus = DBUtility.ClsPub.isStrNull(subList[i].HStatus);
                        oSub.HUnitID = DBUtility.ClsPub.isLong(subList[i].HUnitID);
                        oSub.HInspectVal = DBUtility.ClsPub.isStrNull(subList[i].HInspectVal);
                        oSub.HTargetVal = DBUtility.ClsPub.isStrNull(subList[i].HTargetVal);
                        oSub.HUpLimit = DBUtility.ClsPub.isStrNull(subList[i].HUpLimit);
                        oSub.HDownLimit = DBUtility.ClsPub.isStrNull(subList[i].HDownLimit);
                        oSub.HUpOffSet = DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet);
                        oSub.HDownOffSet = DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet);
                        oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod);
                        oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect);
                        oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID);
                        oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult);
                        BillNew.DetailColl.Add(oSub);
                    }
@@ -171,6 +192,85 @@
            }
        }
        #endregion
        #region æ£€éªŒå€¼ä¿å­˜
        [Route("QC_ProcessCheckBill/set_SaveValue")]
        [HttpPost]
        public object set_SaveValue([FromBody] JObject msg)
        {
            ListModels oListModels = new ListModels();
            try
            {
                var _value = msg["msg"].ToString();
                string msg1 = _value.ToString();
                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                string Value = sArray[0].ToString(); //检验值表格
                Int64 HInterID = Convert.ToInt64(sArray[1]); //主ID
                Int64 HEntryID = Convert.ToInt64(sArray[2]); //子ID
                bool bResult;
                List<Model.ClsQC_ProcessCheckBillSub_ValueGrid> valueList = new List<Model.ClsQC_ProcessCheckBillSub_ValueGrid>();
                valueList = oListModels.getObjectByJson_ClsQC_ProcessCheckBillSub_ValueGrid(Value);
                DAL.ClsQC_ProcessCheckBill BillNew = new DAL.ClsQC_ProcessCheckBill();
                for (int i = 0; i < valueList.ToArray().Length; i++)
                {
                    if (i >= 0)//HQty
                    {
                        Model.ClsQC_ProcessCheckBillSub_ValueGrid oSub_Value = new Model.ClsQC_ProcessCheckBillSub_ValueGrid();
                        oSub_Value.HInterID = HInterID;
                        oSub_Value.HEntryID = HEntryID;
                        oSub_Value.HSEQ = i + 1;
                        oSub_Value.HInSpectResult = ClsPub.isStrNull(valueList[i].HInSpectResult);
                        oSub_Value.HInSpectValue = ClsPub.isDoule(valueList[i].HInSpectValue);
                        oSub_Value.HInSpectValueB = ClsPub.isLong(valueList[i].HInSpectValueB);
                        oSub_Value.HInSpectValueT = ClsPub.isStrNull(valueList[i].HInSpectValueT);
                        BillNew.DetailColl_Value.Add(oSub_Value);
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "无明细行信息!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                bResult = BillNew.AddValue(ref ClsPub.sExeReturnInfo, ref HInterID, ref HEntryID);
                if (bResult == true)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存检验值成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!原因:" + ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¥åºæ£€éªŒå•根据源单类型获取信息-源单为生产状态临时表(3722)
@@ -482,6 +582,89 @@
            }
        }
        #endregion
        //
        #region å·¥åºæ£€éªŒå•列表
        [Route("QC_ProcessCheckBill/QC_ProcessCheckBillList")]
        [HttpGet]
        public object QC_ProcessCheckBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql1 = "select * from h_v_QC_ProcessCheckBill where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBill");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        /// <summary>
        ///返回检验值列表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <returns></returns>
        [Route("QC_ValueTable_ProcessCheck/getValueList")]
        [HttpGet]
        public object getValueList(Int64 HInterID, Int64 HEntryID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select * from QC_ProcessCheckBillSub_ValueGrid  where  HInterID=" + HInterID + " and HEntryID=" + HEntryID, "QC_ProcessCheckBillSub_ValueGrid");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查询到数据!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
    }
}
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
@@ -92,6 +93,7 @@
                BillNew.omodel.HMainSourceEntryID = ClsPub.isLong(mainList[0].HMainSourceEntryID);
                BillNew.omodel.HMainSourceBillNo = ClsPub.isStrNull(mainList[0].HMainSourceBillNo);
                BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType);
                BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID);
                BillNew.omodel.HBillStatus = 1;
                List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_FirstPieceCheckBillSub>();
@@ -135,6 +137,10 @@
                        oSub.HDownLimit= DBUtility.ClsPub.isStrNull(subList[i].HDownLimit);
                        oSub.HUpOffSet= DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet);
                        oSub.HDownOffSet= DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet);
                        oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod);
                        oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect);
                        oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID);
                        oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult);
                        BillNew.DetailColl.Add(oSub);
                    }
                    else
@@ -256,7 +262,7 @@
                List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid> valueList = new List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid>();
                valueList = oListModels.getObjectByJson_ClsClsQC_FirstPieceCheckBillSub_ValueGrid(Value);
                valueList = oListModels.getObjectByJson_ClsQC_FirstPieceCheckBillSub_ValueGrid(Value);
                DAL.ClsQC_FirstPieceCheckBill BillNew = new DAL.ClsQC_FirstPieceCheckBill();
@@ -269,7 +275,7 @@
                        oSub_Value.HEntryID = HEntryID;
                        oSub_Value.HSEQ = i + 1;
                        oSub_Value.HInSpectResult = ClsPub.isStrNull(valueList[i].HInSpectResult);
                        oSub_Value.HInSpectValue = ClsPub.isLong(valueList[i].HInSpectValue);
                        oSub_Value.HInSpectValue = ClsPub.isDoule(valueList[i].HInSpectValue);
                        oSub_Value.HInSpectValueB = ClsPub.isLong(valueList[i].HInSpectValueB);
                        oSub_Value.HInSpectValueT = ClsPub.isStrNull(valueList[i].HInSpectValueT);
@@ -328,8 +334,17 @@
            try
            {              
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillSub_ValueGrid  where  HInterID="+ HInterID + " and HEntryID="+ HEntryID, "h_v_QC_FirstPieceCheckBillList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                if (ds.Tables[0].Rows.Count > 0)
                {
@@ -337,13 +352,14 @@
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查询到数据!";
                    objJsonResult.Message = "无检测值数据!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
@@ -359,5 +375,45 @@
                return objJsonResult;
            }
        }
        #region é¦–件检验单列表
        [Route("QC_FirstPieceCheckBill/QC_FirstPieceCheckBillList")]
        [HttpGet]
        public object QC_FirstPieceCheckBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql1 = "select * from h_v_QC_FirstPieceCheckBill where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBill");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESBeginStepWorkBillController.cs
@@ -1026,11 +1026,23 @@
                    return objJsonResult;
                }
                oCN.BeginTran();
                ds = oCN.RunProcReturn("select * from Sc_ICMOBillWorkQtyStatus_Tmp where HInterID=" + HInterID + " and HSourceInterID=" + HICMOInterID + " and HSourceEntryID=" + HICMOEntryID, "Sc_ICMOBillWorkQtyStatus_Tmp");
                if (ds.Tables[0].Rows.Count == 0) {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查无数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                //删除产量汇报表
                string sql = string.Format(@"delete Sc_ICMOBillWorkQtyStatus_Tmp  where HInterID='" + HInterID + "'");
                oCN.RunProc(sql);
                double sumqty = double.Parse(ds.Tables[0].Rows[0]["HQty"].ToString()) + double.Parse(ds.Tables[0].Rows[0]["HBadQty"].ToString()) + double.Parse(ds.Tables[0].Rows[0]["HWasterQty"].ToString());  //汇报数量+不良+报废
                //回写生产状态临时表Sc_ICMOBillStatus_Tmp拆分汇报数量 HSplitRelationQty
                oCN.RunProc("update Sc_ICMOBillStatus_Tmp set HSplitRelationQty=HSplitRelationQty-" + sumqty + "  where HICMOBillNo='" + ds.Tables[0].Rows[0]["HICMOBillNo"].ToString() + "'  and HSourceID='" + ds.Tables[0].Rows[0]["HSourceID"].ToString() + "' and  HICMOInterID='" + ds.Tables[0].Rows[0]["HICMOInterID"].ToString() + "' and HICMOEntryID='" + ds.Tables[0].Rows[0]["HICMOEntryID"].ToString() + "' and HInterID=" + ds.Tables[0].Rows[0]["HSourceInterID"].ToString());
                oCN.Commit();
                objJsonResult.code = "1";
WebAPI/ListModels.cs
@@ -2680,12 +2680,21 @@
        ///首件检验单 å­™è¡¨
        ///ClsQC_FirstPieceCheckBillSub_ValueGrid
        public List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid> getObjectByJson_ClsClsQC_FirstPieceCheckBillSub_ValueGrid(string jsonString)
        public List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid> getObjectByJson_ClsQC_FirstPieceCheckBillSub_ValueGrid(string jsonString)
        {
            //jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid>>(jsonString);
            return list;
        }
        ///工序检验单 å­™è¡¨
        ///ClsQC_ProcessCheckBillSub_ValueGrid
        public List<Model.ClsQC_ProcessCheckBillSub_ValueGrid> getObjectByJson_ClsQC_ProcessCheckBillSub_ValueGrid(string jsonString)
        {
            //jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsQC_ProcessCheckBillSub_ValueGrid> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub_ValueGrid>>(jsonString);
            return list;
        }
    }
WebAPI/Models/ClsSc_AssemblyBillMain.cs
@@ -24,5 +24,7 @@
        public string HPCrux;
        public string HSCZY;
        public int HSCZYID;
        public int HProdOrgID; //组织
        public int HICMOEntryID; //任务单子ID
    }
}
WebAPI/WebAPI.csproj
@@ -420,6 +420,7 @@
    <Compile Include="Controllers\SBGL\SBTC\Sb_EquipWorkBeforeCheckBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipWorkBeforeCheckSBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipStockInCheckBillSController.cs" />
    <Compile Include="Controllers\SCGL\Gy_SourceWorkStationSetController.cs" />
    <Compile Include="Controllers\SCGL\Sc_ComplementGoodBill_ZXBZController.cs" />
    <Compile Include="Controllers\SCGL\日计划管理\DataHelper.cs" />
    <Compile Include="Controllers\SCGL\日计划管理\JIT_Cg_PODemandPlanBillController.cs" />
@@ -970,6 +971,7 @@
    <Folder Include="Views\Gy_RoutingGroup\" />
    <Folder Include="Views\Gy_SettleStyle\" />
    <Folder Include="Views\Gy_SOPBill\" />
    <Folder Include="Views\Gy_SourceWorkStationSet\" />
    <Folder Include="Views\Gy_SplitBarCode\" />
    <Folder Include="Views\Gy_Staff\" />
    <Folder Include="Views\Gy_StdMinPickQty\" />