| | |
| | | /// <param name="locatNo"></param> |
| | | /// <param name="userId"></param> |
| | | /// <exception cref="Exception"></exception> |
| | | public void AddPallets(string palletNo,string locatNo,int userId) |
| | | public void AddPallets(string palletNo,string locatNo, string deviceCode, int userId) |
| | | { |
| | | var db = DataContext.Db; |
| | | try |
| | |
| | | if (!areaModel.AreaName.Contains("净桶")) |
| | | { |
| | | throw new Exception("新添加的桶只能绑定净桶区"); |
| | | } |
| | | if (!string.IsNullOrEmpty(deviceCode)) |
| | | { |
| | | var areaInfo = db.Queryable<SysStorageArea>().First(w => w.IsDel == "0" && w.DeviceCode.Contains(deviceCode)); |
| | | if (areaInfo == null) |
| | | { |
| | | throw new Exception("未查到设备所属区域信息"); |
| | | } |
| | | //125设备是接料和混料一体机 |
| | | if (deviceCode != "125") |
| | | { |
| | | if (!areaInfo.AreaName.Contains("接料设备")) |
| | | { |
| | | throw new Exception("只能绑定接料设备"); |
| | | } |
| | | if (areaInfo.WareHouseNo != "M03") |
| | | { |
| | | throw new Exception("只有大单体车间才能绑定设备"); |
| | | } |
| | | } |
| | | } |
| | | //开启事务 |
| | | db.BeginTran(); |
| | |
| | | |
| | | PalletStatus = "0",//净桶 |
| | | |
| | | UDF1 = deviceCode, |
| | | |
| | | IsDel = "0", |
| | | CreateUser = userId, |
| | | CreateTime = comTime |
| | | CreateTime = comTime, |
| | | UpdateTime=comTime, |
| | | }; |
| | | //插入库存明细 |
| | | db.Insertable(model).ExecuteCommand(); |