yangle
2022-10-12 bfec4da315abe8013a1683325bcf434c492dba0f
WebAPI/Controllers/CJGL/Cj_SendGoodsBillController.cs
@@ -30,6 +30,7 @@
            public string MaterialName { get; set; }
            public string MaterialModel { get; set; }
            public string Arbitrarily { get; set; }
            public string HBillStatus { get; set; }
            public int? HOrgID;
        }
@@ -61,10 +62,8 @@
                //反序列化传递的值
                JIT_SendGoodsBill com = JsonConvert.DeserializeObject<JIT_SendGoodsBill>(sWhere.ToString());
               oCN.RunProc($"exec h_p_JIT_DeptCheckGoodsBillList_Query '{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}','{com.HBillNo}','{com.HDeptName}'," +
                   $"'{com.MaterialCode}','{com.MaterialName}','{com.MaterialModel}','{com.HOrgID}'");
                ds = oCN.RunProcReturn("select * from ##h_p_JIT_DeptCheckGoodsBillList_Query where 1=1 " + com.Arbitrarily + "", "##h_p_JIT_DeptCheckGoodsBillList_Query");
                ds = oCN.RunProcReturn($"exec h_p_JIT_DeptCheckGoodsBillList_Query '{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}','{com.HBillNo}','{com.HDeptName}'," +
                   $"'{com.MaterialCode}','{com.MaterialName}','{com.MaterialModel}','{com.HOrgID}','{com.HBillStatus}'", "h_p_JIT_DeptCheckGoodsBillList_Query");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -118,5 +117,77 @@
            }
        }
        #endregion
        #region 车间收料列表 撤销确认收料
        [Route("Cj_SendGoodsBill/DeptCheckGoodsBillList_revoke")]
        [HttpGet]
        public object DeptCheckGoodsBillList_revoke(string HInterID, string User)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("JIT_SendGoodsBill_Check", 1, false, User))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无审核权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
              oCN.RunProc($"update JIT_SendGoodsBillMain set HChecker='' ,HCheckDate=null,HBillStatus=1  where HInterID='{HInterID}'");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "已完成撤销";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 车间收料列表 删除
        [Route("Cj_SendGoodsBill/DeleteBill")]
        [HttpGet]
        public object DeleteBill(string HInterID,string HEntryID, string User)
        {
            try
            {
                //获取车间配送单据数据
                ds = oCN.RunProcReturn($"select * from JIT_SendGoodsBillMain a inner join JIT_SendGoodsBillSub b on a.HInterID = b.HInterID where  a.HInterID={HInterID} and HEntryID={HEntryID}  ", "JIT_SendGoodsBillMain");
                //获取拣料配送单的数据
                ds = oCN.RunProcReturn($"select * from JIT_ComplementGoodsBillMain a inner join JIT_ComplementGoodsBillSub b on a.HInterID = b.HInterID where  a.HInterID={(ds.Tables[0].Rows[0]["HMainSourceInterID"].ToString())} and  b.HMaterID={(ds.Tables[0].Rows[0]["HMaterID"].ToString())} and  b.HWHID={(ds.Tables[0].Rows[0]["HWHID"].ToString())} ", "JIT_ComplementGoodsBillMain");
                //获取拣料配送单_LK表 数据
                ds = oCN.RunProcReturn($"select * from from JIT_ComplementGoodsBillSub_LK where  HInterID={(ds.Tables[0].Rows[0]["HInterID"].ToString())} ", "JIT_SendGoodsBillMain");
                //oCN.RunProc($"delete from  JIT_SendGoodsBillMain  where HInterID='{HInterID}'");
                //oCN.RunProc($"delete from  JIT_SendGoodsBillSub  where HInterID='{HInterID}' and HEntryID={HEntryID} ");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "已完成删除";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}