using JiepeiWMS.IServices; using JiepeiWMS.Model.Models; using JiepeiWMS.Services.BASE; using JiepeiWMS.IRepository.Base; using System.Threading.Tasks; using JiepeiWMS.Common.Enums; using System.Collections.Generic; namespace JiepeiWMS.Services { public class WMOrderInfoServices : BaseServices, IWMOrderInfoServices { private readonly IBaseRepository _dal; public WMOrderInfoServices(IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; } /// /// 验证子订单信息非空字段 /// /// /// public async Task ValidateReconParams(WMOrderInfo orderInfoModel) { var msg = ""; if (orderInfoModel == null) return msg = "子订单信息不能为空"; if (string.IsNullOrWhiteSpace(orderInfoModel.OrderNo)) return msg = "订单编号不能为空"; if (orderInfoModel.Num <= 0) return msg = "数量不能为0"; if (orderInfoModel.TotalMoney <= 0) return msg = "销售价不能为0"; if (orderInfoModel.CostMoney <= 0) return msg = "成本价不能为0"; if (orderInfoModel.TotalArea <= 0) return msg = "面积不能为空"; if (orderInfoModel.TypeValue <= 0) return msg = "NC产品规格型号对应值不能为空"; if (orderInfoModel.CodeType <= 0) return msg = "NC产品类型不能为空"; if (string.IsNullOrWhiteSpace(orderInfoModel.TgValue)) return msg = "TG值(PCB用)不能为空"; if (orderInfoModel.Layers <= 0) return msg = "层数(PCB、SMT用)不能为0"; if (orderInfoModel.Thickness <= 0) return msg = "板厚(PCB、钢网用)不能为0"; if (string.IsNullOrWhiteSpace(orderInfoModel.Surface)) return msg = "表面处理(PCB用)不能为0"; if (orderInfoModel.InnerCopperThickness <= 0) return msg = "内层铜厚(PCB用)不能为0"; if (orderInfoModel.CopperThickness <= 0) return msg = "外层铜厚(PCB用)不能为0"; if (string.IsNullOrWhiteSpace(orderInfoModel.SolderTopColor)) return msg = "阻焊颜色(PCB用)不能为空"; if (string.IsNullOrWhiteSpace(orderInfoModel.SolderDownColor)) return msg = "底层阻焊颜色(PCB用)不能为空"; if (string.IsNullOrWhiteSpace(orderInfoModel.FontTopColor)) return msg = "文字颜色(PCB用)不能为空"; if (string.IsNullOrWhiteSpace(orderInfoModel.FontDownColor)) return msg = "底层文字颜色(PCB用)不能为空"; if (string.IsNullOrWhiteSpace(orderInfoModel.FlyingTest)) return msg = "飞针测试(PCB用)不能为空"; if (orderInfoModel.MaterialType <= 0) return msg = "物料种类(SMT用)不能为空"; if (orderInfoModel.SinglePoint <= 0) return msg = "单片贴片点数(SMT用)不能为0"; if (orderInfoModel.SingleInsertPoint <= 0) return msg = "单片插件点数(SMT用)不能为0"; if (orderInfoModel.Width <= 0) return msg = "宽度(钢网用)不能为0"; if (orderInfoModel.Height <= 0) return msg = "高度(钢网用)不能为0"; if (orderInfoModel.ReferenceHole <= 0) return msg = "基准孔值(钢网用)不能为0"; if (string.IsNullOrWhiteSpace(orderInfoModel.BomCategory)) return msg = "元器件类别(BOM用)不能为空"; if (orderInfoModel.AccuracyValue <= 0) return msg = "精度(BOM用)不能为0"; return msg; } } }