1
wtt
2024-06-21 3b91a02964f52ee4bbaf55c4e8963466345d1bad
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)
@@ -1554,6 +1612,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>
        /// åˆ é™¤ç¼“存列表单据
@@ -7011,6 +7105,37 @@
            }
        }
        #endregion
        #region æœŸåˆåº“存报表
        /// <summary>
        /// ä»“库收发存报表
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/UpdateKf_ICInvBal")]
        [HttpGet]
        public object UpdateKf_ICInvBal( )
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_KF_ICinventory ", "h_p_KF_ICinventory");
                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;
            }
        }
        #endregion
        #endregion