jianghaiqing 4 months ago
commit b7caa53be4

@ -31,6 +31,13 @@ public interface IClientInfoService
/// <returns></returns>
DataResult<ClientInfoRes> GetClientInfo(string id);
/// <summary>
/// 批量删除发票抬头
/// </summary>
/// <param name="idModel"></param>
/// <returns></returns>
Task<DataResult> DeleteInvoiceHeaderAsync(IdModel idModel);
/// <summary>
/// 批量删除
/// </summary>

@ -105,6 +105,17 @@ public class ClientInfoService : ServiceBase, IClientInfoService
return DataResult<ClientInfoRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
/// 批量删除发票抬头
/// </summary>
/// <param name="idModel"></param>
/// <returns></returns>
public async Task<DataResult> DeleteInvoiceHeaderAsync(IdModel idModel)
{
int rows = await TenantDb.Deleteable<InvoiceHeader>().Where(x => idModel.Ids.Contains(x.Id)).ExecuteCommandAsync();
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
/// <summary>
/// 批量删除
/// </summary>

@ -10,6 +10,29 @@ namespace DS.WMS.Core.Op.Dtos
/// 运踪接口返回结果
/// </summary>
public class BillTraceRes
{
/// <summary>
/// 是否成功
/// </summary>
public bool Success { get; set; }
/// <summary>
/// 提示消息
/// </summary>
public string Message { get; set; }
/// <summary>
/// 结果编码。0成功
/// </summary>
public string Code { get; set; }
/// <summary>
/// 返回数据
/// </summary>
public List<BillTraceDetail> Data { get; set; }
}
/// <summary>
/// 运踪接口返回结果
/// </summary>
public class BillTraceUnsubscribeRes
{
/// <summary>
/// 是否成功
@ -29,4 +52,22 @@ namespace DS.WMS.Core.Op.Dtos
public string Data { get; set; }
}
public class BillTraceDetail {
public bool IsSuccess { get; set; }
/// <summary>
/// 提示消息
/// </summary>
public string Message { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 分享链接
/// </summary>
public string ShareLink { get; set; }
}
}

@ -0,0 +1,25 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.EDI
{
/// <summary>
/// edi映射信息
/// </summary>
public class EDIMapperInfo
{
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
}
}

@ -1,6 +1,7 @@
using DS.Module.Core;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.EDI;
using SqlSugar;
using System;
using System.Collections.Generic;
@ -84,5 +85,22 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="isEDI"></param>
/// <returns></returns>
public string GetClientCode(long Id, SqlSugarScopeProvider tenantDb, bool isEDI = true);
/// <summary>
/// 获取场站映射名称
/// </summary>
/// <param name="Id"></param>
/// <param name="tenantDb"></param>
/// <returns></returns>
public EDIMapperInfo GetYardMapper(long Id, SqlSugarScopeProvider tenantDb);
/// <summary>
/// 获取船公司映射名称
/// </summary>
/// <param name="Id"></param>
/// <param name="tenantDb"></param>
/// <returns></returns>
public EDIMapperInfo GetCarrierMapper(long Id, SqlSugarScopeProvider tenantDb);
}
}

@ -329,6 +329,8 @@ namespace DS.WMS.Core.Op.Method
return client.CodeName;
}
}
/// <summary>
/// 获取场站代码
/// </summary>
@ -346,6 +348,56 @@ namespace DS.WMS.Core.Op.Method
}
return yard.EDICode.IsNull() ? yard.CodeName : yard.EDICode;
}
/// <summary>
/// 获取场站映射名称
/// </summary>
/// <param name="Id"></param>
/// <param name="tenantDb"></param>
/// <returns></returns>
public EDIMapperInfo GetYardMapper(long Id, SqlSugarScopeProvider tenantDb)
{
var yard = tenantDb.Queryable<InfoClient>().First(v => v.Id == Id && v.Status == StatusEnum.Enable.ToEnumInt());
if (yard.IsNull())
{
throw new Exception("请检查场站信息");
}
var code = yard.EDICode.IsNull() ? yard.CodeName : yard.EDICode;
var map= tenantDb.Queryable<MappingYard>().Where(v => v.Code == code).Select<EDIMapperInfo>().First();
if (map.IsNull())
{
throw new Exception("请维护场站映射信息");
}
return map;
}
/// <summary>
/// 获取船公司映射名称
/// </summary>
/// <param name="Id"></param>
/// <param name="tenantDb"></param>
/// <returns></returns>
public EDIMapperInfo GetCarrierMapper(long Id, SqlSugarScopeProvider tenantDb)
{
var yard = tenantDb.Queryable<InfoClient>().First(v => v.Id == Id && v.Status == StatusEnum.Enable.ToEnumInt());
if (yard.IsNull())
{
throw new Exception("请检查船公司信息");
}
var code = yard.EDICode.IsNull() ? yard.CodeName : yard.EDICode;
var map = tenantDb.Queryable<MappingCarrier>().Where(v => v.Code == code).Select<EDIMapperInfo>().First();
if (map.IsNull())
{
throw new Exception("请维护船公司映射信息");
}
return map;
}
/// <summary>
/// 获取船公司代码
/// </summary>

@ -27,12 +27,23 @@ namespace DS.WMS.Core.Op.Method
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
}
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
//var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
//var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
//var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
var reqUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "request_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
var resUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "response_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
var account = seaComService.GetCodeThirdParty("BillTraceSubcribe", user.UserId, tenantDb);
if (account.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("未配置运踪订阅第三方账号信息!"));
}
if (account.AppSecret.IsNull()|| account.AppKey.IsNull()|| account.RegistContractName.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("请检查运踪订阅第三方账号关键参数!"));
}
BillTraceMain billdto = new BillTraceMain();
List<BillTraceReq> billTraceList = new List<BillTraceReq>();
foreach (var item in req)
@ -70,13 +81,27 @@ namespace DS.WMS.Core.Op.Method
{
return await Task.FromResult(DataResult<string>.Failed($"场站代号配置未找到:{yardCode}"));
}
//var carrierMap = tenantDb.Queryable<MappingYard>().Where(x => x.Code == yardCode && x.Module == "BillTrace").First();
//if (yardMap.IsNull())
//{
// return await Task.FromResult(DataResult<string>.Failed($"船公司代号配置未找到:{yardCode}"));
//}
var carrierName =string.Empty;
if (string.IsNullOrEmpty(carrierCode))
{
carrierName = "";
}
else
{
carrierName = seaComService.GetCarrierMapper(item.CarrierId, tenantDb).MapName;
}
billTraceList.Add(new BillTraceReq
{
BusinessId = item.BusinessId,
MBLNO = item.MBLNO,
YARD = item.Yard == "" ? null : item.Yard,
YARD = yardMap.MapName,
YardCode = yardMap.MapCode == "" ? null : yardMap.MapCode,
CARRIER = item.Carrier == "" ? null : item.Carrier,
CARRIER = carrierName,
CARRIERID = carrierCode == "" ? null : carrierCode,
isBook = item.isBook
});
@ -110,10 +135,10 @@ namespace DS.WMS.Core.Op.Method
}
billdto.Children = billTraceList;
billdto.Key = userKey;
billdto.PWD = userPwd;
billdto.Key = account.AppKey;
billdto.PWD = account.AppSecret;
billdto.url = resUrl;
billdto.Gid = userId;
billdto.Gid = account.RegistContractName;
billdto.PushBackKey = user.TenantId;//根据回传的租户Id回调
var json = billdto.ToJsonString();
@ -124,7 +149,7 @@ namespace DS.WMS.Core.Op.Method
reqUrl += "/";
}
reqUrl += "BillTrace/UpdateMblno";
reqUrl += "BillTrace/SubcribeOrUpdateBilltrace";
var result = RequestHelper.Post(postData.ToJsonString(), reqUrl);
@ -136,7 +161,7 @@ namespace DS.WMS.Core.Op.Method
}
else
{
return await Task.FromResult(DataResult<string>.Success(res.Data));
return await Task.FromResult(DataResult<string>.Success(res.Data.ToJsonString()));
}
}
@ -152,18 +177,28 @@ namespace DS.WMS.Core.Op.Method
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
}
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
//var userKey = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userKey" && x.TenantId == 1288018625843826688).First().Value;
//var userPwd = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userPwd" && x.TenantId == 1288018625843826688).First().Value;
//var userId = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "seae_billtraceurl_userId" && x.TenantId == 1288018625843826688).First().Value;
var reqUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "request_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
var resUrl = db.Queryable<SysConfig>().Filter(null, true).Where(x => x.Code == "response_seae_billtraceurl" && x.TenantId == 1288018625843826688).First().Value;
var account = seaComService.GetCodeThirdParty("BillTraceSubcribe", user.UserId, tenantDb);
if (account.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("未配置运踪订阅第三方账号信息!"));
}
if (account.AppSecret.IsNull() || account.AppKey.IsNull() || account.RegistContractName.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("请检查运踪订阅第三方账号关键参数!"));
}
BillTraceUnsubscribeDto reqDto = new BillTraceUnsubscribeDto()
{
Children = new List<BillTraceUnsubscribeList>(),
Key = userKey,
PWD = userPwd,
Gid = userId,
Key = account.AppKey,
PWD = account.AppSecret,
Gid = account.RegistContractName,
PushBackKey= user.TenantId,
};
foreach (var item in req)
@ -191,7 +226,7 @@ namespace DS.WMS.Core.Op.Method
var postData = new { msg = json };
var result = RequestHelper.Post(postData.ToJsonString(), reqUrl);
var res = JsonConvert.DeserializeObject<BillTraceRes>(result);
var res = JsonConvert.DeserializeObject<BillTraceUnsubscribeRes>(result);
if (!res.Success)
{

@ -120,16 +120,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
if (!result.Succeeded)
return result;
if (task.TaskStatus != TaskStatusEnum.Create)
{
await TenantDb.Updateable<BusinessTask>().SetColumns(x => x.TaskStatus == TaskStatusEnum.Create)
var instance = result.Data as FlowInstance;
var markers = FlowInstanceService.GetNextMarkers(instance);
await TenantDb.Updateable<BusinessTask>()
.SetColumns(x => x.TaskStatus == TaskStatusEnum.Create)
.SetColumns(x => x.RecvUsers == string.Join(',', markers))
.Where(x => x.BusinessId == request.BusinessId &&
x.BusinessType == request.BusinessType && x.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
.ExecuteCommandAsync();
}
return result;
}

@ -64,7 +64,21 @@ public class ClientInfoController : ApiController
}
/// <summary>
/// 根据ID删除
/// 根据ID删除发票明细
/// </summary>
/// <param name="idModel"></param>
/// <returns></returns>
[HttpPost, Route("DeleteInvoiceHeader")]
public async Task<DataResult> DeleteInvoiceHeaderAsync(IdModel idModel)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _invokeService.DeleteInvoiceHeaderAsync(idModel);
}
/// <summary>
/// 根据ID删除往来单位
/// </summary>
/// <param name="model"></param>
/// <returns></returns>

Loading…
Cancel
Save