陈勇
3 天以前 6b74e1dcf5642c8f56975471e27780d695953989
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/Queue.cs
@@ -1,4 +1,5 @@
using StackExchange.Profiling.Internal;
using Mapster;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -8,7 +9,9 @@
using System.Threading.Tasks;
using WIDESEA_Common.MES;
using WIDESEA_Core;
using WIDESEA_Core.Enums;
using WIDESEA_DTO;
using WIDESEA_Model.Models;
using WIDESEA_StorageBasicRepository;
namespace WIDESEA_StoragIntegrationServices
@@ -28,6 +31,12 @@
                //查找对应的PVI码车身信息
                var carinfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI);
                if (carinfo == null) throw new Exception($"{json.PVI}车身信息未找到");
                Dt_CarBodyInfo_hty carInfo_Hty = carinfo.Adapt<Dt_CarBodyInfo_hty>();
                carInfo_Hty.FinishTime = DateTime.Now;
                carInfo_Hty.FinishType = (int)OperateTypeEnum.自动完成;
                carInfo_Hty.sourceID = carinfo.Id;
                VINRespon respon = new VINRespon();
                if (!string.IsNullOrEmpty(carinfo.VIN))
                {
@@ -38,6 +47,10 @@
                        SkyLight = carinfo.skylightCharacteristic,
                        VechicleModel = carinfo.vehicleCharacteristic,
                    };
                    _carBodyInfo_HtyRepository.AddData(carInfo_Hty);
                    _carBodyInfoRepository.DeleteData(carinfo);
                    return content.OK(data: respon);
                }
@@ -66,16 +79,23 @@
                };
                var mesLock = _mesLockInfoRepository.QueryFirst(x => x.carBodyID == carinfo.Id);
                _unitOfWorkManage.BeginTran();
                //删除车身信息
                carInfo_Hty.VIN = respon.VIN;
                _carBodyInfo_HtyRepository.AddData(carInfo_Hty);
                _carBodyInfoRepository.DeleteData(carinfo);
                if (mesLock != null)
                {
                    mesLock.LockStatue = 2;
                    _mesLockInfoRepository.UpdateData(mesLock);
                }
                _unitOfWorkManage.CommitTran();
                content.OK(data: respon);
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content;