WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -589,6 +589,11 @@
                string HMaterNumber = mainList[0].HMaterNumber;
                string HSupNumber = mainList[0].HSupNumber;
                long HPrintQty = mainList[0].HPrintQty;
                string HMouldOWNER = mainList[0].HMouldOWNER;
                string HSaveLife = mainList[0].HSaveLife;
                int HMouldDotCheckRuleInterID= mainList[0].HMouldDotCheckRuleInterID;
                int HMouldMaintainRuleInterID= mainList[0].HMouldMaintainRuleInterID;
                //主表
@@ -601,7 +606,7 @@
                ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
                ",HPrintQty,HMouldStatus,HWhID,HRoutingID" +
                ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife" +
                ",HUseLife,HLeaveLife,HProdQty,HProdWeight" +
                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" +
                ") " +
                " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -611,7 +616,7 @@
                ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +
                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "'" +
                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "'" +
                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"'"+
                ") ");
@@ -721,9 +726,10 @@
                string HMaterNumber = mainList[0].HMaterNumber;
                string HSupNumber = mainList[0].HSupNumber;
                long HPrintQty = mainList[0].HPrintQty;
                string HMouldOWNER = mainList[0].HMouldOWNER;
                string HSaveLife = mainList[0].HSaveLife;
                int HMouldDotCheckRuleInterID = mainList[0].HMouldDotCheckRuleInterID;
                int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
                //若MAINDI重复则重新获取
@@ -758,6 +764,7 @@
                ",HSupNumber='" + HSupNumber + "'" +
                ",HPrintQty=" + HPrintQty.ToString() +
                ",HMouldStatus='" + HMouldStatus + "'" +
                ",HSaveLife='" + HSaveLife + "'" +
                ",HWhID=" + HWHID.ToString() +
                ",HRoutingID=" + HRoutingID.ToString() +
                ",HBomID=" + HBOMID.ToString() +
@@ -768,6 +775,9 @@
                ",HUseLife=" + HUseLife.ToString() +
                ",HLeaveLife=" + HLeaveLife.ToString() +
                ",HProdQty=" + HProdQty.ToString() +
                ",HMouldDotCheckRuleInterID="+ HMouldDotCheckRuleInterID.ToString()+
                ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
                ",HMouldOWNER='" + HMouldOWNER + "'" +
                ",HProdWeight=" + HProdWeight.ToString() +
                " where HInterID=" + HInterID.ToString());
@@ -877,6 +887,56 @@
            return objJsonResult;
        }
        /// <summary>
        /// 模具档案初始化按钮
        /// </summary>
        /// <param name="hmainid"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_Material/InitializeProdInBill")]
        [HttpGet]
        public object InitializeProdInBill(long hmainid, string user)
        {
            DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile();
            try
            {
                string HBillNo = "";
                Int64 HInterID = 0;//显示的字段
                ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID='" + hmainid + "'", "Gy_MouldFileMain");
                DataRow dr = ds.Tables[0].Rows[0];
                HInterID = DBUtility.ClsPub.CreateBillID("3801", ref DBUtility.ClsPub.sExeReturnInfo);
                HBillNo = DBUtility.ClsPub.CreateBillCode("3801", ref DBUtility.ClsPub.sExeReturnInfo, true);
                string sql = "Insert Into Sc_MouldStockBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
                ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
                ") " +
                " values('3801','3801'," + HInterID + ",'" + HBillNo + "',getdate()" +
                ", '" + user + "',getdate()" +
                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
                ", 0," + dr["HDeptID"].ToString() +  ",' ',0"  +
                ") ";
                //主表
                oCN.RunProc(sql);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "初始化成功!";
                //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "初始化失败!";
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #region [模具档案审核、反审核]
        /// <summary>