|
@@ -1958,11 +1958,11 @@ public class OrderController : BaseController
|
|
.Includes(x => x.OrderVisit, y => y.Employee)
|
|
.Includes(x => x.OrderVisit, y => y.Employee)
|
|
//.LeftJoin<OrderScreen>((x, s) => x.Id == s.VisitDetailId && s.IsDeleted == false)
|
|
//.LeftJoin<OrderScreen>((x, s) => x.Id == s.VisitDetailId && s.IsDeleted == false)
|
|
.Includes(x => x.OrderScreens)
|
|
.Includes(x => x.OrderScreens)
|
|
- .Where(x => x.OrderScreens.Any(s => s.Status == EScreenStatus.SendBack && s.SendBackApply == true) || x.OrderScreens.Any() == false
|
|
|
|
|
|
+ .Where(x => x.OrderScreens.Any(s => s.Status == EScreenStatus.SendBack && s.ScreenType == dto.ScreenType && s.SendBackApply == true) || x.OrderScreens.Any() == false
|
|
//|| x.OrderScreens.Any(s => (s.Status != EScreenStatus.SendBack && s.SendBackApply != true)) == false
|
|
//|| x.OrderScreens.Any(s => (s.Status != EScreenStatus.SendBack && s.SendBackApply != true)) == false
|
|
)
|
|
)
|
|
- .WhereIF(dto.ScreenSendBack is 1, x => x.OrderScreens.Any(s => s.Status == EScreenStatus.SendBack && s.SendBackApply == true))
|
|
|
|
- .WhereIF(dto.ScreenSendBack is 2, x => x.OrderScreens.Any(s => (s.Status != EScreenStatus.SendBack && s.SendBackApply != true)) == false)
|
|
|
|
|
|
+ .WhereIF(dto.ScreenSendBack is 1, x => x.OrderScreens.Any(s => s.Status == EScreenStatus.SendBack && s.ScreenType == dto.ScreenType && s.SendBackApply == true))
|
|
|
|
+ .WhereIF(dto.ScreenSendBack is 2, x => x.OrderScreens.Any(s => (s.Status != EScreenStatus.SendBack && s.ScreenType == dto.ScreenType && s.SendBackApply != true)) == false)
|
|
.WhereIF(!string.IsNullOrEmpty(dto.No), x => x.OrderVisit.Order!.No!.Contains(dto.No!))
|
|
.WhereIF(!string.IsNullOrEmpty(dto.No), x => x.OrderVisit.Order!.No!.Contains(dto.No!))
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.OrderVisit.Order!.Title!.Contains(dto.Title!))
|
|
.WhereIF(!string.IsNullOrEmpty(dto.Title), x => x.OrderVisit.Order!.Title!.Contains(dto.Title!))
|
|
.WhereIF(dto.IsProvince.HasValue, x => x.OrderVisit.Order!.IsProvince == dto.IsProvince)
|
|
.WhereIF(dto.IsProvince.HasValue, x => x.OrderVisit.Order!.IsProvince == dto.IsProvince)
|
|
@@ -2016,12 +2016,7 @@ public class OrderController : BaseController
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "2"
|
|
SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "2"
|
|
))
|
|
))
|
|
- .WhereIF(dto.ScreenType == OrderScreenType.Seat, x => x.VisitTarget == EVisitTarget.Seat && (
|
|
|
|
- SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "1" ||
|
|
|
|
- SqlFunc.JsonField(x.OrgProcessingResults, "Key") == "2" ||
|
|
|
|
- SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "1" ||
|
|
|
|
- SqlFunc.JsonField(x.OrgHandledAttitude, "Key") == "2"
|
|
|
|
- ))
|
|
|
|
|
|
+ .WhereIF(dto.ScreenType == OrderScreenType.Seat, x => x.VisitTarget == EVisitTarget.Seat && (x.SeatEvaluate == ESeatEvaluate.VeryNoSatisfied || x.SeatEvaluate == ESeatEvaluate.NoSatisfied))
|
|
;
|
|
;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2097,18 +2092,18 @@ public class OrderController : BaseController
|
|
public async Task StartFlow([FromBody] StartWorkflowDto<OrderScreenDto> dto)
|
|
public async Task StartFlow([FromBody] StartWorkflowDto<OrderScreenDto> dto)
|
|
{
|
|
{
|
|
var screenAny = await _orderScreenRepository.AnyAsync(x =>
|
|
var screenAny = await _orderScreenRepository.AnyAsync(x =>
|
|
- x.VisitDetailId == dto.Data.VisitDetailId &&
|
|
|
|
|
|
+ x.VisitDetailId == dto.Data.VisitDetailId && x.ScreenType == dto.Data.ScreenType
|
|
(x.Status == EScreenStatus.Apply || x.Status == EScreenStatus.Approval));
|
|
(x.Status == EScreenStatus.Apply || x.Status == EScreenStatus.Approval));
|
|
if (screenAny)
|
|
if (screenAny)
|
|
throw UserFriendlyException.SameMessage("该工单已提起甄别申请,正在审批过程中,不能申请");
|
|
throw UserFriendlyException.SameMessage("该工单已提起甄别申请,正在审批过程中,不能申请");
|
|
|
|
|
|
- var isNoPass = await _orderScreenRepository.AnyAsync(x => x.Status == EScreenStatus.Refuse && x.VisitDetailId == dto.Data.VisitDetailId);
|
|
|
|
|
|
+ var isNoPass = await _orderScreenRepository.AnyAsync(x => x.Status == EScreenStatus.Refuse && x.ScreenType == dto.Data.ScreenType && x.VisitDetailId == dto.Data.VisitDetailId);
|
|
if (isNoPass)
|
|
if (isNoPass)
|
|
throw UserFriendlyException.SameMessage("该工单已被拒绝过甄别申请,不能再次申请");
|
|
throw UserFriendlyException.SameMessage("该工单已被拒绝过甄别申请,不能再次申请");
|
|
|
|
|
|
var setting = _systemSettingCacheManager.GetSetting(SettingConstants.ScreenApplyNum);
|
|
var setting = _systemSettingCacheManager.GetSetting(SettingConstants.ScreenApplyNum);
|
|
int count = await _orderScreenRepository.CountAsync(x =>
|
|
int count = await _orderScreenRepository.CountAsync(x =>
|
|
- x.OrderId == dto.Data.OrderId && x.Status == EScreenStatus.Refuse && x.VisitDetailId == dto.Data.VisitDetailId);
|
|
|
|
|
|
+ x.OrderId == dto.Data.OrderId && x.Status == EScreenStatus.Refuse && x.ScreenType == dto.Data.ScreenType && x.VisitDetailId == dto.Data.VisitDetailId);
|
|
if (count > int.Parse(setting?.SettingValue[0]) && int.Parse(setting?.SettingValue[0]) > -1)
|
|
if (count > int.Parse(setting?.SettingValue[0]) && int.Parse(setting?.SettingValue[0]) > -1)
|
|
throw UserFriendlyException.SameMessage("甄别申请已超过系统预定设置,不能申请");
|
|
throw UserFriendlyException.SameMessage("甄别申请已超过系统预定设置,不能申请");
|
|
|
|
|
|
@@ -2277,7 +2272,8 @@ public class OrderController : BaseController
|
|
var rsp = new
|
|
var rsp = new
|
|
{
|
|
{
|
|
ScreenStatus = EnumExts.GetDescriptions<EScreenStatus>(),
|
|
ScreenStatus = EnumExts.GetDescriptions<EScreenStatus>(),
|
|
- ScreenType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.ScreenType),
|
|
|
|
|
|
+ OrderScreenType = EnumExts.GetDescriptions<OrderScreenType>(),
|
|
|
|
+ ScreenType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.ScreenType),
|
|
CounterSignType = EnumExts.GetDescriptions<ECounterSignType>(),
|
|
CounterSignType = EnumExts.GetDescriptions<ECounterSignType>(),
|
|
AcceptType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.AcceptType),
|
|
AcceptType = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.AcceptType),
|
|
SourceChannel = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.SourceChannel),
|
|
SourceChannel = _sysDicDataCacheManager.GetSysDicDataCache(SysDicTypeConsts.SourceChannel),
|