public async Task Update(CreateSupplyRepairDto input) { var repair = _supplyRepairRepository.Get(input.Id.Value); repair.Des = input.Des; if (input.FileList != null) { var fileList = new List<AbpFileListInput>(); foreach (var item in input.FileList) { fileList.Add(new AbpFileListInput() { Id = item.Id, Sort = item.Sort }); } await _abpFileRelationAppService.UpdateAsync(new CreateFileRelationsInput() { BusinessId = repair.Id.ToString(), BusinessType = (int)AbpFileBusinessType.申请用品维修附件, Files = fileList }); } repair.RepairEndTime = input.RepairEndTime; repair.CheckRemark = input.CheckRemark; repair.ScrapReason = input.ScrapReason; repair.RepairResult = input.RepairResult; await _supplyRepairRepository.UpdateAsync(repair); }
public async Task<InitWorkFlowOutput> CreateV2(CreateSupplyRepairDto input) { var u = await _userSupplyRepository.GetAsync(input.UserSupplyId); var model = new SupplyRepair(); model.UserSupplyId = input.UserSupplyId; model.Des = input.Des; model.IsImportant = input.IsImportant; model.RepairEndTime = input.RepairEndTime; model.SupplyId = u.SupplyId; model.Id = Guid.NewGuid(); if (input.FileList != null) { var fileList = new List<AbpFileListInput>(); foreach (var item in input.FileList) { fileList.Add(new AbpFileListInput() { Id = item.Id, Sort = item.Sort }); } await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput() { BusinessId = model.Id.ToString(), BusinessType = (int)AbpFileBusinessType.申请用品维修附件, Files = fileList }); } _supplyRepairRepository.Insert(model); var s = _supplyBaseRepository.Get(u.SupplyId); s.Status = (int)SupplyStatus.维修中; _supplyBaseRepository.Update(s); u.Status = (int)UserSupplyStatus.维修中; _userSupplyRepository.Update(u); return new InitWorkFlowOutput() { InStanceId = model.Id.ToString() }; }