schangxiang@126.com
2024-09-10 b78a8a99a9817b29289dc637711ab122cee829a8
iWara.SCADA.Code/iWare.Wms.Application/Service/Pda/PdaService.cs
@@ -486,13 +486,13 @@
        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;
@@ -504,9 +504,11 @@
            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;
@@ -526,7 +528,7 @@
                if (workPiece != null)
                {
                    workPiece.OutPerson = CurrentUserInfo.Name;
                    workPiece.OutRemark = "撤销工件出库";
                    workPiece.OutRemark = "撤销工件入库";
                    workPiece.OutTime = DateTime.Now;
                    workPiece.IsOut = false;
@@ -544,9 +546,28 @@
                };
                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 "出库成功";
        }