桌面版工序流转卡单据号获取方法修改,PDA出入库缓存列表删除、撤销,模具缓存列表删除调用方法增加写入日志
4个文件已修改
225 ■■■■ 已修改文件
WebAPI/Controllers/条码管理/MouldController.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/条码管理/WEBSController.cs 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web.config 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/流转卡管理/Sc_ProcessExchangeBill.cs 109 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/ÌõÂë¹ÜÀí/MouldController.cs
@@ -26,6 +26,7 @@
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        string ComputerName = SystemInformation.ComputerName;   //设备名称
        #region å™¨å…·æ‰«ç æ¨¡å—调用方法
@@ -358,19 +359,28 @@
        /// <returns></returns>
        [Route("MouldController/set_DeleteMouldBillList_Json")]
        [HttpGet]
        public object set_DeleteMouldBillList_Json(long HInterID, string HBillType)
        public object set_DeleteMouldBillList_Json(long HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle)
        {
            try
            {
                string WorkList = "删除缓存单据,单据号:" + HBillNo;
                string SystemName = "WMS-" + MvarReportTitle + "模块";
                oCn.BeginTran();
                oCn.RunProc("Delete from Sc_MouldStockBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                //写入日志
                oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
                    "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','删除')"
                    );
                oCn.Commit();
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功";
                objJsonResult.Message = "单据号:" + HBillNo + " åˆ é™¤æˆåŠŸ";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除器具缓存列表单据失败!" + e.ToString();
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -31,6 +31,7 @@
        public WebS.WebService1 oWebs = new WebS.WebService1();
        public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        string ComputerName = SystemInformation.ComputerName;   //设备名称
        WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
@@ -127,7 +128,7 @@
                if (oSystemParameter.ShowBill(ref sErrMsg) == true)
                {
                    //判断权限
                    if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, HUserName))
                    if (!DBUtility.ClsPub.Security_Log(ModRightName, 3, false, HUserName))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -1517,6 +1518,63 @@
        /// å·²ä¸Šä¼ åˆ—表界面,撤销功能,删除WMS表和本地出入库单记录,并更新TEMP表中的上传字段 HRelationInterID=0
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_DeleteICStockBillAndWMS_Json")]
        [HttpGet]
        public object set_DeleteICStockBillAndWMS_Json(Int64 HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle)
        {
            try
            {
                string WorkList = "撤销已上传单据,单据号:" + HBillNo;
                string SystemName = "WMS-" + MvarReportTitle + "模块";
                oCn.BeginTran();
                ds = oCn.RunProcReturn("exec h_p_WMS_ICStockBillAndWMS_Delete " + HInterID + ",'" + HBillNo + "','" + HBillType + "'", "h_p_WMS_ICStockBillAndWMS_Delete");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    oCn.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "撤销单据已上传记录失败,撤销单据判断错误!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
                {
                    oCn.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;  //失败!
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    //写入日志
                    oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
                        "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','撤销')"
                        );
                    oCn.Commit();
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;  //成功!
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "撤销单据已上传记录失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// å·²ä¸Šä¼ åˆ—表界面,撤销功能,删除WMS表和本地出入库单记录,并更新TEMP表中的上传字段 HRelationInterID=0
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/DeleteICStockBillAndWMS_Json")]
        [HttpGet]
        public object DeleteICStockBillAndWMS_Json(Int64 HInterID, string HBillNo, string HBillType)
@@ -1556,6 +1614,42 @@
        #region æ¡ç å‡ºå…¥åº“缓存列表模块  åˆ é™¤ç¼“存列表单据
        /// <summary>
        /// åˆ é™¤ç¼“存列表单据,写入日志   20240619
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/set_DelPonderationBillMain_Temp_New_Json")]
        [HttpGet]
        public object set_DelPonderationBillMain_Temp_New_Json(long HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle)
        {
            try
            {
                string WorkList = "删除缓存单据,单据号:" + HBillNo;
                string SystemName = "WMS-" + MvarReportTitle + "模块";
                oCn.BeginTran();
                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                //写入日志
                oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
                    "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','删除')"
                    );
                oCn.Commit();
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "单据号:" + HBillNo + " åˆ é™¤æˆåŠŸ";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除条码出入库缓存列表单据失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// åˆ é™¤ç¼“存列表单据
        /// </summary>
        /// <returns></returns>
WebAPI/Web.config
@@ -22,7 +22,7 @@
        <!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>-->
        <!--<add key="FileIP" value="http://localhost:8080/" />-->
        <!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/>    -->
        <!--<add key="sUrl" value="http://192.168.0.81/WEBS-WMS/WebService1.asmx"/>   --><!--颜台式机-->
        <add key="sUrl" value="http://192.168.0.81/WEBS-WMS/WebService1.asmx"/>   <!--颜台式机-->
        <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> å¤å®-->
        <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> -->
        <!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/>    åšæ—¥ç§‘技-->
@@ -106,7 +106,7 @@
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://61.130.182.102:18181/WEBSCS/WebService1.asmx" binding="basicHttpBinding"
            <endpoint address="http://192.168.0.81/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
     bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap"
     name="WebService1Soap" />
        </client>
@@ -115,7 +115,7 @@
 <applicationSettings>
  <WebAPI.Properties.Settings>
   <setting name="WebAPI_WebS_WebService1" serializeAs="String">
    <value>http://61.130.182.102:18181/WEBSCS/WebService1.asmx</value>
    <value>http://192.168.0.81/WEBS-WMS/WebService1.asmx</value>
   </setting>
  </WebAPI.Properties.Settings>
 </applicationSettings>
WorkM/Á÷ת¿¨¹ÜÀí/Sc_ProcessExchangeBill.cs
@@ -752,7 +752,8 @@
            this.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            this.Sub_OperStatus();//设置TOOLBAR
            this.Sub_ClearBill();//清空界面
            this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//得到新单号
            //this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//得到新单号
            this.txtHBillNo.Text = ClsPub.CreateBillCode_Prod(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//得到新单号    20240620返回值改取存储过程
            this.txtHBillNo.Enabled = true;
            this.txtHBillNo.Focus();
            //灰度源单类型
@@ -3368,62 +3369,62 @@
            string sNo = "";
            int row = oTable.Rows.Count - 1;
            //获取系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
            Ds = oCn.RunProcReturn("select HValue from Xt_SystemParameter with(nolock) where HKey='WMS_CampanyName'", "Xt_SystemParameter", ref DBUtility.ClsPub.sExeReturnInfo);
            if (Ds == null || Ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("获取系统参数失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
                return;
            }
            else
            {
                CampanyName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HValue"]);
            }
            if (CampanyName == "凯贝奈特") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
            {
            ////获取系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
            //Ds = oCn.RunProcReturn("select HValue from Xt_SystemParameter with(nolock) where HKey='WMS_CampanyName'", "Xt_SystemParameter", ref DBUtility.ClsPub.sExeReturnInfo);
            //if (Ds == null || Ds.Tables[0].Rows.Count == 0)
            //{
            //    MessageBox.Show("获取系统参数失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
            //    return;
            //}
            //else
            //{
            //    CampanyName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HValue"]);
            //}
            //if (CampanyName == "凯贝奈特") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
            //{
            }
            else
            {
                //获取当前改生产订单 æœ€å¤§æµè½¬å¡å·ï¼Œå¹¶ç´¯è®¡å¢žåŠ 1。
                //智见单号- å¹´æœˆæ—¥20200701+001
                string sOldNo = "";
                //Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where hicmointerid=" + oTable.Rows[row]["hmainid"].ToString() + "  order by LEN(HBillno) desc, HbillNo desc ", "Sc_ProcessExchangeBillmain");
            //}
            //else
            //{
            //    //获取当前改生产订单 æœ€å¤§æµè½¬å¡å·ï¼Œå¹¶ç´¯è®¡å¢žåŠ 1。
            //    //智见单号- å¹´æœˆæ—¥20200701+001
            //    string sOldNo = "";
            //    //Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where hicmointerid=" + oTable.Rows[row]["hmainid"].ToString() + "  order by LEN(HBillno) desc, HbillNo desc ", "Sc_ProcessExchangeBillmain");
                Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where HDate='" + dtpHDate.Value.ToShortDateString() + "' and HBillSubType<>'Split' order by  HbillNo desc ", "Sc_ProcessExchangeBillmain");
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    sNo = "001";
                }
                else
                {
                    sOldNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]);
                    sOldNo = sOldNo.Substring(sOldNo.Length - 3, 3);
                    //if (sOldNo.Substring(0, 1) == "0" || sOldNo.Substring(0, 1) == "-")
                    //{
                    //    sOldNo = sOldNo.Substring(sOldNo.Length - 2, 2);
                    //    if (sOldNo.Substring(0, 1) == "0")
                    //    {
                    //        sOldNo = sOldNo.Substring(sOldNo.Length - 1, 1);
                    //    }
                    //}
                    sNo = "0000" + DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isLong(sOldNo) + 1);
                }
            //    Ds = oCn.RunProcReturn("select top 1 HBillNo  from Sc_ProcessExchangeBillmain where HDate='" + dtpHDate.Value.ToShortDateString() + "' and HBillSubType<>'Split' order by  HbillNo desc ", "Sc_ProcessExchangeBillmain");
            //    if (Ds == null || Ds.Tables[0].Rows.Count == 0)
            //    {
            //        sNo = "001";
            //    }
            //    else
            //    {
            //        sOldNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]);
            //        sOldNo = sOldNo.Substring(sOldNo.Length - 3, 3);
            //        //if (sOldNo.Substring(0, 1) == "0" || sOldNo.Substring(0, 1) == "-")
            //        //{
            //        //    sOldNo = sOldNo.Substring(sOldNo.Length - 2, 2);
            //        //    if (sOldNo.Substring(0, 1) == "0")
            //        //    {
            //        //        sOldNo = sOldNo.Substring(sOldNo.Length - 1, 1);
            //        //    }
            //        //}
            //        sNo = "0000" + DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isLong(sOldNo) + 1);
            //    }
                sNo = sNo.Substring(sNo.Length - 3, 3);
                //initGrid();
                //initGrid_Sub();
                //string sBillNo = oTable.Rows[row]["生产订单号"].ToString();
                string sYear = dtpHDate.Value.Year.ToString();
                string sMonth = "00" + dtpHDate.Value.Month.ToString();
                string sDay = "00" + dtpHDate.Value.Day.ToString();
                string sBillNo = sYear + sMonth.Substring(sMonth.Length - 2, 2) + sDay.Substring(sDay.Length - 2, 2);
                //sBillNo = sBillNo.Replace("WORKX", "");
                //sBillNo = sBillNo.Replace("WORK", "");
                //sBillNo = sBillNo.Replace("_", "-");
                sBillNo = sBillNo + "-" + sNo;
                txtHBillNo.Text = sBillNo;
            }
            //    sNo = sNo.Substring(sNo.Length - 3, 3);
            //    //initGrid();
            //    //initGrid_Sub();
            //    //string sBillNo = oTable.Rows[row]["生产订单号"].ToString();
            //    string sYear = dtpHDate.Value.Year.ToString();
            //    string sMonth = "00" + dtpHDate.Value.Month.ToString();
            //    string sDay = "00" + dtpHDate.Value.Day.ToString();
            //    string sBillNo = sYear + sMonth.Substring(sMonth.Length - 2, 2) + sDay.Substring(sDay.Length - 2, 2);
            //    //sBillNo = sBillNo.Replace("WORKX", "");
            //    //sBillNo = sBillNo.Replace("WORK", "");
            //    //sBillNo = sBillNo.Replace("_", "-");
            //    sBillNo = sBillNo + "-" + sNo;
            //    txtHBillNo.Text = sBillNo;
            //}