yangle
2023-05-30 0739748004c887135a19bdd45b25b248d6f86ffb
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_Cg_PODemandPlanBillController.cs
@@ -281,11 +281,11 @@
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["单据状态"].ToString() == "2")
                    if (ds.Tables[0].Rows[0]["单据状态"].ToString() == "3")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "当前单据正在审核,不能关闭!";
                        objJsonResult.Message = "当前单据已关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
@@ -321,8 +321,70 @@
        }
        #endregion
        #region ææ–™è®¡åˆ’单 åå…³é—­
        [Route("JIT_Cg_PODemandPlanBill/CancelClosePODemandPlanBillList")]
        [HttpGet]
        public object CancelClosePODemandPlanBillList(string HInterID, string User)
        {
            try
            {
                //关闭权限
                if (!DBUtility.ClsPub.Security_Log_second("JIT_Cg_PODemandPlanBill_Close", 1, false, User))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限关闭!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_JIT_Cg_PODemandPlanBillList where 1=1 and hmainid=" + HInterID, "h_v_JIT_Cg_PODemandPlanBillList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["单据状态"].ToString() != "3")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "当前单据没有处于关闭状态!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    oCN.BeginTran();//开启事务
                    string HBillStatus = ds.Tables[0].Rows[0]["审核人"].ToString() == "" ? "1" : "2";
                    oCN.RunProc($"update JIT_Cg_PODemandPlanBillMain set HBillStatus='{HBillStatus}',HCloseMan='',HCloseDate=null  where HInterID={HInterID}");
                    oCN.Commit();//结束事务
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "关闭成功!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "当前单据不存在,无法关闭!";
                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;
            }
        }
        #endregion
        #region ææ–™è®¡åˆ’单 ææ–™è®¡åˆ’报表(采购订单维度)
        public  class ReportPODemandPlanBill
        public class ReportPODemandPlanBill
        {
            public int? HORGID;
            public DateTime HBEGINDATE;