|
|
@@ -15,38 +15,58 @@ namespace MySystem
|
|
|
/// <summary>
|
|
|
/// 好哒商户修改银行卡参数赋值
|
|
|
/// </summary>
|
|
|
- public class ChangeMerchantCardNewSetUtil
|
|
|
+ public class ChangeMerchantCardSetUtil
|
|
|
{
|
|
|
- public static ChangeMerchantCardNew SetValue(MerchantChangeSettlementCardRecord MerchantChangeSettlementCardRecord)
|
|
|
+ public static ChangeMerchantCard SetValue(MerchantChangeSettlementCardRecord MerchantChangeSettlementCardRecord, int MerchantId)
|
|
|
{
|
|
|
- ChangeMerchantCardNew changeMerchantCardNew = new ChangeMerchantCardNew();
|
|
|
- changeMerchantCardNew.mchtNo = MerchantChangeSettlementCardRecord.MchtNo; //收款商户号
|
|
|
- changeMerchantCardNew.accountNo = MerchantChangeSettlementCardRecord.AccountNo; //卡号(账户类型 0-对公 时填写对公账号,1-对私 时填写银行卡号)
|
|
|
- changeMerchantCardNew.accountName = MerchantChangeSettlementCardRecord.AccountName; //开户名(账户名称 账户类型 0-对公 时填写对公账户名,1-对私 时填写银行卡户名)
|
|
|
- changeMerchantCardNew.zbankNo = MerchantChangeSettlementCardRecord.ZbankNo; //开户支行号
|
|
|
- changeMerchantCardNew.alterType = MerchantChangeSettlementCardRecord.AlterType.ToString(); //结算类型:0-对公结算银行卡;1-法人对私结算银行卡;2-非法人结算
|
|
|
- changeMerchantCardNew.acctZbankCode = MerchantChangeSettlementCardRecord.AcctZbankCode; //开户支行地区码
|
|
|
+ var merchantAddInfo = MerchantAddInfoService.Query(MerchantId);
|
|
|
|
|
|
- if (changeMerchantCardNew.alterType == "2")
|
|
|
+ ChangeMerchantCard changeMerchantCard = new ChangeMerchantCard();
|
|
|
+ changeMerchantCard.mchtNo = MerchantChangeSettlementCardRecord.MchtNo; //收款商户号
|
|
|
+ changeMerchantCard.accountNo = MerchantChangeSettlementCardRecord.AccountNo; //卡号(账户类型 0-对公 时填写对公账号,1-对私 时填写银行卡号)
|
|
|
+ changeMerchantCard.accountName = MerchantChangeSettlementCardRecord.AccountName; //开户名(账户名称 账户类型 0-对公 时填写对公账户名,1-对私 时填写银行卡户名)
|
|
|
+ changeMerchantCard.zbankNo = MerchantChangeSettlementCardRecord.ZbankNo; //开户支行号
|
|
|
+ changeMerchantCard.alterType = MerchantChangeSettlementCardRecord.AlterType.ToString(); //结算类型:0-对公结算银行卡;1-法人对私结算银行卡;2-非法人结算
|
|
|
+ changeMerchantCard.accoutType = MerchantChangeSettlementCardRecord.AccountType.ToString(); //账户类型 0-对公,1-对私
|
|
|
+ changeMerchantCard.acctZbankCode = MerchantChangeSettlementCardRecord.AcctZbankCode; //开户支行地区码
|
|
|
+
|
|
|
+ if (changeMerchantCard.alterType == "2")
|
|
|
{
|
|
|
- changeMerchantCardNew.idCard = MerchantChangeSettlementCardRecord.IdCard; //非法人身份证号(结算类型为2时必填)
|
|
|
+ changeMerchantCard.idCard = MerchantChangeSettlementCardRecord.IdCard; //非法人身份证号(结算类型为2时必填)
|
|
|
var mer = MerchantAddInfoService.Query(" and MchtNo='" + MerchantChangeSettlementCardRecord.MchtNo + "'");
|
|
|
string AgentCardEndDate = MerchantChangeSettlementCardRecord.AgentCardEndDate.Value.ToString("yyyy-MM-dd");
|
|
|
if (AgentCardEndDate.Substring(0, 4) == "9999")
|
|
|
{
|
|
|
- changeMerchantCardNew.agentCardDate = MerchantChangeSettlementCardRecord.AgentCardStartDate.Value.ToString("yyyyMMdd") + "-" + "长期"; //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
|
|
|
+ changeMerchantCard.agentCardDate = MerchantChangeSettlementCardRecord.AgentCardStartDate.Value.ToString("yyyyMMdd") + "-" + "长期"; //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- changeMerchantCardNew.agentCardDate = MerchantChangeSettlementCardRecord.AgentCardStartDate.Value.ToString("yyyyMMdd") + "-" + MerchantChangeSettlementCardRecord.AgentCardEndDate.Value.ToString("yyyyMMdd"); //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
|
|
|
+ changeMerchantCard.agentCardDate = MerchantChangeSettlementCardRecord.AgentCardStartDate.Value.ToString("yyyyMMdd") + "-" + MerchantChangeSettlementCardRecord.AgentCardEndDate.Value.ToString("yyyyMMdd"); //非法人身份证有效期(结算类型为2时必填,格式:20210101-20220101,如长期:20210101-长期)
|
|
|
}
|
|
|
}
|
|
|
- List<PhotoItemNew> photoList = new List<PhotoItemNew>();
|
|
|
- PhotoItemNew photoItemNew = new PhotoItemNew();
|
|
|
+
|
|
|
+ //对公改对公需要提交的参数
|
|
|
+ if (merchantAddInfo.AccountType == "0" && changeMerchantCard.alterType == "0")
|
|
|
+ {
|
|
|
+ var bankInfo = OpenBankAllService.Query(" BankChildNo='" + MerchantChangeSettlementCardRecord.ZbankNo + "'");
|
|
|
+ var areasInfo = HaoDaAreaCodeService.Query(" CityCode='" + MerchantChangeSettlementCardRecord.AcctZbankCode + "'");
|
|
|
+
|
|
|
+ changeMerchantCard.openBankAccName = MerchantChangeSettlementCardRecord.AccountName; //开户许可证-开户名(修改对公凭证时填写)
|
|
|
+ changeMerchantCard.openBankName = bankInfo.BankParent; //开户许可证-银行名称(修改对公凭证时填写)
|
|
|
+ changeMerchantCard.openCollectBankCode = MerchantChangeSettlementCardRecord.ZbankNo; //开户许可证-银行代码(修改对公凭证时填写)
|
|
|
+ changeMerchantCard.openBankRegionCode = MerchantChangeSettlementCardRecord.AcctZbankCode; //开户许可证-银行地区码(修改对公凭证时填写)
|
|
|
+ changeMerchantCard.openBankRegionName = areasInfo.CityName; //开户许可证-开户地名称(修改对公凭证时填写)
|
|
|
+ changeMerchantCard.openUnionNo = MerchantChangeSettlementCardRecord.ZbankNo; //开户许可证-开户支行(修改对公凭证时填写)
|
|
|
+ changeMerchantCard.openUnionName = bankInfo.BankChild; //开户许可证-支行名称(修改对公凭证时填写)
|
|
|
+ changeMerchantCard.openBankAccout = MerchantChangeSettlementCardRecord.AccountNo; //开户许可证-银行卡号(修改对公凭证时填写)
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PhotoItem> photoList = new List<PhotoItem>();
|
|
|
+ PhotoItem photoItem = new PhotoItem();
|
|
|
// alterType结算类型为0时,上传 开户许可证照片
|
|
|
// alterType结算类型为1时,上传 银行卡照片
|
|
|
// alterType结算类型为2时,上传 银行卡照片、非法人身份证正面照片、非法人身份证反面照片、委托结算授权书照片、法人手持委托结算授权书
|
|
|
- if (changeMerchantCardNew.alterType == "0")
|
|
|
+ if (changeMerchantCard.alterType == "0")
|
|
|
{
|
|
|
var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(MerchantChangeSettlementCardRecord.OpenAccountLicenses.Substring(MerchantChangeSettlementCardRecord.OpenAccountLicenses.LastIndexOf("/")).Trim('/'), "0"));
|
|
|
if (tokenInfo["code"].ToString() == "1")
|
|
|
@@ -54,15 +74,16 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.OpenAccountLicenses);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "openAccountLicenses";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "openAccountLicenses";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (changeMerchantCardNew.alterType == "1")
|
|
|
+ if (changeMerchantCard.alterType == "1")
|
|
|
{
|
|
|
+ //结算类型为1和2时必填,0不填
|
|
|
if (!string.IsNullOrEmpty(MerchantChangeSettlementCardRecord.BankCard))
|
|
|
{
|
|
|
var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(MerchantChangeSettlementCardRecord.BankCard.Substring(MerchantChangeSettlementCardRecord.BankCard.LastIndexOf("/")).Trim('/'), "0"));
|
|
|
@@ -71,14 +92,16 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.BankCard);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "bankCard";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "bankCard";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (!string.IsNullOrEmpty(MerchantChangeSettlementCardRecord.PriLicAgreement))
|
|
|
+
|
|
|
+ //结算类型为1且为企业商户时必填
|
|
|
+ if (!string.IsNullOrEmpty(MerchantChangeSettlementCardRecord.PriLicAgreement) && merchantAddInfo.SubjectType == "SUBJECT_TYPE_ENTERPRISE")
|
|
|
{
|
|
|
var tokenInfo = JsonMapper.ToObject(HaoDaHelper.Instance.GetToken(MerchantChangeSettlementCardRecord.PriLicAgreement.Substring(MerchantChangeSettlementCardRecord.PriLicAgreement.LastIndexOf("/")).Trim('/'), "0"));
|
|
|
if (tokenInfo["code"].ToString() == "1")
|
|
|
@@ -86,15 +109,15 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.PriLicAgreement);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "priLicAgreement";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "priLicAgreement";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (changeMerchantCardNew.alterType == "2")
|
|
|
+ if (changeMerchantCard.alterType == "2")
|
|
|
{
|
|
|
if (!string.IsNullOrEmpty(MerchantChangeSettlementCardRecord.BankCard))
|
|
|
{
|
|
|
@@ -104,10 +127,10 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.BankCard);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "bankCard";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "bankCard";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -119,10 +142,10 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.AgentIdCardFront);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "agentIdCardFront";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "agentIdCardFront";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -134,10 +157,10 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.AgentIdCardBack);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "agentIdCardBack";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "agentIdCardBack";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -149,10 +172,10 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.AgentProtocol);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "agentProtocol";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "agentProtocol";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -164,16 +187,16 @@ namespace MySystem
|
|
|
var returnInfo = HaoDaHelper.Instance.ReturnFileName(tokenInfo["token"].ToString(), MerchantChangeSettlementCardRecord.HoldAgentProtocol);
|
|
|
if (returnInfo != "false")
|
|
|
{
|
|
|
- photoItemNew = new PhotoItemNew();
|
|
|
- photoItemNew.mediaCode = "holdAgentProtocol";
|
|
|
- photoItemNew.mediaPath = returnInfo;
|
|
|
- photoList.Add(photoItemNew);
|
|
|
+ photoItem = new PhotoItem();
|
|
|
+ photoItem.mediaCode = "holdAgentProtocol";
|
|
|
+ photoItem.mediaPath = returnInfo;
|
|
|
+ photoList.Add(photoItem);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- changeMerchantCardNew.photoList = photoList; //图片列表
|
|
|
- return changeMerchantCardNew;
|
|
|
+ changeMerchantCard.photoList = photoList; //图片列表
|
|
|
+ return changeMerchantCard;
|
|
|
}
|
|
|
}
|
|
|
}
|