Merge remote-tracking branch 'origin/glms/feature/1.4.2' into glms/feature/1.4.2

This commit is contained in:
张名锐
2026-08-06 18:39:55 +08:00
3 changed files with 28 additions and 18 deletions
+22 -16
View File
@@ -94,28 +94,34 @@ namespace YLErp.Modules.SwapModule
{
var obj = DbContext.swap_event.Where(O => O.id == swap_Event.id).FirstOrDefault();
var trade = DbContext.trade.Where(O => O.id == swap_Event.SwapTradeId).FirstOrDefault();
if (trade == null)
{
throw new ServiceException("未找到交易,请刷新页面后再次尝试!");
}
var oldMaturityDate = trade.ExerciseDate.Value;
if (obj != null && !string.IsNullOrEmpty(obj.EventData))
{
oldMaturityDate = JsonConvert.DeserializeObject<ExtenstionData>(obj.EventData).OldMaturityDate;
}
if (swap_Event.extenstionData.NewMaturityDate <= oldMaturityDate)
{
throw new ServiceException("新到期日应晚于原到期日!");
}
if (obj != null && obj.ValueDate >= swap_Event.ValueDate)
{
throw new ServiceException("新展期日应晚于原展期日!");
}
if (swap_Event.extenstionData.NewMaturityDate< trade.StartDate)
{
throw new ServiceException("新到期日不应早于交易开始日期!");
}
swap_Event.extenstionData.OldMaturityDate = oldMaturityDate;
string data = JsonConvert.SerializeObject(swap_Event.extenstionData);
if (obj != null)
{
obj.Invalid = true;
}
swap_Event.EventReason = "交易展期";
if (swap_Event.extenstionData.OldMaturityDate == swap_Event.extenstionData.NewMaturityDate)
{
throw new ServiceException("新到期日不应和原到期日一致!");
}
if (obj!=null&&obj.ValueDate >= swap_Event.ValueDate)
{
throw new ServiceException("新展期日应晚于原展期日!");
}
if (trade == null)
{
throw new ServiceException("未找到交易,请刷新页面后再次尝试!");
}
if (swap_Event.extenstionData.NewMaturityDate< trade.StartDate)
{
throw new ServiceException("新到期日不应早于交易开始日期!");
}
trade.ExerciseDate = swap_Event.extenstionData.NewMaturityDate;
//修改互换观察日到期日
new SwapTradeService(this).UpdateObservationDay(trade.id, swap_Event.extenstionData.OldMaturityDate, trade.ExerciseDate.Value);
@@ -55,7 +55,7 @@
{{dateFormat(extenstion.extenstionData.OldMaturityDate)}}
</td>
<td>
<vue-datepicker :holiday="1" v-model="extenstion.extenstionData.NewMaturityDate" :disabled="!edit" style="width:100px;"/>
<vue-datepicker :holiday="1" :mindate="extenstion.extenstionData.OldMaturityDate" v-model="extenstion.extenstionData.NewMaturityDate" :disabled="!edit" style="width:100px;"/>
</td>
<td>{{extenstion.OptName}}</td>
<td>{{dateFormat(extenstion.OptTime,'YYYY-MM-DD HH:mm:ss')}}</td>
@@ -31,6 +31,10 @@
main.message("新到期日不能为空");
return;
}
if (this.extenstion.extenstionData.NewMaturityDate <= this.extenstion.extenstionData.OldMaturityDate) {
main.message("新到期日应晚于原到期日");
return;
}
main.post("/swaptrade2/SaveExtension", { swap_Event: thisObj.extenstion })
.done(function (res) {
thisObj.extenstion.id = res.obj.id;
@@ -80,4 +84,4 @@
components: {
'vue-datepicker': FastVue.vueDatePicker(),
}
});
});