BigFix 确认书客户信息 预付金额 计算基准 重置频率等字段逻辑修改 确认书用印上传 修改交易去掉交易确认书 默认按交易日期排序
This commit is contained in:
Binary file not shown.
@@ -103,6 +103,10 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator
|
||||
dic["交易对手方全称"] = client.ClientType != "产品" ? client.Name : $"{client.Manager}作为管理人代表{client.Name}";
|
||||
dic["主协议编号"] = client.MainProtocolCode;
|
||||
dic["定义文件编号"] = client.SettleFileNumber;
|
||||
dic["户名"] = bank?.ClientName;
|
||||
dic["银行账号"] = bank?.Card;
|
||||
dic["开户行"] = bank?.Bank;
|
||||
dic["大额行号"] = bank?.Payment;
|
||||
var count = 0;
|
||||
|
||||
var trades = Context.Trades;
|
||||
@@ -112,13 +116,23 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator
|
||||
{
|
||||
var swapPositions = Context.GetSwapPositions(trade.id, true);
|
||||
var swapPosition = swapPositions.Where(x => x.PositionType == 1 || x.PositionType == 2).FirstOrDefault();
|
||||
var interestMargin = swapPositions.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode)).FirstOrDefault();
|
||||
var interestMargins = swapPositions.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode));
|
||||
var initialMarginQuery = swapPositions.Where(x => x.InterestMode == 5);
|
||||
var additionMarginQuery = swapPositions.Where(x => x.InterestMode == 6);
|
||||
var underlyingCode = swapPosition?.UnderlyingCode;
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
var interestMargin = interestMargins.FirstOrDefault(o => o.interest_rest_days != null);
|
||||
if (interestMargin == null)
|
||||
{
|
||||
interestMargin = interestMargins.FirstOrDefault(o => string.IsNullOrWhiteSpace(o.FloatRateUnderlyingCode));
|
||||
}
|
||||
if (interestMargin == null)
|
||||
{
|
||||
interestMargin = interestMargins.FirstOrDefault();
|
||||
}
|
||||
|
||||
dic["成交日期"] = trade.TradeDate?.ToString("yyyy年M月d日");
|
||||
dic["开始日期"] = trade.StartDate?.ToString("yyyy年M月d日");
|
||||
dic["到期日期"] = trade.ExerciseDate?.ToString("yyyy年M月d日");
|
||||
@@ -146,6 +160,7 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator
|
||||
dic["固定利率"] = ((interestMargin?.InterestRateDefault) ?? 0) * 100;
|
||||
dic["参考利率"] = "";
|
||||
dic["重置频率"] = "";
|
||||
dic["计算基准"] = "";
|
||||
if (posiLong)
|
||||
{
|
||||
dic["多头约定利率"] = ((double)interestRate).ToString("0.####") + "%";
|
||||
@@ -162,28 +177,30 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator
|
||||
dic["利差%"] = ((interestMargin?.InterestRateDefault) ?? 0) * 100;
|
||||
dic["参考利率"] = interestMargin?.FloatRateUnderlyingCode;
|
||||
dic["固定利率"] = "";
|
||||
dic["重置频率"] = interestMargin?.interest_rest_days;
|
||||
dic["计算基准"] = interestMargin?.FloatRateUnderlyingCode +" + " + ((interestMargin?.InterestRateDefault) ?? 0) * 100 + "%";
|
||||
dic["重置频率"] = interestMargin?.interest_rest_days + "天";
|
||||
}
|
||||
dic["初始预付金支付日"] = initialMarginQuery.FirstOrDefault()?.HappenDate == null ? "" : interestMargin?.HappenDate?.ToString("【yyyy】年【M】月【d】日");
|
||||
dic["初始预付金支付日"] = trade.TradeDate?.ToString("yyyy年M月d日");
|
||||
|
||||
dic["管理人名称"] = client.Manager;
|
||||
var calculationBasis = interestMargin?.FloatRateUnderlyingCode;
|
||||
if (!string.IsNullOrEmpty(calculationBasis))
|
||||
{
|
||||
calculationBasis += interestRate > 0 ? " + " + ((double)interestRate).ToString("0.####") + "%" : ((double)interestRate).ToString("0.####") + "%";
|
||||
}
|
||||
else
|
||||
{
|
||||
calculationBasis = ((double)interestRate).ToString("0.####") + "%";
|
||||
}
|
||||
//var calculationBasis = interestMargin?.FloatRateUnderlyingCode;
|
||||
//if (!string.IsNullOrEmpty(calculationBasis))
|
||||
//{
|
||||
// calculationBasis += interestRate > 0 ? " + " + ((double)interestRate).ToString("0.####") + "%" : ((double)interestRate).ToString("0.####") + "%";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// calculationBasis = ((double)interestRate).ToString("0.####") + "%";
|
||||
//}
|
||||
|
||||
dic["计算基准"] = calculationBasis;
|
||||
//dic["计算基准"] = calculationBasis;
|
||||
dic["初始保障金率"] = ((clientMarginRate?.InitMarginRate ?? 0) * 100).ToString("0.####") + "%";
|
||||
dic["维持保障金率"] = ((clientMarginRate?.MaintenanceRate ?? 0) * 100).ToString("0.####") + "%";
|
||||
dic["交易费率"] = dic["基本费率"];
|
||||
var initialMarginSum = initialMarginQuery.Sum(x =>
|
||||
x.InterestDirection == 2 ? x.InterestPrincipalFix * -1 : x.InterestPrincipalFix);
|
||||
dic["期初预付金".Insert("期初预付金".Length, "2?")] = trade.StockEqvNotionalReal.ToString("0.##");
|
||||
//var initialMarginSum = initialMarginQuery.Sum(x =>
|
||||
// x.InterestDirection == 2 ? x.InterestPrincipalFix * -1 : x.InterestPrincipalFix);
|
||||
//dic["期初预付金".Insert("期初预付金".Length, "2?")] = initialMarginSum.ToString("0.##");
|
||||
|
||||
}
|
||||
|
||||
var row = new JObject();
|
||||
@@ -194,10 +211,6 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator
|
||||
row["开始日期"] = trade.StartDate?.ToString("【yyyy】年【M】月【d】日");
|
||||
row["到期日期"] = trade.ExerciseDate?.ToString("【yyyy】年【M】月【d】日");
|
||||
row["成交日期2"] = trade.TradeDate?.ToString("【yyyy】年【M】月【d】日");
|
||||
row["户名"] = bank?.ClientName;
|
||||
row["银行账号"] = bank?.Card;
|
||||
row["开户行"] = bank?.Bank;
|
||||
row["大额行号"] = bank?.Payment;
|
||||
|
||||
FormatToDict("期初标的交割全价", (double)((swapPosition?.PosiGrossPrice) ?? 0) * 100, row);
|
||||
FormatToDict("期初标的交割净价", (double)((swapPosition?.PosiNetNoFeePrice) ?? 0) * 100, row);
|
||||
@@ -237,6 +250,7 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator
|
||||
};
|
||||
table1.Add(row);
|
||||
dic["名义本金".Insert("名义本金".Length, "2?")] = StockEqvNotionalRealSum.ToString("0.##");
|
||||
dic["期初预付金".Insert("期初预付金".Length, "2?")] = (StockEqvNotionalRealSum * clientMarginRate?.InitMarginRate)?.ToString("0.##");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -610,7 +610,7 @@ namespace YLErp.Modules.SwapModule
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (changeConfirmStatus)
|
||||
if (changeConfirmStatus)
|
||||
{
|
||||
//删除交易确认书 TODO
|
||||
new TradeDocumentDataService(this).DeleteBooksAfterEditTrade(dbTrade);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using BaseOUDAL;
|
||||
using DocumentFormat.OpenXml.Office.Word;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Drawing.Printing;
|
||||
using YLErp.Configuration;
|
||||
@@ -562,7 +563,11 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
tcd.SealResult,
|
||||
ContractId = tcr != null ? tcr.id : 0,
|
||||
sp.PositionType,
|
||||
t.SentMailCount
|
||||
t.SentMailCount,
|
||||
tcd.StampDocumentFileName,
|
||||
tcr.OptDate,
|
||||
tcr.OptName,
|
||||
ContractDocId = tcd != null ? tcd.id : 0,
|
||||
};
|
||||
|
||||
if (req.StartDate != null && req.StartDate != DateTime.MinValue)
|
||||
@@ -616,9 +621,13 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
tradeCount = group.Select(x => x.id).Distinct().Count(),
|
||||
PositionType = group.FirstOrDefault().PositionType,
|
||||
SentMailCount = group.FirstOrDefault().SentMailCount ?? 0,
|
||||
StampDocumentFileName = group.FirstOrDefault().StampDocumentFileName,
|
||||
OptDate = group.FirstOrDefault().OptDate,
|
||||
OptName = group.FirstOrDefault().OptName,
|
||||
ContractDocId = group.FirstOrDefault().ContractDocId
|
||||
});
|
||||
}
|
||||
result = contractList.AsQueryable().ToSearchList(req);
|
||||
result = contractList.OrderBy(r => r.TradeDate).AsQueryable().ToSearchList(req);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -653,6 +662,7 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
|
||||
public List<int>? PositionTypes { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class clientContractR
|
||||
@@ -689,5 +699,13 @@ namespace YLErp.Modules.TradeModule.DealModule
|
||||
|
||||
public int SentMailCount { get; set; }
|
||||
|
||||
public string StampDocumentFileName { get; set; }
|
||||
|
||||
public DateTime? OptDate { get; set; }
|
||||
|
||||
public string OptName { get; set; }
|
||||
|
||||
public int ContractDocId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,15 @@ namespace YLErp.Modules.TradeModule
|
||||
return 0;
|
||||
}
|
||||
|
||||
doc.ToList().ForEach(O => O.IsValid = false);
|
||||
//同ContractCode的都要改变
|
||||
var docArr = doc.ToArray();
|
||||
var contractCode = docArr.FirstOrDefault().ContractCode;
|
||||
var types = docArr.Select(o => o.Type).ToArray();
|
||||
var tcrs = from tcr in DbContext.trade_contract_r
|
||||
where tcr.ContractCode == contractCode && types.Contains(tcr.Type) && tcr.IsValid
|
||||
select tcr;
|
||||
|
||||
tcrs.ToList().ForEach(O => O.IsValid = false);
|
||||
|
||||
return DbContext.SaveChanges();
|
||||
}
|
||||
|
||||
@@ -547,6 +547,15 @@ namespace YLErp.Web.Controllers
|
||||
/// </summary>
|
||||
public ActionResult confirmBookUpload(string Id, string SendMailId = "")
|
||||
{
|
||||
//如果都是数字,进行一次编码
|
||||
if (Id.All(char.IsDigit))
|
||||
{
|
||||
Id = DataProtectHelper.Encrypt(int.Parse(Id));
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(SendMailId) && SendMailId.All(char.IsDigit))
|
||||
{
|
||||
SendMailId = DataProtectHelper.Encrypt(int.Parse(SendMailId));
|
||||
}
|
||||
ViewBag.Id = Id;
|
||||
ViewBag.SendMailId = SendMailId;
|
||||
return View();
|
||||
|
||||
@@ -30,7 +30,6 @@ const colModelGrid = (new function () {
|
||||
{ label: '用印状态', name: 'StampStatus', width: 80, align: 'center' }, // 根据实际需要调整宽度和对齐
|
||||
{ label: '邮件发送结果', name: 'EmailResult', width: 100, align: 'center',
|
||||
formatter: function (cellValue, options, rowObject) {
|
||||
console.log(cellValue);
|
||||
var html = "";
|
||||
html += "<label>{0}</lable>".template( rowObject.EmailResult);
|
||||
return html;
|
||||
@@ -52,6 +51,85 @@ const colModelGrid = (new function () {
|
||||
end: function () { SearchClick(true) }
|
||||
});
|
||||
}
|
||||
this.ViewErrInfo = function (code) {
|
||||
main.post("/trade/GetSealErrMsg/", { code: code },
|
||||
{
|
||||
success: function (resp) {
|
||||
main.alert(resp.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (page.ConfirmBookStampStatus) {
|
||||
var colObj = {
|
||||
name: '',
|
||||
label: '用印扫描件',
|
||||
index: '',
|
||||
width: 250,
|
||||
align: 'left',
|
||||
formatter: function (cellValue, options, rowObject) {
|
||||
var templateHtml = "";
|
||||
if (page.IsAutoSealAndUploadFiles && !page.IsAutoSealAfterGeneratedBook) {
|
||||
templateHtml += "<input type=\"button\" class=\"wentiEdit\" {2} value=\"用印\" />";
|
||||
}
|
||||
var canGenerate = page.canGenerate == true ? "" : "disabled";
|
||||
templateHtml += "<input type=\"button\" class=\"wentiEdit\" {0} value=\"上传\" +" + canGenerate + "/>" +
|
||||
"<input type=\"button\" class=\"wentiEdit\" {1} value=\"下载\" />";
|
||||
var html = (templateHtml)
|
||||
.template(
|
||||
(rowObject.ContractDocUrl ? 'onclick="colModelGrid.upload(\'{0}\',\'{1}\')"'.template(rowObject.ContractDocId, rowObject.tradeIds[0]) : "disabled"),
|
||||
(rowObject.StampDocumentFileName ? 'onclick="main.downloadFiles(\'{0}\')"'.template(rowObject.StampDocumentFileName) : "disabled"));
|
||||
if (page.IsAutoSealAndUploadFiles && !page.IsAutoSealAfterGeneratedBook) {
|
||||
html = (templateHtml)
|
||||
.template(
|
||||
(rowObject.ContractDocUrl ? 'onclick="colModelGrid.upload(\'{0}\',\'{1}\')"'.template(rowObject.ContractDocId, rowObject.tradeIds[0]) : "disabled"),
|
||||
(rowObject.StampDocumentFileName ? 'onclick="main.downloadFiles(\'{0}\')"'.template(rowObject.StampDocumentFileName) : "disabled"),
|
||||
('onclick="SealContract(\'{0}\')"'.template(rowObject.ContractDocId))
|
||||
);
|
||||
}
|
||||
if (rowObject.ContractDocUrl) {
|
||||
html = html + (rowObject.ContractStatus === "草稿" || !rowObject.ContractStatus ? "未用印" : rowObject.ContractStatus);
|
||||
}
|
||||
return html;
|
||||
}
|
||||
};
|
||||
this.colModels.splice(2, 0, colObj);
|
||||
}
|
||||
if (page.IsAutoSealAndUploadFiles) {
|
||||
|
||||
var colObj1 = {
|
||||
name: 'SealResult',
|
||||
label: '电子章用印结果',
|
||||
index: 'SealResult',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
formatter: function (cellValue, options, rowObject) {
|
||||
|
||||
if (rowObject.MetaDic.SealResult == "失败") {
|
||||
var html = ("<span style='color:red;'>失败</span><a href='javascript:;' style='color:blue;' title='查看失败详情' onclick=\"colModelGrid.ViewErrInfo('{0}')\" ><详情></a>")
|
||||
.template(rowObject.ContractCode);
|
||||
return html;
|
||||
}
|
||||
else {
|
||||
return rowObject.SealResult;
|
||||
}
|
||||
}
|
||||
};
|
||||
var colObj2 = {
|
||||
name: 'SealTime',
|
||||
label: '电子章用印时间',
|
||||
index: 'SealTime',
|
||||
width: 150,
|
||||
align: 'left',
|
||||
sortable: false,
|
||||
formatter: function (cellValue, options, rowObject) {
|
||||
return rowObject.MetaDic.SealTime;
|
||||
}
|
||||
};
|
||||
this.colModels.push(colObj1, colObj2);
|
||||
}
|
||||
|
||||
}());
|
||||
$(function () {
|
||||
// 初始化jqGrid
|
||||
|
||||
Reference in New Issue
Block a user