duhe
2023-09-01 1739eb7838984e9a55fbbb5d4705f55908749375
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -386,6 +386,7 @@
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (user == "10000")//api同步方式
                {
                    oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID);
@@ -395,6 +396,7 @@
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_Material_Delete", 1, false, user))
                {
@@ -416,6 +418,7 @@
                ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
@@ -444,6 +447,7 @@
            }
            catch (Exception e)
            {
                oCN.RollBack();//回滚事务
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
@@ -1005,7 +1009,7 @@
                int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
                int HNowSupID = mainList[0].HNowSupID;
                int HNowSupTypeID = mainList[0].HNowSupTypeID;
                int HMadeSupID = mainList[0].HMadeSupID;
                //主表
@@ -1018,7 +1022,7 @@
                ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
                ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" +
                ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode" +
                ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" +
                ") " +
                " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -1028,7 +1032,7 @@
                ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'" +
                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
                ") ");
@@ -1146,6 +1150,7 @@
                int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID;
                int HNowSupID = mainList[0].HNowSupID;
                int HNowSupTypeID = mainList[0].HNowSupTypeID;
                int HMadeSupID = mainList[0].HMadeSupID;
                //若MAINDI重复则重新获取
                oCN.BeginTran();
@@ -1198,6 +1203,7 @@
                ",HNowSupTypeID=" + HNowSupTypeID.ToString() +
                ",HProdWeight=" + HProdWeight.ToString() +
                ",HBarCode='" + HBarCode.ToString() + "'" +
                ",HMadeSupID=" + HMadeSupID +
                " where HInterID=" + HInterID.ToString());
                //修改子项目代码
@@ -1224,6 +1230,40 @@
        }
        /// <summary>
        /// 磨具档案修改按钮方法-计算下次保养/校正日期-获取档案最近一次的保养记录
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_Mould_Edit/calculateHNextMainDate")]
        [HttpGet]
        public object calculateHNextMainDate(long HInterID)
        {
            try
            {
                string sql = @"select top(1) a.HInterID, b.HEndDate 保养记录结束日期
                            from Gy_MouldFileMain AS a LEFT OUTER JOIN
                            Sc_MouldMaintainBillMain AS b on a.HInterID = b.HMouldID
                            where a.HInterID = " + HInterID +
                            " order by b.HEndDate desc";
                ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainBillMain");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 磨具档案修改按钮方法