/// <summary> /// 添加出库信息 /// </summary> /// <param name="dtos">要添加的出库信息DTO信息</param> /// <returns>业务操作结果</returns> public virtual async Task <OperationResult> CreateOutStors(params OutStorInputDto[] dtos) { Check.Validate <OutStorInputDto, int>(dtos, nameof(dtos)); //通过ID获取Name foreach (OutStorInputDto dto in dtos) { MatBasedata matdb = await MatBasedataRepository.GetAsync(dto.MatId); CusBasedata cusdb = await CusBasedataRepository.GetAsync(dto.CusId); EmpBasedata empdb = await EmpBasedataRepository.GetAsync(dto.OutEmpId); dto.MatName = matdb.MatName; dto.CusName = cusdb.CusName; dto.OutEmpName = empdb.EmpName; //修改人员工作状态 empdb.EmpWorkState = true; EmpBasedataRepository.Update(empdb); } return(await OutStorRepository.InsertAsync(dtos)); }
/// <summary> /// 初始化一个<see cref="EmpBasedataOutputDto"/>类型的新实例 /// </summary> public EmpBasedataOutputDto(EmpBasedata entity) { Id = entity.Id; EmpId = entity.EmpId; EmpName = entity.EmpName; EmpDep = entity.EmpDep; EmpPhone = entity.EmpPhone; EmpWorkState = entity.EmpWorkState; EmpFireState = entity.EmpFireState; EmpWorkInTime = entity.EmpWorkInTime; EmpWorkOutTime = entity.EmpWorkOutTime; EmpRemark = entity.EmpRemark; CreatedTime = entity.CreatedTime; }