1
wtt
2024-07-10 d3a7017e5541249d8ba56f8285a1f78a689bc955
1
9个文件已修改
13个文件已添加
4129 ■■■■■ 已修改文件
DAL/DAL.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/工资管理/ClsHR_EmployeeSkillExamBill.cs 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_BackSampleCheckBill.cs 315 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_TakeSampleCheckBill.cs 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/工资管理/ClsHR_EmployeeSkillExamBillMain.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/工资管理/ClsHR_EmployeeSkillExamBillSub.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_BackSampleCheckBillMain.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_BackSampleCheckBillSub.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_TakeSampleCheckBillMain.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_TakeSampleCheckBillSub.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/检验取样还样单/QC_TakeSampleCheckBillController.cs 1857 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/工资管理/HR_EmployeeSkillExamBillController.cs 827 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/FolderProfile14.pubxml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/FolderProfile14.pubxml.user 459 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -87,6 +87,7 @@
    <Compile Include="ClsPM_CustomerTaskBillMain.cs" />
    <Compile Include="ClsGy_MaterialMouldBillMain.cs" />
    <Compile Include="ClsPM_WorkPlanMonthBillMain.cs" />
    <Compile Include="质检管理\ClsQC_TakeSampleCheckBill.cs" />
    <Compile Include="MES\ClsSc_SourceLineRepairBill.cs" />
    <Compile Include="MES\ClsSc_MESMaterToSourceBill .cs" />
    <Compile Include="人事管理\ClsHR_EmpFosterBill.cs" />
@@ -138,6 +139,7 @@
    <Compile Include="基础资料\其他基础资料\ClsGy_StdWorkTimes_Ctl.cs" />
    <Compile Include="基础资料\其他基础资料\ClsGy_SupMaterial_Ctl.cs" />
    <Compile Include="工资管理\ClsHR_EmployeeSkillBill.cs" />
    <Compile Include="工资管理\ClsHR_EmployeeSkillExamBill.cs" />
    <Compile Include="工资管理\ClsHR_PostSkillBill.cs" />
    <Compile Include="源单\Cls_S_Xt_BaseBill1.cs" />
    <Compile Include="源单\ERP源单\Cls_S_Sc_ABJJD.cs" />
@@ -660,6 +662,7 @@
    <Compile Include="系统公用\ClsXt_SystemParameter_Ctl.cs" />
    <Compile Include="系统公用\ClsXt_BillSubType_Ctl.cs" />
    <Compile Include="计划管理\ClsGy_MaterialTechParamBillMain.cs" />
    <Compile Include="质检管理\ClsQC_BackSampleCheckBill.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBill.cs" />
    <Compile Include="质检管理\ClsQC_WorkSelfCheckBill.cs" />
    <Compile Include="质检管理\ClsQC_StockCheckBill.cs" />
DAL/¹¤×ʹÜÀí/ClsHR_EmployeeSkillExamBill.cs
New file
@@ -0,0 +1,222 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsHR_EmployeeSkillExamBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsHR_EmployeeSkillExamBillMain omodel = new Model.ClsHR_EmployeeSkillExamBillMain();
        public List<Model.ClsHR_EmployeeSkillExamBillSub> DetailColl = new List<Model.ClsHR_EmployeeSkillExamBillSub>();
        public ClsHR_EmployeeSkillExamBill()
        {
            base.MvarItemKeySub = "HR_EmployeeSkillExamBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "HR_EmployeeSkillExamBillMain";
            base.MvarReportTitle = "人员技能考核记录单";
            base.BillType = "2332";
            base.HBillSubType = "2332";
        }
        #region å›ºå®šä»£ç 
        ~ClsHR_EmployeeSkillExamBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("Update HR_EmployeeSkillExamBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                ",HDeptID='" + omodel.HDeptID.ToString() +
                "',HGroupID ='" + omodel.HGroupID.ToString() +
                "',HCheckEmpID ='" + omodel.HCheckEmpID.ToString() +
                "',HMaterID='" + omodel.HMaterID.ToString() +
                "',HProcID='" + omodel.HProcID.ToString() +
                "',HSourceID='" + omodel.HSourceID.ToString() +
                "',HOrgID='" + omodel.HOrgID.ToString() + "'" +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsHR_EmployeeSkillExamBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into HR_EmployeeSkillExamBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HEmpID,HLowMark,HMark" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HEmpID.ToString() + "," + oSub.HLowMark.ToString() + "," + oSub.HMark.ToString() +
                      ") ");
                }
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into HR_EmployeeSkillExamBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HDeptID,HGroupID,HCheckEmpID,HMaterID,HProcID,HSourceID,HOrgID" +
                ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                ",'" + omodel.HDeptID.ToString() + "'," + omodel.HGroupID.ToString() + "," + omodel.HCheckEmpID + "," + omodel.HMaterID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HSourceID.ToString() + "," + omodel.HOrgID.ToString() + ",'" + omodel.HMainSourceBillType +
                "'," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsHR_EmployeeSkillExamBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into HR_EmployeeSkillExamBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HEmpID,HLowMark,HMark" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HEmpID.ToString() + "," + oSub.HLowMark.ToString() + "," + oSub.HMark.ToString() +
                      ") ");
                }
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //查询主表
                DataSet Ds;
                Ds = oCn.RunProcReturn("Select * from HR_EmployeeSkillExamBillMain Where HInterID=" + lngBillKey.ToString(), "HR_EmployeeSkillExamBillMain");
                if (Ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "单据未找到!";
                    return false;
                }
                //固定赋值===========================================
                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
                omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
                omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
                omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
                omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
                omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]);
                omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]);
                omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim();
                omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim();
                omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim();
                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
                omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim();
                omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim();
                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
                omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]);
                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
                //========================================================
                omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
                omodel.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
                omodel.HCheckEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckEmpID"]);
                omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
                omodel.HProcID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcID"]);
                omodel.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
                omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]);
                //
                //循环
                DataSet DsSub;
                DsSub = oCn.RunProcReturn("Select * from HR_EmployeeSkillExamBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "HR_EmployeeSkillExamBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsHR_EmployeeSkillExamBillSub oSub = new Model.ClsHR_EmployeeSkillExamBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
                    oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
                    oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
                    oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
                    oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]);
                    oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim();
                    //===================================================
                    oSub.HEmpID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEmpID"]);
                    oSub.HLowMark = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HLowMark"]);
                    oSub.HMark = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMark"]);
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
    }
}
DAL/Öʼì¹ÜÀí/ClsQC_BackSampleCheckBill.cs
New file
@@ -0,0 +1,315 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public  class ClsQC_BackSampleCheckBill:DBUtility.ClsXt_BaseBill
    {
        public Model.ClsQC_BackSampleCheckBillMain omodel = new Model.ClsQC_BackSampleCheckBillMain();
        public List<Model.ClsQC_BackSampleCheckBillSub> DetailColl = new List<Model.ClsQC_BackSampleCheckBillSub>();
        public ClsQC_BackSampleCheckBill()
        {
            base.MvarItemKeySub = "QC_BackSampleCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey= "QC_BackSampleCheckBillMain";
            base.MvarReportTitle = "检验还样单";
            base.BillType = "7522";
            base.HBillSubType = "7522";
        }
        #region å›ºå®šä»£ç 
        ~ClsQC_BackSampleCheckBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_BackSampleCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_BackSampleCheckBill_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("UpDate QC_BackSampleCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                ",HDeptID='" + omodel.HDeptID.ToString() + "'" +
                ",HEmp='" + omodel.HEmp.ToString() + "'" +
                ",HProcID='" + omodel.HProcID.ToString() +
                "',HSourceOrgID='" + omodel.HSourceOrgID.ToString() +
                "',HInspectOrgID='" + omodel.HInspectOrgID.ToString() +
                "' where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsQC_BackSampleCheckBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into QC_BackSampleCheckBillSub " +
                       " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                       ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                       ",HMaterID,HUnitID,HQty,HBatchNo,HICMOInterID,HICMOEntryID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HProcExchQty" +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HMaterID.ToString() + "','" + oSub.HUnitID.ToString() + "','" + oSub.HQty.ToString() + "','" + oSub.HBatchNo.ToString() + "','" + oSub.HICMOInterID.ToString() + "','" + oSub.HICMOEntryID.ToString() + "','" + oSub.HICMOBillNo.ToString() +
                       "','" + oSub.HICMOQty.ToString() + "', '" + oSub.HProcExchInterID.ToString() + "', '" + oSub.HProcExchEntryID.ToString() + "','" + oSub.HProcExchBillNo.ToString() + "','" + oSub.HProcExchQty.ToString() +
                       "') ");
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_QC_BackSampleCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_BackSampleCheckBill_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;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_BackSampleCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_BackSampleCheckBill_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 = "";
                sql = "Insert Into QC_BackSampleCheckBillMain" +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType," +
                "HDeptID,HEmp,HProcID,HSourceOrgID,HInspectOrgID) " +
                " values(" +
                "'" + this.BillType +
                "','" + this.HBillSubType +
                "'," + omodel.HInterID.ToString() +
                ",'" + omodel.HBillNo +
                "','" + omodel.HDate +
                "'," + omodel.HYear +
                "," + omodel.HPeriod +
                ",'" + omodel.HRemark +
                "','" + omodel.HMaker +
                "',getdate()" +
                ",'" + omodel.HMainSourceInterID +
                "','" + omodel.HMainSourceEntryID +
                "','" + omodel.HMainSourceBillNo +
                "','" + omodel.HMainSourceBillType +
                "','" + omodel.HDeptID.ToString() +
                "','" + omodel.HEmp.ToString() +
                "','" + omodel.HProcID.ToString() +
                "','" + omodel.HSourceOrgID.ToString() +
                "','" + omodel.HInspectOrgID.ToString() +
                "') ";
                //主表
                oCn.RunProc(sql);
                //插入子表
                foreach (Model.ClsQC_BackSampleCheckBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into QC_BackSampleCheckBillSub " +
                       " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                       ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                       ",HMaterID,HUnitID,HQty,HBatchNo,HICMOInterID,HICMOEntryID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HProcExchQty" +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + 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.HMaterID.ToString() + "','" + oSub.HUnitID.ToString() + "','" + oSub.HQty.ToString() + "','" + oSub.HBatchNo.ToString() + "','" + oSub.HICMOInterID.ToString() + "','" + oSub.HICMOEntryID.ToString() + "','" + oSub.HICMOBillNo.ToString() +
                       "','" + oSub.HICMOQty.ToString() + "', '" + oSub.HProcExchInterID.ToString() + "', '" + oSub.HProcExchEntryID.ToString() + "','" + oSub.HProcExchBillNo.ToString() + "','" + oSub.HProcExchQty.ToString() +
                       "') ");
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_QC_BackSampleCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_BackSampleCheckBill_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;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //查询主表
                DataSet Ds ;
                Ds = oCn.RunProcReturn("Select * from QC_BackSampleCheckBillMain Where HInterID=" + lngBillKey.ToString(), "QC_BackSampleCheckBillMain");
                if(Ds.Tables[0].Rows.Count==0)
                {
                    sReturn = "单据未找到!";
                    return false;
                }
                //固定赋值===========================================
                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
                omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
                omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
                omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
                omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
                omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]);
                omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]);
                omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim();
                omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim();
                omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim();
                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
                omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim();
                omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim();
                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
                omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]);
                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
                //========================================================
                //omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
                //omodel.HContext = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HContext"]);
                //omodel.HDescription = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDescription"]);
                //omodel.HSendMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSendMan"]);
                //omodel.HReceiveMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HReceiveMan"]);
                //omodel.HCopyMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCopyMan"]);
                //omodel.HLevel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HLevel"]);
                //omodel.HReTransmitMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HReTransmitMan"]);
                //omodel.HBillTypeName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillTypeName"]);
                //omodel.HPlanBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPlanBillNo"]);
                //omodel.HMaterName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterName"]);
                //omodel.HMaterModel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterModel"]);
                //omodel.HSendType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSendType"]);
                //omodel.HHasten = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HHasten"]);
                //omodel.HQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HQty"]);
                //
                //循环
                DataSet DsSub ;
                DsSub = oCn.RunProcReturn("Select * from QC_BackSampleCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "QC_BackSampleCheckBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsQC_BackSampleCheckBillSub oSub = new Model.ClsQC_BackSampleCheckBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
                    oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
                    oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
                    oSub.HCloseMan =  DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
                    oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]);
                    oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim();
                    //===================================================
                    //oSub.HDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HDate"]);
                    //oSub.HSendStatus = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSendStatus"]);
                    //oSub.HSendMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSendMan"]);
                    //oSub.HDescription = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDescription"]);
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
    }
}
DAL/Öʼì¹ÜÀí/ClsQC_TakeSampleCheckBill.cs
New file
@@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public  class ClsQC_TakeSampleCheckBill:DBUtility.ClsXt_BaseBill
    {
        public Model.ClsQC_TakeSampleCheckBillMain omodel = new Model.ClsQC_TakeSampleCheckBillMain();
        public List<Model.ClsQC_TakeSampleCheckBillSub> DetailColl = new List<Model.ClsQC_TakeSampleCheckBillSub>();
        public ClsQC_TakeSampleCheckBill()
        {
            base.MvarItemKeySub = "QC_TakeSampleCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey= "QC_TakeSampleCheckBillMain";
            base.MvarReportTitle="检验取样单";
            base.BillType= "7521";
            base.HBillSubType = "7521";
        }
        #region å›ºå®šä»£ç 
        ~ClsQC_TakeSampleCheckBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate QC_TakeSampleCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HBillStatus='" + omodel.HBillStatus + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                ",HICMOInterID=" + omodel.HICMOInterID.ToString() +
                ",HICMOEntryID=" + omodel.HICMOEntryID.ToString() +
                ",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
                ",HICMOQty=" + omodel.HICMOQty.ToString() +
                ",HProcExchInterID=" + omodel.HProcExchInterID.ToString() +
                ",HProcExchEntryID=" + omodel.HProcExchEntryID.ToString() +
                ",HProcExchBillNo='" + omodel.HProcExchBillNo + "'" +
                ",HProcExchQty=" + omodel.HProcExchQty.ToString() +
                ",HSourceID=" + omodel.HSourceID.ToString() +
                ",HDeptID=" + omodel.HDeptID.ToString() +
                ",HMaterID=" + omodel.HMaterID.ToString() +
                ",HUnitID=" + omodel.HUnitID.ToString() +
                ",HProcID=" + omodel.HProcID.ToString() +
                ",HBatchNo='" + omodel.HBatchNo + "'" +
                ",HCheckEmp=" + omodel.HCheckEmp.ToString() +
                ",HGroupID=" + omodel.HGroupID.ToString() +
                ",HShiftsID=" + omodel.HShiftsID.ToString() +
                ",HQty=" + omodel.HQty.ToString() +
                ",HSourceOrgID=" + omodel.HSourceOrgID.ToString() +
                ",HInspectOrgID=" + omodel.HInspectOrgID.ToString() +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                //DeleteBillSub(lngBillKey);
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into QC_TakeSampleCheckBillMain " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
                ",HYear,HPeriod,HRemark" +
                ",HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
                ",HProcExchBillNo,HProcExchQty,HDeptID,HMaterID,HUnitID,HBatchNo,HCheckEmp,HProcID" +
                ",HGroupID,HShiftsID,HQty,HSourceOrgID,HInspectOrgID" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",getdate(),'" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
                ",'" + omodel.HSourceID.ToString() + "','" + omodel.HICMOInterID.ToString() + "','" + omodel.HICMOEntryID.ToString() + "','" + omodel.HICMOBillNo.ToString() + "','" + omodel.HICMOQty.ToString() + "','" + omodel.HProcExchInterID.ToString() + "','" + omodel.HProcExchEntryID.ToString() +
                "','" + omodel.HProcExchBillNo + "','" + omodel.HProcExchQty.ToString() + "','" + omodel.HDeptID.ToString() + "','" + omodel.HMaterID.ToString() + "','" + omodel.HUnitID.ToString() + "','" + omodel.HBatchNo.ToString() +
                "','" + omodel.HCheckEmp.ToString() + "','" + omodel.HProcID.ToString() + "','" + omodel.HGroupID.ToString() + "','" + omodel.HShiftsID.ToString() + "','" + omodel.HQty.ToString() + "','" + omodel.HSourceOrgID.ToString() + "','" +omodel.HInspectOrgID.ToString()+
              "') ");
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //查询主表
                DataSet Ds ;
                Ds = oCn.RunProcReturn("Select * from QC_TakeSampleCheckBillMain Where HInterID=" + lngBillKey.ToString(), "QC_TakeSampleCheckBillMain");
                if(Ds.Tables[0].Rows.Count==0)
                {
                    sReturn = "单据未找到!";
                    return false;
                }
                //固定赋值===========================================
                omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
                omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
                omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
                omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]);
                omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]);
                omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim();
                omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
                omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim();
                omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim();
                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
                omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim();
                omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim();
                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
                //========================================================
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
    }
}
Model/Model.csproj
@@ -138,6 +138,8 @@
    <Compile Include="CRM\ClsSec_ProductRepairBillMain.cs" />
    <Compile Include="CRM\ClsSec_ProductRepairBillSub.cs" />
    <Compile Include="CRM\ClsSec_ProductRepairBillSub1.cs" />
    <Compile Include="质检管理\ClsQC_TakeSampleCheckBillMain.cs" />
    <Compile Include="质检管理\ClsQC_TakeSampleCheckBillSub.cs" />
    <Compile Include="MES\ClsSc_SourceLineRepairBillSub_Mater.cs" />
    <Compile Include="MES\ClsSc_SourceLineRepairBillSub.cs" />
    <Compile Include="MES\ClsSc_SourceLineRepairBillMain.cs" />
@@ -476,6 +478,8 @@
    <Compile Include="工资管理\ClsHR_EmpEngageRequestBillSub.cs" />
    <Compile Include="工资管理\ClsHR_EmployeeSkillBillMain.cs" />
    <Compile Include="工资管理\ClsHR_EmployeeSkillBillSub.cs" />
    <Compile Include="工资管理\ClsHR_EmployeeSkillExamBillMain.cs" />
    <Compile Include="工资管理\ClsHR_EmployeeSkillExamBillSub.cs" />
    <Compile Include="工资管理\ClsPay_CarOutApplyBillMain.cs" />
    <Compile Include="工资管理\ClsPay_CarOutApplyBillSub.cs" />
    <Compile Include="工资管理\ClsPay_EmpInitChangeBillMain.cs" />
@@ -655,6 +659,8 @@
    <Compile Include="系统公用\ClsXt_SystemParameter_Model.cs" />
    <Compile Include="计划管理\ClsGy_MaterialTechParamBillSub.cs" />
    <Compile Include="计划管理\ClsGy_MaterialTechParamBillMain.cs" />
    <Compile Include="质检管理\ClsQC_BackSampleCheckBillMain.cs" />
    <Compile Include="质检管理\ClsQC_BackSampleCheckBillSub.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBillMain.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBillSub.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBillSub_ValueGrid.cs" />
Model/¹¤×ʹÜÀí/ClsHR_EmployeeSkillExamBillMain.cs
New file
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsHR_EmployeeSkillExamBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HDeptID;//        éƒ¨é—¨
        public Int64 HGroupID;//    ç”Ÿäº§ç­ç»„
        public Int64 HCheckEmpID;    //评定人
        public Int64 HMaterID;//    äº§å“ç¼–码
        public Int64 HProcID;//        å·¥åº
        public Int64 HSourceID;//        ç”Ÿäº§èµ„源
        public Int64 HOrgID;//        ç»„织
    }
}
Model/¹¤×ʹÜÀí/ClsHR_EmployeeSkillExamBillSub.cs
New file
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsHR_EmployeeSkillExamBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HEmpID;//    è€ƒè¯•人
        public decimal HLowMark;//   æœ€ä½Žè¦æ±‚分数
        public decimal HMark;//   åˆ†æ•°
    }
}
Model/Öʼì¹ÜÀí/ClsQC_BackSampleCheckBillMain.cs
New file
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_BackSampleCheckBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public int HDeptID ;       // éƒ¨é—¨(Gy_Department)
        public int HEmp;      // è¿˜æ ·å‘˜
        public int HProcID; // å·¥åº
        public int HSourceOrgID;    //来源组织
        public int HInspectOrgID;   //质检组织
    }
}
Model/Öʼì¹ÜÀí/ClsQC_BackSampleCheckBillSub.cs
New file
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_BackSampleCheckBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HICMOInterID;
        public Int64 HICMOEntryID;
        public String HICMOBillNo;
        public Int64 HICMOQty;
        public Int64 HProcExchInterID;
        public Int64 HProcExchEntryID;
        public String HProcExchBillNo;
        public Double HProcExchQty;
        public Int64 HMaterID;
        public Int64 HUnitID;
        public Double HQty;
        public String HBatchNo;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_TakeSampleCheckBillMain.cs
New file
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_TakeSampleCheckBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HSourceID;
        public Int64 HICMOInterID;
        public Int64 HICMOEntryID;
        public String HICMOBillNo;
        public Int64 HICMOQty;
        public Int64 HProcExchInterID;
        public Int64 HProcExchEntryID;
        public String HProcExchBillNo;
        public Double HProcExchQty;
        public Int64 HDeptID;
        public Int64 HMaterID;
        public Int64 HUnitID;
        public String HBatchNo;
        public Int64 HCheckEmp;
        public Int64 HProcID;
        public Int64 HGroupID;
        public Int64 HShiftsID;
        public Double HQty;
        public Int64 HSourceOrgID;
        public Int64 HInspectOrgID;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_TakeSampleCheckBillSub.cs
New file
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_TakeSampleCheckBillSub : DBUtility.ClsXt_BaseBillSub
    {
    }
}
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -3752,6 +3752,11 @@
                    {
                        omodel.OA_ErrMsgBackBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //是否发送钉钉消息  æœ¬åœ°ä¸å‘,(斯莫尔)客户发
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "OA_ErrMsgBackBill_SendDingDingMsg")
                    {
                        omodel.OA_ErrMsgBackBill_SendDingDingMsg = 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
@@ -591,6 +591,7 @@
        public string OA_ErrMsgBackBill_AutoCheck;                      //保存后是否自动审核
        public string OA_ErrMsgBackBill_SaveAutoAddnew;               //保存后变为新增状态
        public string OA_ErrMsgBackBill_DeleterAndMakerMustSame;      //删除人必须是制单人
        public string OA_ErrMsgBackBill_SendDingDingMsg;               //保存时,发送钉钉消息 (N æœ¬åœ°,Y æ–¯èޫ尔)
        //报工台工序汇报
        public string Sc_MESProceReportWorkBill_AutoCheck; //保存后是否自动审核
        public string Sc_MESProceReportWorkBill_SaveAutoAddnew;               //保存后变为新增状态
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -1465,6 +1465,46 @@
        #endregion
        #region  æŠ¥å·¥å¹³å°æ£€éªŒå–样单弹窗查找数据
        [Route("Sc_MESBeginWorkBill/GetQC_TakeSampleCheckBill")]
        [HttpGet]
        public object GetQC_TakeSampleCheckBill(string HSourceInterID, string HSourceEntryID, string HSourceBillNo, string HSourceBillType)
        {
            try
            {
                //根据选择资源ID获取当前生产工单、责任人
                ds = oCN.RunProcReturn("exec h_p_GetQC_TakeSampleCheckBill @HSourceInterID=" + HSourceInterID + ",@HSourceEntryID=" + HSourceEntryID + ",@HSourceBillNo='" + HSourceBillNo + "',@HSourceBillType='" + HSourceBillType + "'", "h_p_GetQC_TakeSampleCheckBill");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取资源绑定数据成功!";
                    objJsonResult.data = ds;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "暂无资源绑定!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
    }
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -6623,13 +6623,27 @@
        /// <returns></returns>
        public async Task<object> SendDingDingAsync(string HSendMan, int HHandleEmpID,string HDescription,string HCopyMan)
        {
            string concatenatedNames = "";
            string appKey = "";
            string appSecret = "";
            string sReturn = "";
            Cls_DDMsg msg = new Cls_DDMsg();
            string appKey = "dingrsrzhdyn3mlaof95";
            string appSecret = "RAqH6YtZnPLCpDbuqfaYQkKkVtVdS0wqfC8I26X6qiS-8eoCJCNrzx3fubGND4Sq";
            //斯莫尔
            //string appKey = "dingkdddbhdcssk7jduw";
            //string appSecret = "iv07c-GLfJPnzfJaNAAOfJDl3Z-eODvDAhlInMZCZhGorkle5Evbaxx3ImylvdjQ";
            if (oSystemParameter.ShowBill(ref sReturn) == true)
            {
                //系统参数是否为私有云模式,N为本地,Y为斯莫尔
                if (oSystemParameter.omodel.OA_ErrMsgBackBill_SendDingDingMsg == "N")
                {
                     appKey = "dingrsrzhdyn3mlaof95";
                     appSecret = "RAqH6YtZnPLCpDbuqfaYQkKkVtVdS0wqfC8I26X6qiS-8eoCJCNrzx3fubGND4Sq";
                }
                else
                {
                     appKey = "dingkdddbhdcssk7jduw";
                     appSecret = "iv07c-GLfJPnzfJaNAAOfJDl3Z-eODvDAhlInMZCZhGorkle5Evbaxx3ImylvdjQ";
                }
            }
            if (HHandleEmpID==0) //异常反馈验收单保存  å°†æ¶ˆæ¯ å‘送给 æŽ¥æ”¶äººï¼ŒæŒ‡æ´¾å¤„理人,全部抄送人 
            {
                string HReceiveMan = HSendMan;
WebAPI/Controllers/Æ·ÖʹÜÀí/¼ìÑéÈ¡Ñù»¹Ñùµ¥/QC_TakeSampleCheckBillController.cs
New file
@@ -0,0 +1,1857 @@
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 QC_TakeSampleCheckBillController : ApiController
    {
        //检验取样单
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        public DAL.ClsQC_TakeSampleCheckBill BillOld = new DAL.ClsQC_TakeSampleCheckBill();
        public DAL.ClsQC_TakeSampleCheckBill BillNew0 = new DAL.ClsQC_TakeSampleCheckBill();
        public DAL.ClsQC_BackSampleCheckBill BillOld1 = new DAL.ClsQC_BackSampleCheckBill();//还样
        public DAL.ClsQC_BackSampleCheckBill BillNew1 = new DAL.ClsQC_BackSampleCheckBill();//还样
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region æ£€éªŒå–样单列表 æŸ¥è¯¢
        [Route("QC_TakeSampleCheckBill/QC_TakeSampleCheckBillMainList")]
        [HttpGet]
        public object QC_TakeSampleCheckBillMainList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("QC_TakeSampleCheckBillMain_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_QC_TakeSampleCheckBillList order by å•据号 desc", "h_v_QC_TakeSampleCheckBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_QC_TakeSampleCheckBillList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_QC_TakeSampleCheckBillList");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region æ£€éªŒå–样单保存 æ–°å¢ž/编辑
        [Route("QC_TakeSampleCheckBill/SaveQC_TakeSampleCheckBillMain")]
        [HttpPost]
        public object SaveQC_TakeSampleCheckBillMain([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string refSav = sArray[1].ToString();//操作方式数据类型 1添加 3修改 2 å¤åˆ¶
            string msg4 = sArray[2].ToString();//用户名
            DBUtility.ClsPub.CurUserName = msg4;
            string UserName = "";
            string s = "";
            ListModels oListModels = new ListModels();
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("QC_TakeSampleCheckBillMain_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsQC_TakeSampleCheckBill oBill = new DAL.ClsQC_TakeSampleCheckBill();
                List<Model.ClsQC_TakeSampleCheckBillMain> lsmain = new List<Model.ClsQC_TakeSampleCheckBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_QC_TakeSampleCheckBillMain(msg2);
                foreach (Model.ClsQC_TakeSampleCheckBillMain oItem in lsmain)
                {
                    if (refSav == "Add")
                    {
                        //单据号是否重复
                        if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据号重复!不允许保存!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    if (refSav == "Update")
                    {
                        if (BillOld.ShowBill(oItem.HInterID, ref s) == false)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据有误!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //判断是否可编辑
                        if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据已经被审核,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (BillOld.omodel.HBillStatus > 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据处于不可编辑状态,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = s + ",不允许修改";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "7521";
                    oItem.HBillSubType = "7521";
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有单据日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (refSav == "Add")
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else if (refSav == "Update")
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = false;
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒå–样单 ç¼–辑页面初始化
        [Route("QC_TakeSampleCheckBill/QC_TakeSampleCheckBillMainEditList")]
        [HttpGet]
        public object QC_TakeSampleCheckBillMainEditList(long HInterID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_QC_TakeSampleCheckBillEdit where hmainid='" + HInterID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_QC_TakeSampleCheckBillEdit");
                //添加列名
                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 ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒå–样单 åˆ é™¤
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("QC_TakeSampleCheckBill/DeleteQC_TakeSampleCheckBillMain")]
        [HttpGet]
        public object DeleteQC_TakeSampleCheckBillMain(string HInterID, string user)
        {
            try
            {
                string s = "";
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("QC_TakeSampleCheckBillMain_Delete", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID == null || HInterID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可删除
                if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否是创建状态进行删除
                if (int.Parse(BillOld.omodel.HBillStatus.ToString()) <= 1)
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    //删除前控制=========================================
                    string sql1 = "exec h_p_QC_TakeSampleCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_TakeSampleCheckBill_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    oCN.BeginTran();
                    oCN.RunProc("delete from QC_TakeSampleCheckBillMain where HInterID = " + HInterID);
                    oCN.RunProc("delete from QC_TakeSampleCheckBillSub where HInterID= " + HInterID);
                    //删除后控制==================================================================================
                    string sql2 = "exec h_p_QC_TakeSampleCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_QC_TakeSampleCheckBill_AfterDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        s = "删除后判断失败,请与网络管理人员联系";
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + s;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        s = ds.Tables[0].Rows[0]["HRemark"].ToString();
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + s;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==============================================================================================
                    oCN.Commit();
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据不是创建状态,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒå–样单 å®¡æ ¸/反审核
        [Route("QC_TakeSampleCheckBill/AuditQC_TakeSampleCheckBillMain")]
        [HttpGet]
        public object AuditQC_TakeSampleCheckBillMain(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "QC_TakeSampleCheckBillMain_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsQC_TakeSampleCheckBill oBill = new DAL.ClsQC_TakeSampleCheckBill();                              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的审核/反审核操作
                if (IsAudit == 0) //审核提交
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    oCN.BeginTran();
                    //记录返回信息
                    string msg = "";
                    //审核前控制=========================================
                    string sql1 = "exec h_p_QC_TakeSampleCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_TakeSampleCheckBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID,oBill.omodel.HBillNo, "h_p_QC_TakeSampleCheckBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!" + msg;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_QC_TakeSampleCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_TakeSampleCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_TakeSampleCheckBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒå–样单 å…³é—­/反关闭
        [Route("QC_TakeSampleCheckBill/CloseQC_TakeSampleCheckBill")]
        [HttpGet]
        public object CloseQC_TakeSampleCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "QC_TakeSampleCheckBillMain_Close";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "关闭失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsQC_TakeSampleCheckBill oBill = new DAL.ClsQC_TakeSampleCheckBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据未审核!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "关闭失败或者反关闭失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒå–样单 ä½œåºŸ/反作废
        [Route("QC_TakeSampleCheckBill/DeleteQC_TakeSampleCheckBill")]
        [HttpGet]
        public object DeleteQC_TakeSampleCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "QC_TakeSampleCheckBillMain_Drop";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "作废失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsQC_TakeSampleCheckBill oBill = new DAL.ClsQC_TakeSampleCheckBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HChecker.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能进行作废!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未作废!不需要反作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的作废/反作废操作
                if (IsAudit == 0) //作废提交
                {
                    //作废提交
                    if (oBill.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "作废失败或者反作废失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è¿˜æ ·èŽ·å–å–æ ·å•æ•°æ®
        [Route("QC_TakeSampleCheckBill/Get_BackSample")]
        [HttpGet]
        public object Get_BackSample(string HInterID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select * from h_v_QC_TakeSampleCheckBillEdit where hmainid='"+ HInterID + "' order by å•据号 desc", "h_v_QC_TakeSampleCheckBillList");
                //添加列名
                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;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å•列表 æŸ¥è¯¢
        [Route("QC_TakeSampleCheckBill/QC_BackSampleCheckBillMainList")]
        [HttpGet]
        public object QC_BackSampleCheckBillMainList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("QC_BackSampleCheckBillMain_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_QC_BackSampleCheckBillList order by å•据号 desc", "h_v_QC_BackSampleCheckBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_QC_BackSampleCheckBillList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_QC_BackSampleCheckBillList");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å•保存 æ–°å¢ž/编辑
        [Route("QC_TakeSampleCheckBill/SaveQC_BackSampleCheckBillMain")]
        [HttpPost]
        public object SaveQC_BackSampleCheckBillMain([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString(); //子表
            string refSav = sArray[2].ToString();//操作方式数据类型 1添加 3修改 2 å¤åˆ¶
            string msg4 = sArray[3].ToString();//用户名
            DBUtility.ClsPub.CurUserName = msg4;
            string UserName = "";
            string s = "";
            ListModels oListModels = new ListModels();
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("QC_BackSampleCheckBillMain_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsQC_BackSampleCheckBill oBill = new DAL.ClsQC_BackSampleCheckBill();
                List<Model.ClsQC_BackSampleCheckBillMain> lsmain = new List<Model.ClsQC_BackSampleCheckBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_QC_BackSampleCheckBillMain(msg2);
                foreach (Model.ClsQC_BackSampleCheckBillMain oItem in lsmain)
                {
                    if (refSav == "Add")
                    {
                        //单据号是否重复
                        if (BillNew1.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据号重复!不允许保存!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    if (refSav == "Update")
                    {
                        if (BillOld1.ShowBill(oItem.HInterID, ref s) == false)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据有误!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //判断是否可编辑
                        if (BillOld1.omodel.HChecker != "" && BillOld1.omodel.HChecker != null)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据已经被审核,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (BillOld1.omodel.HBillStatus > 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据处于不可编辑状态,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld1, ref s))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = s + ",不允许修改";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "7522";
                    oItem.HBillSubType = "7522";
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有单据日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                // è¡¨ä½“数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Model.ClsQC_BackSampleCheckBillSub> ls = new List<Model.ClsQC_BackSampleCheckBillSub>();
                ls = oListModels.getObjectByJson_QC_TakeSampleCheckBillSub(msg3);
                int i = 0;
                foreach (Model.ClsQC_BackSampleCheckBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    oBill.DetailColl.Add(oItemSub);
                }
                //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (refSav == "Add")
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else if (refSav == "Update")
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = false;
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å• ç¼–辑页面初始化
        [Route("QC_TakeSampleCheckBill/QC_BackSampleCheckBillMainEditList")]
        [HttpGet]
        public object QC_BackSampleCheckBillMainEditList(long HInterID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_QC_BackSampleCheckBillEdit where hmainid='" + HInterID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_QC_BackSampleCheckBillEdit");
                //添加列名
                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 ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å• åˆ é™¤
        [Route("QC_TakeSampleCheckBill/DeleteQC_BackSampleCheckBillMain")]
        [HttpGet]
        public object DeleteQC_BackSampleCheckBillMain(string HInterID, string user)
        {
            try
            {
                string s = "";
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("QC_BackSampleCheckBillMain_Delete", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID == null || HInterID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可删除
                if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否是创建状态进行删除
                if (int.Parse(BillOld.omodel.HBillStatus.ToString()) <= 1)
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    //删除前控制=========================================
                    string sql1 = "exec h_p_QC_BackSampleCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_BackSampleCheckBill_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    oCN.BeginTran();
                    oCN.RunProc("delete from QC_BackSampleCheckBillMain where HInterID = " + HInterID);
                    oCN.RunProc("delete from QC_BackSampleCheckBillSub where HInterID= " + HInterID);
                    //删除后控制==================================================================================
                    string sql2 = "exec h_p_QC_BackSampleCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_QC_BackSampleCheckBill_AfterDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        s = "删除后判断失败,请与网络管理人员联系";
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + s;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        s = ds.Tables[0].Rows[0]["HRemark"].ToString();
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + s;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==============================================================================================
                    oCN.Commit();
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据不是创建状态,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å• å®¡æ ¸/反审核
        [Route("QC_TakeSampleCheckBill/AuditQC_BackSampleCheckBillMain")]
        [HttpGet]
        public object AuditQC_BackSampleCheckBillMain(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "QC_BackSampleCheckBillMain_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsQC_BackSampleCheckBill oBill = new DAL.ClsQC_BackSampleCheckBill();                              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的审核/反审核操作
                if (IsAudit == 0) //审核提交
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    oCN.BeginTran();
                    //记录返回信息
                    string msg = "";
                    //审核前控制=========================================
                    string sql1 = "exec h_p_QC_BackSampleCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_BackSampleCheckBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_BackSampleCheckBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!" + msg;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_QC_BackSampleCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_BackSampleCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_BackSampleCheckBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å• å…³é—­/反关闭
        [Route("QC_TakeSampleCheckBill/CloseQC_BackSampleCheckBill")]
        [HttpGet]
        public object CloseQC_BackSampleCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "QC_BackSampleCheckBillMain_Close";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "关闭失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsQC_BackSampleCheckBill oBill = new DAL.ClsQC_BackSampleCheckBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据未审核!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "关闭失败或者反关闭失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å• ä½œåºŸ/反作废
        [Route("QC_TakeSampleCheckBill/DeleteQC_BackSampleCheckBill")]
        [HttpGet]
        public object DeleteQC_BackSampleCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "QC_BackSampleCheckBillMain_Drop";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "作废失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsQC_BackSampleCheckBill oBill = new DAL.ClsQC_BackSampleCheckBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HChecker.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能进行作废!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未作废!不需要反作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的作废/反作废操作
                if (IsAudit == 0) //作废提交
                {
                    //作废提交
                    if (oBill.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "作废失败或者反作废失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/¹¤×ʹÜÀí/HR_EmployeeSkillExamBillController.cs
New file
@@ -0,0 +1,827 @@
using DAL;
using DBUtility;
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI;
using WebAPI.Models;
using WebAPI.Service;
namespace WebAPI.Controllers.工资管理
{
    public class HR_EmployeeSkillExamBillController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        DataSet ds;
        public DAL.ClsHR_EmployeeSkillExamBill oBill = new DAL.ClsHR_EmployeeSkillExamBill();
        public DAL.ClsHR_EmployeeSkillExamBill BillNew = new DAL.ClsHR_EmployeeSkillExamBill();   //对应单据类
        public DAL.ClsHR_EmployeeSkillExamBill BillOld = new DAL.ClsHR_EmployeeSkillExamBill();   //对应单据类
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        #region äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单列表
        /// <summary>
        /// èŽ·å–äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•å•åˆ—è¡¨ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("HR_EmployeeSkillExamBill/GetHR_EmployeeSkillExamBillList")]
        [HttpGet]
        public object GetHR_EmployeeSkillExamBillList(string sWhere, string user)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("HR_EmployeeSkillExamBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //返回列表信息
                ds = oCn.RunProcReturn("select * from h_v_HR_EmployeeSkillExamBillList where 1=1 " + sWhere + " order by hmainid desc", "h_v_HR_EmployeeSkillExamBillList");
                List<object> columnNameList = new List<object>();
                //添加列名
                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 = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询列表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单编辑
        /// <summary>
        /// äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单编辑时,根据单据ID获取单据信息
        /// </summary>
        /// <returns></returns>
        [Route("HR_EmployeeSkillExamBill/HR_EmployeeSkillExamBill_Edit")]
        [HttpGet]
        public object HR_EmployeeSkillExamBill_Edit(Int64 HInterID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("HR_EmployeeSkillExamBill_Query", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块编辑权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //返回列表信息
                ds = oCn.RunProcReturn("select * from h_v_HR_EmployeeSkillExamBill_Edit where 1=1 and hmainid=" + HInterID + " order by hmainid desc", "h_v_HR_EmployeeSkillExamBill_Edit");
                //添加列名
                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)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到人员技能考核记录单信息,请刷新数据后重新选择!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回人员技能考核记录单信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单 æ–°å¢ž/编辑
        [Route("HR_EmployeeSkillExamBill/SaveHR_EmployeeSkillExamBill")]
        [HttpPost]
        public object SaveHR_EmployeeSkillExamBill([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString(); //子表
            string refSav = sArray[2].ToString();//操作方式数据类型 1添加 3修改 2 å¤åˆ¶
            string msg4 = sArray[3].ToString();//用户名
            DBUtility.ClsPub.CurUserName = msg4;
            string UserName = "";
            string s = "";
            ListModels oListModels = new ListModels();
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("HR_EmployeeSkillExamBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsHR_EmployeeSkillExamBill oBill = new DAL.ClsHR_EmployeeSkillExamBill();
                List<Model.ClsHR_EmployeeSkillExamBillMain> lsmain = new List<Model.ClsHR_EmployeeSkillExamBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_HR_EmployeeSkillExamBillMain(msg2);
                foreach (Model.ClsHR_EmployeeSkillExamBillMain oItem in lsmain)
                {
                    if (refSav == "Add")
                    {
                        //单据号是否重复
                        if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据号重复!不允许保存!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    if (refSav == "Update")
                    {
                        if (BillOld.ShowBill(oItem.HInterID, ref s) == false)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据有误!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //判断是否可编辑
                        if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据已经被审核,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (BillOld.omodel.HBillStatus > 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据处于不可编辑状态,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = s + ",不允许修改";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "2332";
                    oItem.HBillSubType = "2332";
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有单据日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                // è¡¨ä½“数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Model.ClsHR_EmployeeSkillExamBillSub> ls = new List<Model.ClsHR_EmployeeSkillExamBillSub>();
                ls = oListModels.getObjectByJson_HR_EmployeeSkillExamBillSub(msg3);
                int i = 0;
                foreach (Model.ClsHR_EmployeeSkillExamBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (refSav == "Add")
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else if (refSav == "Update")
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = false;
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
        #region äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单删除
        /// <summary>
        /// åˆ é™¤äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单
        /// </summary>
        /// <returns></returns>
        [Route("HR_EmployeeSkillExamBill/DeleteHR_EmployeeSkillExamBill")]
        [HttpGet]
        public object DeleteHR_PostSkillBill(Int64 HInterID, string user)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("HR_EmployeeSkillExamBill_Delete", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块删除功能权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断存在性
                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    //删除前控制=========================================
                    string sql1 = "exec h_p_HR_EmployeeSkillExamBill_BeforeDelCtrl  " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCn.RunProcReturn(sql1, "h_p_HR_EmployeeSkillExamBill_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //删除单据(包含删除后控制、写入日志)
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_HR_EmployeeSkillExamBill_AfterDelCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到该岗位技能清单,请刷新数据后重新选择!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单审核/反审核
        /// <summary>
        /// å®¡æ ¸/反审人员技能考核记录单
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="Type">审核(1),反审核(2)</param>
        /// <param name="HMaker">审核人</param>
        /// <returns></returns>
        [Route("HR_EmployeeSkillExamBill/AuditHR_EmployeeSkillExamBill")]
        [HttpGet]
        public object AuditHR_EmployeeSkillExamBill(Int64 HInterID, int IsAudit, string user)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("HR_EmployeeSkillExamBill_Check", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块审核/反审核功能权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsHR_EmployeeSkillExamBill oBill = new DAL.ClsHR_EmployeeSkillExamBill();                              //实例化单据操作类,用于进行相关操作
                //判断存在性
                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                    if (IsAudit == 1)
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核,不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (IsAudit == 1)  //审核判断
                        {
                            if (oBill.omodel.HChecker.Trim() != "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "单据已审核!不能再次审核!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                        if (IsAudit == 2) //反审核判断
                        {
                            if (oBill.omodel.HChecker.Trim() == "")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "单据未审核!不需要反审核!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                        //审核前控制=========================================
                        string sql1 = "exec h_p_HR_EmployeeSkillExamBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                        ds = oCn.RunProcReturn(sql1, "h_p_HR_EmployeeSkillExamBill_BeforeCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                            objJsonResult.data = null;
                            oCn.RollBack();
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCn.RollBack();
                            return objJsonResult;
                        }
                        //==================================================================================
                        //审核单据
                        if (!oBill.CheckBill(HInterID, oBill.omodel.HBillNo, "h_p_HR_EmployeeSkillExamBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "单据号:" + oBill.omodel.HBillNo + " å®¡æ ¸æˆåŠŸï¼";
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                    }
                    else
                    {
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核,不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反审核前控制=========================================
                        string sql1 = "exec h_p_HR_EmployeeSkillExamBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                        ds = oCn.RunProcReturn(sql1, "h_p_HR_EmployeeSkillExamBill_BeforeUnCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //===========================================================
                        //反审核单据
                        if (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_HR_EmployeeSkillExamBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反审核失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "单据号:" + oBill.omodel.HBillNo + " åå®¡æ ¸æˆåŠŸï¼";
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到人员技能考核记录单信息,请刷新数据后重新选择!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核或反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单关闭/反关闭
        /// <summary>
        /// å…³é—­/反关闭人员技能考核记录单
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="Type">关闭(1),反关闭(2)</param>
        /// <param name="HMaker">关闭人</param>
        /// <returns></returns>
        [Route("HR_EmployeeSkillExamBill/CloseHR_EmployeeSkillExamBill")]
        [HttpGet]
        public object CloseHR_EmployeeSkillExamBill(Int64 HInterID, int Type, string user)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("HR_EmployeeSkillExamBill_Close", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块关闭/反关闭功能权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断存在性
                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    //Type 1 å…³é—­  2  åå…³é—­
                    if (Type == 1)
                    {
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不能进行关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭,不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //关闭单据
                        if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "关闭失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "关闭成功!";
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                    }
                    else
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未关闭,不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反关闭单据
                        if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反关闭失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反关闭成功!";
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到人员技能考核记录单信息,请刷新数据后重新选择!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "关闭或反关闭失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region äººå‘˜æŠ€èƒ½è€ƒæ ¸è®°å½•单作废/反作废
        /// <summary>
        /// ä½œåºŸ/反作废人员技能考核记录单
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="Type">作废(1),反作废(2)</param>
        /// <param name="HMaker">作废人</param>
        /// <returns></returns>
        [Route("HR_EmployeeSkillExamBill/DropHR_EmployeeSkillExamBill")]
        [HttpGet]
        public object DropHR_EmployeeSkillExamBill(Int64 HInterID, int Type, string user)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("HR_EmployeeSkillExamBill_Drop", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块作废/反作废功能权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //判断存在性
                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    //Type 1 ä½œåºŸ  2  åä½œåºŸ
                    if (Type == 1)
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能进行作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //作废单据
                        if (!oBill.Cancelltion(HInterID, oBill.omodel.HBillNo, user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "作废失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = " ä½œåºŸæˆåŠŸï¼";
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                    }
                    else
                    {
                        if (oBill.omodel.HDeleteMan.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未作废,不需要反作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反作废单据
                        if (!oBill.AbandonCancelltion(HInterID, oBill.omodel.HBillNo, user, ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反作废失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = " åä½œåºŸæˆåŠŸï¼";
                            objJsonResult.data = null;
                            return objJsonResult; ;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到该岗位技能清单,请刷新数据后重新选择!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "作废或反作废失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/ListModels.cs
@@ -1302,6 +1302,30 @@
        }
        /// <summary>
        /// å¤„理人员技能考核记录单主表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsHR_EmployeeSkillExamBillMain> getObjectByJson_HR_EmployeeSkillExamBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsHR_EmployeeSkillExamBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_EmployeeSkillExamBillMain>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理人员技能考核记录单子表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsHR_EmployeeSkillExamBillSub> getObjectByJson_HR_EmployeeSkillExamBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsHR_EmployeeSkillExamBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_EmployeeSkillExamBillSub>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理安灯逐级呼吸规则主表的json
        /// </summary>
        /// <param name="jsonString"></param>
@@ -3329,6 +3353,41 @@
            return list;
        }
        /// <summary>
        /// æŠ¥å·¥å¹³å°æ£€éªŒå–样主表json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsQC_TakeSampleCheckBillMain> getObjectByJson_QC_TakeSampleCheckBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsQC_TakeSampleCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_TakeSampleCheckBillMain>>(jsonString);
            return list;
        }
        /// <summary>
        /// æŠ¥å·¥å¹³å°æ£€éªŒè¿˜æ ·ä¸»è¡¨json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsQC_BackSampleCheckBillMain> getObjectByJson_QC_BackSampleCheckBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsQC_BackSampleCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_BackSampleCheckBillMain>>(jsonString);
            return list;
        }
        /// <summary>
        /// æŠ¥å·¥å¹³å°æ£€éªŒè¿˜æ ·ä¸»è¡¨json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsQC_BackSampleCheckBillSub> getObjectByJson_QC_TakeSampleCheckBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsQC_BackSampleCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_BackSampleCheckBillSub>>(jsonString);
            return list;
        }
        /// <summary>
        /// æŠ¥å·¥å¹³å°æ–°å¢žä¸Šæ–™é˜²é”™å•子表(配料)的json
WebAPI/Properties/PublishProfiles/FolderProfile14.pubxml
New file
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <PublishProvider>FileSystem</PublishProvider>
    <PublishUrl>D:\网站发布\智云MESWMS\API</PublishUrl>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <SiteUrlToLaunchAfterPublish />
  </PropertyGroup>
</Project>
WebAPI/Properties/PublishProfiles/FolderProfile14.pubxml.user
New file
@@ -0,0 +1,459 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <_PublishTargetUrl>D:\网站发布\智云MESWMS\API</_PublishTargetUrl>
    <History>True|2024-07-10T05:44:55.6004881Z;True|2024-07-10T11:06:41.4657993+08:00;True|2024-07-10T11:06:14.2046277+08:00;True|2024-07-09T17:00:11.3098766+08:00;True|2024-07-09T16:52:34.1330415+08:00;True|2024-07-09T16:41:08.5428012+08:00;True|2024-07-09T16:38:45.6135989+08:00;True|2024-07-09T16:37:08.4743511+08:00;True|2024-07-09T15:41:15.0233394+08:00;True|2024-07-09T14:44:03.0473735+08:00;True|2024-07-09T14:34:31.6590139+08:00;True|2024-07-09T10:38:29.2075409+08:00;True|2024-07-08T15:39:48.6830620+08:00;True|2024-07-08T15:38:36.2214537+08:00;True|2024-07-08T15:35:34.5004806+08:00;True|2024-07-08T15:26:55.4570540+08:00;True|2024-07-08T12:07:22.9712713+08:00;</History>
  </PropertyGroup>
  <ItemGroup>
    <File Include="apiapp.json">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="bin/Aliyun.Credentials.dll">
      <publishTime>12/05/2022 15:40:12</publishTime>
    </File>
    <File Include="bin/Antlr3.Runtime.dll">
      <publishTime>02/22/2013 16:43:40</publishTime>
    </File>
    <File Include="bin/Antlr3.Runtime.pdb">
      <publishTime>02/22/2013 16:43:40</publishTime>
    </File>
    <File Include="bin/BLL.dll">
      <publishTime>07/10/2024 13:44:33</publishTime>
    </File>
    <File Include="bin/BLL.pdb">
      <publishTime>07/10/2024 13:44:33</publishTime>
    </File>
    <File Include="bin/BouncyCastle.Crypto.dll">
      <publishTime>12/18/2020 05:32:28</publishTime>
    </File>
    <File Include="bin/DAL.dll">
      <publishTime>07/10/2024 13:44:31</publishTime>
    </File>
    <File Include="bin/DAL.pdb">
      <publishTime>07/10/2024 13:44:31</publishTime>
    </File>
    <File Include="bin/Dapper.dll">
      <publishTime>07/22/2016 22:52:40</publishTime>
    </File>
    <File Include="bin/DBUtility.dll">
      <publishTime>07/10/2024 13:44:29</publishTime>
    </File>
    <File Include="bin/DBUtility.pdb">
      <publishTime>07/10/2024 13:44:29</publishTime>
    </File>
    <File Include="bin/Grpc.Core.Api.dll">
      <publishTime>03/22/2022 13:17:26</publishTime>
    </File>
    <File Include="bin/Grpc.Core.Api.pdb">
      <publishTime>03/19/2022 07:39:42</publishTime>
    </File>
    <File Include="bin/Grpc.Core.dll">
      <publishTime>03/22/2022 13:17:20</publishTime>
    </File>
    <File Include="bin/Grpc.Core.pdb">
      <publishTime>03/19/2022 07:39:48</publishTime>
    </File>
    <File Include="bin/grpc_csharp_ext.x64.dll">
      <publishTime>03/22/2022 13:17:22</publishTime>
    </File>
    <File Include="bin/grpc_csharp_ext.x86.dll">
      <publishTime>03/22/2022 13:17:22</publishTime>
    </File>
    <File Include="bin/ICSharpCode.SharpZipLib.dll">
      <publishTime>05/09/2021 01:08:30</publishTime>
    </File>
    <File Include="bin/ICSharpCode.SharpZipLib.pdb">
      <publishTime>05/09/2021 01:08:30</publishTime>
    </File>
    <File Include="bin/Kingdee.BOS.WebApi.Client.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="bin/libgrpc_csharp_ext.x64.dylib">
      <publishTime>03/19/2022 07:38:44</publishTime>
    </File>
    <File Include="bin/libgrpc_csharp_ext.x64.so">
      <publishTime>03/19/2022 07:38:42</publishTime>
    </File>
    <File Include="bin/Microsoft.Azure.AppService.ApiApps.Service.dll">
      <publishTime>03/19/2015 01:02:50</publishTime>
    </File>
    <File Include="bin/Microsoft.CSharp.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/Microsoft.Web.Infrastructure.dll">
      <publishTime>07/25/2012 19:48:56</publishTime>
    </File>
    <File Include="bin/Model.dll">
      <publishTime>07/10/2024 13:44:29</publishTime>
    </File>
    <File Include="bin/Model.pdb">
      <publishTime>07/10/2024 13:44:29</publishTime>
    </File>
    <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="bin/Newtonsoft.Json.dll">
      <publishTime>09/07/2014 18:39:38</publishTime>
    </File>
    <File Include="bin/NPOI.dll">
      <publishTime>10/23/2021 09:07:54</publishTime>
    </File>
    <File Include="bin/NPOI.OOXML.dll">
      <publishTime>10/23/2021 09:07:56</publishTime>
    </File>
    <File Include="bin/NPOI.OOXML.pdb">
      <publishTime>10/23/2021 17:07:56</publishTime>
    </File>
    <File Include="bin/NPOI.OpenXml4Net.dll">
      <publishTime>10/23/2021 09:07:54</publishTime>
    </File>
    <File Include="bin/NPOI.OpenXml4Net.pdb">
      <publishTime>10/23/2021 17:07:54</publishTime>
    </File>
    <File Include="bin/NPOI.OpenXmlFormats.dll">
      <publishTime>10/23/2021 09:07:54</publishTime>
    </File>
    <File Include="bin/NPOI.OpenXmlFormats.pdb">
      <publishTime>10/23/2021 17:07:54</publishTime>
    </File>
    <File Include="bin/NPOI.pdb">
      <publishTime>10/23/2021 17:07:54</publishTime>
    </File>
    <File Include="bin/Pub_Class.dll">
      <publishTime>07/10/2024 13:44:27</publishTime>
    </File>
    <File Include="bin/Pub_Class.pdb">
      <publishTime>07/10/2024 13:44:27</publishTime>
    </File>
    <File Include="bin/Pub_Control.dll">
      <publishTime>07/10/2024 13:44:28</publishTime>
    </File>
    <File Include="bin/Pub_Control.pdb">
      <publishTime>07/10/2024 13:44:28</publishTime>
    </File>
    <File Include="bin/RestSharp.dll">
      <publishTime>08/31/2012 06:22:50</publishTime>
    </File>
    <File Include="bin/SQLHelper.dll">
      <publishTime>07/10/2024 13:44:28</publishTime>
    </File>
    <File Include="bin/SQLHelper.pdb">
      <publishTime>07/10/2024 13:44:28</publishTime>
    </File>
    <File Include="bin/Swashbuckle.Core.dll">
      <publishTime>02/16/2015 01:57:08</publishTime>
    </File>
    <File Include="bin/System.Buffers.dll">
      <publishTime>07/19/2017 18:01:28</publishTime>
    </File>
    <File Include="bin/System.ComponentModel.DataAnnotations.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Configuration.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Data.DataSetExtensions.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Data.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Drawing.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.EnterpriseServices.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.IdentityModel.Tokens.Jwt.dll">
      <publishTime>08/19/2014 18:03:34</publishTime>
    </File>
    <File Include="bin/System.Memory.dll">
      <publishTime>04/18/2019 00:24:34</publishTime>
    </File>
    <File Include="bin/System.Net.Http.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Net.Http.Extensions.dll">
      <publishTime>02/20/2015 04:10:46</publishTime>
    </File>
    <File Include="bin/System.Net.Http.Formatting.dll">
      <publishTime>11/28/2018 21:00:36</publishTime>
    </File>
    <File Include="bin/System.Net.Http.Primitives.dll">
      <publishTime>02/20/2015 04:10:46</publishTime>
    </File>
    <File Include="bin/System.Runtime.CompilerServices.Unsafe.dll">
      <publishTime>09/19/2018 03:38:10</publishTime>
    </File>
    <File Include="bin/System.Runtime.Serialization.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Web.ApplicationServices.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Web.Cors.dll">
      <publishTime>11/28/2018 20:58:44</publishTime>
    </File>
    <File Include="bin/System.Web.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Web.DynamicData.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Web.Entity.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Web.Extensions.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Web.Helpers.dll">
      <publishTime>01/28/2015 12:04:30</publishTime>
    </File>
    <File Include="bin/System.Web.Http.Cors.dll">
      <publishTime>11/28/2018 21:01:26</publishTime>
    </File>
    <File Include="bin/System.Web.Http.dll">
      <publishTime>11/28/2018 21:01:00</publishTime>
    </File>
    <File Include="bin/System.Web.Http.WebHost.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="bin/System.Web.Mvc.dll">
      <publishTime>01/28/2015 12:02:18</publishTime>
    </File>
    <File Include="bin/System.Web.Optimization.dll">
      <publishTime>02/11/2014 23:26:04</publishTime>
    </File>
    <File Include="bin/System.Web.Razor.dll">
      <publishTime>01/28/2015 12:02:32</publishTime>
    </File>
    <File Include="bin/System.Web.Services.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Web.WebPages.Deployment.dll">
      <publishTime>01/28/2015 12:04:30</publishTime>
    </File>
    <File Include="bin/System.Web.WebPages.dll">
      <publishTime>01/28/2015 12:04:30</publishTime>
    </File>
    <File Include="bin/System.Web.WebPages.Razor.dll">
      <publishTime>01/28/2015 12:04:30</publishTime>
    </File>
    <File Include="bin/System.Xml.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/System.Xml.Linq.dll">
      <publishTime>09/26/2012 03:16:08</publishTime>
    </File>
    <File Include="bin/WebActivatorEx.dll">
      <publishTime>11/24/2014 19:18:48</publishTime>
    </File>
    <File Include="bin/WebAPI.dll">
      <publishTime>07/10/2024 13:44:39</publishTime>
    </File>
    <File Include="bin/WebAPI.pdb">
      <publishTime>07/10/2024 13:44:39</publishTime>
    </File>
    <File Include="bin/WebGrease.dll">
      <publishTime>07/18/2013 01:03:52</publishTime>
    </File>
    <File Include="bin/zh-Hans/System.Net.Http.Formatting.resources.dll">
      <publishTime>11/29/2018 21:26:02</publishTime>
    </File>
    <File Include="bin/zh-Hans/System.Web.Http.resources.dll">
      <publishTime>11/29/2018 21:26:30</publishTime>
    </File>
    <File Include="Config/kdapi.config">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Content/bootstrap.css">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Content/bootstrap.min.css">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Content/Site.css">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/BLL.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/DAL.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/DBUtility.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/Kingdee.BOS.WebApi.Client.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/Model.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/Newtonsoft.Json.Net35.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/Pub_Class.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/Pub_Control.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="DLL/SQLHelper.dll">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="fonts/glyphicons-halflings-regular.eot">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="fonts/glyphicons-halflings-regular.svg">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="fonts/glyphicons-halflings-regular.ttf">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="fonts/glyphicons-halflings-regular.woff">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Global.asax">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="grpc_csharp_ext.x64.dll">
      <publishTime>03/22/2022 13:17:22</publishTime>
    </File>
    <File Include="grpc_csharp_ext.x86.dll">
      <publishTime>03/22/2022 13:17:22</publishTime>
    </File>
    <File Include="Index.html">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="libgrpc_csharp_ext.x64.dylib">
      <publishTime>03/19/2022 07:38:44</publishTime>
    </File>
    <File Include="libgrpc_csharp_ext.x64.so">
      <publishTime>03/19/2022 07:38:42</publishTime>
    </File>
    <File Include="libman.json">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="packages.config">
      <publishTime>06/25/2024 09:50:21</publishTime>
    </File>
    <File Include="Views/Scripts/bootstrap.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/bootstrap.min.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/jquery-1.10.2.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/jquery-1.10.2.min.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/jquery-1.10.2.min.map">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/jquery.validate.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/jquery.validate.min.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/jquery.validate.unobtrusive.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Scripts/modernizr-2.6.2.js">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Shared/Error.cshtml">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/Shared/_Layout.cshtml">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/web.config">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Views/_ViewStart.cshtml">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsCLD_Department_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsCLD_Employee_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsCLD_StockPlace_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsCLD_Supplier_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsCLD_Warehouse_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_BadReason_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model_View.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Customer_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Department_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Employee_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Group_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Item30JiTai_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Source_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_StockPlace_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Supplier_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsGy_Warehouse_Model.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsKf_ICStockBill_Mould.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/ClsKf_ICStockBill_WMS.datasource">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web References/WebS/Reference.map">
      <publishTime>05/25/2024 09:46:41</publishTime>
    </File>
    <File Include="Web.config">
      <publishTime>07/10/2024 13:44:54</publishTime>
    </File>
  </ItemGroup>
</Project>
WebAPI/WebAPI.csproj
@@ -537,6 +537,7 @@
    <Compile Include="Controllers\品质管理\巡检单\QC_PatrolProcCheckOtherBillController.cs" />
    <Compile Include="Controllers\品质管理\工序检验单\MES_ProcessCheckBill_PDAController.cs" />
    <Compile Include="Controllers\品质管理\库存检验单\QC_StockCheckBillController.cs" />
    <Compile Include="Controllers\品质管理\检验取样还样单\QC_TakeSampleCheckBillController.cs" />
    <Compile Include="Controllers\品质管理\质量报表\QC_QualityReportsController.cs" />
    <Compile Include="Controllers\品质管理\车间自检单\QC_WorkSelfCheckBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_CardChangeTypeController.cs" />
@@ -583,6 +584,7 @@
    <Compile Include="Controllers\基础资料\生产基础资料\Gy_ShiftsController.cs" />
    <Compile Include="Controllers\夏宝售后接口\ASSController.cs" />
    <Compile Include="Controllers\工资管理\HR_EmployeeSkillBillController.cs" />
    <Compile Include="Controllers\工资管理\HR_EmployeeSkillExamBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_OutApplyBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_OverApplyBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_PayMentBillController.cs" />
WebAPI/WebAPI.csproj.user
@@ -9,7 +9,7 @@
    <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\智云迈思\MES\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile14.pubxml</NameOfLastUsedPublishProfile>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>true</UseIISExpress>
    <Use64BitIISExpress />