zzr99
2021-12-30 c1baff1d0e27c57477e90bc91a28223e37491a9e
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_StockCheckItemBillController.cs
@@ -278,7 +278,7 @@
                        left join Gy_Customer c1 on m.HNowSupID=c1.HItemID
                        left join Gy_Warehouse w on k.HCorrespondentID=w.HItemID
                        left join Gy_Warehouse w1 on m.HNowSupID=w1.HItemID
                  where " + sWhere);
                  where k.HBillType='3822' and " + sWhere);
                }
                else
                {
@@ -296,7 +296,7 @@
                        left join Gy_Customer c1 on m.HNowSupID=c1.HItemID
                        left join Gy_Warehouse w on k.HCorrespondentID=w.HItemID
                        left join Gy_Warehouse w1 on m.HNowSupID=w1.HItemID
                  where " + sWhere + " and k.HSourceInterID=(select HItemID from Gy_StockCheckItem where HItemID=" + sID + ") and k.HMakeDate<=(select HEndDate from Gy_StockCheckItem where HItemID=" + sID + ")");
                  where k.HBillType='3822' and " + sWhere + " and k.HSourceInterID=(select HItemID from Gy_StockCheckItem where HItemID=" + sID + ") and k.HMakeDate<=(select HEndDate from Gy_StockCheckItem where HItemID=" + sID + ")");
                }
                ds = oCN.RunProcReturn(sql, "Sc_MouldStockBillMain_Temp");
                list.Add(ds.Tables[0]);
@@ -317,9 +317,98 @@
        }
        #endregion
        #region ç›˜ç‚¹è®°å½•列表
        [Route("Gy_StockCheckItemBill/Get_MouldStockBillMainTemp")]
        [HttpGet]
        public object Get_MouldStockBillMainTemp(string sWhere)
        {
            try
            {
                ds = MouldStockBillMainTemp(sWhere);
                if (ds == null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询数据异常,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        public static DataSet MouldStockBillMainTemp(string sWhere)
        {
            string sql1 = string.Format(@"select * from h_v_Gy_MouldStockBillMainTempList where 1=1 ");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + sWhere + " order by åˆ¶å•日期 desc", "h_v_Gy_MouldStockBillMainTempList");
            }
            else
            {
                string sql = sql1 + sWhere + "order by åˆ¶å•日期 desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Gy_MouldStockBillMainTempList");
            }
        }
        #endregion
        #region [盘点方案删除功能]
        [Route("Gy_StockCheckItemBill/set_DeleteBill_Temp")]
        [HttpGet]
        public object set_DeleteBill_Temp(string HItemID)
        {
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HItemID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            ds = oCn.RunProcReturn("select * from Sc_MouldStockBillMain_Temp where HItemID=" + lngBillKey, "Sc_MouldStockBillMain_Temp");
            if (ds != null)
            {
                oCn.RunProc("Delete from Sc_MouldStockBillMain_Temp where HItemID=" + lngBillKey);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "此单据不存在,请查看是否重复删除";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç›˜ç‚¹åˆ†æžå®¡æ ¸
        #region è°ƒæ‹¨â€”直接调拨
            [Route("Gy_StockCheckItemBill/MakeProdMove")]
        [Route("Gy_StockCheckItemBill/MakeProdMove")]
            [HttpGet]
            public object MakeProdMove(string HBarCode, string user, string userID)
        {