yusijie
2025-03-12 9dfad280107f0cc8eb07719752930e0b34ec5a92
器具保养规程功能优化
4个文件已修改
127 ■■■■■ 已修改文件
DAL/生产管理/模具管理/ClsSc_MouldMaintainRuleBill.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSc_MouldMaintainRuleBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_ProcessController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainRuleBill.cs
@@ -61,6 +61,7 @@
                ",HSafeDays=" + omodel.HSafeDays +
                ",HErrWarDays=" + omodel.HErrWarDays +
                ",HErrWarQtys=" + omodel.HErrWarQtys +
                ",HUSEORGID=" + omodel.HUSEORGID +
                " where HInterID=" + lngBillKey.ToString());                
                //删除关联
                //DeleteRelation(ref sReturn, lngBillKey);
@@ -121,11 +122,11 @@
                oCn.RunProc("Insert Into Sc_MouldMaintainRuleBillMain" +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HCycleUnit,HCheckCycle,HExplanation,HInnerBillNo,HMaintainLevID,HUseQtys,HSafeDays,HErrWarDays,HErrWarQtys" +
                ",HCycleUnit,HCheckCycle,HExplanation,HInnerBillNo,HMaintainLevID,HUseQtys,HSafeDays,HErrWarDays,HErrWarQtys,HUSEORGID,HCREATEORGID" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HMaintainLevID + "," + omodel.HUseQtys + "," + omodel.HSafeDays + "," + omodel.HErrWarDays + "," + omodel.HErrWarQtys +
                ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HMaintainLevID + "," + omodel.HUseQtys + "," + omodel.HSafeDays + "," + omodel.HErrWarDays + "," + omodel.HErrWarQtys + "," + omodel.HUSEORGID + "," + omodel.HCREATEORGID +
                ") ");
                ////插入子表
                foreach (Model.ClsSc_MouldMaintainRuleBillSub oSub in DetailColl_Mater)
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainRuleBillMain.cs
@@ -16,5 +16,7 @@
        public Int64 HSafeDays; //保养安全天数
        public Int64 HErrWarDays; //保养预警天数
        public Int64 HErrWarQtys; //保养预警次数
        public Int64 HUSEORGID; //使用组织
        public Int64 HCREATEORGID; //创建组织
    }
}
WebAPI/Controllers/BaseSet/Gy_ProcessController.cs
@@ -880,7 +880,7 @@
                        ",HTypeCount= '" + HTypeCount + "'" +
                        ",HDeptNumber='" + HDeptNumber + "'" +
                        ",HSNo= " + HSNo +
                         ",HUseFlag= " + HUseFlag +
                        ",HUseFlag= '" + HUseFlag + "'" +
                        ",HLevel= " + HLevel +
                        ",HEndFlag= '" + HEndFlag + "'" +
                        ",HTProcessFlag= '" + HTProcessFlag + "'" +
WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
@@ -630,6 +630,124 @@
        }
        #endregion
        #region å™¨å…·ä¿å…»è§„程作废/反作废功能
        [Route("Sc_MouldMaintainRuleBill/DeleteSc_MouldMaintainRule")]
        [HttpGet]
        public object DeleteGy_Mould(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainRuleBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限关闭!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (string.IsNullOrWhiteSpace(HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsSc_MouldMaintainRuleBill oBill = new DAL.ClsSc_MouldMaintainRuleBill();
                ClsPub.CurUserName = user;
                oCN.BeginTran();//开始事务
                //Type 1 ä½œåºŸ  2  åä½œåºŸ
                if (Type == 1)
                {
                    //作废前控制
                    string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    string sql = "";
                    sql = "exec h_p_Sc_MouldMaintainRuleBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldMaintainRuleBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (!oBill.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "作废失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //作废后控制
                    sql = "exec h_p_Sc_MouldMaintainRuleBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldMaintainRuleBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        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;
                    }
                }
                else
                {
                    if (!oBill.AbandonCancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å™¨å…·ä¿å…»è§„程 æ–‡ä»¶å¯¼å…¥ä¿å­˜
        #region å™¨å…·ä¿å…»è§„程 æ–‡ä»¶ä¸Šä¼ 
        [Route("Sc_MouldMaintainRuleBill/Sc_MouldMaintainRuleBill_Excel")]