public PlanTaskBatchAdjust AddPlantaskAdjustWithWarehouseInfor(PlanTaskBatchAdjust newplanAdjust, string OrgDepCode) { PlanTaskBatchAdjust rtnplantaskbatchAdjust = null; try { _unitOfWork.Actions.Clear(); int billId = _sysBillNoService.GetBillNoID("MAN", "PAN"); newplanAdjust.plantask_batch_adjust_number = _sysBillNoService.GetBillNo(billId, OrgDepCode); newplanAdjust.adjust_time = _sPGetSysDateTimeService.GetSysDateTime(); _unitOfWork.AddAction(newplanAdjust, DataActions.Add); //_warehouseStoreInfoService.UpdateWarehouseStoreInfoWithPlanTaskBatchAdjust(newplanAdjust); _unitOfWork.Save(); } catch (RepositoryException ex) { throw ex; } return(rtnplantaskbatchAdjust); }
public PlanTaskBatchAdjust AddPlantaskAdjustWithPlantaskBatchInfo(PlanTaskBatchAdjust newPlanAdjust, PlanTaskBatch plantaskBatch, string orgDeptCode) { try { //新建冲补单 _unitOfWork.Actions.Clear(); int billId = _sysBillNoService.GetBillNoID("MAN", "PAN"); newPlanAdjust.plantask_batch_adjust_number = _sysBillNoService.GetBillNo(billId, orgDeptCode); newPlanAdjust.adjust_time = _sPGetSysDateTimeService.GetSysDateTime(); _unitOfWork.AddAction(newPlanAdjust, DataActions.Add); //更新批次净重 if (newPlanAdjust.adjust_type == (int)plantaskahjusttype.增加) { plantaskBatch.batch_count += newPlanAdjust.adjust_count; } else { plantaskBatch.batch_count -= newPlanAdjust.adjust_count; } _unitOfWork.AddAction(plantaskBatch, DataActions.Update); //更新库存记录 _warehouseStoreInfoService.UpdateWarehouseStoreInfoWithPlanTaskBatchAdjust(newPlanAdjust, plantaskBatch); _unitOfWork.Save(); } catch (RepositoryException ex) { throw new AisinoMesServiceException("新增作业计划冲补记录失败!", ex); } catch (Exception ex) { throw new AisinoMesServiceException("新增作业计划冲补记录失败!", ex); } return(newPlanAdjust); }
public WarehouseInOutRecord UpdateWarehouseInOutRecordWithStoreInfoAndBatchAdjust(WarehouseStoreInfo warehouseStoreInfo, PlanTaskBatchAdjust planTaskBatchAdjust, PlanTaskBatch plantaskBatch) { WarehouseInOutRecord warehouseInOutRecord = plantaskBatch.WarehouseInOutRecords.Where(t => t.warehouse_id == warehouseStoreInfo.warehouse_id).FirstOrDefault(); if (plantaskBatch.PlanTask.PlanTaskType.warehouse_control_mode.Value == (int)WarehouseControlMode.入仓) { if (planTaskBatchAdjust.adjust_type == (int)plantaskahjusttype.增加) { warehouseInOutRecord.record_count += planTaskBatchAdjust.adjust_count; warehouseInOutRecord.balance_count += planTaskBatchAdjust.adjust_count; } else { warehouseInOutRecord.record_count -= planTaskBatchAdjust.adjust_count; warehouseInOutRecord.balance_count -= planTaskBatchAdjust.adjust_count; } } else { if (planTaskBatchAdjust.adjust_type == (int)plantaskahjusttype.增加) { warehouseInOutRecord.record_count += planTaskBatchAdjust.adjust_count; warehouseInOutRecord.balance_count -= planTaskBatchAdjust.adjust_count; } else { warehouseInOutRecord.record_count -= planTaskBatchAdjust.adjust_count; warehouseInOutRecord.balance_count += planTaskBatchAdjust.adjust_count; } } _unitOfWork.AddAction(warehouseInOutRecord, DataActions.Update); AddWarehouseInOutRecordDetailWithInOutRecordAndBatchAdjust(warehouseInOutRecord, planTaskBatchAdjust); return(warehouseInOutRecord); }
/// <summary> /// 根据出入库冲补和记录,新增出入库条目 /// </summary> /// <param name="warehouseInOutRecord">出入库记录</param> /// <param name="planTaskBatchAdjust">计划冲补单</param> /// <returns></returns> private WarehouseInOutRecordDetail AddWarehouseInOutRecordDetailWithInOutRecordAndBatchAdjust(WarehouseInOutRecord warehouseInOutRecord, PlanTaskBatchAdjust planTaskBatchAdjust) { WarehouseInOutRecordDetail winoutRecordDetail = new WarehouseInOutRecordDetail(); winoutRecordDetail.create_time = planTaskBatchAdjust.adjust_time.ToString("yyyyMMdd"); winoutRecordDetail.inout_count = planTaskBatchAdjust.adjust_count.Value; winoutRecordDetail.record_number = warehouseInOutRecord.record_number; winoutRecordDetail.record_status = (int)RecordStatus.效; winoutRecordDetail.reference_number = planTaskBatchAdjust.plantask_batch_adjust_number; winoutRecordDetail.regist_type = (int)WarehouseInOutRecordDetailRegistType.通过冲补登记; _unitOfWork.AddAction(winoutRecordDetail, DAL.Enums.DataActions.Add); return(winoutRecordDetail); }