服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-04-15 c00956f6649cc13b094ec83cc3121e7cb0027b3c
盟祺-查询导出修改
已修改4个文件
112 ■■■■■ 文件已修改
Tiger.Api/Controllers/WMS/WMSController.MqSNData.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business/WMS/MengQi/Biz.Mq.SNData.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.IBusiness/WMS/MengQi/IMqSNData.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Model.Net/Entitys/WMS/MengQi/SNData_His.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Api/Controllers/WMS/WMSController.MqSNData.cs
@@ -49,5 +49,46 @@
            }
            return Ok(response);
        }
        /// <summary>
        /// 获取所有条码,原厂条码和客户条码分开两行,按条件
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetAllSNData([FromBody] ApiAction<SNDataWhere> action)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(await DI.Resolve<IMqSNData>().GetAllSNData(action.Data));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
        /// <summary>
        /// 获取所有条码,原厂条码和客户条码在同一行,按条件
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetAllSNDataHis([FromBody] ApiAction<SNDataWhere> action)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(await DI.Resolve<IMqSNData>().GetAllSNDataHis(action.Data));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
    }
}
Tiger.Business/WMS/MengQi/Biz.Mq.SNData.cs
@@ -89,6 +89,68 @@
                res.Data = pageList;
                return res;
            }
            /// <summary>
            /// 获取所有条码,原厂条码和客户条码在同一行,按条件
            /// </summary>
            /// <param name="where"></param>
            /// <returns></returns>
            public async Task<ApiAction<List<SNData_His>>> GetAllSNDataHis(SNDataWhere where)
            {
                var res = new ApiAction<List<SNData_His>>();
                List<SNData_His> list = new List<SNData_His>();
                try
                {
                    DateTime StartTime = DateTime.Now;
                    DateTime EndTime = DateTime.Now;
                    string[] strTime = where.strStartEnd?.Split(',');
                    if (!string.IsNullOrEmpty(where.strStartEnd)) { StartTime = Convert.ToDateTime(strTime[0].ToString()); EndTime = strTime.Length == 2 ? Convert.ToDateTime(strTime[1].ToString()) : DateTime.MinValue; }
                    RefAsync<int> total = 0;
                    list = await Db.Queryable<SNData_His>()
                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd), x => Convert.ToDateTime(x.ScanTime) > StartTime)
                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.ScanTime) < EndTime)
                        .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ModelCode == where.model)
                        .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode))
                        .ToListAsync();
                }
                catch (Exception ex)
                {
                    res.CatchExceptionWithLog(ex, "查询异常");
                }
                res.Data = list;
                return res;
            }
            /// <summary>
            /// 获取所有条码,原厂条码和客户条码分开两行,按条件
            /// </summary>
            /// <param name="where"></param>
            /// <returns></returns>
            public async Task<ApiAction<List<SNData>>> GetAllSNData(SNDataWhere where)
            {
                var res = new ApiAction<List<SNData>>();
                List<SNData> list = new List<SNData>();
                try
                {
                    DateTime StartTime = DateTime.Now;
                    DateTime EndTime = DateTime.Now;
                    string[] strTime = where.strStartEnd?.Split(',');
                    if (!string.IsNullOrEmpty(where.strStartEnd)) { StartTime = Convert.ToDateTime(strTime[0].ToString()); EndTime = strTime.Length == 2 ? Convert.ToDateTime(strTime[1].ToString()) : DateTime.MinValue; }
                    RefAsync<int> total = 0;
                    list = await Db.Queryable<SNData>()
                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd), x => Convert.ToDateTime(x.CREATE_TIME) > StartTime)
                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.CREATE_TIME) < EndTime)
                        .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ItemCode == where.model)
                        .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode))
                        .ToListAsync();
                }
                catch (Exception ex)
                {
                    res.CatchExceptionWithLog(ex, "查询异常");
                }
                res.Data = list;
                return res;
            }
        }
    }
}
Tiger.IBusiness/WMS/MengQi/IMqSNData.cs
@@ -13,5 +13,7 @@
    {
        public Task<ApiAction> ReturnSN(string barcode);
        public Task<ApiAction<PageAble<SNData_His>>> GetSNDataHis(PageAble<SNData_His> pageList);
        public Task<ApiAction<List<SNData_His>>> GetAllSNDataHis(SNDataWhere where);
        public Task<ApiAction<List<SNData>>> GetAllSNData(SNDataWhere where);
    }
}
Tiger.Model.Net/Entitys/WMS/MengQi/SNData_His.cs
@@ -105,4 +105,11 @@
            }
        }
    }
    public class SNDataWhere
    {
        public string strStartEnd { get; set; }
        public string model { get; set; }
        public string customerCode { get; set; }
    }
}