MerchantAddInfoController.cs 44 KB

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