| | |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Inbound; |
| | | using WIDESEA_TaskInfoRepository; |
| | | using OrderByType = SqlSugar.OrderByType; |
| | | |
| | |
| | | private readonly IOutboundOrderDetail_HtyRepository _outboundOrderDetail_HtyRepository; |
| | | private readonly IOutBoundOrderBYDRepository _outBoundOrderBYDRepository; |
| | | private readonly IOutboundOrderDetailBYDRepository _outboundOrderDetailByDRepository; |
| | | private readonly IMainReturnInventoryRepository _mainReturnInventoryRepository; |
| | | private readonly IReturnInventoryDetailRepository _returnInventoryDetailRepository; |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | | private Dictionary<string, OrderByType> _OutLockOrderBy = new Dictionary<string, OrderByType>() |
| | |
| | | |
| | | }; |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository, IReturnInventoryDetailRepository returnInventoryDetailRepository,IMainReturnInventoryRepository mainReturnInventoryRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _outboundOrderRepository = outboundOrderRepository; |
| | | _outboundOrder_HtyRepository = outboundOrder_HtyRepository; |
| | | _outboundOrderDetail_HtyRepository = outboundOrderDetail_HtyRepository; |
| | | _returnInventoryDetailRepository = returnInventoryDetailRepository; |
| | | _mainReturnInventoryRepository = mainReturnInventoryRepository; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | //使å
¥åºå®æåï¼éè¦å°ç»çä¿¡æ¯è°ç¨ä¸æ¸¸WMSåæä¸æ¶ç»ææ¥å£ |
| | | //使å
¥åºå®æåï¼éè¦å°ç»çä¿¡æ¯è°ç¨ä¸æ¸¸WMS使éåç»ææ¥å£ |
| | | #region åä¼ é»è¾å¤ç |
| | | //try |
| | | //{ |
| | | // PutAwayRequest request = new PutAwayRequest(); |
| | | // List<PutAway> itemData = new List<PutAway>(); |
| | | // request.ITEMDATA = itemData; |
| | | // request.WERKS = AppSettings.Configuration["WERKS"]; |
| | | // request.WH_NUMBER = AppSettings.Configuration["WERKS"]; |
| | | // request.IZLID = request.WERKS + request.WH_NUMBER + DateTime.Now.ToString("yyyyMMdd") + task.TaskNum.ToString(); |
| | | // request.CREATE_DATE = task.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | // request.PSTNG_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | // request.INBOUND_NO = "";//todo:åå·è¦ä»æ¡ç ä¸»æ°æ®ä¸è·åï¼ä¸ç¶åä¼ ä¼æç¤ºï¼è¯¥æ¡ç æ è¿ä»åæ°æ®ï¼ |
| | | // request.RECEIPT_NO = "";//todo:åå·è¦ä»æ¡ç ä¸»æ°æ®ä¸ï¼ä¸ç¶åä¼ ä¼æç¤ºï¼è¯¥æ¡ç æ è¿ä»åæ°æ®ï¼ |
| | | // Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | // foreach (Dt_StockInfoDetail detail in stockInfo.Details) |
| | | // { |
| | | // Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber); |
| | | // if (labMaster != null) |
| | | // { |
| | | // if (request.INBOUND_NO == "") |
| | | // { |
| | | // request.INBOUND_NO = labMaster.INBOUND_NO; |
| | | // } |
| | | // if (request.RECEIPT_NO == "") |
| | | // { |
| | | // request.RECEIPT_NO = labMaster.RECEIPT_NO; |
| | | // } |
| | | // PutAway putAway = new PutAway(); |
| | | // putAway.MATNR = labMaster.MATNR; |
| | | // putAway.BATCH = labMaster.BATCH; |
| | | // putAway.LIFNR = labMaster.LIFNR; |
| | | // putAway.LIKTX = labMaster.LIKTX; |
| | | // putAway.RECEIPT_QTY = labMaster.BOX_QTY; |
| | | // putAway.UNIT = labMaster.UNIT; |
| | | // putAway.LABEL_NO = labMaster.LABEL_NO; |
| | | // putAway.PACK_LABEL_NO = labMaster.Pack_LABEL_No; |
| | | // putAway.PALLET_LABEL_NO = labMaster.Pallet_label_no; |
| | | // putAway.TPNUM = task.PalletCode; |
| | | // putAway.FLAG = "0"; |
| | | // putAway.TKTXT = ""; |
| | | // putAway.PO_NO = labMaster.PO_NO; |
| | | // putAway.PO_ITEM_NO = labMaster.PO_ITEM_NO; |
| | | // putAway.SOBKZ = labMaster.SOBKZ; |
| | | // putAway.RECEIPT_ITEM_NO = labMaster.RECEIPT_ITEM_NO; |
| | | // putAway.INBOUND_NO = task.TaskNum.ToString(); |
| | | // //LABEL _STATUS æ¡ç ç¶æ 02å·²æ¶æ(æ éè´¨æ£)03 å¾
è¿ä»(已质æ£)ï¼å¹¶ä¸ï¼QC RESULT CODEè´¨æ£ç¶æä¸ºâ02â æå
è®¡ä¸æ¶ |
| | | // if (labMaster.QC_RESULT_CODE == "02" && (labMaster.LABEL_STATUS == "02" || labMaster.LABEL_STATUS == "03")) |
| | | // { |
| | | // itemData.Add(putAway); |
| | | // } |
| | | try |
| | | { |
| | | PutAwayReturnRequest request = new PutAwayReturnRequest(); |
| | | List<PutAwayReturn> DATA = new List<PutAwayReturn>(); |
| | | request.DATA = DATA; |
| | | request.WERKS = AppSettings.Configuration["WERKS"]; |
| | | request.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | request.IZLID = task.OrderNo;//è¿ä¸ªå¼ä¼å¨æ¥æ¶ä¸æ¸¸ååºç»çä¿¡æ¯æ¶ï¼åå¨åºå表ä¸ï¼ååå°ä»»å¡è¡¨ä¸ |
| | | Dt_MainReturnInventory mainReturnInventory = _mainReturnInventoryRepository.QueryFirst(x => x.IZLID == task.OrderNo); |
| | | if (mainReturnInventory != null) |
| | | { |
| | | request.RETURN_NO = mainReturnInventory.RETURN_NO; |
| | | request.RETURN_ITEM_NO = mainReturnInventory.RETURN_ITEM_NO; |
| | | request.BUSINESS_NAME = mainReturnInventory.BUSINESS_NAME; |
| | | request.BUSINESS_CODE = mainReturnInventory.BUSINESS_CODE; |
| | | request.TPNUM = mainReturnInventory.TPNUM; |
| | | request.LGORT = mainReturnInventory.LGORT; |
| | | request.MO_NO = mainReturnInventory.MO_NO; |
| | | |
| | | // } |
| | | // } |
| | | // if (itemData.Count > 0) |
| | | // { |
| | | // _sys_JobService.CallPutAway(request); |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error(ex.Message); |
| | | //} |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | foreach (Dt_StockInfoDetail detail in stockInfo.Details) |
| | | { |
| | | Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = _returnInventoryDetailRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber); |
| | | if (dt_ReturnInventoryDetail != null) |
| | | { |
| | | PutAwayReturn putAwayReturn = new PutAwayReturn(); |
| | | putAwayReturn.LABEL_NO = dt_ReturnInventoryDetail.LABEL_NO; |
| | | putAwayReturn.SOBKZ = dt_ReturnInventoryDetail.SOBKZ; |
| | | putAwayReturn.UNIT = dt_ReturnInventoryDetail.UNIT; |
| | | putAwayReturn.LGORT = dt_ReturnInventoryDetail.LGORT; |
| | | putAwayReturn.TOTAL_RETURN_QTY = dt_ReturnInventoryDetail.QTY; |
| | | putAwayReturn.F_LGORT = dt_ReturnInventoryDetail.F_LGORT; |
| | | putAwayReturn.MO_NO = mainReturnInventory.MO_NO; |
| | | putAwayReturn.LIFNR = dt_ReturnInventoryDetail.LIFNR; |
| | | putAwayReturn.MATNR = dt_ReturnInventoryDetail.MATNR; |
| | | putAwayReturn.BATCH = ""; |
| | | DATA.Add(putAwayReturn); |
| | | } |
| | | } |
| | | if(DATA.Count>0) |
| | | { |
| | | _sys_JobService.CallPutAwayReturn(request);//使éåºåä¼ |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | #endregion |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | PickAndPostRequest request = new PickAndPostRequest(); |
| | | List<PickAndPost> itemData = new List<PickAndPost>(); |
| | | request.ITEMDATA = itemData; |
| | | request.WH_NUMBER = AppSettings.Configuration["WERKS"]; |
| | | request.WH_NUMBER = AppSettings.Configuration["SYSNO"]; |
| | | request.SYSNOD = AppSettings.Configuration["SYSNO"]; |
| | | request.WERKS = AppSettings.Configuration["WERKS"]; |
| | | //ææ¶æ ¹æ®æçå·æ¥åºåºéå®è¡¨ä¸Dt_OutStockLockInfoä¸çç¶æä¸º1çææ°ä¸æ¡,å 为å
éå®ï¼ææä»»å¡ï¼æä»¥æ²¡æå
³èä»»å¡å· |
| | | //Dt_OutStockLockInfo outStockLockInfo= _outStockLockInfoRepository.QueryFirst(x => x.PalletCode == task.PalletCode && x.Status == 1, _OutLockOrderBy); |
| | | |
| | | |
| | | request.WERKS = AppSettings.Configuration["CallMaterialID"]; |
| | | |
| | | Dt_OutboundOrderDetail_Hty detail = _outboundOrderDetail_HtyRepository.QueryFirst(x => x.SourceId.ToString() == task.Remark);// task.Remarkåéæ±æç»ID |
| | | if (detail != null) |
| | | { |