沈泽
2021-09-10 356fb43b6b458f33d2c6ba6b13d8729f7f656ea1
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
7个文件已修改
158 ■■■■ 已修改文件
DAL/MES/ClsSc_MESMaterToSourceBill .cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/设备管理/ClsSb_EquipDotCheckBill.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/MES/ClsSc_MESMaterToSourceBill .cs
@@ -58,7 +58,7 @@
                ",HMainSourceBillType=" + omodel.HMainSourceBillType.ToString() +
                ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString() +
                ",HMainSourceEntryID=" + omodel.HMainSourceEntryID.ToString() +
                ",HMainSourceBillNo=" + omodel.HMainSourceBillNo.ToString() +
                ",HMainSourceBillNo='" + omodel.HMainSourceBillNo.ToString() +"'"+
                ",HSourceID=" + omodel.HSourceID.ToString() +
                ",HProcID=" + omodel.HProcID.ToString() +
                ",HMaterID=" + omodel.HMaterID.ToString() +
@@ -88,7 +88,7 @@
                      ",'" + oSub.HBarCode + "','" + oSub.HBarCode_Pack + "','" + oSub.HBillNo_bak + "'" +
                      ") ");
                }
                sReturn = "修改单据成功!";
                sReturn = omodel.HInterID.ToString();
                oCn.Commit();
                return true;
            }
@@ -265,6 +265,45 @@
            }
        }
        //删除单据
        public override bool DeleteBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                //判断是否允许删除
                DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_DelCtrl @HInterId=" + lngBillKey + "", "h_p_Sc_MaterToSourceBill_DelCtrl");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    sReturn = "无验证数据!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
                {
                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //删除关联关系
                oCn.RunProc("exec h_p_Sc_MaterToSourceBill_DelRelation @HInterId=" + lngBillKey + "");
                //删除明细表
                oCn.RunProc("Delete From " + MvarItemKeySub + "  where HInterID=" + lngBillKey.ToString());
                //删除主表
                oCn.RunProc("Delete From " + MvarItemKey + "  where HInterID=" + lngBillKey.ToString());
                sReturn = "删除单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //审核
        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
        {
DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipDotCheckBill.cs
@@ -67,14 +67,14 @@
                      " (HInterID,HEntryID," +
                      "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
                      "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
                      "HDotCheckItem,HDotCheckPart,HClaim," +
                      "HDotCheckItemID,HDotCheckItem,HDotCheckPart,HClaim," +
                      "HManagerID,HManagerNumber" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
                      ",'" + oSub.HCloseMan + "','"+oSub.HEntryCloseDate+"'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
                      ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      ",'" + oSub.HDotCheckItem + "','"+oSub.HDotCheckPart+"','"  + oSub.HClaim +
                      "'," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+
                      ",'" + oSub.HDotCheckItemID + "','" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim +
                      "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "'" +
                      ") ");
                }
                //
WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
@@ -82,7 +82,7 @@
        #region è®¾å¤‡ç‚¹æ£€è®°å½•表 ä¿å­˜/编辑
        /// <summary>
        /// ä¿å­˜æ¨¡å…·ç»´ä¿®å•
        /// ç‚¹æ£€è®°å½•表 ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
@@ -318,7 +318,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select ç‚¹æ£€é¡¹ç›® HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人编码 HManagerCode,负责人 HManagerName  from h_v_Sb_EquipDotCheckBillList", "h_v_Sb_EquipDotCheckBillList");
                    ds = oCN.RunProcReturn("select ç‚¹æ£€é¡¹ç›®ID HDotCheckItemID,点检项目代码 as HDotCheckCode ,点检项目 HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人编码 HManagerCode,负责人 HManagerName  from h_v_Sb_EquipDotCheckBillList", "h_v_Sb_EquipDotCheckBillList");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
@@ -326,7 +326,7 @@
                }
                else
                {
                    string sql1 = "select ç‚¹æ£€é¡¹ç›® HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人编码 HManagerCode,负责人 HManagerName  from h_v_Sb_EquipDotCheckBillList where 1 = 1 ";
                    string sql1 = "select ç‚¹æ£€é¡¹ç›®ID HDotCheckItemID,点检项目代码 as HDotCheckCode ,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人编码 HManagerCode,负责人 HManagerName  from h_v_Sb_EquipDotCheckBillList where 1 = 1 ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckBillList");
                    objJsonResult.code = "0";
WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
@@ -301,7 +301,7 @@
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        #endregion
        #region[设备点检计划表编辑时获取表题数据]
        #region[设备点检计划表编辑时获取表体数据]
        [Route("Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListProjectDetai")]
        [HttpGet]
        public object Sb_EquipDotCheckPlanBillListProjectDetai(string sqlWhere)
@@ -312,7 +312,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select ç‚¹æ£€é¡¹ç›® HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人代码 HManagerID,负责人 HManagerName from h_v_Sb_EquipDotCheckPlanBillList", "h_v_Sb_EquipDotCheckPlanBillList");
                    ds = oCN.RunProcReturn("select ç‚¹æ£€é¡¹ç›®ID  HDotCheckItemID,点检项目代码  HDotCheckCode ,点检项目 HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人代码 HManagerCode,负责人 HManagerName from h_v_Sb_EquipDotCheckPlanBillList", "h_v_Sb_EquipDotCheckPlanBillList");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
@@ -320,7 +320,7 @@
                }
                else
                {
                    string sql1 = "select ç‚¹æ£€é¡¹ç›® HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人代码 HManagerID,负责人 HManagerName from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1 ";
                    string sql1 = "select ç‚¹æ£€é¡¹ç›®ID  HDotCheckItemID,点检项目代码  HDotCheckCode ,点检项目 HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人代码 HManagerCode,负责人 HManagerName from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1 ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList");
                    objJsonResult.code = "0";
WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
@@ -40,13 +40,13 @@
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillList " + sWhere, "h_v_Sc_MaterToSourceBillList");
                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillMain " + sWhere, "h_v_Sc_MaterToSourceBillMain");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_MaterToSourceBillList where 1 = 1 ";
                    string sql1 = "select * from h_v_Sc_MaterToSourceBillMain where 1 = 1 ";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillList");
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillMain");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
@@ -132,6 +132,87 @@
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
        #region [上料防错单删除功能]
        /// <summary>
        /// å¼€å·¥å•删除功能
        /// </summary>
        /// <returns></returns>
        [Route("Sc_MaterToSourceBill/DeltetMaterToSourceBill")]
        [HttpGet]
        public object DeltetMaterToSourceBill(string HInterID, string UserName)
        {
            DBUtility.ClsPub.CurUserName = UserName;
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无删除权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            DAL.ClsSc_MESMaterToSourceBill oBill = new DAL.ClsSc_MESMaterToSourceBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                if (oBill.omodel.HBillStatus > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.omodel.HChecker != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据未找到";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
@@ -515,6 +596,7 @@
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //返回主ID
                    objJsonResult.Verify = "N";
                }
                if (bResult)
WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs
@@ -98,6 +98,9 @@
                "," + omodel.HSourceInterID.ToString() + "," + omodel.HSourceEntryID.ToString() + ",'" + omodel.HSourceBillNo + "','" + omodel.HSplitNO + "','" + omodel.HSourceBillType + "'" +
                "," + omodel.HRelationInterID.ToString() + "," + omodel.HRelationEntryID.ToString() + ",'" + omodel.HRelationBillNo + "'," + omodel.HReportEntryID.ToString() + 
                ") ");
                double sumqty = omodel.HQty + omodel.HBadQty + omodel.HWasterQty;  //汇报数量+不良+报废
                //回写生产状态临时表Sc_ICMOBillStatus_Tmp拆分汇报数量 HSplitRelationQty
                oCn.RunProc("update Sc_ICMOBillStatus_Tmp set HSplitRelationQty=HSplitRelationQty+"+ sumqty + "  where HICMOBillNo='"+omodel.HICMOBillNo+"'  and HSourceID='"+omodel.HSourceID+"' and  HICMOInterID='"+omodel.HICMOInterID+"' and HICMOEntryID='"+omodel.HICMOEntryID+"'");
                //再次验证 ä¿å­˜æ˜¯å¦ åˆç†
                DataSet ds = oCn.RunProcReturn("exec h_p_JIT_ICMOBillWorkQtyStatus_SaveCtrl @HInterId=" + omodel.HInterID + "", "h_p_JIT_ICMOBillWorkQtyStatus_SaveCtrl");
WebAPI/WebAPI.csproj.user
@@ -7,7 +7,7 @@
    <WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
    <WebStackScaffolding_LayoutPageFile />
    <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
    <NameOfLastUsedPublishProfile>D:\Git仓库\项目\MESWMS\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>false</UseIISExpress>
    <Use64BitIISExpress />