|
|
|
@ -63,7 +63,7 @@ namespace DS.WMS.Core.TaskInteraction.Method
|
|
|
|
|
var check = await GetTasks(request.BusinessId, request.BusinessType, false, request.TaskType);
|
|
|
|
|
|
|
|
|
|
await TenantDb.Ado.BeginTranAsync();
|
|
|
|
|
if (check.Count>0)
|
|
|
|
|
if (check.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
//货物状态
|
|
|
|
|
var goodsStatus = TenantDb.Queryable<BookingGoodsStatus>().First(x => x.StatusCode == "TIJIAO" && x.BusinessId == request.BusinessId);
|
|
|
|
@ -113,7 +113,8 @@ namespace DS.WMS.Core.TaskInteraction.Method
|
|
|
|
|
{
|
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
|
|
|
|
|
|
if (check.Count > 0) {
|
|
|
|
|
if (check.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
//更新大简云货物状态
|
|
|
|
|
var pushModel = new EmbedServiceProjectStatusDto
|
|
|
|
|
{
|
|
|
|
@ -128,7 +129,7 @@ namespace DS.WMS.Core.TaskInteraction.Method
|
|
|
|
|
|
|
|
|
|
await djyStatusService.Value.SaveServiceStatus(pushModel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return res1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -427,65 +428,29 @@ namespace DS.WMS.Core.TaskInteraction.Method
|
|
|
|
|
|
|
|
|
|
internal async Task<List<TaskCreationRequest>> GetSubRequestAsync(long id, BusinessType businessType, params long[]? recvUsers)
|
|
|
|
|
{
|
|
|
|
|
var svcList = await GetServicesAsync(id);
|
|
|
|
|
var list = new List<TaskCreationRequest>(svcList.Length);
|
|
|
|
|
for (int i = 0; i < svcList.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
var dto = new TaskCreationRequest { BusinessId = id, BusinessType = businessType, RecvUserIdList = recvUsers };
|
|
|
|
|
var svcName = svcList[i];
|
|
|
|
|
|
|
|
|
|
if (svcName == "报关")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_BAOGUAN.ToString();
|
|
|
|
|
else if (svcName == "订舱")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_CANGDAN.ToString();
|
|
|
|
|
else if (svcName.Equals("VGM", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_VGM.ToString();
|
|
|
|
|
else if (svcName.Equals("AFR", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_AFR.ToString();
|
|
|
|
|
else if (svcName.Equals("AMS", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_AMS.ToString();
|
|
|
|
|
else if (svcName.Equals("ISF", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_ISF.ToString();
|
|
|
|
|
else if (svcName == "熏蒸")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_XUNZHENG.ToString();
|
|
|
|
|
else if (svcName == "商检")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_SHANGJIAN.ToString();
|
|
|
|
|
else if (svcName.Equals("COA证书", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_COA.ToString();
|
|
|
|
|
else if (svcName == "产地证")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_CHANDIZHENG.ToString();
|
|
|
|
|
else if (svcName == "拖车")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_TUOCHE.ToString();
|
|
|
|
|
else if (svcName == "保险")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_INSURANCE.ToString();
|
|
|
|
|
else if (svcName == "出号")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_CHUHAO.ToString();
|
|
|
|
|
else if (svcName == "内点入货")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_NDRH.ToString();
|
|
|
|
|
else if (svcName == "快递")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_DELIVERY.ToString();
|
|
|
|
|
else if (svcName == "箱使")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_XIANGSHI.ToString();
|
|
|
|
|
|
|
|
|
|
list.Add(dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal async Task<string[]> GetServicesAsync(long id)
|
|
|
|
|
{
|
|
|
|
|
var result = await djyService.Value.GetServiceProjectList(
|
|
|
|
|
new EmbedQueryServiceProjectWithStatus { BusinessId = id.ToString() });
|
|
|
|
|
|
|
|
|
|
if (!result.success)
|
|
|
|
|
var svcItem = await TenantDb.Queryable<SeaExport>().Where(x => x.Id == id)
|
|
|
|
|
.Select(x => x.ServiceItem).FirstAsync();
|
|
|
|
|
if (string.IsNullOrEmpty(svcItem))
|
|
|
|
|
return [];
|
|
|
|
|
|
|
|
|
|
if (((JObject)result.data)["ext"] is not JArray extArray || extArray.Count == 0)
|
|
|
|
|
return [];
|
|
|
|
|
var svcItems = svcItem.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
|
List<TaskCreationRequest> requests = new List<TaskCreationRequest>(svcItems.Length);
|
|
|
|
|
for (int i = 0; i < svcItems.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (Enum.TryParse(svcItems[i], true, out TaskBaseTypeEnum taskType))
|
|
|
|
|
{
|
|
|
|
|
var req = new TaskCreationRequest
|
|
|
|
|
{
|
|
|
|
|
BusinessId = id,
|
|
|
|
|
BusinessType = businessType,
|
|
|
|
|
RecvUserIdList = recvUsers,
|
|
|
|
|
TaskTypeName = taskType.ToString()
|
|
|
|
|
};
|
|
|
|
|
requests.Add(req);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return extArray.Where(x => x["isYield"].Value<bool>()).Select(
|
|
|
|
|
x => x["projectName"]?.Value<string>() ?? string.Empty).ToArray();
|
|
|
|
|
return requests;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|