yl
2023-03-29 0259b2ac132ac7d1d22e2ecbc92048acca421a4d
订单下达生成工单号语句修改、生产工单手工创建获取单号接口
已修改4个文件
51 ■■■■■ 文件已修改
.vs/VueWebApi/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/Controllers/ProductionManagementController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/DLL/BLL/ProductionManagementBLL.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VueWebApi/DLL/DAL/ProductionManagementDAL.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/VueWebApi/v16/.suo
Binary files differ
VueWebApi/Controllers/ProductionManagementController.cs
@@ -232,6 +232,20 @@
        }
        #endregion
        #region[MES工单新增、获取工单号]
        /// <summary>
        /// MES工单新增、获取工单号
        /// </summary>
        /// <returns></returns>
        [Route(template: "AddMesOrderCodeSearch")]
        [HttpPost]
        public HttpResponseMessage AddMesOrderCodeSearch()
        {
            mes = ProductionManagementBLL.AddMesOrderCodeSearch();
            return TJson.toJson(mes);
        }
        #endregion
        #region[MES工单新增、编辑提交]
        /// <summary>
        /// MES工单新增、编辑提交
VueWebApi/DLL/BLL/ProductionManagementBLL.cs
@@ -76,6 +76,13 @@
        }
        #endregion
        #region[MES工单新增、获取工单号]
        public static ToMessage AddMesOrderCodeSearch()
        {
            return ProductionManagementDAL.AddMesOrderCodeSearch();
        }
        #endregion
        #region[MES工单新增、编辑提交]
        public static ToMessage AddUpdateMesOrder(string mesorderstus, string mesordercode,string sourceorder,string ordertype, string partcode, string mesqty, string routecode, string wkshopcode, string planstartdate, string planenddate, string orderlev, string username, string opertype)
        {
VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -125,7 +125,8 @@
                    //获取最大单据号
                    if (i == 1)  //首单获取工单号
                    {
                        sql = @"select isnull(max(substring(wo_code,charindex('_',wo_code)+1,len(wo_code)-charindex('_',wo_code))),0)+1 as worknumb from TK_Wrk_Man where m_po=@erpordercode";
                        sql = @"select isnull(max(cast(substring(wo_code,charindex('_',wo_code)+1,len(wo_code)-charindex('_',wo_code)) as numeric)),0)+1 as worknumb
                                from TK_Wrk_Man where m_po=@erpordercode";
                        dynamicParams.Add("@erpordercode", erpordercode);
                        var data = DapperHelper.selectdata(sql, dynamicParams);
                        num = Convert.ToInt32(data.Rows[0]["WORKNUMB"].ToString());
@@ -620,6 +621,33 @@
        }
        #endregion
        #region[MES工单新增、获取工单号]
        public static ToMessage AddMesOrderCodeSearch()
        {
            string sql = "";
            string wo_code = "";
            var dynamicParams = new DynamicParameters();
            try
            {
                //获取单据号
                sql = @"SELECT 'SGPO'+CONVERT(varchar(12) , getdate(), 112 )+'_'+cast(isnull(max(cast(substring(wo_code,charindex('_',wo_code)+1,len(wo_code)-charindex('_',wo_code)) as numeric)),0)+1 as varchar) as numct
                        FROM TK_Wrk_Man where wo_code like '%SGPO%'";
                var data = DapperHelper.selecttable(sql);
                mes.code = "200";
                mes.Message = "查询成功!";
                mes.data = data.Rows[0]["numct"].ToString();
            }
            catch (Exception e)
            {
                mes.code = "300";
                mes.count = 0;
                mes.Message = e.Message;
                mes.data = null;
            }
            return mes;
        }
        #endregion
        #region[MES工单新增、编辑提交]
        public static ToMessage AddUpdateMesOrder(string mesorderstus, string sourceorder, string ordertype, string mesordercode, string partcode, string mesqty, string routecode, string wkshopcode, string planstartdate, string planenddate, string orderlev, string username, string opertype)
        {