MerchantAddInfoController.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.Extensions.Logging;
  7. using Microsoft.Extensions.Options;
  8. using Microsoft.AspNetCore.Authorization;
  9. using System.Web;
  10. using MySystem.MainModels;
  11. using LitJson;
  12. using Library;
  13. namespace MySystem.Areas.Api.Controllers.v1
  14. {
  15. [Area("Api")]
  16. [Route("Api/v1/[controller]/[action]")]
  17. public class MerchantAddInfoController : BaseController
  18. {
  19. public MerchantAddInfoController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
  20. {
  21. }
  22. #region 创客-首页-新增商户
  23. [Authorize]
  24. public JsonResult Add(string value)
  25. {
  26. value = DesDecrypt(value);
  27. JsonData data = JsonMapper.ToObject(value);
  28. AppResultJson result = AddDo(value);
  29. return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
  30. }
  31. public AppResultJson AddDo(string value)
  32. {
  33. // value = "{\"AlipayAccount\": \"13308013195\",\"LicenseCopy\": \"/mptest/v2/2023/5/16/330549a279dc65e1.png\",\"CertMerchantName\": \"测试\",\"LicenseNumber\": \"12341674981561J\",\"BusinessTerm\": \"2023-05-18-2023-05-25\",\"SubjectType\": \"SUBJECT_TYPE_INDIVIDUAL\",\"MerchantShortname\": \"测试\",\"ServicePhone\": \"14781419364\",\"QualificationType\": \"食品生鲜,酒类\",\"SpecialQualification\": \"\",\"MerchantAuthorizationLetter\": \"\",\"BizStoreName\": \"测试门店\",\"BizAddressCode\": \"北京市,东城区\",\"BizStoreAddress\": \"天安门红旗下\",\"IdCardCopy\": \"/mptest/v2/2023/5/16/f1a84d2a06113b5d.png\",\"IdCardNational\": \"/mptest/v2/2023/5/16/f50795237dea60ef.png\",\"CertLegalPerson\": \"张晟源\",\"IdCardNumber\": \"51382219940929723\",\"CardPeriodBegin\": \"2023-05-16\",\"CardPeriodEnd\": \"2023-05-19\",\"MobilePhone\": \"13308013195\",\"ContactEmail\": \"13308013195\",\"AccountName\": \"张晟源\",\"BankAccountType\": \"BANK_ACCOUNT_TYPE_PERSONAL\",\"AccountNumber\": \"6135124587452145\",\"AccountBank\": \"工商银行\",\"BankName\": \"中原银行股份有限公司信阳工商支行\",\"BankAddressCode\": \"北京市,东城区\",\"StoreEntrancePic\": \"/mptest/v2/2023/5/16/ac601bd8da78f4c8.png,/mptest/v2/2023/5/16/61d7dabf9aec0589.png\",\"IndoorPic\": \"/mptest/v2/2023/5/16/d20c693f5c15293b.png,/mptest/v2/2023/5/16/bd365c9d677ee77c.png,/mptest/v2/2023/5/16/706a3b275b7ca186.png\",\"ContactName\": \"张晟源\",\"ContactIdNumber\": \"51382219940929723\",\"IdCardName\": \"张晟源\",\"Qualifications\": \"\",\"Finish\": 1,\"UserId\": \"14\",\"Id\": \"\",\"SettlementId\": \"719_C_C05_5921\"}";
  34. JsonData data = JsonMapper.ToObject(value);
  35. string ContactName = data["ContactName"].ToString(); //管理员姓名
  36. string ContactIdNumber = data["ContactIdNumber"].ToString(); //管理员身份证件号码
  37. string MobilePhone = data["MobilePhone"].ToString(); //联系手机
  38. string ContactEmail = data["ContactEmail"].ToString(); //联系邮箱
  39. string SubjectType = data["SubjectType"].ToString(); //主体类型
  40. string LicenseCopy = data["LicenseCopy"].ToString(); //营业执照照片
  41. string LicenseNumber = data["LicenseNumber"].ToString(); //统一社会信用代码
  42. string CertMerchantName = data["CertMerchantName"].ToString(); //商户名称
  43. string CertLegalPerson = data["CertLegalPerson"].ToString(); //法人姓名
  44. string IdCardCopy = data["IdCardCopy"].ToString(); //身份证人像面照片
  45. string IdCardNational = data["IdCardNational"].ToString(); //身份证国徽面照片
  46. string IdCardName = data["IdCardName"].ToString(); //身份证姓名
  47. string IdCardNumber = data["IdCardNumber"].ToString(); //身份证号码
  48. string IdCardAddress = data["IdCardAddress"].ToString(); //身份证号码
  49. string CardPeriodBeginString = data["CardPeriodBegin"].ToString();
  50. if (string.IsNullOrEmpty(CardPeriodBeginString))
  51. {
  52. CardPeriodBeginString = "1900-01-01";
  53. }
  54. DateTime CardPeriodBegin = DateTime.Parse(CardPeriodBeginString); //身份证有效期开始时间
  55. string CardPeriodEndString = data["CardPeriodEnd"].ToString();
  56. if (string.IsNullOrEmpty(CardPeriodEndString))
  57. {
  58. CardPeriodEndString = "1900-01-01";
  59. }
  60. DateTime CardPeriodEnd = DateTime.Parse(CardPeriodEndString); //身份证有效期结束时间
  61. string ServicePhone = data["ServicePhone"].ToString(); //客服电话
  62. string BizStoreName = data["BizStoreName"].ToString(); //门店名称
  63. string BizAddressCode = data["BizAddressCode"].ToString(); //门店省市编码
  64. string BizStoreAddress = data["BizStoreAddress"].ToString(); //门店地址
  65. string StoreEntrancePic = data["StoreEntrancePic"].ToString(); //门店门头照片
  66. string IndoorPic = data["IndoorPic"].ToString(); //店内环境照片
  67. string QualificationType = data["QualificationType"].ToString(); //所属行业
  68. string SettlementId = data["SettlementId"].ToString(); //入驻结算规则ID
  69. string AlipayMccCode = "";
  70. if (!string.IsNullOrEmpty(SettlementId))
  71. {
  72. AlipayMccCode = SettlementId.Substring(SettlementId.IndexOf("_") + 1);
  73. SettlementId = SettlementId.Substring(0, SettlementId.IndexOf("_"));
  74. }
  75. string AlipayAccount = data["AlipayAccount"].ToString(); //支付宝账号
  76. string BankAccountType = data["BankAccountType"].ToString(); //账户类型
  77. string AccountName = data["AccountName"].ToString(); //开户名称
  78. string AccountBank = data["AccountBank"].ToString(); //开户银行
  79. string BankAddressCode = data["BankAddressCode"].ToString(); //开户银行省市编码
  80. string MerchantShortname = data["MerchantShortname"].ToString();
  81. string BankName = data["BankName"].ToString(); //开户银行全称
  82. string AccountNumber = data["AccountNumber"].ToString(); //银行账号
  83. string Qualifications = data["Qualifications"].ToString(); //特殊资质图
  84. int Finish = int.Parse(function.CheckInt(data["Finish"].ToString()));
  85. int UserId = int.Parse(function.CheckInt(data["UserId"].ToString()));
  86. int MerchantAddInfoId = int.Parse(function.CheckInt(data["Id"].ToString()));
  87. string BankBranchId = "";
  88. if (Finish == 1)
  89. {
  90. OpenBankTable openBank = maindb.OpenBankTable.FirstOrDefault(m => m.BankName == BankName);
  91. if (openBank == null)
  92. {
  93. return new AppResultJson() { Status = "-1", Info = "开户银行全称不正确" };
  94. }
  95. BankBranchId = openBank.BankCode;
  96. }
  97. Dictionary<string, object> Obj = new Dictionary<string, object>();
  98. MerchantAddInfo query = maindb.MerchantAddInfo.FirstOrDefault(m => m.CertMerchantName == CertMerchantName);
  99. if(query == null)
  100. {
  101. query = maindb.MerchantAddInfo.Add(new MerchantAddInfo()
  102. {
  103. CreateDate = DateTime.Now,
  104. CertMerchantName = CertMerchantName,
  105. }).Entity;
  106. maindb.SaveChanges();
  107. }
  108. query.UpdateDate = DateTime.Now; //修改时间
  109. query.ContactName = ContactName; //管理员姓名
  110. query.ContactIdNumber = ContactIdNumber; //管理员身份证件号码
  111. query.MobilePhone = MobilePhone; //联系手机
  112. query.ContactEmail = ContactEmail; //联系邮箱
  113. query.SubjectType = SubjectType; //主体类型
  114. query.LicenseCopy = LicenseCopy; //营业执照照片
  115. query.LicenseNumber = LicenseNumber; //统一社会信用代码
  116. query.LegalPerson = CertLegalPerson; //;体户经营者/法人姓名
  117. query.CertMerchantName = CertMerchantName; //商户名称
  118. query.CertLegalPerson = CertLegalPerson; //法人姓名
  119. query.ServicePhone = ServicePhone; //客服电话
  120. query.BizStoreName = BizStoreName; //门店名称
  121. query.BizAddressCode = BizAddressCode; //门店省市编码
  122. query.BizStoreAddress = BizStoreAddress; //门店地址
  123. query.StoreEntrancePic = StoreEntrancePic; //门店门头照片
  124. query.IndoorPic = IndoorPic; //店内环境照片
  125. query.QualificationType = QualificationType; //所属行业
  126. query.SettlementId = SettlementId; //入驻结算规则ID
  127. query.BankAccountType = BankAccountType; //账户类型
  128. query.AccountName = AccountName; //开户名称
  129. query.AccountBank = AccountBank; //开户银行
  130. query.BankAddressCode = BankAddressCode; //开户银行省市编码
  131. query.BankName = BankName; //开户银行全称
  132. query.BankBranchId = BankBranchId;
  133. query.AccountNumber = AccountNumber; //银行账号
  134. query.IdCardCopy = IdCardCopy; //身份证人像面照片
  135. query.IdCardNational = IdCardNational; //身份证国徽面照片
  136. query.IdCardName = IdCardName; //身份证姓名
  137. query.IdCardNumber = IdCardNumber; //身份证号码
  138. query.IdCardAddress = IdCardAddress; //身份证居住地址
  139. query.CardPeriodBegin = CardPeriodBegin; //身份证有效期开始时间
  140. query.CardPeriodEnd = CardPeriodEnd; //身份证有效期结束时间
  141. query.MerchantShortname = MerchantShortname;
  142. query.Qualifications = Qualifications; //特殊资质图片
  143. query.ActivitiesId = "20191030111cff5b5e";
  144. query.ActivitiesRate = "0.60";
  145. query.CreateMan = AlipayAccount;
  146. query.UpdateMan = AlipayMccCode;
  147. MerchantInfo merchant = maindb.MerchantInfo.FirstOrDefault(m => m.Id == query.Id);
  148. if(merchant == null)
  149. {
  150. merchant = maindb.MerchantInfo.Add(new MerchantInfo()
  151. {
  152. Id = query.Id,
  153. CreateDate = DateTime.Now,
  154. }).Entity;
  155. maindb.SaveChanges();
  156. }
  157. merchant.UpdateDate = DateTime.Now;
  158. merchant.UserId = UserId; //创客
  159. merchant.Name = CertMerchantName;
  160. merchant.Mobile = MobilePhone;
  161. merchant.Areas = BizAddressCode;
  162. merchant.Address = BizStoreAddress;
  163. merchant.QueryCount = 1;
  164. if (Finish == 1)
  165. {
  166. merchant.QueryCount = 0;
  167. // 如果提交完整资料,则发送到BsServer执行进件操作
  168. RedisDbconn.Instance.AddList("MerchantConfirmQueue", "{\"MerchantId\":\"" + merchant.Id + "\"}");
  169. }
  170. maindb.SaveChanges();
  171. Obj.Add("Id", MerchantAddInfoId); //Id
  172. return new AppResultJson() { Status = "1", Info = "", Data = Obj };
  173. }
  174. #endregion
  175. #region 创客-首页-商户进件详情
  176. [Authorize]
  177. public JsonResult Detail(string value)
  178. {
  179. value = DesDecrypt(value);
  180. JsonData data = JsonMapper.ToObject(value);
  181. Dictionary<string, object> Obj = DetailDo(value);
  182. return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
  183. }
  184. public Dictionary<string, object> DetailDo(string value)
  185. {
  186. JsonData data = JsonMapper.ToObject(value);
  187. Dictionary<string, object> Obj = new Dictionary<string, object>();
  188. int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
  189. Dictionary<string, string> Subjects = GetSubjects();
  190. Dictionary<string, string> AccountTypes = GetAccountTypes();
  191. MerchantAddInfo query = MerchantAddInfoDbconn.Instance.Get(Id) ?? new MerchantAddInfo();
  192. List<SettleData> Settles = GetSettles(query.SubjectType);
  193. Obj.Add("ContactName", query.ContactName); //管理员姓名
  194. Obj.Add("ContactIdNumber", query.ContactIdNumber); //管理员身份证件号码
  195. Obj.Add("OpenId", query.OpenId); //管理员微信openid
  196. Obj.Add("MobilePhone", query.MobilePhone); //联系手机
  197. Obj.Add("ContactEmail", query.ContactEmail); //联系邮箱
  198. Obj.Add("SubjectType", query.SubjectType); //主体类型
  199. if (Subjects.ContainsKey(query.SubjectType))
  200. {
  201. Obj.Add("SubjectTypeName", Subjects[query.SubjectType]);
  202. }
  203. else
  204. {
  205. Obj.Add("SubjectTypeName", "");
  206. }
  207. Obj.Add("LicenseCopy", query.LicenseCopy); //营业执照照片
  208. Obj.Add("LicenseNumber", query.LicenseNumber); //统一社会信用代码
  209. Obj.Add("LegalPerson", query.LegalPerson); //个体户经营者/法人姓名
  210. Obj.Add("CertCopy", query.CertCopy); //登记证书照片
  211. Obj.Add("CertType", query.CertType); //登记证书类型
  212. Obj.Add("CertNumber", query.CertNumber); //证书号
  213. Obj.Add("CertMerchantName", query.CertMerchantName); //商户名称
  214. Obj.Add("CompanyAddress", query.CompanyAddress); //注册地址
  215. Obj.Add("CertLegalPerson", query.CertLegalPerson); //法人姓名
  216. Obj.Add("PeriodBegin", query.PeriodBegin == null ? "" : query.PeriodBegin.Value.ToString("yyyy-MM-dd HH:mm:ss")); //有效期限开始日期
  217. Obj.Add("PeriodEnd", query.PeriodEnd == null ? "" : query.PeriodEnd.Value.ToString("yyyy-MM-dd HH:mm:ss")); //有效期限结束日期
  218. Obj.Add("OrganizationCopy", query.OrganizationCopy); //组织机构代码证照片
  219. Obj.Add("OrganizationCode", query.OrganizationCode); //组织机构代码
  220. Obj.Add("OrgPeriodBegin", query.OrgPeriodBegin == null ? "" : query.OrgPeriodBegin.Value.ToString("yyyy-MM-dd HH:mm:ss")); //组织机构代码证有效期开始日期
  221. Obj.Add("OrgPeriodEnd", query.OrgPeriodEnd == null ? "" : query.OrgPeriodEnd.Value.ToString("yyyy-MM-dd HH:mm:ss")); //组织机构代码证有效期结束日期
  222. Obj.Add("CertificateLetterCopy", query.CertificateLetterCopy); //单位证明函照片
  223. Obj.Add("IdDocType", query.IdDocType); //证件类型
  224. Obj.Add("Owner", query.Owner); //经营者/法人是否为受益人
  225. Obj.Add("UboInfoIdType", query.UboInfoIdType); //最终受益人证件类型
  226. Obj.Add("UboInfoIdCardCopy", query.UboInfoIdCardCopy); //最终受益人身份证人像面照片
  227. Obj.Add("UboInfoIdCardNational", query.UboInfoIdCardNational); //身份证国徽面照片
  228. Obj.Add("UboInfoIdDocCopy", query.UboInfoIdDocCopy); //最终受益人证件照片
  229. Obj.Add("UboInfoName", query.UboInfoName); //受益人姓名
  230. Obj.Add("UboInfoIdNumber", query.UboInfoIdNumber); //最终受益人证件号码
  231. Obj.Add("UboInfoIdPeriodBegin", query.UboInfoIdPeriodBegin == null ? "" : query.UboInfoIdPeriodBegin.Value.ToString("yyyy-MM-dd HH:mm:ss")); //证件有效期开始时间
  232. Obj.Add("UboInfoIdPeriodEnd", query.UboInfoIdPeriodEnd == null ? "" : query.UboInfoIdPeriodEnd.Value.ToString("yyyy-MM-dd HH:mm:ss")); //证件有效期结束时间
  233. Obj.Add("MerchantShortname", query.MerchantShortname); //商户简称
  234. Obj.Add("ServicePhone", query.ServicePhone); //客服电话
  235. Obj.Add("SalesScenesType", query.SalesScenesType); //经营场景类型
  236. Obj.Add("BizStoreName", query.BizStoreName); //门店名称
  237. Obj.Add("BizAddressCode", query.BizAddressCode); //门店省市编码
  238. Obj.Add("BizStoreAddress", query.BizStoreAddress); //门店地址
  239. Obj.Add("StoreEntrancePic", query.StoreEntrancePic); //门店门头照片
  240. Obj.Add("IndoorPic", query.IndoorPic); //店内环境照片
  241. Obj.Add("BizSubAppid", query.BizSubAppid); //线下场所对应的商家APPID
  242. Obj.Add("MpAppid", query.MpAppid); //服务商公众号APPID
  243. Obj.Add("MpSubAppid", query.MpSubAppid); //商家公众号APPID
  244. Obj.Add("MpPics", query.MpPics); //公众号页面截图
  245. Obj.Add("MiniProgramAppid", query.MiniProgramAppid); //服务商小程序APPID
  246. Obj.Add("MiniProgramSubAppid", query.MiniProgramSubAppid); //商家小程序APPID
  247. Obj.Add("MiniProgramPics", query.MiniProgramPics); //小程序截图
  248. Obj.Add("AppAppid", query.AppAppid); //服务商应用APPID
  249. Obj.Add("AppSubAppid", query.AppSubAppid); //商家应用APPID
  250. Obj.Add("AppPics", query.AppPics); //APP截图
  251. Obj.Add("WebDomain", query.WebDomain); //互联网网站域名
  252. Obj.Add("WebAuthorisation", query.WebAuthorisation); //网站授权函
  253. Obj.Add("WebAppId", query.WebAppId); //互联网网站对应的商家APPID
  254. Obj.Add("SubCorpId", query.SubCorpId); //商家企业微信CorpID
  255. Obj.Add("WeworkPics", query.WeworkPics); //企业微信页面截图
  256. Obj.Add("SettlementId", query.SettlementId + "_" + query.UpdateMan); //入驻结算规则ID
  257. Obj.Add("QualificationType", query.QualificationType); //所属行业
  258. SettleData item = Settles.FirstOrDefault(m => m.value == query.QualificationType);
  259. if (item != null)
  260. {
  261. Obj.Add("QualificationTypeName", item.ptext + "," + item.text);
  262. }
  263. else
  264. {
  265. Obj.Add("QualificationTypeName", "");
  266. }
  267. Obj.Add("Qualifications", query.Qualifications); //特殊资质图片
  268. Obj.Add("ActivitiesId", query.ActivitiesId); //优惠费率活动ID
  269. Obj.Add("ActivitiesRate", query.ActivitiesRate); //优惠费率活动值
  270. Obj.Add("BankAccountType", query.BankAccountType); //账户类型
  271. if (AccountTypes.ContainsKey(query.BankAccountType))
  272. {
  273. Obj.Add("BankAccountTypeName", AccountTypes[query.BankAccountType]);
  274. }
  275. else
  276. {
  277. Obj.Add("BankAccountTypeName", "");
  278. }
  279. Obj.Add("AccountName", query.AccountName); //开户名称
  280. Obj.Add("AccountBank", query.AccountBank); //开户银行
  281. Obj.Add("BankAddressCode", query.BankAddressCode); //开户银行省市编码
  282. Obj.Add("BankBranchId", query.BankBranchId); //开户银行联行号
  283. Obj.Add("BankName", query.BankName); //开户银行全称
  284. Obj.Add("AccountNumber", query.AccountNumber); //银行账号
  285. Obj.Add("ApplymentId", query.ApplymentId); //微信支付申请单号
  286. Obj.Add("SubMchid", query.SubMchid); //特约商户号
  287. Obj.Add("SignUrl", query.SignUrl); //超级管理员签约链接
  288. Obj.Add("ApplymentState", query.ApplymentState); //申请单状态
  289. Obj.Add("AuditDetail", query.AuditDetail); //驳回原因详情
  290. Obj.Add("IdCardCopy", query.IdCardCopy); //身份证人像面照片
  291. Obj.Add("IdCardNational", query.IdCardNational); //身份证国徽面照片
  292. Obj.Add("IdCardName", query.IdCardName); //身份证姓名
  293. Obj.Add("IdCardNumber", query.IdCardNumber); //身份证号码
  294. Obj.Add("IdCardAddress", query.IdCardAddress);
  295. Obj.Add("CardPeriodBegin", query.CardPeriodBegin == null ? "" : query.CardPeriodBegin.Value.ToString("yyyy-MM-dd HH:mm:ss")); //身份证有效期开始时间
  296. Obj.Add("CardPeriodEnd", query.CardPeriodEnd == null ? "" : query.CardPeriodEnd.Value.ToString("yyyy-MM-dd HH:mm:ss")); //身份证有效期结束时间
  297. Obj.Add("Id", query.Id); //Id
  298. Obj.Add("Status", query.Status); //状态
  299. Obj.Add("CreateDate", query.CreateDate); //创建时间
  300. Obj.Add("AlipayAccount", query.CreateMan); //支付宝账号
  301. return Obj;
  302. }
  303. #endregion
  304. #region 创客-首页-进件选项接口
  305. [Authorize]
  306. public JsonResult Options(string value)
  307. {
  308. value = DesDecrypt(value);
  309. JsonData data = JsonMapper.ToObject(value);
  310. List<Dictionary<string, object>> dataList = OptionsDo(value);
  311. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  312. }
  313. public List<Dictionary<string, object>> OptionsDo(string value)
  314. {
  315. JsonData data = JsonMapper.ToObject(value);
  316. string Kind = data["Kind"].ToString(); //分类
  317. int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
  318. int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
  319. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  320. if (Kind == "2")
  321. {
  322. dataList = GetPersonSettles();
  323. }
  324. else if (Kind == "21")
  325. {
  326. dataList = GetBusinessSettles();
  327. }
  328. else
  329. {
  330. Dictionary<string, string> query = new Dictionary<string, string>();
  331. if (Kind == "1")
  332. {
  333. query = GetSubjects();
  334. }
  335. else if (Kind == "3")
  336. {
  337. query = GetAccountTypes();
  338. }
  339. else if (Kind == "4")
  340. {
  341. query = GetBanks();
  342. }
  343. foreach (string key in query.Keys)
  344. {
  345. Dictionary<string, object> curData = new Dictionary<string, object>();
  346. curData.Add("text", query[key]); //文本
  347. curData.Add("value", key); //值
  348. dataList.Add(curData);
  349. }
  350. }
  351. return dataList;
  352. }
  353. public Dictionary<string, string> GetSubjects()
  354. {
  355. Dictionary<string, string> dic = new Dictionary<string, string>();
  356. dic.Add("SUBJECT_TYPE_INDIVIDUAL", "个体户");
  357. dic.Add("SUBJECT_TYPE_ENTERPRISE", "企业");
  358. // dic.Add("SUBJECT_TYPE_INSTITUTIONS", "党政、机关及事业单位");
  359. // dic.Add("SUBJECT_TYPE_OTHERS", "其他组织");
  360. return dic;
  361. }
  362. public List<SettleData> GetSettles(string Kind)
  363. {
  364. if (Kind == "SUBJECT_TYPE_INDIVIDUAL")
  365. {
  366. return GetPersonSettleItems();
  367. }
  368. return GetBusinessSettleItems();
  369. }
  370. public List<SettleData> GetPersonSettleItems()
  371. {
  372. List<SettleData> dic = new List<SettleData>();
  373. dic.Add(new SettleData() { ptext = "餐饮", text = "餐饮", code = "C_C05_5814", value = "719", special = 0});
  374. dic.Add(new SettleData() { ptext = "食品生鲜", text = "酒类", code = "C_C05_5921", value = "719", special = 1});
  375. dic.Add(new SettleData() { ptext = "食品生鲜", text = "肉、禽、蛋及水产品等", code = "C_C05_5422", value = "719", special = 0});
  376. dic.Add(new SettleData() { ptext = "私立/民营医院/诊所", text = "医疗服务", code = "P_P01_8011", value = "719", special = 1});
  377. dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "药品、药品经营者(批发商)", code = "B_B04_5122", value = "719", special = 1});
  378. dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "医疗器械", code = "B_B04_5047", value = "719", special = 1});
  379. dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "游艺厅/KTV", code = "D_D01_7999", value = "719", special = 1});
  380. dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "网吧", code = "D_D01_7999", value = "719", special = 1});
  381. dic.Add(new SettleData() { ptext = "宠物医院", text = "宠物及宠物用品", code = "C_C10_5995", value = "719", special = 1});
  382. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "公共交通", code = "A_A01_4121", value = "719", special = 0});
  383. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "旅行住宿", code = "A_A04_7011", value = "719", special = 0});
  384. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "公共仓储、集装整理", code = "A_A02_4225", value = "719", special = 0});
  385. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "商业服务", code = "S_S05_7338", value = "719", special = 0});
  386. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "汽车租赁和服务", code = "S_S10_7512", value = "719", special = 0});
  387. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "生活服务", code = "S_S08_7295", value = "719", special = 0});
  388. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "百货商城", code = "C_C04_5411", value = "719", special = 0});
  389. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "服饰鞋包", code = "C_C06_5699", value = "719", special = 0});
  390. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "家居家纺建材", code = "C_C03_5211", value = "719", special = 0});
  391. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "母婴玩具", code = "C_C02_5641", value = "719", special = 0});
  392. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "数码家电", code = "C_C07_5732", value = "719", special = 0});
  393. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "图书音像", code = "C_C09_5942", value = "719", special = 0});
  394. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "文化玩乐宠物", code = "C_C10_5995", value = "719", special = 0});
  395. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "彩票", code = "D_D03_7995", value = "719", special = 0});
  396. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "娱乐票务", code = "D_D01_7999", value = "719", special = 0});
  397. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "法律咨询和律师事务所", code = "P_P04_8111", value = "719", special = 1});
  398. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "办公用品", code = "B_B01_5943", value = "719", special = 0});
  399. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "工业产品", code = "B_B02_5065", value = "719", special = 0});
  400. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "汽车和运输工具", code = "B_B03_5599", value = "719", special = 0});
  401. dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "专业咨询", code = "P_P04_8999", value = "719", special = 0});
  402. dic.Add(new SettleData() { ptext = "话费通讯", text = "话费充值与缴费", code = "D_D04_4815", value = "720", special = 1});
  403. dic.Add(new SettleData() { ptext = "加油", text = "加油站、服务站", code = "B_B03_5541", value = "721", special = 1});
  404. return dic;
  405. }
  406. public List<Dictionary<string, object>> GetPersonSettles()
  407. {
  408. List<SettleData> dic = GetPersonSettleItems();
  409. int i = 0;
  410. List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
  411. foreach (string sub in dic.Select(m => m.ptext).Distinct().ToList())
  412. {
  413. i += 1;
  414. Dictionary<string, object> bigDic = new Dictionary<string, object>();
  415. bigDic.Add("value", i.ToString());
  416. bigDic.Add("text", sub);
  417. List<Dictionary<string, object>> children = new List<Dictionary<string, object>>();
  418. foreach (SettleData ssub in dic.Where(m=>m.ptext == sub).ToList())
  419. {
  420. Dictionary<string, object> smallDic = new Dictionary<string, object>();
  421. smallDic.Add("value", ssub.value + "_" + ssub.code);
  422. smallDic.Add("text", ssub.text);
  423. smallDic.Add("special", ssub.special);
  424. children.Add(smallDic);
  425. }
  426. bigDic.Add("children", children);
  427. list.Add(bigDic);
  428. }
  429. return list;
  430. }
  431. public List<SettleData> GetBusinessSettleItems()
  432. {
  433. List<SettleData> dic = new List<SettleData>();
  434. dic.Add(new SettleData() { ptext = "餐饮", text = "餐饮", code = "C_C05_5814", value = "716", special = 0});
  435. dic.Add(new SettleData() { ptext = "电商平台", text = "电商平台", code = "C_C05_5814", value = "716", special = 0});
  436. dic.Add(new SettleData() { ptext = "食品生鲜", text = "酒类", code = "C_C05_5921", value = "716", special = 1});
  437. dic.Add(new SettleData() { ptext = "食品生鲜", text = "肉、禽、蛋及水产品等", code = "C_C05_5422", value = "716", special = 0});
  438. dic.Add(new SettleData() { ptext = "电信运营商/宽带收费", text = "电信通讯", code = "D_D04_4814", value = "716", special = 1});
  439. dic.Add(new SettleData() { ptext = "私立/民营医院/诊所", text = "医疗服务", code = "P_P01_8011", value = "716", special = 1});
  440. dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "医疗器械", code = "B_B04_5047", value = "716", special = 1});
  441. dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "药品、药品经营者(批发商)", code = "B_B04_5122", value = "716", special = 1});
  442. dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "游艺厅/KTV", code = "D_D01_7999", value = "716", special = 1});
  443. dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "网吧", code = "D_D01_7999", value = "716", special = 1});
  444. dic.Add(new SettleData() { ptext = "宠物医院", text = "宠物及宠物用品", code = "C_C10_5995", value = "716", special = 1});
  445. dic.Add(new SettleData() { ptext = "旅行社", text = "旅行社和旅游服务", code = "A_A04_4722", value = "716", special = 1});
  446. dic.Add(new SettleData() { ptext = "宗教组织", text = "宗教物品", code = "C_C10_5973", value = "716", special = 0});
  447. dic.Add(new SettleData() { ptext = "宗教组织", text = "其他宗教服务", code = "P_P04_8999", value = "716", special = 1});
  448. dic.Add(new SettleData() { ptext = "文物经营/文物复制品销售", text = "文物经营/文物复制品销售", code = "C_C10_5971", value = "716", special = 1});
  449. dic.Add(new SettleData() { ptext = "拍卖典当", text = "典当行", code = "S_S04_5933", value = "716", special = 1});
  450. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "公共交通", code = "A_A01_4121", value = "716", special = 0});
  451. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "旅行住宿", code = "A_A04_7011", value = "716", special = 0});
  452. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "公共仓储、集装整理", code = "A_A02_4225", value = "716", special = 0});
  453. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "商业服务", code = "S_S05_7338", value = "716", special = 0});
  454. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "汽车租赁和服务", code = "S_S10_7512", value = "716", special = 0});
  455. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "生活服务", code = "S_S08_7295", value = "716", special = 0});
  456. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "百货商城", code = "C_C04_5411", value = "716", special = 0});
  457. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "服饰鞋包", code = "C_C06_5699", value = "716", special = 0});
  458. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "家居家纺建材", code = "C_C03_5211", value = "716", special = 0});
  459. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "母婴玩具", code = "C_C02_5641", value = "716", special = 0});
  460. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "数码家电", code = "C_C07_5732", value = "716", special = 0});
  461. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "图书音像", code = "C_C09_5942", value = "716", special = 0});
  462. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "文化玩乐宠物", code = "C_C10_5995", value = "716", special = 0});
  463. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "彩票", code = "D_D03_7995", value = "716", special = 0});
  464. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "娱乐票务", code = "D_D01_7999", value = "716", special = 0});
  465. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "法律咨询和律师事务所", code = "P_P04_8111", value = "716", special = 1});
  466. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "办公用品", code = "B_B01_5943", value = "716", special = 0});
  467. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "工业产品", code = "B_B02_5065", value = "716", special = 0});
  468. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "汽车和运输工具", code = "B_B03_5599", value = "716", special = 0});
  469. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "专业咨询", code = "P_P04_8999", value = "716", special = 0});
  470. dic.Add(new SettleData() { ptext = "话费通讯", text = "话费充值与缴费", code = "D_D04_4815", value = "728", special = 1});
  471. dic.Add(new SettleData() { ptext = "婚介平台/就业信息平台/其他", text = "婚介服务", code = "S_S08_7273", value = "728", special = 0});
  472. dic.Add(new SettleData() { ptext = "门户论坛/网络广告及推广/软件开发/其他互联网服务", text = "计算机服务/其他", code = "D_D05_7372", value = "711", special = 0});
  473. dic.Add(new SettleData() { ptext = "快递", text = "快递服务", code = "A_A02_4215", value = "717", special = 1});
  474. dic.Add(new SettleData() { ptext = "加油", text = "加油站、服务站", code = "B_B03_5541", value = "717", special = 1});
  475. dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业(电、气、水)", code = "S_S06_4900", value = "730", special = 1});
  476. dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业-电力缴费", code = "S_S06_4901", value = "730", special = 1});
  477. dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业-煤气缴费", code = "S_S06_4902", value = "730", special = 1});
  478. dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业-自来水缴费", code = "S_S06_4903", value = "730", special = 1});
  479. return dic;
  480. }
  481. public List<Dictionary<string, object>> GetBusinessSettles()
  482. {
  483. List<SettleData> dic = GetBusinessSettleItems();
  484. int i = 0;
  485. List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
  486. foreach (string sub in dic.Select(m => m.ptext).Distinct().ToList())
  487. {
  488. i += 1;
  489. Dictionary<string, object> bigDic = new Dictionary<string, object>();
  490. bigDic.Add("value", i.ToString());
  491. bigDic.Add("text", sub);
  492. List<Dictionary<string, object>> children = new List<Dictionary<string, object>>();
  493. foreach (SettleData ssub in dic.Where(m=>m.ptext == sub).ToList())
  494. {
  495. Dictionary<string, object> smallDic = new Dictionary<string, object>();
  496. smallDic.Add("value", ssub.value + "_" + ssub.code);
  497. smallDic.Add("text", ssub.text);
  498. smallDic.Add("special", ssub.special);
  499. children.Add(smallDic);
  500. }
  501. bigDic.Add("children", children);
  502. list.Add(bigDic);
  503. }
  504. return list;
  505. }
  506. public Dictionary<string, string> GetAccountTypes()
  507. {
  508. Dictionary<string, string> dic = new Dictionary<string, string>();
  509. dic.Add("BANK_ACCOUNT_TYPE_CORPORATE", "对公银行账户");
  510. dic.Add("BANK_ACCOUNT_TYPE_PERSONAL", "经营者个人银行卡");
  511. return dic;
  512. }
  513. public Dictionary<string, string> GetBanks()
  514. {
  515. Dictionary<string, string> dic = new Dictionary<string, string>();
  516. dic.Add("工商银行", "工商银行");
  517. dic.Add("农业银行", "农业银行");
  518. dic.Add("邮储银行", "邮储银行");
  519. dic.Add("建设银行", "建设银行");
  520. dic.Add("招商银行", "招商银行");
  521. dic.Add("中国银行", "中国银行");
  522. dic.Add("交通银行", "交通银行");
  523. dic.Add("浦发银行", "浦发银行");
  524. dic.Add("广发银行", "广发银行");
  525. dic.Add("民生银行", "民生银行");
  526. dic.Add("平安银行", "平安银行");
  527. dic.Add("光大银行", "光大银行");
  528. dic.Add("兴业银行", "兴业银行");
  529. dic.Add("中信银行", "中信银行");
  530. dic.Add("上海银行", "上海银行");
  531. dic.Add("其他银行", "其他银行");
  532. return dic;
  533. }
  534. #endregion
  535. #region 检查签名是否合法,合法返回1,不合法返回提示信息
  536. /// <summary>
  537. /// 检查签名是否合法,合法返回1,不合法返回提示信息
  538. /// </summary>
  539. /// <param name="value">请求的参数(json字符串)</param>
  540. /// <param name="signField">要签名的字段</param>
  541. /// <returns></returns>
  542. private string CheckSign(string value, string[] signField)
  543. {
  544. JsonData json = JsonMapper.ToObject(value);
  545. Dictionary<string, string> dic = new Dictionary<string, string>();
  546. for (int i = 0; i < signField.Length; i++)
  547. {
  548. dic.Add(signField[i], json[signField[i]].ToString());
  549. }
  550. string sign = json["sign"].ToString(); //客户端签名字符串
  551. return new Sign().sign(dic, sign);
  552. }
  553. #endregion
  554. }
  555. }