|
@@ -1473,12 +1473,27 @@ public class OrderController : BaseController
|
|
/// <param name="id"></param>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("supervise/{id}")]
|
|
[HttpGet("supervise/{id}")]
|
|
- public async Task<OrderSupervise> SuperviseEntity(string id)
|
|
|
|
|
|
+ public async Task<OrderSuperviseDto> SuperviseEntity(string id)
|
|
{
|
|
{
|
|
- return await _orderSuperviseRepository.Queryable()
|
|
|
|
|
|
+ var orderSupervise = await _orderSuperviseRepository.Queryable()
|
|
.Includes(x => x.Order)
|
|
.Includes(x => x.Order)
|
|
.FirstAsync(x => x.Id == id);
|
|
.FirstAsync(x => x.Id == id);
|
|
- }
|
|
|
|
|
|
+ var orderSuperviseDto = new OrderSuperviseDto();
|
|
|
|
+ if (orderSupervise != null)
|
|
|
|
+ {
|
|
|
|
+ orderSuperviseDto = _mapper.Map<OrderSuperviseDto>(orderSupervise);
|
|
|
|
+ var files = await _fileRepository.Queryable().Where(x => x.Key == orderSupervise.Id).ToListAsync();
|
|
|
|
+ if (files.Any())
|
|
|
|
+ {
|
|
|
|
+ var applyFiles = files.Where(x => x.Classify == "督办申请").ToList();
|
|
|
|
+ if (applyFiles.Any()) orderSuperviseDto.Files = _mapper.Map<List<FileDto>>(applyFiles);
|
|
|
|
+ var replyFiles = files.Where(x => x.Classify == "督办回复").ToList();
|
|
|
|
+ if (replyFiles.Any()) orderSuperviseDto.ReplyFiles = _mapper.Map<List<FileDto>>(replyFiles);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return orderSuperviseDto;
|
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
@@ -1607,12 +1622,20 @@ public class OrderController : BaseController
|
|
/// <param name="id"></param>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpGet("urge/{id}")]
|
|
[HttpGet("urge/{id}")]
|
|
- public async Task<OrderUrge> UrgeEntity(string id)
|
|
|
|
|
|
+ public async Task<OrderUrgeDto> UrgeEntity(string id)
|
|
{
|
|
{
|
|
- return await _orderUrgeRepository.Queryable()
|
|
|
|
|
|
+ var orderUrge = await _orderUrgeRepository.Queryable()
|
|
.Includes(x => x.Order)
|
|
.Includes(x => x.Order)
|
|
.FirstAsync(x => x.Id == id);
|
|
.FirstAsync(x => x.Id == id);
|
|
- }
|
|
|
|
|
|
+ var orderUrgeDto = new OrderUrgeDto();
|
|
|
|
+ if (orderUrge != null)
|
|
|
|
+ {
|
|
|
|
+ orderUrgeDto = _mapper.Map<OrderUrgeDto>(orderUrge);
|
|
|
|
+ var files = await _fileRepository.Queryable().Where(x => x.Key == orderUrge.Id).ToListAsync();
|
|
|
|
+ if (files.Any()) orderUrgeDto.Files = _mapper.Map<List<FileDto>>(files);
|
|
|
|
+ }
|
|
|
|
+ return orderUrgeDto;
|
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
@@ -2158,7 +2181,9 @@ public class OrderController : BaseController
|
|
model.OrgId = _sessionContext.OrgId;
|
|
model.OrgId = _sessionContext.OrgId;
|
|
model.OrgName = _sessionContext.OrgName;
|
|
model.OrgName = _sessionContext.OrgName;
|
|
if (!dto.Audit) model.State = 1;
|
|
if (!dto.Audit) model.State = 1;
|
|
- await _orderSpecialRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
|
|
|
+ model.InitId();
|
|
|
|
+ if (dto.Files.Any()) model.FileJson = await _fileRepository.AddFileAsync(dto.Files, model.Id, "", HttpContext.RequestAborted);
|
|
|
|
+ await _orderSpecialRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
if (model.State == 1)
|
|
if (model.State == 1)
|
|
{
|
|
{
|
|
var recall = new RecallDto
|
|
var recall = new RecallDto
|
|
@@ -2170,7 +2195,7 @@ public class OrderController : BaseController
|
|
Opinion = dto.Cause
|
|
Opinion = dto.Cause
|
|
};
|
|
};
|
|
if (dto.AlterTime) recall.External = new External { TimeLimit = dto.TimeLimit, TimeLimitUnit = dto.TimeLimitUnit };
|
|
if (dto.AlterTime) recall.External = new External { TimeLimit = dto.TimeLimit, TimeLimitUnit = dto.TimeLimitUnit };
|
|
- if (dto.Files.Any()) recall.Files = dto.Files;
|
|
|
|
|
|
+ //if (dto.Files.Any()) recall.Files = dto.Files;
|
|
await _workflowApplication.RecallAsync(recall, HttpContext.RequestAborted);
|
|
await _workflowApplication.RecallAsync(recall, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2188,7 +2213,8 @@ public class OrderController : BaseController
|
|
if (special is null) throw UserFriendlyException.SameMessage("无效特提审批信息!");
|
|
if (special is null) throw UserFriendlyException.SameMessage("无效特提审批信息!");
|
|
if (special.State != 0) throw UserFriendlyException.SameMessage("无效特提审批信息,特提审批信息错误,该信息已审核!");
|
|
if (special.State != 0) throw UserFriendlyException.SameMessage("无效特提审批信息,特提审批信息错误,该信息已审核!");
|
|
_mapper.Map(dto, special);
|
|
_mapper.Map(dto, special);
|
|
- await _orderSpecialRepository.UpdateAsync(special, HttpContext.RequestAborted);
|
|
|
|
|
|
+ if (dto.Files.Any()) special.ReplyFileJson = await _fileRepository.AddFileAsync(dto.Files, special.Id, "", HttpContext.RequestAborted);
|
|
|
|
+ await _orderSpecialRepository.UpdateAsync(special, HttpContext.RequestAborted);
|
|
if (special.State == 1)
|
|
if (special.State == 1)
|
|
{
|
|
{
|
|
var recall = new RecallDto
|
|
var recall = new RecallDto
|
|
@@ -2200,7 +2226,7 @@ public class OrderController : BaseController
|
|
Opinion = dto.Opinion
|
|
Opinion = dto.Opinion
|
|
};
|
|
};
|
|
if (dto.AlterTime) recall.External = new External { TimeLimit = dto.TimeLimit, TimeLimitUnit = dto.TimeLimitUnit };
|
|
if (dto.AlterTime) recall.External = new External { TimeLimit = dto.TimeLimit, TimeLimitUnit = dto.TimeLimitUnit };
|
|
- if (dto.Files.Any()) recall.Files = dto.Files;
|
|
|
|
|
|
+ //if (dto.Files.Any()) recall.Files = dto.Files;
|
|
await _workflowApplication.RecallAsync(recall, HttpContext.RequestAborted);
|
|
await _workflowApplication.RecallAsync(recall, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2279,7 +2305,14 @@ public class OrderController : BaseController
|
|
var item = await _orderSpecialRepository.Queryable()
|
|
var item = await _orderSpecialRepository.Queryable()
|
|
.Includes(x => x.Order)
|
|
.Includes(x => x.Order)
|
|
.FirstAsync(x => x.Id == id);
|
|
.FirstAsync(x => x.Id == id);
|
|
- return _mapper.Map<OrderSpecialDto>(item);
|
|
|
|
|
|
+ var itemDto = new OrderSpecialDto();
|
|
|
|
+ if (item != null)
|
|
|
|
+ {
|
|
|
|
+ itemDto = _mapper.Map<OrderSpecialDto>(item);
|
|
|
|
+ var files = await _fileRepository.Queryable().Where(x => x.Key == item.Id).ToListAsync();
|
|
|
|
+ if (files.Any()) itemDto.Files = _mapper.Map<List<FileDto>>(files);
|
|
|
|
+ }
|
|
|
|
+ return itemDto;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|