yangle
2024-04-02 baca2f3c0f299258db6c601b0378517c54d5cfe3
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
10个文件已添加
5个文件已修改
3574 ■■■■■ 已修改文件
DAL/DAL.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/信息平台/ClsOA_ErrMsgBackCheckBill.cs 323 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/信息平台/ClsOA_ErrMsgBackHandleBill.cs 323 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/工资管理/ClsHR_PostSkillBill.cs 216 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/信息平台/ClsOA_ErrMsgBackCheckBillMain.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/信息平台/ClsOA_ErrMsgBackCheckBillSub.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/信息平台/ClsOA_ErrMsgBackHandleBillMain.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/信息平台/ClsOA_ErrMsgBackHandleBillSub.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/工资管理/ClsHR_PostSkillBillMain.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/工资管理/ClsHR_PostSkillBillSub.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs 1726 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/工资管理/HR_PostSkillBillController.cs 817 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -95,6 +95,8 @@
    <Compile Include="仓库管理\ClsKf_SellOutBillForLayUI.cs" />
    <Compile Include="仓库管理\条码管理\ClsGy_BarCodeBill_ChaiMa.cs" />
    <Compile Include="仓库管理\条码管理\ClsKF_BarCodeStatusChangeBill.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackCheckBill.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackHandleBill.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackSignBill.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackReceiveBill.cs" />
    <Compile Include="基础资料\InterFace基础资料\ClsIF_ORGANIZATIONS_View.cs" />
@@ -124,6 +126,7 @@
    <Compile Include="基础资料\其他基础资料\ClsGy_QCCheckProject_View.cs" />
    <Compile Include="基础资料\其他基础资料\ClsGy_StdWorkTimes_Ctl.cs" />
    <Compile Include="基础资料\其他基础资料\ClsGy_SupMaterial_Ctl.cs" />
    <Compile Include="工资管理\ClsHR_PostSkillBill.cs" />
    <Compile Include="源单\ERP源单\Cls_S_Sc_ABJJD.cs" />
    <Compile Include="源单\InterFace源单\Cls_S_IF_ICMOBillList.cs" />
    <Compile Include="源单\InterFace源单\Cls_S_IF_ProcessReportBillList.cs" />
DAL/ÐÅϢƽ̨/ClsOA_ErrMsgBackCheckBill.cs
New file
@@ -0,0 +1,323 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsOA_ErrMsgBackCheckBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsOA_ErrMsgBackCheckBillMain omodel = new Model.ClsOA_ErrMsgBackCheckBillMain();
        public List<Model.ClsOA_ErrMsgBackCheckBillSub> DetailColl = new List<Model.ClsOA_ErrMsgBackCheckBillSub>();
        public ClsOA_ErrMsgBackCheckBill()
        {
            base.MvarItemKeySub = "OA_ErrMsgBackCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "OA_ErrMsgBackCheckBillMain";
            base.MvarReportTitle = "异常反馈验收单";
            base.BillType = "4532";
            base.HBillSubType = "4532";
        }
        #region å›ºå®šä»£ç 
        ~ClsOA_ErrMsgBackCheckBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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 OA_ErrMsgBackCheckBillMain 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() + "'" +
                ",HReceiveID='" + omodel.HReceiveID.ToString() + "'" +
                ",HSendMan='" + omodel.HSendMan + "'" +
                 ",HReceiveMan='" + omodel.HReceiveMan + "'" +
                 ",HCopyMan='" + omodel.HCopyMan + "'" +
                 ",HLevel='" + omodel.HLevel + "'" +
                 ",HErrMsgBackTypeID='" + omodel.HErrMsgBackTypeID.ToString() +
                 "',HContext='" + omodel.HContext + "'" +
                 ",HDescription='" + omodel.HDescription + "'" +
                 ",HBillTypeName='" + omodel.HBillTypeName + "'" +
                 ",HPlanBillNo='" + omodel.HPlanBillNo + "'" +
                 ",HMaterName='" + omodel.HMaterName + "'" +
                 ",HMaterModel='" + omodel.HMaterModel + "'" +
                 ",HEquipID='" + omodel.HEquipID.ToString() +
                 "',HMouldID='" + omodel.HMouldID.ToString() +
                 "',HCheckEmpID='" + omodel.HCheckEmpID.ToString() +
                 "',HCheckNote='" + omodel.HCheckNote + "'" +
                 ",HCheckResult='" + omodel.HCheckResult + "'" +
                 ",HHCheckDate='" + omodel.HHCheckDate + "'" +
                 ",HErrMsgBackBillNo='" + omodel.HErrMsgBackBillNo +
                 "',HErrMsgBackInterID='" + omodel.HErrMsgBackInterID.ToString() +
                 "',HErrMsgBackEntryID='" + omodel.HErrMsgBackEntryID.ToString() +
                "' where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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
            {
                //得到mainid
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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;
                }
                //=========================================================
                string sql = "";
                sql = "Insert Into OA_ErrMsgBackCheckBillMain" +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType," +
                "HDeptID,HReceiveID,HSendMan,HReceiveMan,HCopyMan,HLevel,HErrMsgBackTypeID,HContext,HDescription,HBillTypeName,HPlanBillNo,HMaterName,HMaterModel,HEquipID,HMouldID,HCheckEmpID,HCheckNote,HCheckResult,HHCheckDate,HErrMsgBackBillNo,HErrMsgBackInterID,HErrMsgBackEntryID) " +
                " 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.HReceiveID.ToString() +
                "','" + omodel.HSendMan +
                "','" + omodel.HReceiveMan +
                "','" + omodel.HCopyMan +
                "','" + omodel.HLevel +
                "','" + omodel.HErrMsgBackTypeID.ToString() +
                "','" + omodel.HContext +
                "','" + omodel.HDescription +
                "','" + omodel.HBillTypeName +
                "','" + omodel.HPlanBillNo +
                "','" + omodel.HMaterName +
                "','" + omodel.HMaterModel +
                "','" + omodel.HEquipID.ToString() +
                "','" + omodel.HMouldID.ToString() +
                "','" + omodel.HCheckEmpID.ToString() +
                "','" + omodel.HCheckNote +
                 "','" + omodel.HCheckResult +
                "','" + omodel.HHCheckDate +
                 "','" + omodel.HErrMsgBackBillNo +
                "','" + omodel.HErrMsgBackInterID.ToString() +
                "','" + omodel.HErrMsgBackEntryID.ToString() +
                "') ";
                //主表
                oCn.RunProc(sql);
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackCheckBill_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 OA_ErrMsgBackCheckBillMain Where HInterID=" + lngBillKey.ToString(), "OA_ErrMsgBackCheckBillMain");
                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 OA_ErrMsgBackCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "OA_ErrMsgBackCheckBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsOA_ErrMsgBackCheckBillSub oSub = new Model.ClsOA_ErrMsgBackCheckBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    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/ÐÅϢƽ̨/ClsOA_ErrMsgBackHandleBill.cs
New file
@@ -0,0 +1,323 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsOA_ErrMsgBackHandleBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsOA_ErrMsgBackHandleBillMain omodel = new Model.ClsOA_ErrMsgBackHandleBillMain();
        public List<Model.ClsOA_ErrMsgBackHandleBillSub> DetailColl = new List<Model.ClsOA_ErrMsgBackHandleBillSub>();
        public ClsOA_ErrMsgBackHandleBill()
        {
            base.MvarItemKeySub = "OA_ErrMsgBackHandleBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "OA_ErrMsgBackHandleBillMain";
            base.MvarReportTitle = "异常反馈签到单";
            base.BillType = "4531";
            base.HBillSubType = "4531";
        }
        #region å›ºå®šä»£ç 
        ~ClsOA_ErrMsgBackHandleBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackHandleBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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 OA_ErrMsgBackHandleBillMain 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() + "'" +
                ",HReceiveID='" + omodel.HReceiveID.ToString() + "'" +
                ",HSendMan='" + omodel.HSendMan + "'" +
                 ",HReceiveMan='" + omodel.HReceiveMan + "'" +
                 ",HCopyMan='" + omodel.HCopyMan + "'" +
                 ",HLevel='" + omodel.HLevel + "'" +
                 ",HErrMsgBackTypeID='" + omodel.HErrMsgBackTypeID.ToString() +
                 "',HContext='" + omodel.HContext + "'" +
                 ",HDescription='" + omodel.HDescription + "'" +
                 ",HBillTypeName='" + omodel.HBillTypeName + "'" +
                 ",HPlanBillNo='" + omodel.HPlanBillNo + "'" +
                 ",HMaterName='" + omodel.HMaterName + "'" +
                 ",HMaterModel='" + omodel.HMaterModel + "'" +
                 ",HEquipID='" + omodel.HEquipID.ToString() +
                 "',HMouldID='" + omodel.HMouldID.ToString() +
                 "',HHandleEmpID='" + omodel.HHandleEmpID.ToString() +
                 "',HHandleNote='" + omodel.HHandleNote + "'" +
                 ",HHandleResult='" + omodel.HHandleResult + "'" +
                 ",HHandleDate='" + omodel.HHandleDate + "'" +
                 ",HErrMsgBackBillNo='" + omodel.HErrMsgBackBillNo +
                 "',HErrMsgBackInterID='" + omodel.HErrMsgBackInterID.ToString() +
                 "',HErrMsgBackEntryID='" + omodel.HErrMsgBackEntryID.ToString() +
                "' where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackHandleBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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
            {
                //得到mainid
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackHandleBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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;
                }
                //=========================================================
                string sql = "";
                sql = "Insert Into OA_ErrMsgBackHandleBillMain" +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType," +
                "HDeptID,HReceiveID,HSendMan,HReceiveMan,HCopyMan,HLevel,HErrMsgBackTypeID,HContext,HDescription,HBillTypeName,HPlanBillNo,HMaterName,HMaterModel,HEquipID,HMouldID,HHandleEmpID,HHandleNote,HHandleResult,HHandleDate,HErrMsgBackBillNo,HErrMsgBackInterID,HErrMsgBackEntryID) " +
                " 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.HReceiveID.ToString() +
                "','" + omodel.HSendMan +
                "','" + omodel.HReceiveMan +
                "','" + omodel.HCopyMan +
                "','" + omodel.HLevel +
                "','" + omodel.HErrMsgBackTypeID.ToString() +
                "','" + omodel.HContext +
                "','" + omodel.HDescription +
                "','" + omodel.HBillTypeName +
                "','" + omodel.HPlanBillNo +
                "','" + omodel.HMaterName +
                "','" + omodel.HMaterModel +
                "','" + omodel.HEquipID.ToString() +
                "','" + omodel.HMouldID.ToString() +
                "','" + omodel.HHandleEmpID.ToString() +
                "','" + omodel.HHandleNote +
                 "','" + omodel.HHandleResult +
                "','" + omodel.HHandleDate +
                 "','" + omodel.HErrMsgBackBillNo +
                "','" + omodel.HErrMsgBackInterID.ToString() +
                "','" + omodel.HErrMsgBackEntryID.ToString() +
                "') ";
                //主表
                oCn.RunProc(sql);
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackHandleBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackHandleBill_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 OA_ErrMsgBackHandleBillMain Where HInterID=" + lngBillKey.ToString(), "OA_ErrMsgBackHandleBillMain");
                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 OA_ErrMsgBackHandleBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "OA_ErrMsgBackHandleBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsOA_ErrMsgBackHandleBillSub oSub = new Model.ClsOA_ErrMsgBackHandleBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    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/¹¤×ʹÜÀí/ClsHR_PostSkillBill.cs
New file
@@ -0,0 +1,216 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public  class ClsHR_PostSkillBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsHR_PostSkillBillMain omodel = new Model.ClsHR_PostSkillBillMain();
        public List<Model.ClsHR_PostSkillBillSub> DetailColl = new List<Model.ClsHR_PostSkillBillSub>();
        public ClsHR_PostSkillBill()
        {
            base.MvarItemKeySub = "HR_PostSkillBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="HR_PostSkillBillMain";
            base.MvarReportTitle="岗位技能清单";
            base.BillType="2331";
            base.HBillSubType = "2331";
        }
        #region å›ºå®šä»£ç 
        ~ClsHR_PostSkillBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate HR_PostSkillBillMain 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() +
                "',HPostID='" + omodel.HPostID.ToString() +
                "',HOrgID='" + omodel.HOrgID.ToString() + "'" +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsHR_PostSkillBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into HR_PostSkillBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HPostSkillid,HSkillLev" +
                      ") 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.HPostSkillid.ToString() + "," + oSub.HSkillLev.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_PostSkillBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HDeptID,HPostID,HOrgID" +
                ") " +
                " 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.HPostID.ToString() + "," + omodel.HOrgID.ToString() +
                ") ");
                //插入子表
                foreach (Model.ClsHR_PostSkillBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into HR_PostSkillBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HPostSkillid,HSkillLev" +
                      ") 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.HPostSkillid.ToString() + ",'" + oSub.HSkillLev.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_PostSkillBillMain Where HInterID=" + lngBillKey.ToString(), "HR_PostSkillBillMain");
                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.HPostID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPostID"]);
                omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]);
                //
                //循环
                DataSet DsSub ;
                DsSub = oCn.RunProcReturn("Select * from HR_PostSkillBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "HR_PostSkillBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsHR_PostSkillBillSub oSub = new Model.ClsHR_PostSkillBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    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.HPostSkillid = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPostSkillid"]);
                    oSub.HSkillLev = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSkillLev"]);
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
    }
}
Model/Model.csproj
@@ -286,9 +286,13 @@
    <Compile Include="信息平台\ClsOA_ComFileBillMain.cs" />
    <Compile Include="信息平台\ClsOA_ComFileBillSub.cs" />
    <Compile Include="信息平台\ClsOA_EmpMinMessage.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackCheckBillMain.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackHandleBillMain.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackCheckBillSub.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackSignBill.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackReceiveBillMain.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackBillMain.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackHandleBillSub.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackSignBillSub.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackReceiveBillSub.cs" />
    <Compile Include="信息平台\ClsOA_ErrMsgBackBillSub.cs" />
@@ -474,6 +478,8 @@
    <Compile Include="工资管理\ClsPay_SubsidyChangeBillSub.cs" />
    <Compile Include="工资管理\ClsPay_SumBalBillMain .cs" />
    <Compile Include="工资管理\ClsPay_SumBalBillSub.cs" />
    <Compile Include="工资管理\ClsHR_PostSkillBillMain.cs" />
    <Compile Include="工资管理\ClsHR_PostSkillBillSub.cs" />
    <Compile Include="应收管理\ClsYS_ReceiveOtherBillSub.cs" />
    <Compile Include="成本管理\ClsCB_ChangeMoneyBillMain.cs" />
    <Compile Include="成本管理\ClsCB_ChangeMoneyBillSub.cs" />
Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackCheckBillMain.cs
New file
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsOA_ErrMsgBackCheckBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public int HDeptID ;       // å‘送部门(Gy_Department)
        public int HReceiveID ;      // æŽ¥æ”¶éƒ¨é—¨(Gy_Department)
        public string HSendMan ;     // å‘送人(gy_czygl)(功能跟 å¼‚常反馈单 ä¸€è‡´)
        public string HReceiveMan ;  // æŽ¥æ”¶äººï¼ˆgy_czygl)(功能跟 å¼‚常反馈单 ä¸€è‡´)
        public string HCopyMan ;     // æŠ„送(gy_czygl)(功能跟 å¼‚常反馈单 ä¸€è‡´)
        public string HLevel ;       // ç´§æ€¥ç¨‹åº¦ï¼ˆæ™®é€šï¼Œç´§æ€¥ï¼‰
        public int HErrMsgBackTypeID ; // å¼‚常类型(Gy_ErrMsgBackType)
        public string HContext ;       // ä¸»é¢˜
        public string HDescription ;   // å†…容
        public string HBillTypeName ;  // å•据类型
        public string HPlanBillNo ;    // å•据号码
        public string HMaterName ;     // äº§å“åç§°
        public string HMaterModel ;    // è§„格型号
        public int HEquipID ;         // ç›¸å…³è®¾å¤‡ï¼ˆGy_EquipFileBillMain)
        public int HMouldID ;          // ç›¸å…³æ¨¡æ²»å…·ï¼ˆGy_MouldFileMain)
        public int HCheckEmpID;    // éªŒæ”¶äººï¼ˆGy_Employee)
        public string HCheckNote;   //     éªŒæ”¶å†…容
        public string HCheckResult;   //     éªŒæ”¶ç»“果(处理完成,未处理,无法处理)
        public DateTime HHCheckDate; // éªŒæ”¶æ—¶é—´ï¼ˆå¹´æœˆæ—¥æ—¶åˆ†ç§’)
        public string HErrMsgBackBillNo;    //异常反馈单号
        public int HErrMsgBackInterID;  //异常反馈单主内码
        public int HErrMsgBackEntryID;  //异常反馈单子内码
    }
}
Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackCheckBillSub.cs
New file
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsOA_ErrMsgBackCheckBillSub : DBUtility.ClsXt_BaseBillSub
    {
    }
}
Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackHandleBillMain.cs
New file
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsOA_ErrMsgBackHandleBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public int HDeptID ;       // å‘送部门(Gy_Department)
        public int HReceiveID ;      // æŽ¥æ”¶éƒ¨é—¨(Gy_Department)
        public string HSendMan ;     // å‘送人(gy_czygl)(功能跟 å¼‚常反馈单 ä¸€è‡´)
        public string HReceiveMan ;  // æŽ¥æ”¶äººï¼ˆgy_czygl)(功能跟 å¼‚常反馈单 ä¸€è‡´)
        public string HCopyMan ;     // æŠ„送(gy_czygl)(功能跟 å¼‚常反馈单 ä¸€è‡´)
        public string HLevel ;       // ç´§æ€¥ç¨‹åº¦ï¼ˆæ™®é€šï¼Œç´§æ€¥ï¼‰
        public int HErrMsgBackTypeID ; // å¼‚常类型(Gy_ErrMsgBackType)
        public string HContext ;       // ä¸»é¢˜
        public string HDescription ;   // å†…容
        public string HBillTypeName ;  // å•据类型
        public string HPlanBillNo ;    // å•据号码
        public string HMaterName ;     // äº§å“åç§°
        public string HMaterModel ;    // è§„格型号
        public int HEquipID ;         // ç›¸å…³è®¾å¤‡ï¼ˆGy_EquipFileBillMain)
        public int HMouldID ;          // ç›¸å…³æ¨¡æ²»å…·ï¼ˆGy_MouldFileMain)
        public int HHandleEmpID;    // å¤„理人(Gy_Employee)
        public string HHandleNote;   //     å¤„理内容
        public string HHandleResult;   //     å¤„理结果(处理完成,未处理,无法处理)
        public DateTime HHandleDate; // å¤„理完成时间(年月日时分秒)
        public string HErrMsgBackBillNo;    //异常反馈单号
        public int HErrMsgBackInterID;  //异常反馈单主内码
        public int HErrMsgBackEntryID;  //异常反馈单子内码
    }
}
Model/ÐÅϢƽ̨/ClsOA_ErrMsgBackHandleBillSub.cs
New file
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsOA_ErrMsgBackHandleBillSub : DBUtility.ClsXt_BaseBillSub
    {
    }
}
Model/¹¤×ʹÜÀí/ClsHR_PostSkillBillMain.cs
New file
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsHR_PostSkillBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HDeptID;//        éƒ¨é—¨
        public Int64 HPostID;//    å²—位
        public Int64 HOrgID;    //组织
    }
}
Model/¹¤×ʹÜÀí/ClsHR_PostSkillBillSub.cs
New file
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsHR_PostSkillBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HPostSkillid;//    int   å²—位技能编码
        public Int64 HSkillLev;//   int èƒ½åŠ›ç­‰çº§éœ€æ±‚
    }
}
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -747,7 +747,7 @@
        }
        #endregion
        #region å¼‚常反馈 æŽ¥æ”¶/签到 å•列表   æ ¹æ®å¼‚常反馈单下推获取数据
        #region å¼‚常反馈 æŽ¥æ”¶/签到/处理 å•列表   æ ¹æ®å¼‚常  åé¦ˆ/接收/签到/处理  å•下推获取数据
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackList")]
        [HttpGet]
@@ -776,7 +776,12 @@
                    string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList  where hmainid = '" + HInterID + "'";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList");
                }
                else if (num == 3)    //异常反馈处理单
                {
                    string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList   where hmainid = '" + HInterID + "'";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList ");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
@@ -805,6 +810,8 @@
        #endregion
        #region  å¼‚常反馈接收单
        #region å¼‚常反馈接收单 æ–°å¢ž/编辑
        [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackReceiveBill")]
@@ -1660,6 +1667,10 @@
        }
        #endregion
        #endregion
        #region  å¼‚常反馈签到单
        #region å¼‚常反馈签到单 æ–°å¢ž/编辑      
        [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackSignBill")]
        [HttpPost]
@@ -2514,5 +2525,1716 @@
        }
        #endregion
        #endregion
        #region  å¼‚常反馈处理单
        #region å¼‚常反馈处理单 æ–°å¢ž/编辑
        [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackHandleBill")]
        [HttpPost]
        public object SaveOA_ErrMsgBackHandleBill([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[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("OA_ErrMsgBackHandleBillMain_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                // OA_ErrMsgBackHandleBill
                DAL.ClsOA_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill();
                List<Model.ClsOA_ErrMsgBackHandleBillMain> lsmain = new List<Model.ClsOA_ErrMsgBackHandleBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_OA_ErrMsgBackHandleBill(msg2);
                foreach (Model.ClsOA_ErrMsgBackHandleBillMain oItem in lsmain)
                {
                    if (refSav == "Add")
                    {
                        //单据号是否重复
                        if (oBill.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 (oBill.ShowBill(oItem.HInterID, ref s) == false)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据有误!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //判断是否可编辑
                        if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据已经被审核,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (oBill.omodel.HBillStatus > 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据处于不可编辑状态,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(oBill, ref s))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = s + ",不允许修改";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "4531";
                    oItem.HBillSubType = "4531";
                    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;
                }
                //保存
                //保存完毕后处理
                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("Sc_MESTransFerWorkBill/Edit_OA_ErrMsgBackHandleBill")]
        [HttpGet]
        public object Edit_OA_ErrMsgBackHandleBill(string HID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList");
                //添加列名
                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("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackHandleBillList")]
        [HttpGet]
        public object Get_OA_ErrMsgBackHandleBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackHandleBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackHandleBillMainList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList");
                }
                //添加列名
                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("Sc_MESTransFerWorkBill/DeleteOA_ErrMsgBackHandleBill")]
        [HttpGet]
        public object DeleteOA_ErrMsgBackHandleBill(string HInterID, string user)
        {
            try
            {
                string s = "";
                DAL.ClsOA_ErrMsgBackHandleBill BillOld = new DAL.ClsOA_ErrMsgBackHandleBill();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackHandleBillMain_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;
                }
                //删除前控制=========================================
                string sql1 = "exec h_p_OA_ErrMsgBackHandleBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_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 OA_ErrMsgBackHandleBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from OA_ErrMsgBackHandleBillSub where HInterID= " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_OA_ErrMsgBackHandleBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_OA_ErrMsgBackHandleBill_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;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼‚常反馈处理单 å®¡æ ¸/反审核
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Sc_MESTransFerWorkBill/AuditOA_ErrMsgBackHandleBill")]
        [HttpGet]
        public object AuditOA_ErrMsgBackHandleBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "OA_ErrMsgBackHandleBillMain_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.ClsOA_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill();               //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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) //审核提交
                {
                    oCN.BeginTran();
                    //记录返回信息
                    string msg = "";
                    //审核前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackHandleBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_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_OA_ErrMsgBackHandleBill_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 sql1 = "exec h_p_OA_ErrMsgBackHandleBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_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_OA_ErrMsgBackHandleBill_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 å¼‚常反馈处理单 å…³é—­/反关闭
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">关闭(0),反关闭(1)</param>
        /// <param name="CurUserName">关闭人</param>
        /// <returns></returns>
        [Route("Sc_MESTransFerWorkBill/CloseOA_ErrMsgBackHandleBill")]
        [HttpGet]
        public object CloseOA_ErrMsgBackHandleBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "OA_ErrMsgBackHandleBillMain_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.ClsOA_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill();             //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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 å¼‚常反馈处理单  ä½œåºŸ/反作废
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">作废(0),反作废(1)</param>
        /// <param name="CurUserName">作废人</param>
        /// <returns></returns>
        [Route("Sc_MESTransFerWorkBill/DeleteOA_ErrMsgBackHandleBill")]
        [HttpGet]
        public object DeleteOA_ErrMsgBackHandleBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "OA_ErrMsgBackHandleBillMain_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.ClsOA_ErrMsgBackHandleBill oBill = new DAL.ClsOA_ErrMsgBackHandleBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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
        #endregion
        #region å¼‚常反馈验收单
        #region å¼‚常反馈验收单 æ–°å¢ž/编辑
        [Route("Sc_MESTransFerWorkBill/SaveOA_ErrMsgBackCheckBill")]
        [HttpPost]
        public object SaveOA_ErrMsgBackCheckBill([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[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("OA_ErrMsgBackCheckBillMain_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                // OA_ErrMsgBackCheckBill
                DAL.ClsOA_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill();
                List<Model.ClsOA_ErrMsgBackCheckBillMain> lsmain = new List<Model.ClsOA_ErrMsgBackCheckBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_OA_ErrMsgBackCheckBill(msg2);
                foreach (Model.ClsOA_ErrMsgBackCheckBillMain oItem in lsmain)
                {
                    if (refSav == "Add")
                    {
                        //单据号是否重复
                        if (oBill.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 (oBill.ShowBill(oItem.HInterID, ref s) == false)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据有误!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //判断是否可编辑
                        if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据已经被审核,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (oBill.omodel.HBillStatus > 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据处于不可编辑状态,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(oBill, ref s))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = s + ",不允许修改";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "4532";
                    oItem.HBillSubType = "4532";
                    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;
                }
                //保存
                //保存完毕后验收
                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("Sc_MESTransFerWorkBill/Edit_OA_ErrMsgBackCheckBill")]
        [HttpGet]
        public object Edit_OA_ErrMsgBackCheckBill(string HID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_OA_ErrMsgBackCheckBillMainList where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainList");
                //添加列名
                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("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackCheckBillList")]
        [HttpGet]
        public object Get_OA_ErrMsgBackCheckBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackCheckBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackCheckBillMainList order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainList");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackCheckBillMainList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainList");
                }
                //添加列名
                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("Sc_MESTransFerWorkBill/DeleteOA_ErrMsgBackCheckBill")]
        [HttpGet]
        public object DeleteOA_ErrMsgBackCheckBill(string HInterID, string user)
        {
            try
            {
                string s = "";
                DAL.ClsOA_ErrMsgBackCheckBill BillOld = new DAL.ClsOA_ErrMsgBackCheckBill();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackCheckBillMain_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;
                }
                //删除前控制=========================================
                string sql1 = "exec h_p_OA_ErrMsgBackCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_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 OA_ErrMsgBackCheckBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from OA_ErrMsgBackCheckBillSub where HInterID= " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_OA_ErrMsgBackCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_OA_ErrMsgBackCheckBill_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;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼‚常反馈验收单 å®¡æ ¸/反审核
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Sc_MESTransFerWorkBill/AuditOA_ErrMsgBackCheckBill")]
        [HttpGet]
        public object AuditOA_ErrMsgBackCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "OA_ErrMsgBackCheckBillMain_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.ClsOA_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill();               //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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) //审核提交
                {
                    oCN.BeginTran();
                    //记录返回信息
                    string msg = "";
                    //审核前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_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_OA_ErrMsgBackCheckBill_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 sql1 = "exec h_p_OA_ErrMsgBackCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_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_OA_ErrMsgBackCheckBill_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 å¼‚常反馈验收单 å…³é—­/反关闭
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">关闭(0),反关闭(1)</param>
        /// <param name="CurUserName">关闭人</param>
        /// <returns></returns>
        [Route("Sc_MESTransFerWorkBill/CloseOA_ErrMsgBackCheckBill")]
        [HttpGet]
        public object CloseOA_ErrMsgBackCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "OA_ErrMsgBackCheckBillMain_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.ClsOA_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill();             //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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 å¼‚常反馈验收单  ä½œåºŸ/反作废
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">作废(0),反作废(1)</param>
        /// <param name="CurUserName">作废人</param>
        /// <returns></returns>
        [Route("Sc_MESTransFerWorkBill/DeleteOA_ErrMsgBackCheckBill")]
        [HttpGet]
        public object DeleteOA_ErrMsgBackCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "OA_ErrMsgBackCheckBillMain_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.ClsOA_ErrMsgBackCheckBill oBill = new DAL.ClsOA_ErrMsgBackCheckBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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
        #endregion
    }
}
WebAPI/Controllers/¹¤×ʹÜÀí/HR_PostSkillBillController.cs
New file
@@ -0,0 +1,817 @@
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 HR_PostSkillBillController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        public const string ModName = "2331";                   //单据类型
        public const string ModCaption = "岗位技能清单";          //单据名称
        public const string ModRightName = "HR_PostSkillBillMain";
        public const string ModRightNameQuery = ModRightName + "_Query";      //查询
        public const string ModRightNameEdit = ModRightName + "_Edit";      //编辑
        public const string ModRightNameCheck = ModRightName + "_Check";    //审核
        public const string ModRightNameClose = ModRightName + "_Close";    //关闭
        public const string ModRightNameDelete = ModRightName + "_Delete";  //作废
        public const string ModRightNameDrop = ModRightName + "_Drop";      //删除
        public DataSet ds = new DataSet();
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        public DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill();
        public DAL.ClsHR_PostSkillBill BillNew = new DAL.ClsHR_PostSkillBill();   //对应单据类
        public DAL.ClsHR_PostSkillBill BillOld = new DAL.ClsHR_PostSkillBill();   //对应单据类
        // HR_PostSkillBill HR_PostSkillBillMain
        #region å²—位技能清单列表
        /// <summary>
        /// èŽ·å–å²—ä½æŠ€èƒ½æ¸…å•åˆ—è¡¨ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("HR_PostSkillBill/GetHR_PostSkillBillList")]
        [HttpGet]
        public object GetHR_PostSkillBillList(string sWhere, string HMaker)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameQuery, 3, false, HMaker))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //返回列表信息
                ds = oCn.RunProcReturn("select * from h_v_HR_PostSkillBillMainList where 1=1 " + sWhere + " order by hmainid desc", "h_v_HR_PostSkillBillMainList");
                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>
        /// åˆ é™¤å²—位技能清单
        /// </summary>
        /// <returns></returns>
        [Route("HR_PostSkillBill/DeleteHR_PostSkillBill")]
        [HttpGet]
        public object DeleteHR_PostSkillBill(Int64 HInterID, string HMaker)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameDrop, 3, false, HMaker))
                {
                    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_PostSkillBill_BeforeDelCtrl  " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + HMaker + "'";
                    ds = oCn.RunProcReturn(sql1, "h_p_YS_ReceiveOtherBill_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_PostSkillBill_AfterDelCtrl", HMaker, 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_PostSkillBill/AuditHR_PostSkillBill")]
        [HttpGet]
        public object AuditHR_PostSkillBill(Int64 HInterID, int IsAudit, string HMaker)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块审核/反审核功能权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill();                              //实例化单据操作类,用于进行相关操作
                //判断存在性
                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_PostSkillBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'";
                        ds = oCn.RunProcReturn(sql1, "h_p_HR_PostSkillBill_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_PostSkillBill_AfterCheckCtrl", HMaker, 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_PostSkillBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'";
                        ds = oCn.RunProcReturn(sql1, "h_p_HR_PostSkillBill_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_PostSkillBill_AfterUnCheckCtrl", HMaker, 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_PostSkillBill/CloseHR_PostSkillBill")]
        [HttpGet]
        public object CloseHR_PostSkillBill(Int64 HInterID, int Type, string HMaker)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker))
                {
                    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, HMaker, 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, HMaker, 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_PostSkillBill/DropHR_PostSkillBill")]
        [HttpGet]
        public object DropHR_PostSkillBill(Int64 HInterID, int Type, string HMaker)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker))
                {
                    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, HMaker, 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, HMaker, 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>
        /// å²—位技能清单编辑时,根据单据ID获取单据信息
        /// </summary>
        /// <returns></returns>
        [Route("HR_PostSkillBill/EditHR_PostSkillBill")]
        [HttpGet]
        public object EditHR_PostSkillBill(Int64 HInterID, string HMaker)
        {
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 3, false, HMaker))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块编辑权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //返回列表信息
                ds = oCn.RunProcReturn("select * from h_v_HR_PostSkillBillMainList where 1=1 and hmainid=" + HInterID + " order by hmainid desc", "h_v_HR_PostSkillBillMainList");
                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];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回岗位技能清单信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å²—位技能清单 æ–°å¢ž/编辑
        [Route("HR_PostSkillBill/SaveHR_PostSkillBill")]
        [HttpPost]
        public object SaveHR_PostSkillBill([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_PostSkillBillMain_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill();
                List<Model.ClsHR_PostSkillBillMain> lsmain = new List<Model.ClsHR_PostSkillBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_HR_PostSkillBillMain(msg2);
                foreach (Model.ClsHR_PostSkillBillMain 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 = "2002";
                    oItem.HBillSubType = "2002";
                    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_PostSkillBillSub> ls = new List<Model.ClsHR_PostSkillBillSub>();
                ls = oListModels.getObjectByJson_HR_PostSkillBillSub(msg3);
                int i = 0;
                foreach (Model.ClsHR_PostSkillBillSub 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
    }
}
WebAPI/ListModels.cs
@@ -1076,6 +1076,17 @@
        }
        /// <summary>  
        /// å¤„理新增异常反馈验收单表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsOA_ErrMsgBackCheckBillMain> getObjectByJson_OA_ErrMsgBackCheckBill(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsOA_ErrMsgBackCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsOA_ErrMsgBackCheckBillMain>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增异常反馈签到单表的json
        /// </summary>
        /// <param name="jsonString"></param>
@@ -1087,6 +1098,17 @@
            return list;
        }
        /// <summary>
        /// å¤„理新增异常反馈处理单表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsOA_ErrMsgBackHandleBillMain> getObjectByJson_OA_ErrMsgBackHandleBill(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsOA_ErrMsgBackHandleBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsOA_ErrMsgBackHandleBillMain>>(jsonString);
            return list;
        }
        /// <summary>  
        /// å¤„理新增异常反馈类型表的json
        /// </summary>
@@ -1134,6 +1156,31 @@
            List<Models.ClsGy_StockCheckItemBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_StockCheckItemBill>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新岗位技能清单主表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsHR_PostSkillBillMain> getObjectByJson_HR_PostSkillBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsHR_PostSkillBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_PostSkillBillMain>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新岗位技能清单子表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsHR_PostSkillBillSub> getObjectByJson_HR_PostSkillBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsHR_PostSkillBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_PostSkillBillSub>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增周总结表的json
        /// </summary>
WebAPI/WebAPI.csproj
@@ -570,6 +570,7 @@
    <Compile Include="Controllers\QC_POStockInCheckBillController.cs" />
    <Compile Include="Controllers\工资管理\Gy_GroupEmpBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_PurchaseWallclothBillController.cs" />
    <Compile Include="Controllers\工资管理\HR_PostSkillBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_WorkTimesBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_SingleBalBillController.cs" />
    <Compile Include="Controllers\ProductionOrderController.cs" />