| | |
| | | public async Task<string> outBoundWorkPiece([FromBody] OutBoundInput input) |
| | | { |
| | | |
| | | if (input.Password == null || !input.Password.Equals("123456")) |
| | | { |
| | | throw Oops.Oh("修改工件质量状态失败:密码输入错误!"); |
| | | } |
| | | //if (input.Password == null || !input.Password.Equals("123456")) |
| | | //{ |
| | | // throw Oops.Oh("修改工件质量状态失败:密码输入错误!"); |
| | | //} |
| | | if (input.WorkPieceInfoLst.Count < 1) |
| | | { |
| | | throw Oops.Oh("工件出库失败:数据不能为空!"); |
| | | throw Oops.Oh("工件入库失败:数据不能为空!"); |
| | | } |
| | | |
| | | List<OutBoundDetailsInput> WorkPieceInfoLst = input.WorkPieceInfoLst; |
| | |
| | | |
| | | List<WorkPieceInfo> db_WorkPieceInfoList = await _workPieceInfoRep.Where(w => queryOP80NewCodeList.Contains(w.OP80NewCode) && w.IsDeleted == false).ToListAsync(); |
| | | |
| | | var addOutBoundLogList = new List<WorkPieceOutboundRecord>(); |
| | | |
| | | foreach (var item in WorkPieceInfoLst) |
| | | { |
| | | var itemModel = db_itemModelList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode); |
| | | var itemModel = db_itemModelList.FirstOrDefault(w => w.OP80NewCode == item.OP80NewCode && w.IsDeleted == false); |
| | | if (itemModel != null) |
| | | { |
| | | //itemModel.IsDeleted = true; |
| | |
| | | if (workPiece != null) |
| | | { |
| | | workPiece.OutPerson = CurrentUserInfo.Name; |
| | | workPiece.OutRemark = "撤销工件出库"; |
| | | workPiece.OutRemark = "撤销工件入库"; |
| | | workPiece.OutTime = DateTime.Now; |
| | | workPiece.IsOut = false; |
| | | |
| | |
| | | }; |
| | | addOutBoundList.Add(outBoundLog); |
| | | |
| | | var outBoundLogRecord = new WorkPieceOutboundRecord |
| | | { |
| | | OperationType = OutboundOperationType.入库.ToString(), |
| | | WorkPieceID = workPiece?.WorkPieceID, |
| | | OP80NewCode = item.OP80NewCode, |
| | | |
| | | CreatedUserId = CurrentUserInfo.UserId, |
| | | CreatedUserName = CurrentUserInfo.Name, |
| | | |
| | | |
| | | //CarNo = input.CarNo, |
| | | Remark = "工件入库", |
| | | |
| | | }; |
| | | addOutBoundLogList.Add(outBoundLogRecord); |
| | | |
| | | |
| | | } |
| | | await _workPieceOutboundRep.InsertAsync(addOutBoundList); |
| | | |
| | | await _workPieceOutboundRecordRep.InsertAsync(addOutBoundLogList); |
| | | |
| | | return "出库成功"; |
| | | } |
| | | |