yusijie
2025-06-29 e69d3f70d1c82fdbf5cc0b39f55882a10361c0d6
小车锁定;排时根据产品器具清单获取模具;
7个文件已修改
3个文件已添加
403 ■■■■■ 已修改文件
DAL/DAL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/仓库管理/小车锁定/ClsKf_TrolleyPositionBill.cs 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/仓库管理/ClsKf_TrolleyPositionBillMain.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/仓库管理/ClsKf_TrolleyPositionBillSub.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/条码管理/WEBSController.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ICMOReportBill.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -80,6 +80,7 @@
  <ItemGroup>
    <Compile Include="APS\ClsSc_WorkBillMonthSortBill.cs" />
    <Compile Include="APS\ClsSc_ICMOChangeBill.cs" />
    <Compile Include="仓库管理\小车锁定\ClsKf_TrolleyPositionBill.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_PatrolCheckItemMethod_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_PatrolCheckItemClass_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_MaintainClass_Ctl.cs" />
DAL/²Ö¿â¹ÜÀí/С³µËø¶¨/ClsKf_TrolleyPositionBill.cs
New file
@@ -0,0 +1,211 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsKf_TrolleyPositionBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsKf_TrolleyPositionBillMain omodel = new Model.ClsKf_TrolleyPositionBillMain();
        public List<Model.ClsKf_TrolleyPositionBillSub> DetailColl = new List<Model.ClsKf_TrolleyPositionBillSub>();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        public ClsKf_TrolleyPositionBill()
        {
            base.MvarItemKeySub = "Kf_TrolleyPositionBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "Kf_TrolleyPositionBillMain";
            base.MvarReportTitle = "小车锁定";
            base.BillType = "10004";
            base.HBillSubType = "10004";
        }
        #region å›ºå®šä»£ç 
        ~ClsKf_TrolleyPositionBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            string sErr = "";
            try
            {
                //得到mainid
                if (omodel.HInterID == 0 || omodel.HInterID.ToString() == null || omodel.HInterID.ToString() == "undefined")
                {
                    omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Kf_TrolleyPositionBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Kf_TrolleyPositionBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                oCn.BeginTran();
                //插入主表
                oCn.RunProc("Insert Into Kf_TrolleyPositionBillMain   " +
                "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" +
                ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" +
                ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" +
                ",HWHID,HSPID,HSCWHID,HSCSPID" +
                ") " +
                " values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HBillType + "','" + omodel.HBillSubType + "','" + omodel.HDate.ToShortDateString() + "','" + omodel.HRemark + "'" +
                ", " + omodel.HYear + "," + omodel.HPeriod + ",'" + omodel.HMaker + "',getdate()," + omodel.HSTOCKORGID.ToString() +
                ",'" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "'" +
                ", " + omodel.HWHID.ToString() + "," + omodel.HSPID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HSCSPID.ToString() +
                ") ");
                sErr = sErr + "1;";
                //插入子表
                foreach (Model.ClsKf_TrolleyPositionBillSub oSub in DetailColl)
                {
                    string sql1 = string.Format(@"Insert into Kf_TrolleyPositionBillSub " +
                      " (HInterID,HEntryID,HBillNo_bak,HRemark," +
                      "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType," +
                      "HRelationQty,HRelationMoney," +
                      "HMaterID,HUnitID,HWhID,HSCWHID,HSPID,HSCSPID,HCarBarCode,HEquipID,HEquipBarCode," +
                      "HICMOInterID,HICMOEntryID,HICMOBillNo,HProcessExchangeInterID,HProcessExchangeEntryID,HProcessExchangeBillNo,HStockOrgID" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + omodel.HBillNo + "'" + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "',"
                      + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HMaterID + "," + oSub.HUnitID + "," + oSub.HWhID + ","
                      + oSub.HSCWHID + "," + oSub.HSPID + "," + oSub.HSCSPID + ",'" + oSub.HCarBarCode + "'," + oSub.HEquipID + ",'" + oSub.HEquipBarCode + "'," + oSub.HICMOInterID + "," + oSub.HICMOEntryID + ",'"
                      + oSub.HICMOBillNo + "'," + oSub.HProcessExchangeInterID + "," + oSub.HProcessExchangeEntryID + ",'" + oSub.HProcessExchangeBillNo + "',"
                      + omodel.HSTOCKORGID +
                      ") ");
                    sErr = sErr + sql1 + "2;";
                    oCn.RunProc(sql1);
                    sErr = sErr + "3;";
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Kf_TrolleyPositionBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Kf_TrolleyPositionBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = sErr + "," + e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //查询主表
                DataSet Ds;
                Ds = oCn.RunProcReturn("Select * from Kf_TrolleyPositionBillMain Where HInterID=" + lngBillKey.ToString() , "Kf_TrolleyPositionBillMain");
                if (Ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "单据未找到!";
                    return false;
                }
                //固定赋值===========================================
                omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
                omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
                omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
                omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]);
                omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]);
                omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim();
                omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
                omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim();
                omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim();
                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
                omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim();
                omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim();
                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
                //========================================================
                //
                //循环
                DataSet DsSub;
                DsSub = oCn.RunProcReturn("Select * from Kf_TrolleyPositionBillSub Where HInterID=" + lngBillKey.ToString() , "Kf_TrolleyPositionBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsKf_TrolleyPositionBillSub oSub = new Model.ClsKf_TrolleyPositionBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
                    oSub.HBillNo_bak = DsSub.Tables[0].Rows[i]["HBillNo_bak"].ToString().Trim();
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
                    oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
                    oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
                    oSub.HRelationQty_In = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_In"]);
                    oSub.HRelationQty_Out = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_Out"]);
                    oSub.HRelationQty_WWOrder = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_WWOrder"]);
                    oSub.HRelationQty_Bad = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty_Bad"]);
                    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();
                    //===================================================
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
    }
}
Model/Model.csproj
@@ -97,6 +97,8 @@
    <Compile Include="APS\ClsSc_ICMOChangeBillMain.cs" />
    <Compile Include="APS\ClsSc_ICMOChangeBillSub.cs" />
    <Compile Include="ClsGy_PatrolCheckItemMethod_Model.cs" />
    <Compile Include="仓库管理\ClsKf_TrolleyPositionBillMain.cs" />
    <Compile Include="仓库管理\ClsKf_TrolleyPositionBillSub.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_PatrolCheckItemClass_Model.cs" />
    <Compile Include="仓库管理\ClsKf_WorkShopICStockBillMain.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_MaintainClass_Model.cs" />
Model/²Ö¿â¹ÜÀí/ClsKf_TrolleyPositionBillMain.cs
New file
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsKf_TrolleyPositionBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HWHID;         //   int            --调入仓库
        public Int64 HSPID;     //  int               --调入仓位
        public Int64 HSCWHID;         //   int             --调出仓库
        public Int64 HSCSPID;           //     int             --调出仓位
    }
}
Model/²Ö¿â¹ÜÀí/ClsKf_TrolleyPositionBillSub.cs
New file
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsKf_TrolleyPositionBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HMaterID;
        public Int64 HUnitID;
        public Int64 HWhID;
        public Int64 HSCWHID;
        public Int64 HSPID;
        public Int64 HSCSPID;
        public string HCarBarCode;
        public Int64 HEquipID;
        public string HEquipBarCode;
        public Int64 HICMOInterID;
        public Int64 HICMOEntryID;
        public string HICMOBillNo;
        public Int64 HProcessExchangeInterID;
        public Int64 HProcessExchangeEntryID;
        public string HProcessExchangeBillNo;
        public Int64 HStockOrgID;
    }
}
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs
@@ -409,7 +409,7 @@
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.Message = "保存失败err!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -286,6 +286,7 @@
                        var HEmpID = list[i]["HEmpID"].ToString();
                        var HWorkQty = list[i]["小时产能"].ToString();
                        var HSourceName = list[i]["生产资源"].ToString();
                        var HMouldID = list[i]["HMouldID"].ToString();
                        //var HWorkQty_ProdLine = list[i]["产线总产能"].ToString();
                        LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
@@ -324,7 +325,7 @@
                            " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," +
                            "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," +
                            "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" +
                            ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName)values" +
                            ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HMouldID)values" +
                            $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," +
                            $"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," +
                            $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HProdORGID == "" ? 0.ToString() : HProdORGID)}," +
@@ -332,7 +333,7 @@
                            $" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," +
                            $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," +
                            $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," +
                            $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}')";
                            $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HMouldID}')";
                        //LogService.Write("sql:" + sql);
                        //主表
@@ -378,6 +379,7 @@
                        var HOrderLev = list[i]["订单等级"].ToString();
                        var HPlanQty = list[i]["计划数量"].ToString();
                        var HEmpID = list[i]["HEmpID"].ToString();
                         var HMouldID = list[i]["HMouldID"].ToString();
                        LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd"));
                        
@@ -535,7 +537,7 @@
                            oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" +
                                $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" +
                                $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine}" +
                                $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine},HMouldID={HMouldID}" +
                                $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["单据号"].ToString()}'");
                        }                       
                    }
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -4403,6 +4403,114 @@
        #endregion
        #region å°è½¦é”å®šå•    ä¸Šä¼ ç”Ÿå•
        /// <summary>
        /// å°è½¦é”å®šå•新增上传
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_SaveTrolleyPositionBill_Json2")]
        [HttpPost]
        public object set_SaveTrolleyPositionBill_Json([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string UserName = sArray[2].ToString();
            string OperationType = sArray[3].ToString();
            DBUtility.ClsPub.CurUserName = UserName;
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsKf_TrolleyPositionBill oBill = new DAL.ClsKf_TrolleyPositionBill();
                List<Model.ClsKf_TrolleyPositionBillMain> lsmain = new List<Model.ClsKf_TrolleyPositionBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Kf_TrolleyPositionBillMain(msg2);
                foreach (Model.ClsKf_TrolleyPositionBillMain oItem in lsmain)
                {
                    DBUtility.ClsPub.CurUserName = oItem.HMaker;
                    oItem.HBillType = "10004";
                    oItem.HBillSubType = "10004";
                    oItem.HBillStatus = 1;   //单据状态(1未审,2审核通过,3关闭,4作废,5审核退回,6审核中,7已阅,8已回复,9结案,10验证,11下达,12开工,13申请审批,15申请检验,16 åˆ¤å®šåˆæ ¼ï¼Œ17判定不合格)
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有单据日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                // è¡¨ä½“数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Model.ClsKf_TrolleyPositionBillSub> ls = new List<Model.ClsKf_TrolleyPositionBillSub>();
                ls = oListModels.getObjectByJson_Kf_TrolleyPositionBillSub(msg3);
                int i = 0;
                foreach (Model.ClsKf_TrolleyPositionBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (OperationType == "1")
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.Verify = "N";
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "小车锁定单上传失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -192,6 +192,7 @@
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                {
                    LogService.Write("生产汇报单保存失败原因:" + ds.Tables[0].Rows[0]["HBackRemark"]);
                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
@@ -265,6 +266,7 @@
                    , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                {
                    LogService.Write("生产汇报单保存失败原因:" + ds.Tables[0].Rows[0]["HBackRemark"]);
                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
@@ -288,6 +290,7 @@
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                {
                    LogService.Write("生产汇报单保存失败原因:" + ds.Tables[0].Rows[0]["HBackRemark"]);
                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
@@ -300,6 +303,7 @@
            }
            catch (Exception e)
            {
                LogService.Write("生产汇报单保存失败原因:" + e.Message);
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
WebAPI/ListModels.cs
@@ -3859,6 +3859,30 @@
        }
        /// <summary>
        /// è½¦é—´å®šä½å°è½¦é”å®šä¸»è¡¨json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsKf_TrolleyPositionBillMain> getObjectByJson_Kf_TrolleyPositionBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsKf_TrolleyPositionBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_TrolleyPositionBillMain>>(jsonString);
            return list;
        }
        /// <summary>
        /// è½¦é—´å®šä½å°è½¦é”å®šå­è¡¨json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsKf_TrolleyPositionBillSub> getObjectByJson_Kf_TrolleyPositionBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsKf_TrolleyPositionBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_TrolleyPositionBillSub>>(jsonString);
            return list;
        }
        /// <summary>
        /// æŠ¥å·¥å¹³å°è¿”工单主表json
        /// </summary>
        /// <param name="jsonString"></param>