|
|
@ -204,24 +204,29 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail");
|
|
|
|
JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail");
|
|
|
|
JsonUtil.TrimFields(input);
|
|
|
|
JsonUtil.TrimFields(input);
|
|
|
|
//////
|
|
|
|
if (input.ctnInputs!=null) {
|
|
|
|
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
|
|
|
|
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
|
|
|
|
input.CNTRTOTAL = string.Join(" / ", groupList);
|
|
|
|
input.CNTRTOTAL = string.Join(" / ", groupList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
|
|
|
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
if (input.ctnInputs != null) {
|
|
|
|
{
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
var ctnentity = item.Adapt<BookingCtn>();
|
|
|
|
|
|
|
|
ctnentity.BILLID = entity.Id;
|
|
|
|
|
|
|
|
await _repCtn.InsertAsync(ctnentity);
|
|
|
|
|
|
|
|
foreach (var it in item.ctnDetailInputs)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var ctndetail = it.Adapt<BookingCtnDetail>();
|
|
|
|
var ctnentity = item.Adapt<BookingCtn>();
|
|
|
|
ctndetail.CTNID = ctnentity.Id;
|
|
|
|
ctnentity.BILLID = entity.Id;
|
|
|
|
await _ctndetailrep.InsertAsync(ctndetail);
|
|
|
|
await _repCtn.InsertAsync(ctnentity);
|
|
|
|
|
|
|
|
foreach (var it in item.ctnDetailInputs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var ctndetail = it.Adapt<BookingCtnDetail>();
|
|
|
|
|
|
|
|
ctndetail.CTNID = ctnentity.Id;
|
|
|
|
|
|
|
|
await _ctndetailrep.InsertAsync(ctndetail);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
////添加booking日志
|
|
|
|
////添加booking日志
|
|
|
|
await _bookinglog.InsertAsync(new BookingLog
|
|
|
|
await _bookinglog.InsertAsync(new BookingLog
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -261,26 +266,32 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail");
|
|
|
|
JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail");
|
|
|
|
JsonUtil.TrimFields(input);
|
|
|
|
JsonUtil.TrimFields(input);
|
|
|
|
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
|
|
|
|
if (input.ctnInputs!=null) {
|
|
|
|
input.CNTRTOTAL = string.Join(" / ", groupList);
|
|
|
|
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
|
|
|
|
|
|
|
|
input.CNTRTOTAL = string.Join(" / ", groupList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
var main = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
|
|
var main = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == input.Id).Select(x => x.Id).ToListAsync();
|
|
|
|
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == input.Id).Select(x => x.Id).ToListAsync();
|
|
|
|
await _repCtn.DeleteAsync(x => x.BILLID == input.Id);
|
|
|
|
await _repCtn.DeleteAsync(x => x.BILLID == input.Id);
|
|
|
|
await _ctndetailrep.DeleteAsync(x => ctnlist.Contains((long)x.CTNID));
|
|
|
|
await _ctndetailrep.DeleteAsync(x => ctnlist.Contains((long)x.CTNID));
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
if (input.ctnInputs != null) {
|
|
|
|
{
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
var ctnentity = item.Adapt<BookingCtn>();
|
|
|
|
|
|
|
|
ctnentity.BILLID = entity.Id;
|
|
|
|
|
|
|
|
await _repCtn.InsertAsync(ctnentity);
|
|
|
|
|
|
|
|
foreach (var it in item.ctnDetailInputs)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var ctndetail = it.Adapt<BookingCtnDetail>();
|
|
|
|
var ctnentity = item.Adapt<BookingCtn>();
|
|
|
|
ctndetail.CTNID = ctnentity.Id;
|
|
|
|
ctnentity.BILLID = entity.Id;
|
|
|
|
await _ctndetailrep.InsertAsync(ctndetail);
|
|
|
|
await _repCtn.InsertAsync(ctnentity);
|
|
|
|
|
|
|
|
foreach (var it in item.ctnDetailInputs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var ctndetail = it.Adapt<BookingCtnDetail>();
|
|
|
|
|
|
|
|
ctndetail.CTNID = ctnentity.Id;
|
|
|
|
|
|
|
|
await _ctndetailrep.InsertAsync(ctndetail);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool flag = true;
|
|
|
|
bool flag = true;
|
|
|
|
long bid = 0;
|
|
|
|
long bid = 0;
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(entity))
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(entity))
|
|
|
@ -321,7 +332,7 @@ namespace Myshipping.Application
|
|
|
|
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
|
|
|
|
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PId = bid,
|
|
|
|
PId = bid,
|
|
|
|
Field = name,
|
|
|
|
Field = descriptor.Description,
|
|
|
|
OldValue = _oldvalue,
|
|
|
|
OldValue = _oldvalue,
|
|
|
|
NewValue = _value,
|
|
|
|
NewValue = _value,
|
|
|
|
});
|
|
|
|
});
|
|
|
|