|
@@ -1392,7 +1392,7 @@ public class OrderController : BaseController
|
|
{
|
|
{
|
|
var model = await _orderDelayRepository.Queryable()
|
|
var model = await _orderDelayRepository.Queryable()
|
|
.Includes(d => d.Order)
|
|
.Includes(d => d.Order)
|
|
- .Includes(d => d.Workflow, x=>x.Steps)
|
|
|
|
|
|
+ .Includes(d => d.Workflow, x => x.Steps)
|
|
.FirstAsync(d => d.Id == id);
|
|
.FirstAsync(d => d.Id == id);
|
|
var rspModel = _mapper.Map<OrderDelayDto>(model);
|
|
var rspModel = _mapper.Map<OrderDelayDto>(model);
|
|
//rspModel.IsCanHandle = model.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
//rspModel.IsCanHandle = model.CanHandle(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
@@ -1735,7 +1735,7 @@ public class OrderController : BaseController
|
|
{
|
|
{
|
|
var model = await _orderScreenRepository.Queryable(canView: false)
|
|
var model = await _orderScreenRepository.Queryable(canView: false)
|
|
.Includes(x => x.Order)
|
|
.Includes(x => x.Order)
|
|
- .Includes(x => x.Workflow, d=>d.Steps)
|
|
|
|
|
|
+ .Includes(x => x.Workflow, d => d.Steps)
|
|
.Includes(x => x.Visit, d => d.Order)
|
|
.Includes(x => x.Visit, d => d.Order)
|
|
.FirstAsync(x => x.Id == id);
|
|
.FirstAsync(x => x.Id == id);
|
|
var rspModel = _mapper.Map<OrderScreenListDto>(model);
|
|
var rspModel = _mapper.Map<OrderScreenListDto>(model);
|
|
@@ -2943,23 +2943,47 @@ public class OrderController : BaseController
|
|
if (dto.EndTime.HasValue)
|
|
if (dto.EndTime.HasValue)
|
|
dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
dto.EndTime = dto.EndTime.Value.AddDays(1).AddSeconds(-1);
|
|
|
|
|
|
- var (total, items) = await _orderRepository.Queryable(canView: false)
|
|
|
|
- .WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
|
|
|
|
- .WhereIF(dto.IsHandled.HasValue, d => handleStatuses.Contains(d.Status))
|
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.No.Contains(dto.Keyword!) || d.Title.Contains(dto.Keyword!))
|
|
|
|
- .Where(d => string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)
|
|
|
|
- .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == true, d => d.CounterSignType.HasValue)
|
|
|
|
- .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == false, d => !d.CounterSignType.HasValue)
|
|
|
|
- .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == true, d => (d.ExpiredTime < DateTime.Now && d.Status < EOrderStatus.Filed) || (d.ExpiredTime < d.ActualHandleTime && d.Status >= EOrderStatus.Filed)) //超期 未办
|
|
|
|
- .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == false, d => d.NearlyExpiredTime < DateTime.Now && d.ExpiredTime > DateTime.Now)//即将超期 未办
|
|
|
|
- .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
|
- .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
|
- .Where(x => x.Source < ESource.MLSQ || x.Source > ESource.WZSC)
|
|
|
|
- .Where(x => x.Status != EOrderStatus.BackToProvince && x.Status < EOrderStatus.Filed)
|
|
|
|
- .OrderBy(d => d.Status)
|
|
|
|
- .OrderByIF(dto.IsHandled == true, d => d.StartTime, OrderByType.Desc)
|
|
|
|
- .OrderByIF(dto.IsHandled == false, d => d.CreationTime, OrderByType.Desc)
|
|
|
|
- .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
+ //var (total, items) = await _orderRepository.Queryable(canView: false)
|
|
|
|
+ // .WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
|
|
|
|
+ // .WhereIF(dto.IsHandled.HasValue, d => handleStatuses.Contains(d.Status))
|
|
|
|
+ // .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.No.Contains(dto.Keyword!) || d.Title.Contains(dto.Keyword!))
|
|
|
|
+ // .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == true, d => d.CounterSignType.HasValue)
|
|
|
|
+ // .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == false, d => !d.CounterSignType.HasValue)
|
|
|
|
+ // .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == true, d => (d.ExpiredTime < DateTime.Now && d.Status < EOrderStatus.Filed) || (d.ExpiredTime < d.ActualHandleTime && d.Status >= EOrderStatus.Filed)) //超期 未办
|
|
|
|
+ // .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == false, d => d.NearlyExpiredTime < DateTime.Now && d.ExpiredTime > DateTime.Now)//即将超期 未办
|
|
|
|
+ // .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
|
+ // .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
|
+ // .Where(d=>(string.IsNullOrEmpty(d.WorkflowId) && (string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)))
|
|
|
|
+ // //.Where(d => string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)
|
|
|
|
+ // .Where(x => x.Source < ESource.MLSQ || x.Source > ESource.WZSC)
|
|
|
|
+ // .Where(x => x.Status != EOrderStatus.BackToProvince && x.Status < EOrderStatus.Filed)
|
|
|
|
+ // .OrderBy(d => d.Status)
|
|
|
|
+ // .OrderByIF(dto.IsHandled == true, d => d.StartTime, OrderByType.Desc)
|
|
|
|
+ // .OrderByIF(dto.IsHandled == false, d => d.CreationTime, OrderByType.Desc)
|
|
|
|
+ // .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
+
|
|
|
|
+ var a = _orderRepository.Queryable(hasHandled: dto.IsHandled);
|
|
|
|
+ var b = _orderRepository.Queryable()
|
|
|
|
+ .Where(d => (string.IsNullOrEmpty(d.WorkflowId) &&
|
|
|
|
+ (string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)));
|
|
|
|
+ var (total, items) = await _orderRepository.UnionAll(a, b)
|
|
|
|
+ .WhereIF(dto.IsProvince.HasValue, d => d.IsProvince == dto.IsProvince)
|
|
|
|
+ .WhereIF(dto.IsHandled.HasValue, d => handleStatuses.Contains(d.Status))
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.Keyword), d => d.No.Contains(dto.Keyword!) || d.Title.Contains(dto.Keyword!))
|
|
|
|
+ .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == true, d => d.CounterSignType.HasValue)
|
|
|
|
+ .WhereIF(dto.IsCounterSign.HasValue && dto.IsCounterSign == false, d => !d.CounterSignType.HasValue)
|
|
|
|
+ .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == true, d => (d.ExpiredTime < DateTime.Now && d.Status < EOrderStatus.Filed) || (d.ExpiredTime < d.ActualHandleTime && d.Status >= EOrderStatus.Filed)) //超期 未办
|
|
|
|
+ .WhereIF(dto.ExpiredOrAlmostOverdue.HasValue && dto.ExpiredOrAlmostOverdue == false, d => d.NearlyExpiredTime < DateTime.Now && d.ExpiredTime > DateTime.Now)//即将超期 未办
|
|
|
|
+ .WhereIF(dto.StartTime.HasValue, d => d.CreationTime >= dto.StartTime)
|
|
|
|
+ .WhereIF(dto.EndTime.HasValue, d => d.CreationTime <= dto.EndTime)
|
|
|
|
+ //.Where(d => (string.IsNullOrEmpty(d.WorkflowId) && (string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)))
|
|
|
|
+ //.Where(d => string.IsNullOrEmpty(d.SignerId) || d.SignerId == _sessionContext.RequiredUserId)
|
|
|
|
+ .Where(x => x.Source < ESource.MLSQ || x.Source > ESource.WZSC)
|
|
|
|
+ .Where(x => x.Status != EOrderStatus.BackToProvince && x.Status < EOrderStatus.Filed)
|
|
|
|
+ .OrderBy(d => d.Status)
|
|
|
|
+ .OrderByIF(dto.IsHandled == true, d => d.StartTime, OrderByType.Desc)
|
|
|
|
+ .OrderByIF(dto.IsHandled == false, d => d.CreationTime, OrderByType.Desc)
|
|
|
|
+ .ToPagedListAsync(dto, HttpContext.RequestAborted);
|
|
|
|
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
return new PagedDto<OrderDto>(total, _mapper.Map<IReadOnlyList<OrderDto>>(items));
|
|
}
|
|
}
|
|
@@ -4775,7 +4799,7 @@ public class OrderController : BaseController
|
|
try
|
|
try
|
|
{
|
|
{
|
|
|
|
|
|
- if(item.Source!= "麻辣社区"|| item.Source!= "人民网" || item.Source!= "省长信箱" || item.Source!= "问政四川")
|
|
|
|
|
|
+ if (item.Source != "麻辣社区" || item.Source != "人民网" || item.Source != "省长信箱" || item.Source != "问政四川")
|
|
//if (item.Source < ESource.MLSQ || item.Source > ESource.WZSC)
|
|
//if (item.Source < ESource.MLSQ || item.Source > ESource.WZSC)
|
|
{
|
|
{
|
|
errorCount++;
|
|
errorCount++;
|
|
@@ -4801,78 +4825,78 @@ public class OrderController : BaseController
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
var order = await _orderRepository.GetAsync(x => x.ExternalId == item.ExternalId && x.Source == (ESource)SourceCode, HttpContext.RequestAborted);
|
|
var order = await _orderRepository.GetAsync(x => x.ExternalId == item.ExternalId && x.Source == (ESource)SourceCode, HttpContext.RequestAborted);
|
|
-
|
|
|
|
- order = _mapper.Map<Orders.Order>(item);
|
|
|
|
- #region 处理数据开始
|
|
|
|
- order.Source = (ESource)SourceCode; //来源
|
|
|
|
-
|
|
|
|
- //处理热点
|
|
|
|
- //处理一级热点
|
|
|
|
- string hotspotId = "";
|
|
|
|
- string hotspotName = "";
|
|
|
|
- string hotspotFullName = "";
|
|
|
|
- var hotspotOne = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameOne, HttpContext.RequestAborted);
|
|
|
|
- if (hotspotOne!=null)
|
|
|
|
|
|
+
|
|
|
|
+ order = _mapper.Map<Orders.Order>(item);
|
|
|
|
+ #region 处理数据开始
|
|
|
|
+ order.Source = (ESource)SourceCode; //来源
|
|
|
|
+
|
|
|
|
+ //处理热点
|
|
|
|
+ //处理一级热点
|
|
|
|
+ string hotspotId = "";
|
|
|
|
+ string hotspotName = "";
|
|
|
|
+ string hotspotFullName = "";
|
|
|
|
+ var hotspotOne = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameOne, HttpContext.RequestAborted);
|
|
|
|
+ if (hotspotOne != null)
|
|
|
|
+ {
|
|
|
|
+ hotspotId = hotspotOne.Id;
|
|
|
|
+ hotspotName = hotspotOne.HotSpotName;
|
|
|
|
+ hotspotFullName = hotspotOne.HotSpotFullName;
|
|
|
|
+ var hotspotTwo = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameTwo && x.ParentId == hotspotId, HttpContext.RequestAborted);
|
|
|
|
+ if (hotspotTwo != null)
|
|
{
|
|
{
|
|
- hotspotId = hotspotOne.Id;
|
|
|
|
- hotspotName = hotspotOne.HotSpotName;
|
|
|
|
- hotspotFullName = hotspotOne.HotSpotFullName;
|
|
|
|
- var hotspotTwo = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameTwo && x.ParentId == hotspotId,HttpContext.RequestAborted);
|
|
|
|
- if (hotspotTwo!=null)
|
|
|
|
|
|
+ hotspotId = hotspotTwo.Id;
|
|
|
|
+ hotspotName = hotspotTwo.HotSpotName;
|
|
|
|
+ hotspotFullName = hotspotTwo.HotSpotFullName;
|
|
|
|
+ var hotspotThree = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameThree && x.ParentId == hotspotId, HttpContext.RequestAborted);
|
|
|
|
+ if (hotspotThree != null)
|
|
{
|
|
{
|
|
- hotspotId = hotspotTwo.Id;
|
|
|
|
- hotspotName = hotspotTwo.HotSpotName;
|
|
|
|
- hotspotFullName = hotspotTwo.HotSpotFullName;
|
|
|
|
- var hotspotThree = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameThree && x.ParentId == hotspotId, HttpContext.RequestAborted);
|
|
|
|
- if (hotspotThree!=null)
|
|
|
|
|
|
+ hotspotId = hotspotThree.Id;
|
|
|
|
+ hotspotName = hotspotThree.HotSpotName;
|
|
|
|
+ hotspotFullName = hotspotThree.HotSpotFullName;
|
|
|
|
+ var hotspotFour = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameFour && x.ParentId == hotspotId, HttpContext.RequestAborted);
|
|
|
|
+ if (hotspotFour != null)
|
|
{
|
|
{
|
|
- hotspotId = hotspotThree.Id;
|
|
|
|
- hotspotName = hotspotThree.HotSpotName;
|
|
|
|
- hotspotFullName = hotspotThree.HotSpotFullName;
|
|
|
|
- var hotspotFour = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameFour && x.ParentId == hotspotId, HttpContext.RequestAborted);
|
|
|
|
- if (hotspotFour!=null)
|
|
|
|
|
|
+ hotspotId = hotspotFour.Id;
|
|
|
|
+ hotspotName = hotspotFour.HotSpotName;
|
|
|
|
+ hotspotFullName = hotspotFour.HotSpotFullName;
|
|
|
|
+ var hotspotFive = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameFive && x.ParentId == hotspotId, HttpContext.RequestAborted);
|
|
|
|
+ if (hotspotFive != null)
|
|
{
|
|
{
|
|
- hotspotId = hotspotFour.Id;
|
|
|
|
- hotspotName = hotspotFour.HotSpotName;
|
|
|
|
- hotspotFullName = hotspotFour.HotSpotFullName;
|
|
|
|
- var hotspotFive = await _hotspotTypeRepository.Queryable().FirstAsync(x => x.HotSpotName == item.HotspotNameFive && x.ParentId == hotspotId, HttpContext.RequestAborted);
|
|
|
|
- if (hotspotFive!=null)
|
|
|
|
- {
|
|
|
|
- hotspotId = hotspotFive.Id;
|
|
|
|
- hotspotName = hotspotFive.HotSpotName;
|
|
|
|
- hotspotFullName = hotspotFive.HotSpotFullName;
|
|
|
|
- }
|
|
|
|
|
|
+ hotspotId = hotspotFive.Id;
|
|
|
|
+ hotspotName = hotspotFive.HotSpotName;
|
|
|
|
+ hotspotFullName = hotspotFive.HotSpotFullName;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- order.HotspotId = hotspotId;
|
|
|
|
- order.HotspotName = hotspotName;
|
|
|
|
- order.HotspotSpliceName = hotspotFullName;
|
|
|
|
|
|
+ }
|
|
|
|
+ order.HotspotId = hotspotId;
|
|
|
|
+ order.HotspotName = hotspotName;
|
|
|
|
+ order.HotspotSpliceName = hotspotFullName;
|
|
|
|
|
|
- //处理部门
|
|
|
|
- var orgOne = await _organizeRepository.Queryable().FirstAsync(x => x.Name == item.OrgLevelOneName, HttpContext.RequestAborted);
|
|
|
|
- if (orgOne!=null)
|
|
|
|
- {
|
|
|
|
- order.OrgLevelOneCode = orgOne.Id;
|
|
|
|
- order.OrgLevelOneName = orgOne.Name;
|
|
|
|
- var orgTwo = await _organizeRepository.Queryable().FirstAsync(x => x.Name == item.OrgLevelTwoName && x.ParentId == order.OrgLevelOneCode, HttpContext.RequestAborted);
|
|
|
|
- if (orgTwo!=null)
|
|
|
|
- {
|
|
|
|
- order.OrgLevelTwoCode = orgTwo.Id;
|
|
|
|
- order.OrgLevelTwoName = orgTwo.Name;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //承办部门
|
|
|
|
- var ActualHandleOrg = await _organizeRepository.Queryable().FirstAsync(x => x.Name == item.ActualHandleOrgName, HttpContext.RequestAborted);
|
|
|
|
- if (ActualHandleOrg!=null)
|
|
|
|
|
|
+ //处理部门
|
|
|
|
+ var orgOne = await _organizeRepository.Queryable().FirstAsync(x => x.Name == item.OrgLevelOneName, HttpContext.RequestAborted);
|
|
|
|
+ if (orgOne != null)
|
|
|
|
+ {
|
|
|
|
+ order.OrgLevelOneCode = orgOne.Id;
|
|
|
|
+ order.OrgLevelOneName = orgOne.Name;
|
|
|
|
+ var orgTwo = await _organizeRepository.Queryable().FirstAsync(x => x.Name == item.OrgLevelTwoName && x.ParentId == order.OrgLevelOneCode, HttpContext.RequestAborted);
|
|
|
|
+ if (orgTwo != null)
|
|
{
|
|
{
|
|
- order.ActualHandleOrgCode = ActualHandleOrg.Id;
|
|
|
|
|
|
+ order.OrgLevelTwoCode = orgTwo.Id;
|
|
|
|
+ order.OrgLevelTwoName = orgTwo.Name;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ //承办部门
|
|
|
|
+ var ActualHandleOrg = await _organizeRepository.Queryable().FirstAsync(x => x.Name == item.ActualHandleOrgName, HttpContext.RequestAborted);
|
|
|
|
+ if (ActualHandleOrg != null)
|
|
|
|
+ {
|
|
|
|
+ order.ActualHandleOrgCode = ActualHandleOrg.Id;
|
|
|
|
+ }
|
|
|
|
|
|
- //处理地址
|
|
|
|
- order.Address = $"{order.Province}{order.City}{order.County}{order.Town}";
|
|
|
|
- order.FullAddress = $"{order.Address}{order.Street}";
|
|
|
|
|
|
+ //处理地址
|
|
|
|
+ order.Address = $"{order.Province}{order.City}{order.County}{order.Town}";
|
|
|
|
+ order.FullAddress = $"{order.Address}{order.Street}";
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
if (order is null)
|
|
if (order is null)
|