|
|
|
@ -1608,43 +1608,48 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
/////
|
|
|
|
|
///// </summary>
|
|
|
|
|
///// <param name="req"></param>
|
|
|
|
|
///// <returns></returns>
|
|
|
|
|
//public async Task<DataResult> CreateOrderAuditTaskAsync(IdModel req)
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
// var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
// var id = long.Parse(req.Id);
|
|
|
|
|
// var info = await tenantDb.Queryable<SeaExport>().Where(x => x.Id == id).FirstAsync();
|
|
|
|
|
// if (info.IsNull())
|
|
|
|
|
// return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist));
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提交订单
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="req"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult> CreateOrderAuditTaskAsync(IdModel req)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// if (string.IsNullOrEmpty(info.ServiceItem))
|
|
|
|
|
// return await Task.FromResult(DataResult.Failed("海运出口服务项目不能为空!", MultiLanguageConst.SeaExportServiceItemNotExist));
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var id = long.Parse(req.Id);
|
|
|
|
|
var info = await tenantDb.Queryable<SeaExport>().Where(x => x.Id == id).FirstAsync();
|
|
|
|
|
if (info.IsNull())
|
|
|
|
|
return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist));
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(info.ServiceItem))
|
|
|
|
|
return await Task.FromResult(DataResult.Failed("海运出口服务项目不能为空!", MultiLanguageConst.SeaExportServiceItemNotExist));
|
|
|
|
|
|
|
|
|
|
// var items = info.ServiceItem.Split(',');
|
|
|
|
|
var items = info.ServiceItem.Split(',');
|
|
|
|
|
//订舱 走审单流程
|
|
|
|
|
if (items.Contains("dingcang"))
|
|
|
|
|
{
|
|
|
|
|
var taskReq = new TaskCreationRequest()
|
|
|
|
|
{
|
|
|
|
|
BusinessId = id,
|
|
|
|
|
BusinessType = BusinessType.OceanShippingExport,
|
|
|
|
|
TaskTypeName = TaskBaseTypeEnum.WAIT_ORDER_AUDIT.ToString(),
|
|
|
|
|
};
|
|
|
|
|
var result = await _seaTaskService.CreateTaskAsync(taskReq, false);
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
return await Task.FromResult(DataResult.Failed(result.Message));
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
else //没有订舱服务不调用审单流程生成订舱相关任务,直接根据服务项目生成任务。
|
|
|
|
|
{
|
|
|
|
|
var taskReq = new BusinessTask()
|
|
|
|
|
{
|
|
|
|
|
BusinessId = id,
|
|
|
|
|
BusinessType = BusinessType.OceanShippingExport,
|
|
|
|
|
};
|
|
|
|
|
await _seaTaskService.CreateSubTaskAsync(taskReq);
|
|
|
|
|
|
|
|
|
|
// if (items.Contains("dingcang"))
|
|
|
|
|
// {
|
|
|
|
|
// var taskReq = new TaskCreationRequest()
|
|
|
|
|
// {
|
|
|
|
|
// BusinessId = id,
|
|
|
|
|
// BusinessType = BusinessType.OceanShippingExport,
|
|
|
|
|
// TaskTypeName = TaskBaseTypeEnum.WAIT_ORDER_AUDIT.ToString(),
|
|
|
|
|
// };
|
|
|
|
|
// var result = await _seaTaskService.CreateTaskAsync(taskReq, false);
|
|
|
|
|
// if (!result.Succeeded)
|
|
|
|
|
// return await Task.FromResult(DataResult.Failed(result.Message));
|
|
|
|
|
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!"));
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
return DataResult.Success;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|