yxj
2024-06-18 951587f554b2daabb19f969d17811b7bfedf6b44
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -16,6 +16,15 @@
    public class Sc_ProcessExchangeBillController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        public const string ModName = "3772";                   //单据类型
        public const string ModCaption = "工序流转卡";          //单据名称
        public const string ModRightName = "Sc_ProcessExchangeBill";
        public const string ModRightNameList = ModRightName + "List";       //列表
        public const string ModRightNameEdit = ModRightName + "_Edit";      //编辑
        public const string ModRightNameCheck = ModRightName + "_Check";    //审核
        public const string ModRightNameClose = ModRightName + "_Close";    //关闭
        public const string ModRightNameDelete = ModRightName + "_Delete";  //作废
        public const string ModRightNameDrop = ModRightName + "_Drop";      //删除
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
@@ -1762,8 +1771,24 @@
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭提交
                    oBill.oCn.BeginTran();
                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        //控制关联数量,判断反关闭后,生产订单下推流转卡总数是否超过计划数量
                        ds = oCN.RunProcReturn("exec h_p_Sc_ProcessExchangeBill_Checkqty " + lngBillKey, "h_p_Sc_ProcessExchangeBill_Checkqty");
                        if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反作废失败!原因:" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]).ToString();
                            objJsonResult.data = null;
                            oBill.oCn.RollBack();
                            return objJsonResult;
                        }
                        oBill.oCn.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
@@ -1886,5 +1911,59 @@
        }
        #endregion
        #region 工序流转卡列表
        /// <summary>
        /// 获取工序流转卡列表信息
        /// </summary>
        /// <returns></returns>
        [Route("Sc_ProcessExchangeBillController/GetSc_ProcessExchangeBillList_Json")]
        [HttpGet]
        public object GetSc_ProcessExchangeBillList_Json(string sWhere, string HMaker, string OperationType, string ViewName)
        {
            try
            {
                //判断权限
                if (OperationType == "1")
                {
                    //判断权限
                    if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, HMaker))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                //返回列表信息
                ds = oCN.RunProcReturn("select * from " + ViewName + " where 1=1 " + sWhere + " order by hmainid desc", ViewName);
                List<object> columnNameList = new List<object>();
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                }
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询列表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}