xiaojiao
7 小时以前 557f02072fa311eefe3123aa44afebac22adc465
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA.Services/Services/ToAPP/InboundBoxingAction.cs
@@ -2,6 +2,7 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WIDESEA.Common;
using WIDESEA.Core.Enums;
@@ -12,6 +13,7 @@
using WIDESEA.Services.IServices.ToApp;
using WIDESEA.Services.Repositories;
using WIDESEA.Services.Services;
using WIDESEA_Common.LogEnum;
using WIDESEA_Entity.DomainModels;
@@ -53,6 +55,12 @@
                //生产日期
                string ProductDate = saveModel.MainData["ProductDate"].ToString();
                // æ ‡å‡†å€¼
                string Standard_value = saveModel.MainData["Standard_value"].ToString();
                // äº§åœ°
                string Placeoforigin = saveModel.MainData["Placeoforigin"].ToString();
                if (string.IsNullOrEmpty(madeUnit) || string.IsNullOrEmpty(materielId) || string.IsNullOrEmpty(materielType) || string.IsNullOrEmpty(NewOrOld))
                    throw new Exception($"厂家/轮对/型号/检修类型都不能为空");
@@ -93,9 +101,11 @@
                    throw new Exception($"托盘码:【{rfid}】已经存在于空托盘库存中,货位号:{conInfoEmpty.location_id}");
                //查找该托盘是否之前入过库,组盘进库的托盘之前必须已经入过库的
                Dt_container_head_hty head_Hty = Dt_container_head_htyRepository.Instance.FindFirst(x => x.containerhead_barcode == rfid);
                if (head_Hty == null)
                    throw new Exception($"托盘码:【{rfid}】该托盘无入库记录,无法组盘,请先将其空托盘状态入库,在呼叫空托盘出库进行组盘入库");
                Dt_EmptyPallet dt_EmptyPallet = Dt_EmptyPalletRepository.Instance.Find(x => x.EmptyPallet_name == rfid).FirstOrDefault();
                if (dt_EmptyPallet == null)
                    throw new Exception($"托盘码:【{rfid}】,在托盘管理中,无该托盘,请先添加托盘信息");
            
                //判断轴承有效期是否超过2å¹´
@@ -122,7 +132,7 @@
                    newBoxDetail.boxdtl_materielid = materielId;
                    newBoxDetail.boxdtl_qty = "1";
                    newBoxDetail.boxdtl_operator = UserContext.Current.UserTrueName;
                    newBoxDetail.boxdtl_inboundUnit = "智粤";
                    newBoxDetail.boxdtl_inboundUnit = "北京动车段";
                    newBoxDetail.boxdtl_standard = NewOrOld;
                    newBoxDetail.boxdtl_carType = materielId;
                    newBoxDetail.boxdtl_type = materielType;
@@ -142,7 +152,7 @@
                    Dt_mes_goods_info info = new Dt_mes_goods_info();
                    info.mesInfo_id = Guid.NewGuid();
                    info.mesInfo_inUnit = "智粤";
                    info.mesInfo_inUnit = "北京动车段";
                    info.mesInfo_madeUnit = madeUnit;
                    info.mesInfo_carType = materielId;
                    info.mesInfo_type = materielType;
@@ -152,11 +162,25 @@
                    info.mesInfo_createType = "mes";
                    info.mesInfo_qrCode = qrCode;
                    info.mesInfo_createDate = DateTime.Now;
                    info.mesInfo_bak_3 = Standard_value; // ä»¥åŽæ ‡å‡†å€¼ä»Žè¿™é‡ŒèŽ·å– è‚–佼新增
                    info.mesInfo_bak_4 = Placeoforigin; // è½´æ‰¿çš„产地
                    Dt_mes_goods_infoRepository.Instance.Add(info, true);
                    //获取空货位
                    Dt_locationinfo emptyLocation = CommonFunction.GetEmptyLocationAction();
                    Dt_locationinfo emptyLocation = CommonFunction.GetEmptyLocationAction(1);
                    VV_ContainerInfo_EmptyPallet SelectLocation = VV_ContainerInfo_EmptyPalletRepository.Instance.FindFirst(x => x.location_id == emptyLocation.location_id);
                    VV_ContainerInfo conInfohw = VV_ContainerInfoRepository.Instance.FindFirst(x => x.location_id == emptyLocation.location_id);
                    if (SelectLocation != null || conInfohw != null)
                    {
                        LogRecord.WriteLog((int)LogEnum.InBound, $"分配的货位已有货,货位号{emptyLocation.location_id}");
                        throw new Exception($"分配的货位已有货,货位号{SelectLocation.location_id}");
                    }
                    //获取任务
                    Dt_taskinfo tmpTaskInfo = CommonFunction.AddWMSTask_BoxPalletIn(emptyLocation, rfid, materielId, qrCode, materielType);
                    //修改货位状态