|
|
|
@ -204,15 +204,17 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail");
|
|
|
|
|
JsonUtil.TrimFields(input);
|
|
|
|
|
if (input.ctnInputs!=null) {
|
|
|
|
|
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)}");
|
|
|
|
|
input.CNTRTOTAL = string.Join(" / ", groupList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
|
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
|
if (input.ctnInputs != null) {
|
|
|
|
|
if (input.ctnInputs != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
|
{
|
|
|
|
|
var ctnentity = item.Adapt<BookingCtn>();
|
|
|
|
@ -226,7 +228,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
////添加booking日志
|
|
|
|
|
await _bookinglog.InsertAsync(new BookingLog
|
|
|
|
|
{
|
|
|
|
@ -263,13 +265,12 @@ namespace Myshipping.Application
|
|
|
|
|
[HttpPost("/BookingOrder/update")]
|
|
|
|
|
public async Task Update(UpdateBookingOrderInput input)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail");
|
|
|
|
|
JsonUtil.TrimFields(input);
|
|
|
|
|
if (input.ctnInputs!=null) {
|
|
|
|
|
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)}");
|
|
|
|
|
input.CNTRTOTAL = string.Join(" / ", groupList);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
var main = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
@ -277,7 +278,8 @@ namespace Myshipping.Application
|
|
|
|
|
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 _ctndetailrep.DeleteAsync(x => ctnlist.Contains((long)x.CTNID));
|
|
|
|
|
if (input.ctnInputs != null) {
|
|
|
|
|
if (input.ctnInputs != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
|
{
|
|
|
|
|
var ctnentity = item.Adapt<BookingCtn>();
|
|
|
|
@ -291,7 +293,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool flag = true;
|
|
|
|
|
long bid = 0;
|
|
|
|
|
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(entity))
|
|
|
|
|