|
|
@ -160,7 +160,6 @@ public class SwapOrderController : ControllerBase
|
|
|
|
swapOrderResp.Rows[i].StepList
|
|
|
|
swapOrderResp.Rows[i].StepList
|
|
|
|
.AddRange(swapOrderStepResps);
|
|
|
|
.AddRange(swapOrderStepResps);
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
swapOrderResp.Rows[i].ManualStep = String.Join(",",
|
|
|
|
swapOrderResp.Rows[i].ManualStep = String.Join(",",
|
|
|
|
swapOrderStepResps.Where(i => i.StepType == (int)SwapConstant.StepType.MANUAL).Select(i => i.StepDesc)
|
|
|
|
swapOrderStepResps.Where(i => i.StepType == (int)SwapConstant.StepType.MANUAL).Select(i => i.StepDesc)
|
|
|
|
.ToList());
|
|
|
|
.ToList());
|
|
|
@ -394,6 +393,7 @@ public class SwapOrderController : ControllerBase
|
|
|
|
cfg.CreateMap<SwapOrderDto2, SwapOrderResp>().ReverseMap();
|
|
|
|
cfg.CreateMap<SwapOrderDto2, SwapOrderResp>().ReverseMap();
|
|
|
|
cfg.CreateMap<SwapLoseOrderDto, SwapOrderResp>().ReverseMap();
|
|
|
|
cfg.CreateMap<SwapLoseOrderDto, SwapOrderResp>().ReverseMap();
|
|
|
|
cfg.CreateMap<SwapLoseOrderDto2, SwapOrderResp>().ReverseMap();
|
|
|
|
cfg.CreateMap<SwapLoseOrderDto2, SwapOrderResp>().ReverseMap();
|
|
|
|
|
|
|
|
cfg.CreateMap<SwapOrderStep, SwapOrderStepResp>().ReverseMap();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
IMapper mapper = config.CreateMapper();
|
|
|
|
IMapper mapper = config.CreateMapper();
|
|
|
@ -428,18 +428,37 @@ public class SwapOrderController : ControllerBase
|
|
|
|
.In(vehicle => vehicle.VehicleNo, vehicleNoList)
|
|
|
|
.In(vehicle => vehicle.VehicleNo, vehicleNoList)
|
|
|
|
.ToListAsync();
|
|
|
|
.ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var stepList = swapOrderStepService.QueryListByClause(u => orderSns.Contains(u.SwapOrderSn));
|
|
|
|
|
|
|
|
stepList = stepList.OrderBy(s => s.Sort).ToList();
|
|
|
|
|
|
|
|
List<SwapOrderStepResp> swapOrderStep = mapper.Map<List<SwapOrderStepResp>>(stepList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//将步序数据添加到换电订单数据中
|
|
|
|
// 给换电订单赋值车的公司和部门
|
|
|
|
// 给换电订单赋值车的公司和部门
|
|
|
|
foreach (var swapOrder in swapOrderResp)
|
|
|
|
for (int i = 0; i < swapOrderResp.Count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var matchingVehicle = vehicleList.FirstOrDefault(v => v.VehicleNo == swapOrder.VehicleNo);
|
|
|
|
// 初始化 StepList
|
|
|
|
|
|
|
|
swapOrderResp[i].StepList = new List<SwapOrderStepResp>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取与当前订单匹配的步骤信息
|
|
|
|
|
|
|
|
var swapOrderStepResps = swapOrderStep.Where(step => step.SwapOrderSn == swapOrderResp[i].Sn).ToList();
|
|
|
|
|
|
|
|
swapOrderResp[i].StepList.AddRange(swapOrderStepResps);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置 ManualStep 字段
|
|
|
|
|
|
|
|
swapOrderResp[i].ManualStep = string.Join(",",
|
|
|
|
|
|
|
|
swapOrderStepResps.Where(step => step.StepType == (int)SwapConstant.StepType.MANUAL)
|
|
|
|
|
|
|
|
.Select(step => step.StepDesc)
|
|
|
|
|
|
|
|
.ToList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查找匹配的车辆信息并赋值公司和部门字段
|
|
|
|
|
|
|
|
var matchingVehicle = vehicleList.FirstOrDefault(v => v.VehicleNo == swapOrderResp[i].VehicleNo);
|
|
|
|
if (matchingVehicle != null)
|
|
|
|
if (matchingVehicle != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
swapOrder.Company = matchingVehicle.Company;
|
|
|
|
swapOrderResp[i].Company = matchingVehicle.Company;
|
|
|
|
swapOrder.Departments = matchingVehicle.Departments;
|
|
|
|
swapOrderResp[i].Departments = matchingVehicle.Departments;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (req.SwapResult == 0 || req.SwapResult == 1)
|
|
|
|
if (req.SwapResult == 0 || req.SwapResult == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<SwapOrderDto> list = mapper.Map<List<SwapOrderDto>>(swapOrderResp);
|
|
|
|
List<SwapOrderDto> list = mapper.Map<List<SwapOrderDto>>(swapOrderResp);
|
|
|
|