| | |
| | | skuname = "%" + model.SkuName + "%", //物料名称 |
| | | lotno = model.LotNo, //批次号 |
| | | isqualified = model.IsQualified, //是否合格 |
| | | origin=model.Origin//来源 |
| | | origin = model.Origin//来源 |
| | | }); |
| | | return qualityList; |
| | | } |
| | |
| | | { |
| | | sqlStr += $" and LotNo='{model.LotNo}' "; |
| | | } |
| | | BllArrivalNoticeDetail arrivalDetail = Db.SqlQueryable<BllArrivalNoticeDetail>(sqlStr).First(); |
| | | BllArrivalNoticeDetail arrivalDetail = Db.SqlQueryable<BllArrivalNoticeDetail>(sqlStr).First(); |
| | | if (arrivalDetail == null) |
| | | { |
| | | throw new Exception("未找到入库单信息!"); |
| | |
| | | List<DataStockDetail> detail = Db.SqlQueryable<DataStockDetail>(sqlStr2).ToList(); |
| | | foreach (var item in detail) |
| | | { |
| | | List<BllBoxInfo> box = Db.Queryable<BllBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList(); |
| | | //List<BllBoxInfo> box = Db.Queryable<BllBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList(); |
| | | //判断合格状态是否合格 |
| | | if (model.IsQualified == "1") |
| | | { |
| | |
| | | item.InspectStatus = "2"; //2不合格 |
| | | } |
| | | |
| | | Db.Updateable(box).ExecuteCommand(); |
| | | //Db.Updateable(box).ExecuteCommand(); |
| | | Db.Updateable(item).ExecuteCommand(); |
| | | } |
| | | |
| | | Db.Updateable(arrivalDetail).ExecuteCommand(); |
| | | var isquality = Db.Insertable(model).ExecuteCommand(); |
| | | |
| | | //修改库存箱码质检状态 |
| | | string uptDataBoxStatusSql = $@"update DataBoxInfo set InspectStatus='1' where IsDel='0' and SkuNo='{model.SkuNo}' and LotNo='{model.LotNo}' and StockDetailId in (select Id from DataStockDetail where IsDel='0' and SkuNo='{model.SkuNo}' and LotNo='{model.LotNo}' and InspectStatus='1') "; |
| | | int uptDataBoxStatus = Db.Ado.ExecuteCommand(uptDataBoxStatusSql); |
| | | |
| | | |
| | | return isquality; |
| | | } |
| | |
| | | //回滚事务 |
| | | Db.RollbackTran(); |
| | | //抛出异常 |
| | | throw new Exception("接收SAP下发库存调整单异常:", ex); |
| | | throw new Exception($"接收SAP下发库存调整单异常:{ex}"); |
| | | } |
| | | } |
| | | #endregion |