yangle
2023-05-30 0739748004c887135a19bdd45b25b248d6f86ffb
反关闭
4个文件已修改
203 ■■■■■ 已修改文件
WebAPI/Controllers/SCGL/日计划管理/JIT_Cg_PODemandPlanBillController.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormImportController.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_WorkBillSortBillController.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_WorkDemandPlanBillController.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormImportController.cs
@@ -105,8 +105,10 @@
                    ds = oCN.RunProcReturn(sql1, "h_v_IF_ICMOBillList");
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        error += $"没有生产订单信息,生产订单号:{ tb2.Rows[i]["生产订单号*"].ToString()},生产车间编码:{tb2.Rows[i]["生产车间编码*"].ToString()}" +
                            $",生产订单明细行号:{ tb2.Rows[i]["生产订单明细行号*"].ToString()},物料编码:{ tb2.Rows[i]["物料编码*"].ToString()}";
                               $",生产订单明细行号:{ tb2.Rows[i]["生产订单明细行号*"].ToString()},物料编码:{ tb2.Rows[i]["物料编码*"].ToString()}";
                    }
                    if (error.Length > 0)
                    {
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_WorkBillSortBillController.cs
@@ -367,11 +367,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;
                    }
@@ -406,5 +406,66 @@
            }
        }
        #endregion
        #region æ—¥è®¡åˆ’工单 åå…³é—­
        [Route("Sc_WorkBillSortBill/CancelCloseBillWorkBillSortBillList")]
        [HttpGet]
        public object CancelCloseBillWorkBillSortBillList(string HInterID, string User)
        {
            try
            {
                //关闭权限
                if (!DBUtility.ClsPub.Security_Log_second("Sc_WorkBillSortBill_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_Sc_WorkBillSortBillList where 1=1 and hmainid=" + HInterID, "h_v_JIT_Sc_WorkBillSortBillList");
                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 Sc_WorkBillSortBillMain 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
    }
}
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_WorkDemandPlanBillController.cs
@@ -280,11 +280,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;
                    }
@@ -320,6 +320,68 @@
        }
        #endregion
        #region è¦æ–™è®¡åˆ’单 åå…³é—­
        [Route("Sc_WorkDemandPlanBill/CancelCloseWorkDemandPlanBillList")]
        [HttpGet]
        public object CancelCloseWorkDemandPlanBillList(string HInterID, string User)
        {
            try
            {
                //关闭权限
                if (!DBUtility.ClsPub.Security_Log_second("Sc_WorkDemandPlanBill_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_Sc_WorkDemandPlanBillList where 1=1 and hmainid=" + HInterID, "h_v_JIT_Sc_WorkDemandPlanBillList");
                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 Sc_WorkDemandPlanBillMain 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 ReportWorkDemandPlanBill
        {