duhe
2024-10-16 380127b84c3fa9cfc8c9753d8ffed5b20e927720
出门确认单
2个文件已删除
79个文件已修改
4个文件已添加
1755 ■■■■■ 已修改文件
APSM/bin/Release/APSM.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/APSM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/BLL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/BaseSet.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/BaseSet.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/PlanM.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/PlanM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/WarM.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/WarM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/WorkM.dll 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/WorkM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
BLL/bin/Release/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
BLL/bin/Release/BLL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
BLL/bin/Release/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
BLL/bin/Release/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
BLL/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
BLL/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/BLL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/BaseSet.dll 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/BaseSet.pdb 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/bin/Release/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
DAL/bin/Release/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
DAL/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
DAL/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
DAL/销售管理/ClsXs_OutDoorBill.cs 441 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
Model/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
Model/obj/Release/Model.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
Model/obj/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
Model/obj/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
Model/销售管理/ClsXs_OutDoorBillMain.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/销售管理/ClsXs_OutDoorBillSub.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/BLL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/PlanM.dll 补丁 | 查看 | 原始文档 | blame | 历史
PlanM/bin/Release/PlanM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/BLL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/WarM.dll 补丁 | 查看 | 原始文档 | blame | 历史
WarM/bin/Release/WarM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/XSGL/Xs_OutDoorBillController.cs 1220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/FolderProfile6.pubxml.user 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/BLL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/WarM.dll 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/WarM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/WorkM.dll 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/bin/Release/WorkM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/bin/Debug/TopSdk.dll 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.FileListAbsolute.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/obj/Debug/TopSdk.dll 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb 补丁 | 查看 | 原始文档 | blame | 历史
APSM/bin/Release/APSM.dll
Binary files differ
APSM/bin/Release/APSM.pdb
Binary files differ
APSM/bin/Release/BLL.dll
Binary files differ
APSM/bin/Release/BLL.pdb
Binary files differ
APSM/bin/Release/BaseSet.dll
Binary files differ
APSM/bin/Release/BaseSet.pdb
Binary files differ
APSM/bin/Release/DAL.dll
Binary files differ
APSM/bin/Release/DAL.pdb
Binary files differ
APSM/bin/Release/Model.dll
Binary files differ
APSM/bin/Release/Model.pdb
Binary files differ
APSM/bin/Release/PlanM.dll
Binary files differ
APSM/bin/Release/PlanM.pdb
Binary files differ
APSM/bin/Release/WarM.dll
Binary files differ
APSM/bin/Release/WarM.pdb
Binary files differ
APSM/bin/Release/WorkM.dll
Binary files differ
APSM/bin/Release/WorkM.pdb
Binary files differ
BLL/bin/Release/BLL.dll
Binary files differ
BLL/bin/Release/BLL.pdb
Binary files differ
BLL/bin/Release/DAL.dll
Binary files differ
BLL/bin/Release/DAL.pdb
Binary files differ
BLL/bin/Release/Model.dll
Binary files differ
BLL/bin/Release/Model.pdb
Binary files differ
BaseSet/bin/Release/BLL.dll
Binary files differ
BaseSet/bin/Release/BLL.pdb
Binary files differ
BaseSet/bin/Release/BaseSet.dll
Binary files differ
BaseSet/bin/Release/BaseSet.pdb
Binary files differ
BaseSet/bin/Release/DAL.dll
Binary files differ
BaseSet/bin/Release/DAL.pdb
Binary files differ
BaseSet/bin/Release/Model.dll
Binary files differ
BaseSet/bin/Release/Model.pdb
Binary files differ
DAL/DAL.csproj
@@ -812,6 +812,7 @@
    <Compile Include="车间管理\ClsSc_ProcExchQualityReport.cs" />
    <Compile Include="车间管理\ClsSc_ProcExchReport.cs" />
    <Compile Include="销售管理\ClsKf_ICStockBackBill.cs" />
    <Compile Include="销售管理\ClsXs_OutDoorBill.cs" />
    <Compile Include="销售管理\ClsXs_SellOutChangeBill.cs" />
    <Compile Include="销售管理\ClsXs_ReceivableBill.cs" />
    <Compile Include="销售管理\ClsXs_OutDoorCheckBill.cs" />
DAL/bin/Release/DAL.dll
Binary files differ
DAL/bin/Release/DAL.pdb
Binary files differ
DAL/bin/Release/Model.dll
Binary files differ
DAL/bin/Release/Model.pdb
Binary files differ
DAL/ÏúÊÛ¹ÜÀí/ClsXs_OutDoorBill.cs
New file
@@ -0,0 +1,441 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsXs_OutDoorBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsXs_OutDoorBillMain omodel = new Model.ClsXs_OutDoorBillMain();
        public List<Model.ClsXs_OutDoorBillSub> DetailColl = new List<Model.ClsXs_OutDoorBillSub>();
        public ClsXs_OutDoorBill()
        {
            base.MvarItemKeySub = "Xs_OutDoorBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "Xs_OutDoorBillMain";
            base.MvarReportTitle = "出门确认单";
            base.BillType = "1427";
            base.HBillSubType = "1427";
        }
        #region å›ºå®šä»£ç 
        ~ClsXs_OutDoorBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_OutDoorBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_OutDoorBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                oCn.BeginTran();
                string mainSql = "UpDate Xs_OutDoorBillMain set  " +
                " HBillSubType='" + omodel.HBillSubType + "'" +
                ",HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HDate.Year + "'" +
                ",HPeriod='" + omodel.HDate.Month + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + omodel.HUpDater + "'" +
                ",HUpDateDate=getdate()" +
                ",HStockOrgID=" + omodel.HStockOrgID +
                //========================================
                ",HCusID=" + omodel.HCusID.ToString() +
                ",HEmpID=" + omodel.HEmpID + "" +
                ",HShipper='" + omodel.HShipper + "'" +
                ",HCarNumber='" + omodel.HCarNumber + "'" +
                ",HPhone='" + omodel.HPhone + "'" +
                ",HOutReason='" + omodel.HOutReason + "'" +
                ",HMaterName='" + omodel.HMaterName + "'" +
                " where HInterID=" + lngBillKey.ToString();
                oCn.RunProc(mainSql);
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsXs_OutDoorBillSub oSub in DetailColl)
                {
                    string subSql = "Insert into Xs_OutDoorBillSub" +
                        "(HInterID,HBillNo_bak,HEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HQty,HPieceQty" +
                        ") " +
                        "values(" +
                        "" + omodel.HInterID + "" +
                        ",'" + omodel.HBillNo + "'" +
                        "," + oSub.HEntryID + "" +
                        ",'" + oSub.HRemark + "'" +
                        "," + oSub.HSourceInterID + "" +
                        "," + oSub.HSourceEntryID + "" +
                        ",'" + (oSub.HSourceBillNo == null ? "" : oSub.HSourceBillNo) + "'" +
                        ",'" + (oSub.HSourceBillType == null ? "" : oSub.HSourceBillType) + "'" +
                        "," + oSub.HRelationQty + "" +
                        "," + oSub.HRelationMoney + "" +
                        "," + oSub.HMaterID + "" +
                        "," + oSub.HQty + "" +
                        "," + oSub.HPieceQty + "" +
                        ")";
                    oCn.RunProc(subSql);
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_Xs_OutDoorBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Xs_OutDoorBill_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;
                }
                //==============================================================================
                //反写源单关联数量
                oCn.RunProc("exec h_p_Xs_OutDoorBill_RewriteSellOutBill " + omodel.HInterID.ToString());
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_OutDoorBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_OutDoorBill_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();
                //检查主表内码是否重复,若重复则重新生成并继续检查,直到不再重复
                while (true)
                {
                    ds = oCn.RunProcReturn("select * from Xs_OutDoorBillMain where HInterID = " + omodel.HInterID, "Xs_OutDoorBillMain");
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                    }
                    else
                    {
                        break;
                    }
                }
                //插入主表
                string mainSql = "Insert Into Xs_OutDoorBillMain" +
                    "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HDate,HBillStatus,HMaker,HMakeDate,HRemark,HStockOrgID" +
                    ",HCusID,HEmpID,HShipper,HCarNumber,HPhone,HOutReason,HMaterName) " +
                    "values(" +
                    "" + omodel.HDate.Year + "" +
                    "," + omodel.HDate.Month + "" +
                    ",'" + this.BillType + "'" +
                    ",'" + omodel.HBillSubType + "'" +
                    "," + omodel.HInterID + "" +
                    ",'" + omodel.HBillNo + "'" +
                    ",'" + omodel.HDate + "'" +
                    "," + "1" + "" +
                    ",'" + omodel.HMaker + "'" +
                    "," + "getdate()" + "" +
                    ",'" + omodel.HRemark + "'" +
                    "," + omodel.HStockOrgID + "" +
                    "," + omodel.HCusID + "" +
                    "," + omodel.HEmpID + "" +
                    ",'" + omodel.HShipper + "'" +
                    ",'" + omodel.HCarNumber + "'" +
                    ",'" + omodel.HPhone + "'" +
                    ",'" + omodel.HOutReason + "'" +
                    ",'" + omodel.HMaterName + "'" +
                    ")";
                oCn.RunProc(mainSql);
                //插入子表
                foreach (Model.ClsXs_OutDoorBillSub oSub in DetailColl)
                {
                    string subSql = "Insert into Xs_OutDoorBillSub" +
                        "(HInterID,HBillNo_bak,HEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HQty,HPieceQty" +
                        ") " +
                        "values(" +
                        "" + omodel.HInterID + "" +
                        ",'" + omodel.HBillNo + "'" +
                        "," + oSub.HEntryID + "" +
                        ",'" + oSub.HRemark + "'" +
                        "," + oSub.HSourceInterID + "" +
                        "," + oSub.HSourceEntryID + "" +
                        ",'" + (oSub.HSourceBillNo == null ? "" : oSub.HSourceBillNo) + "'" +
                        ",'" + (oSub.HSourceBillType == null ? "" : oSub.HSourceBillType) + "'" +
                        "," + oSub.HRelationQty + "" +
                        "," + oSub.HRelationMoney + "" +
                        "," + oSub.HMaterID + "" +
                        "," + oSub.HQty + "" +
                        "," + oSub.HPieceQty + "" +
                        ")";
                    oCn.RunProc(subSql);
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_Xs_OutDoorBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Xs_OutDoorBill_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;
                }
                //===============================================================
                //反写源单关联数量
                oCn.RunProc("exec h_p_Xs_OutDoorBill_RewriteSellOutBill " + omodel.HInterID.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 Xs_OutDoorBillMain Where HInterID=" + lngBillKey.ToString(), "Xs_OutDoorBillMain");
                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.HPrintQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPrintQty"]);
                omodel.HStockOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HStockOrgID"]);
                //========================================================
                omodel.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"]);
                omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
                omodel.HShipper = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HShipper"]);
                omodel.HCarNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCarNumber"]);
                omodel.HPhone = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPhone"]);
                omodel.HOutReason = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HOutReason"]);
                omodel.HMaterName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterName"]);
                omodel.HOutCheckMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HOutCheckMan"]);
                omodel.HOutCheckDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HOutCheckDate"]);
                //
                //循环
                DataSet DsSub;
                DsSub = oCn.RunProcReturn("Select * from Xs_OutDoorBillSub Where HInterID=" + lngBillKey.ToString(), "Xs_OutDoorBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsXs_OutDoorBillSub oSub = new Model.ClsXs_OutDoorBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
                    oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]);
                    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.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
                    oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]);
                    oSub.HPieceQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPieceQty"]);
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        public void BackPrintQty(Int64 sInterID)
        {
            //回填打印次数
            oCn.RunProc("update " + this.MvarItemKey + " set HPrintQty=HPrintQty + 1 Where HInterID= " + sInterID.ToString());
        }
        //发起审批
        public bool startCheckFlow(Int64 lngBillKey, Int64 HCheckFlowID_select, ref string sReturn)
        {
            try
            {
                string HBillNo = "";                //单据号
                string HCheckFlowID = "";           //审批流ID
                string HCheckItemNowID = "";        //当前审核项目ID
                string HCheckItemNextID = "";       //待审核项目ID
                //判断是否已经发起审批
                string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + this.BillType + "'";
                DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus");
                if (ds0 != null && ds0.Tables[0].Rows.Count > 0)
                {
                    sReturn = "单据已发起审批,不可重复审批!";
                    return false;
                }
                //获取单据数据
                string sql = "select * from " + this.MvarItemKey + " where HInterID = " + lngBillKey;
                DataSet ds = oCn.RunProcReturn(sql, this.MvarItemKey);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "单据不存在!";
                    return false;
                }
                HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                //获取单据类型对应的默认审批流
                string sql1 = "select b.HInterID,b.HCheckItemID from Xt_CheckFlowMain as a " +
                                "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " +
                                "where a.HBillTypeID = '" + this.BillType + "' " +
                                "and a.HInterID = " + HCheckFlowID_select + " " +
                                "order by b.HFlowNo asc";
                DataSet ds1 = oCn.RunProcReturn(sql1, "Xt_CheckFlowMain");
                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                {
                    sReturn = "默认审批流不存在!";
                    return false;
                }
                HCheckFlowID = ds1.Tables[0].Rows[0]["HInterID"].ToString();
                HCheckItemNowID = ds1.Tables[0].Rows[0]["HCheckItemID"].ToString();
                if (ds1.Tables[0].Rows.Count >= 2)
                {
                    HCheckItemNextID = ds1.Tables[0].Rows[1]["HCheckItemID"].ToString();
                }
                else
                {
                    HCheckItemNextID = "0";
                }
                oCn.BeginTran();
                //增加 å•据审批状态表 æ•°æ®
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    string sql2 = "insert into Xt_BillCheckFlowStatus" +
                        "(HBillTypeID,HBillInterID,HBillNo,HCheckFlowID,HCheckItemID,HChecker,HCheckDate,HCheckNote) " +
                        "values(" +
                        "'" + this.BillType + "'," +
                        "" + lngBillKey + "," +
                        "'" + HBillNo + "'," +
                        "" + ds1.Tables[0].Rows[i]["HInterID"].ToString() + "," +
                        "" + ds1.Tables[0].Rows[i]["HCheckItemID"].ToString() + "," +
                        "" + "''" + "," +
                        "" + "''" + "," +
                        "" + "''" + "" +
                        ")";
                    oCn.RunProc(sql2);
                }
                //更新主表 å®¡æ‰¹æµ æ•°æ®
                string sql3 = "update " + this.MvarItemKey + " set HCheckFlowID = " + HCheckFlowID + ",HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey;
                oCn.RunProc(sql3);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn += e.Message;
                return false;
            }
        }
    }
}
DBUtility/obj/Release/DBUtility.csproj.AssemblyReference.cache
Binary files differ
Model/Model.csproj
@@ -1036,6 +1036,8 @@
    <Compile Include="金蝶单据\销售管理\ClsXs_SeOutStockBackBillSub_K3.cs" />
    <Compile Include="金蝶单据\销售管理\ClsXs_SeOutStockBillMain_K3.cs" />
    <Compile Include="金蝶单据\销售管理\ClsXs_SeOutStockBillSub_K3.cs" />
    <Compile Include="销售管理\ClsXs_OutDoorBillMain.cs" />
    <Compile Include="销售管理\ClsXs_OutDoorBillSub.cs" />
    <Compile Include="销售管理\ClsXs_SellOutChangeBillSub.cs" />
    <Compile Include="销售管理\ClsXs_SellOutChangeBillMain.cs" />
    <Compile Include="销售管理\ClsKf_ICStockBackBillMain.cs" />
Model/bin/Release/Model.dll
Binary files differ
Model/bin/Release/Model.pdb
Binary files differ
Model/obj/Release/Model.csproj.AssemblyReference.cache
Binary files differ
Model/obj/Release/Model.dll
Binary files differ
Model/obj/Release/Model.pdb
Binary files differ
Model/ÏúÊÛ¹ÜÀí/ClsXs_OutDoorBillMain.cs
New file
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsXs_OutDoorBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HEmpID;        //业务员
        public Int64 HCusID;//        int        --客户
        public string HShipper;         //varchar  å¸æœº
        public string HCarNumber;       //车牌号
        public string HPhone;           //联系电话
        public string HOutReason;       //出门原因
        public string HMaterName;       //装运何物
        public string HOutCheckMan;     //出门确认人
        public string HOutCheckDate;    //出门确认时间
        public Int64 HStockOrgID;
        public Int64 HPrintQty;         //打印次数
    }
}
Model/ÏúÊÛ¹ÜÀí/ClsXs_OutDoorBillSub.cs
New file
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsXs_OutDoorBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HMaterID;
        public Double HQty;
        public Int64 HPieceQty;
    }
}
PlanM/bin/Release/BLL.dll
Binary files differ
PlanM/bin/Release/BLL.pdb
Binary files differ
PlanM/bin/Release/DAL.dll
Binary files differ
PlanM/bin/Release/DAL.pdb
Binary files differ
PlanM/bin/Release/Model.dll
Binary files differ
PlanM/bin/Release/Model.pdb
Binary files differ
PlanM/bin/Release/PlanM.dll
Binary files differ
PlanM/bin/Release/PlanM.pdb
Binary files differ
SQLHelper/obj/Release/SQLHelper.csproj.AssemblyReference.cache
Binary files differ
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache
Binary files differ
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt
@@ -3,4 +3,3 @@
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.CoreCompileInputs.cache
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.dll
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.pdb
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.AssemblyReference.cache
WarM/bin/Release/BLL.dll
Binary files differ
WarM/bin/Release/BLL.pdb
Binary files differ
WarM/bin/Release/DAL.dll
Binary files differ
WarM/bin/Release/DAL.pdb
Binary files differ
WarM/bin/Release/Model.dll
Binary files differ
WarM/bin/Release/Model.pdb
Binary files differ
WarM/bin/Release/WarM.dll
Binary files differ
WarM/bin/Release/WarM.pdb
Binary files differ
WebAPI/Controllers/XSGL/Kf_SellOutBillController.cs
@@ -1257,7 +1257,7 @@
            {
                List<object> columnNameListSum = new List<object>();
                List<object> columnNameList0 = new List<object>();
                //List<object> columnNameList1 = new List<object>();
                List<object> columnNameList1 = new List<object>();
                //List<object> columnNameList2 = new List<object>();
                //List<object> columnNameList3 = new List<object>();
                //List<object> columnNameList4 = new List<object>();
@@ -1273,13 +1273,13 @@
                    columnNameList0.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                ////添加 ç”Ÿäº§è®¢å• åˆ—名
                //foreach (DataColumn col in ds.Tables[1].Columns)
                //{
                //    Type dataType = col.DataType;
                //    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                //    columnNameList1.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                //}
                //添加 ç”Ÿäº§è®¢å• åˆ—名
                foreach (DataColumn col in ds.Tables[1].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList1.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                ////添加 ç‰¹æ‰¹ç”³è¯·å• åˆ—名
                //foreach (DataColumn col in ds.Tables[2].Columns)
@@ -1306,7 +1306,7 @@
                //}
                columnNameListSum.Add(columnNameList0);
                //columnNameListSum.Add(columnNameList1);
                columnNameListSum.Add(columnNameList1);
                //columnNameListSum.Add(columnNameList2);
                //columnNameListSum.Add(columnNameList3);
                //columnNameListSum.Add(columnNameList4);
WebAPI/Controllers/XSGL/Xs_OutDoorBillController.cs
New file
@@ -0,0 +1,1220 @@
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.Net;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    //出门确认单Controller
    public class Xs_OutDoorBillController : ApiController
    {
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        public DAL.ClsXs_OutDoorBill BillOld = new DAL.ClsXs_OutDoorBill();
        public DAL.ClsXs_OutDoorBill BillNew0 = new DAL.ClsXs_OutDoorBill();
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region å‡ºé—¨ç¡®è®¤å•列表 æŸ¥è¯¢
        /// <summary>
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xs_OutDoorBill/list")]
        [HttpGet]
        public object getXs_OutDoorBill(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Xs_OutDoorCheckBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Xs_OutDoorBillList_Query order by å•据号 desc", "h_v_Xs_OutDoorBillList_Query");
                }
                else
                {
                    string sql1 = "select * from h_v_Xs_OutDoorBillList_Query where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Xs_OutDoorBillList_Query");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å‡ºé—¨ç¡®è®¤å•列表 å·²ç¡®è®¤å‡ºé—¨åˆ—表查询
        /// <summary>
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Xs_OutDoorBill/list_checked")]
        [HttpGet]
        public object getXs_OutDoorBill_Checked(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Xs_OutDoorCheckBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Xs_OutDoorBillList_Checked_Query order by å•据号 desc", "h_v_Xs_OutDoorBillList_Checked_Query");
                }
                else
                {
                    string sql1 = "select * from h_v_Xs_OutDoorBillList_Checked_Query where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Xs_OutDoorBillList_Checked_Query");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å‡ºé—¨ç¡®è®¤å•保存 æ–°å¢ž/编辑
        [Route("Xs_OutDoorBill/SaveXs_OutDoorBill")]
        [HttpPost]
        public object SaveXs_OutDoorBill([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();                             //子表1数据
            string refSav = sArray[2].ToString();                           //操作方式
            string msg4 = sArray[3].ToString();                             //用户
            DBUtility.ClsPub.CurUserName = msg4;
            string UserName = "";
            string s = "";
            ListModels oListModels = new ListModels();
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Xs_OutDoorCheckBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsXs_OutDoorBill oBill = new DAL.ClsXs_OutDoorBill();
                List<Model.ClsXs_OutDoorBillMain> lsmain = new List<Model.ClsXs_OutDoorBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Xs_OutDoorBillMain(msg2);
                foreach (Model.ClsXs_OutDoorBillMain oItem in lsmain)
                {
                    if (refSav == "Add")
                    {
                        //单据号是否重复
                        if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据号重复!不允许保存!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    if (refSav == "Update")
                    {
                        if (BillOld.ShowBill(oItem.HInterID, ref s) == false)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据有误!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //判断是否可编辑
                        if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据已经被审核,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (BillOld.omodel.HBillStatus > 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "此单据处于不可编辑状态,不允许修改!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = s + ",不允许修改";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                    }
                    oItem.HMaker = msg4;
                    oItem.HUpDater = msg4;
                    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
                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsXs_OutDoorBillSub> ls = new List<Model.ClsXs_OutDoorBillSub>();
                ls = oListModels.getObjectByJson_Xs_OutDoorBillSub(msg3);
                int i = 0;
                foreach (Model.ClsXs_OutDoorBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    //oItemSub.HCloseMan = "";       //行关闭
                    //oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    //oItemSub.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    //oItemSub.HSourceInterID = 0;     // æºå•主内码
                    //oItemSub.HSourceEntryID = 0;   //源单子内码
                    //oItemSub.HSourceBillNo = "";  //源单单号
                    //oItemSub.HSourceBillType = ""; //源单类型
                    //oItemSub.HRelationQty = 0;     //关联数量
                    //oItemSub.HRelationMoney = 0;   //关联金额
                    oBill.DetailColl.Add(oItemSub);
                }
                //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (refSav == "Add")
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    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 = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    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("Xs_OutDoorBill/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_Xs_OutDoorBillList where hmainid=" + HInterID, "h_v_Xs_OutDoorBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å‡ºé—¨ç¡®è®¤å• åˆ é™¤
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("Xs_OutDoorBill/delete")]
        [HttpGet]
        public object deleteXs_OutDoorBill(string HInterID, string user)
        {
            try
            {
                string s = "";
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Xs_OutDoorCheckBill_Drop", 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_Xs_OutDoorBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_Xs_OutDoorBill_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;
                }
                //==================================================================================
                //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
                oCN.BeginTran();
                //反写源单关联数量
                oCN.RunProc("exec h_p_Xs_OutDoorBill_RewriteSellOutBillDelete " + HInterID);
                oCN.RunProc("delete from Xs_OutDoorBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Xs_OutDoorBillSub where HInterID= " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_Xs_OutDoorBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_Xs_OutDoorBill_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)
            {
                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("Xs_OutDoorBill/AuditXs_OutDoorBill")]
        [HttpGet]
        public object AuditXs_OutDoorBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "Xs_OutDoorCheckBill_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.ClsXs_OutDoorBill oBill = new DAL.ClsXs_OutDoorBill();                              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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;
                        }
                    }
                    for(int i = 0; i < oBill.DetailColl.Count; i++)
                    {
                        //检查源单是否存在
                        string sql = "select * from Kf_ICStockBillMain where HInterID = " + oBill.DetailColl[i].HSourceInterID;
                        ds = oCN.RunProcReturn(sql, "Kf_ICStockBillMain");
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!原因:源单[" + oBill.DetailColl[i].HSourceBillNo + "]数据不存在!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        else if (ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "2")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!原因:源单[" + oBill.DetailColl[i].HSourceBillNo + "]未处于已审核状态!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的审核/反审核操作
                if (IsAudit == 0) //审核提交
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Xs_OutDoorBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Xs_OutDoorBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    oCN.BeginTran();
                    //审核提交
                    if (oBill.CheckBill(oCN,oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Xs_OutDoorBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //进行 ä¼šè®¡æœŸé—´ ç»“è´¦ çš„判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Xs_OutDoorBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Xs_OutDoorBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    oCN.BeginTran();
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oCN,oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Xs_OutDoorBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        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("Xs_OutDoorBill/CloseXs_OutDoorBill")]
        [HttpGet]
        public object CloseXs_OutDoorBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "Xs_OutDoorCheckBill_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.ClsXs_OutDoorBill oBill = new DAL.ClsXs_OutDoorBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                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("Xs_OutDoorBill/DeleteXs_OutDoorBill")]
        [HttpGet]
        public object DeleteXs_OutDoorBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "Xs_OutDoorCheckBill_Delete";
            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.ClsXs_OutDoorBill oBill = new DAL.ClsXs_OutDoorBill();              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HChecker.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能进行作废!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未作废!不需要反作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //进行需要进行的作废/反作废操作
                if (IsAudit == 0) //作废提交
                {
                    //作废提交
                    if (oBill.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反作废失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "作废失败或者反作废失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å‡ºé—¨ç¡®è®¤å•列表 ç¡®è®¤å‡ºé—¨-撤销
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("Xs_OutDoorBill/revoke")]
        [HttpGet]
        public object revokeXs_OutDoorBill(string HInterID,string HBillNo, string user)
        {
            try
            {
                oCN.BeginTran();
                string sql = " update Xs_OutDoorBillMain set HOutCheckMan = '',HOutCheckDate = null where HInterID = " + HInterID;
                oCN.RunProc(sql);
                //写入日志
                string WorkList = "撤销单据-出门确认,单据号:" + HBillNo;
                string MvarReportTitle = BillNew0.MvarReportTitle;
                string SystemName = "LMES-" + MvarReportTitle + "模块";
                string ComputerName = SystemInformation.ComputerName;
                string IPAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString();
                oCN.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
                    "(getdate(),'" + user + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','撤销')"
                    );
                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 å‡ºé—¨ç¡®è®¤å• æ‰«ç å‡ºé—¨ç¡®è®¤-获取单据信息
        [Route("Xs_OutDoorBill/cx_PDA")]
        [HttpGet]
        public object cx_PDA(string HBillNo,int HStockOrgID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select * from h_v_Xs_OutDoorBillList_PDA where å•据号='" + HBillNo + "' and HStockOrgID = " + HStockOrgID, "h_v_Xs_OutDoorBillList_PDA");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å‡ºé—¨ç¡®è®¤å• æ‰«ç å‡ºé—¨ç¡®è®¤-提交
        [Route("Xs_OutDoorBill/OutDoorCheck_Xs_OutDoorBill")]
        [HttpPost]
        public object OutDoorCheck_Xs_OutDoorBill([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();                             //子表1数据
            string msg4 = sArray[2].ToString();                             //用户
            DBUtility.ClsPub.CurUserName = msg4;
            string UserName = "";
            string s = "";
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsXs_OutDoorBill oBill = new DAL.ClsXs_OutDoorBill();
                List<Model.ClsXs_OutDoorBillMain> lsmain = new List<Model.ClsXs_OutDoorBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Xs_OutDoorBillMain(msg2);
                oCN.BeginTran();
                Model.ClsXs_OutDoorBillMain oItem = lsmain[0];
                if (BillOld.ShowBill(oItem.HInterID, ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否为已审核状态
                if (BillOld.omodel.HBillStatus != 2)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "提交失败!此单据当前状态不为“已审核”!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                if (BillOld.omodel.HOutCheckMan != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "提交失败!此单据已经提交,无需重复提交!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                string HShipper = oItem.HShipper;
                string HCarNumber = oItem.HCarNumber;
                string HPhone = oItem.HPhone;
                string HOutReason = oItem.HOutReason;
                string HMaterName = oItem.HMaterName;
                string HRemark = oItem.HRemark;
                string HOutCheckMan = msg4;
                string sql = "update Xs_OutDoorBillMain set " +
                    //"HShipper = '" + HShipper + "'" +
                    //",HCarNumber = '" + HCarNumber + "'" +
                    //",HPhone = '" + HPhone + "'" +
                    //",HOutReason='" + HOutReason + "'" +
                    //",HMaterName ='" + HMaterName + "'" +
                    //",HRemark = '" + HRemark + "'" +
                    "HOutCheckMan = '" + HOutCheckMan + "'" +
                    ",HOutCheckDate = getdate() " +
                    "where HInterID = " + oItem.HInterID;
                oCN.RunProc(sql);
                //==============================写入日志
                string WorkList = "单据-出门确认,单据号:" + oItem.HBillNo;
                string MvarReportTitle = BillNew0.MvarReportTitle;
                string SystemName = "LMES-" + MvarReportTitle + "模块";
                string ComputerName = SystemInformation.ComputerName;
                string IPAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString();
                oCN.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
                    "(getdate(),'" + msg4 + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','出门确认')"
                    );
                //=======================================
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "提交成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/ListModels.cs
@@ -4152,6 +4152,21 @@
        }
        #endregion
        #region å‡ºé—¨ç¡®è®¤å•_新
        public List<Model.ClsXs_OutDoorBillMain> getObjectByJson_Xs_OutDoorBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsXs_OutDoorBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXs_OutDoorBillMain>>(jsonString);
            return list;
        }
        public List<Model.ClsXs_OutDoorBillSub> getObjectByJson_Xs_OutDoorBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsXs_OutDoorBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXs_OutDoorBillSub>>(jsonString);
            return list;
        }
        #endregion
        #region åº”收退款单
        /// <summary>
        /// åº”收退款单主表json
WebAPI/Properties/PublishProfiles/FolderProfile6.pubxml.user
@@ -4,7 +4,7 @@
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <History>True|2024-10-11T08:49:55.1188159Z;True|2024-10-11T16:11:04.2021026+08:00;True|2024-10-11T15:48:50.7687290+08:00;True|2024-10-11T15:33:27.8527915+08:00;True|2024-10-11T14:49:01.6142514+08:00;False|2024-10-11T14:48:33.6149374+08:00;True|2024-10-11T13:50:33.4424142+08:00;False|2024-10-11T13:41:53.6580199+08:00;False|2024-10-11T13:41:39.5167380+08:00;False|2024-10-11T13:37:52.6531605+08:00;False|2024-10-11T13:37:11.7263329+08:00;</History>
    <History>True|2024-10-16T03:57:09.2205029Z;True|2024-10-16T11:47:09.1175797+08:00;True|2024-10-16T11:12:45.2631759+08:00;False|2024-10-16T11:11:57.2236500+08:00;True|2024-10-15T16:20:02.9116206+08:00;True|2024-10-15T15:58:43.2926050+08:00;True|2024-10-15T15:42:21.7936803+08:00;True|2024-10-15T15:08:43.2300880+08:00;True|2024-10-15T14:57:53.1025144+08:00;True|2024-10-15T14:49:52.0203753+08:00;True|2024-10-15T13:43:28.4322672+08:00;True|2024-10-15T13:02:51.9833820+08:00;True|2024-10-15T10:35:13.3052884+08:00;True|2024-10-15T10:31:23.7280933+08:00;True|2024-10-15T10:16:45.0292893+08:00;True|2024-10-15T09:59:30.2256849+08:00;True|2024-10-15T09:53:37.7284098+08:00;True|2024-10-15T09:45:34.6928334+08:00;False|2024-10-15T09:45:08.0828173+08:00;True|2024-10-15T09:20:15.0444151+08:00;False|2024-10-15T09:18:15.4388995+08:00;True|2024-10-14T15:31:49.0978922+08:00;False|2024-10-14T15:31:08.3741419+08:00;True|2024-10-14T15:09:44.3508500+08:00;True|2024-10-14T14:45:34.5430843+08:00;True|2024-10-14T14:04:11.8258435+08:00;True|2024-10-14T13:54:24.2353356+08:00;True|2024-10-14T13:48:16.0893349+08:00;False|2024-10-14T13:47:57.1909782+08:00;True|2024-10-14T11:12:14.9583385+08:00;False|2024-10-14T11:11:21.0058133+08:00;True|2024-10-11T16:49:55.1188159+08:00;True|2024-10-11T16:11:04.2021026+08:00;True|2024-10-11T15:48:50.7687290+08:00;True|2024-10-11T15:33:27.8527915+08:00;True|2024-10-11T14:49:01.6142514+08:00;False|2024-10-11T14:48:33.6149374+08:00;True|2024-10-11T13:50:33.4424142+08:00;False|2024-10-11T13:41:53.6580199+08:00;False|2024-10-11T13:41:39.5167380+08:00;False|2024-10-11T13:37:52.6531605+08:00;False|2024-10-11T13:37:11.7263329+08:00;</History>
    <_PublishTargetUrl>D:\网站发布\智云MESWMS\API</_PublishTargetUrl>
  </PropertyGroup>
  <ItemGroup>
@@ -45,19 +45,19 @@
      <publishTime>02/22/2013 16:43:40</publishTime>
    </File>
    <File Include="bin/BLL.dll">
      <publishTime>10/11/2024 13:37:29</publishTime>
      <publishTime>10/16/2024 11:46:33</publishTime>
    </File>
    <File Include="bin/BLL.pdb">
      <publishTime>10/11/2024 13:37:29</publishTime>
      <publishTime>10/16/2024 11:46:33</publishTime>
    </File>
    <File Include="bin/BouncyCastle.Crypto.dll">
      <publishTime>12/18/2020 05:32:28</publishTime>
    </File>
    <File Include="bin/DAL.dll">
      <publishTime>10/11/2024 13:37:28</publishTime>
      <publishTime>10/16/2024 11:46:31</publishTime>
    </File>
    <File Include="bin/DAL.pdb">
      <publishTime>10/11/2024 13:37:28</publishTime>
      <publishTime>10/16/2024 11:46:31</publishTime>
    </File>
    <File Include="bin/Dapper.dll">
      <publishTime>07/22/2016 22:52:40</publishTime>
@@ -111,10 +111,10 @@
      <publishTime>07/25/2012 19:48:56</publishTime>
    </File>
    <File Include="bin/Model.dll">
      <publishTime>10/11/2024 13:37:24</publishTime>
      <publishTime>10/16/2024 11:46:26</publishTime>
    </File>
    <File Include="bin/Model.pdb">
      <publishTime>10/11/2024 13:37:24</publishTime>
      <publishTime>10/16/2024 11:46:26</publishTime>
    </File>
    <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
      <publishTime>04/06/2023 15:57:02</publishTime>
@@ -294,13 +294,13 @@
      <publishTime>11/24/2014 19:18:48</publishTime>
    </File>
    <File Include="bin/WebAPI.dll">
      <publishTime>10/11/2024 16:49:47</publishTime>
      <publishTime>10/16/2024 11:47:03</publishTime>
    </File>
    <File Include="bin/WebAPI.pdb">
      <publishTime>10/11/2024 16:49:47</publishTime>
      <publishTime>10/16/2024 11:47:03</publishTime>
    </File>
    <File Include="bin/WebAPI.XmlSerializers.dll">
      <publishTime>10/11/2024 16:49:54</publishTime>
      <publishTime>10/16/2024 11:47:08</publishTime>
    </File>
    <File Include="bin/WebGrease.dll">
      <publishTime>07/18/2013 01:03:52</publishTime>
WebAPI/WebAPI.csproj
@@ -442,6 +442,7 @@
    <Compile Include="Controllers\SBGL\SBBB\Sb_EquipMentCollectionTechParamController.cs" />
    <Compile Include="Controllers\SBGL\SBBB\Sb_EquipMentCollectionTechParam_TempController.cs" />
    <Compile Include="Controllers\SCGL\Sc_ProductionReportsController.cs" />
    <Compile Include="Controllers\XSGL\Xs_OutDoorBillController.cs" />
    <Compile Include="Controllers\ZLGL\BaseSet\Gy_InspectBasisController.cs" />
    <Compile Include="Controllers\ZLGL\BaseSet\Gy_InspectMethodController.cs" />
    <Compile Include="Controllers\ZLGL\BaseSet\Gy_QualityController.cs" />
WorkM/bin/Release/BLL.dll
Binary files differ
WorkM/bin/Release/BLL.pdb
Binary files differ
WorkM/bin/Release/DAL.dll
Binary files differ
WorkM/bin/Release/DAL.pdb
Binary files differ
WorkM/bin/Release/Model.dll
Binary files differ
WorkM/bin/Release/Model.pdb
Binary files differ
WorkM/bin/Release/WarM.dll
Binary files differ
WorkM/bin/Release/WarM.pdb
Binary files differ
WorkM/bin/Release/WorkM.dll
Binary files differ
WorkM/bin/Release/WorkM.pdb
Binary files differ
sdk_dingding/TopSdk/bin/Debug/TopSdk.dll
Binary files differ
sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb
Binary files differ
sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.AssemblyReference.cache
Binary files differ
sdk_dingding/TopSdk/obj/Debug/TopSdk.csproj.FileListAbsolute.txt
@@ -21,4 +21,3 @@
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.csproj.CoreCompileInputs.cache
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.dll
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.pdb
D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\sdk_dingding\TopSdk\obj\Debug\TopSdk.csproj.AssemblyReference.cache
sdk_dingding/TopSdk/obj/Debug/TopSdk.dll
Binary files differ
sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb
Binary files differ