MerchantAddInfoController.cs 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  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 MySystem.Service.Main;
  10. using System.Web;
  11. using MySystem.Models.Main;
  12. using LitJson;
  13. using Library;
  14. using System.Text.RegularExpressions;
  15. namespace MySystem.Areas.Api.Controllers.v1
  16. {
  17. [Area("Api")]
  18. [Route("Api/v1/[controller]/[action]")]
  19. public class MerchantAddInfoController : BaseController
  20. {
  21. public MerchantAddInfoController(IHttpContextAccessor accessor) : base(accessor)
  22. {
  23. }
  24. #region 创客-首页-新增商户
  25. // [Authorize]
  26. public JsonResult Add(string value)
  27. {
  28. value = DesDecrypt(value);
  29. value = value.Replace("null", "\"\"");
  30. JsonData data = JsonMapper.ToObject(value);
  31. AppResultJson result = AddDo(value);
  32. return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
  33. }
  34. public AppResultJson AddDo(string value)
  35. {
  36. function.WriteLog(value, "创客-首页-新增商户");
  37. JsonData data = JsonMapper.ToObject(value);
  38. string LicenseCopy = data.getItem("LicenseCopy").ToString(); //- 营业执照
  39. string CertMerchantName = data.getItem("CertMerchantName").ToString(); //- 商户名称
  40. string LicenseNumber = data.getItem("LicenseNumber").ToString(); //- 商户信用代码
  41. string SubjectType = data.getItem("SubjectType").ToString(); //- 主体类型
  42. string MerchantShortname = data.getItem("MerchantShortname").ToString(); //- 用户名称简写
  43. string ServicePhone = data.getItem("ServicePhone").ToString(); //- 商户电话
  44. string SalesScenesType = data.getItem("SalesScenesType").ToString(); //- 所属行业
  45. string SalesScenesTypeName = data.getItem("SalesScenesTypeName").ToString(); //- 所属行业
  46. string MchtNo = data.getItem("MchtNo").ToString(); // 收款商户号
  47. string BizStoreName = data.getItem("BizStoreName").ToString(); //- 门店名称
  48. string BizAddressCode = data.getItem("BizAddressCode").ToString(); //- 门店区域
  49. string BizStoreAddress = data.getItem("BizStoreAddress").ToString(); //- 门店地址
  50. string IdCardCopy = data.getItem("IdCardCopy").ToString(); //- 身份证正面
  51. string IdCardNational = data.getItem("IdCardNational").ToString(); //- 身份证反面
  52. string CertLegalPerson = data.getItem("CertLegalPerson").ToString(); //- 真实姓名
  53. string IdCardNumber = data.getItem("IdCardNumber").ToString(); //- 身份证号码
  54. string CardPeriodBegin = data.getItem("CardPeriodBegin").ToString(); //- 身份证有效期开始
  55. string CardPeriodEnd = data.getItem("CardPeriodEnd").ToString(); //- 身份证有效期结束
  56. string IdCardAddress = data.getItem("IdCardAddress").ToString();//身份证居住地址
  57. string PeriodBegin = data.getItem("PeriodBegin").ToString(); //- 营业执照有效期开始
  58. string PeriodEnd = data.getItem("PeriodEnd").ToString(); //- 营业执照有效期结束
  59. if (string.IsNullOrEmpty(CardPeriodBegin))
  60. {
  61. CardPeriodBegin = "1900-01-01";
  62. }
  63. if (string.IsNullOrEmpty(CardPeriodEnd))
  64. {
  65. CardPeriodEnd = "1900-01-01";
  66. }
  67. if (string.IsNullOrEmpty(PeriodBegin))
  68. {
  69. PeriodBegin = "1900-01-01";
  70. }
  71. if (string.IsNullOrEmpty(PeriodEnd))
  72. {
  73. PeriodEnd = "1900-01-01";
  74. }
  75. string MobilePhone = data.getItem("MobilePhone").ToString(); //- 手机号码
  76. string AccountName = data.getItem("AccountName").ToString(); //- 开户名称
  77. string ChannelKind = data.getItem("ChannelKind").ToString(); // 商户类型
  78. string BankAccountType = data.getItem("BankAccountType").ToString(); //- 账户类型
  79. string AccountNumber = data.getItem("AccountNumber").ToString(); //- 银行卡号
  80. string AccountBank = data.getItem("AccountBank").ToString(); //- 开户行
  81. string BankCard = data.getItem("BankCard").ToString(); // 银行卡照片
  82. string OpenAccountLicenses = data.getItem("OpenAccountLicenses").ToString(); // 开户许可证
  83. string BankName = data.getItem("BankName").ToString(); //- 开户行全称
  84. string BankAddressCode = data.getItem("BankAddressCode").ToString(); //- 开户地区
  85. string PersonWithIdCard = data.getItem("PersonWithIdCard").ToString(); //- 手持身份证照片(小微)
  86. string StoreEntrancePic = data.getItem("StoreEntrancePic").ToString(); // 门头照片组
  87. string IndoorPic = data.getItem("IndoorPic").ToString(); // 环境照片组
  88. string CheckstandImg = data.getItem("CheckstandImg").ToString(); // 收银照片组
  89. string Extra1 = data.getItem("Extra1").ToString(); // 补充资料照片组
  90. string IndustryLicense1 = data.getItem("IndustryLicense1").ToString(); //- 特殊资质照片组
  91. string ResserveMobile = data.getItem("ResserveMobile").ToString(); //银行预留手机号 channelkind为000001时必填
  92. string OpenBankAccout = data.getItem("OpenBankAccout").ToString(); // 开户许可证-银行卡号
  93. string OpenBankName = data.getItem("OpenBankName").ToString(); // 开户许可证-开户行全称
  94. string OpenBankAccName = data.getItem("OpenBankAccName").ToString(); // 开户许可证-开户名
  95. string OpenBankRegionCode = data.getItem("OpenBankRegionCode").ToString(); // 开户许可证-开户支行区域
  96. int PlaceType = int.Parse(function.CheckInt(data.getItem("PlaceType").ToString())); // 小微商户经营场所类型(0 固定场所 1 流动动摊贩)
  97. //添加银联进件品牌选择
  98. int BrandId = 0;
  99. if (!string.IsNullOrEmpty(data.getItem("BrandId").ToString()))
  100. {
  101. BrandId = int.Parse(function.CheckInt(data.getItem("BrandId").ToString())); // 品牌(0 银联 1 好哒)
  102. }
  103. // string ContactName = data["ContactName"].ToString(); //管理员姓名
  104. // string ContactIdNumber = data["ContactIdNumber"].ToString(); //管理员身份证件号码
  105. // string MobilePhone = data["MobilePhone"].ToString(); //联系手机
  106. // string ContactEmail = data["ContactEmail"].ToString(); //联系邮箱
  107. // string SubjectType = data["SubjectType"].ToString(); //主体类型 0-企业法人营业执照 1-个体工商户营业执照
  108. // string LicenseCopy = data["LicenseCopy"].ToString(); //营业执照照片
  109. // string LicenseNumber = data["LicenseNumber"].ToString(); //统一社会信用代码
  110. // string CertMerchantName = data["CertMerchantName"].ToString(); //商户名称
  111. // string CertLegalPerson = data["CertLegalPerson"].ToString(); //法人姓名
  112. // string IdCardCopy = data["IdCardCopy"].ToString(); //身份证人像面照片
  113. // string IdCardNational = data["IdCardNational"].ToString(); //身份证国徽面照片
  114. // string IdCardName = data["IdCardName"].ToString(); //身份证姓名
  115. // string IdCardNumber = data["IdCardNumber"].ToString(); //身份证号码
  116. // string IdCardAddress = data["IdCardAddress"].ToString(); //身份证号码
  117. // string CardPeriodBeginString = data["CardPeriodBegin"].ToString();
  118. // if (string.IsNullOrEmpty(CardPeriodBeginString))
  119. // {
  120. // CardPeriodBeginString = "1900-01-01";
  121. // }
  122. // DateTime CardPeriodBegin = DateTime.Parse(CardPeriodBeginString); //身份证有效期开始时间
  123. // string CardPeriodEndString = data["CardPeriodEnd"].ToString();
  124. // if (string.IsNullOrEmpty(CardPeriodEndString))
  125. // {
  126. // CardPeriodEndString = "1900-01-01";
  127. // }
  128. // DateTime CardPeriodEnd = DateTime.Parse(CardPeriodEndString); //身份证有效期结束时间
  129. // string ServicePhone = data["ServicePhone"].ToString(); //客服电话
  130. // string BizStoreName = data["BizStoreName"].ToString(); //门店名称
  131. // string BizAddressCode = data["BizAddressCode"].ToString(); //门店省市编码
  132. // string BizStoreAddress = data["BizStoreAddress"].ToString(); //门店地址
  133. // string StoreEntrancePic = data["StoreEntrancePic"].ToString(); //门店门头照片
  134. // string IndoorPic = data["IndoorPic"].ToString(); //店内环境照片
  135. // string QualificationType = data["QualificationType"].ToString(); //所属行业
  136. // string SettlementId = data["SettlementId"].ToString(); //入驻结算规则ID
  137. // string AlipayMccCode = "";
  138. // if (!string.IsNullOrEmpty(SettlementId))
  139. // {
  140. // AlipayMccCode = SettlementId.Substring(SettlementId.IndexOf("_") + 1);
  141. // SettlementId = SettlementId.Substring(0, SettlementId.IndexOf("_"));
  142. // }
  143. // string AlipayAccount = data["AlipayAccount"].ToString(); //支付宝账号
  144. // string BankAccountType = data["BankAccountType"].ToString(); //账户类型 1 对私 0 对公
  145. // string AccountName = data["AccountName"].ToString(); //开户名称
  146. // string AccountBank = data["AccountBank"].ToString(); //开户银行
  147. // string BankAddressCode = data["BankAddressCode"].ToString(); //开户银行省市编码
  148. // string MerchantShortname = data["MerchantShortname"].ToString();
  149. // string BankName = data["BankName"].ToString(); //开户银行全称
  150. // string AccountNumber = data["AccountNumber"].ToString(); //银行账号
  151. // string Qualifications = data["Qualifications"].ToString(); //特殊资质图
  152. // //new add parameters:
  153. // string PeriodBegin = data["PeriodBegin"].ToString();//营业执照有效开始时间
  154. // string PeriodEnd = data["PeriodEnd"].ToString();//营业执照有效结束时间
  155. // string ChannelKind = data["ChannelKind"].ToString(); //商户类型 有执照填000002无执照填000001
  156. // string BusinessId = data["BusinessId"].ToString(); //经营范围 参考经营范围表
  157. // string OpenAccountLicenses = data["OpenAccountLicenses"].ToString(); //开户许可证(对公凭证)
  158. // // string RentAgreement = data["RentAgreement"].ToString(); //租赁协议
  159. // // string OperatorMcht = data["OperatorMcht"].ToString(); //盒伙人商户合影
  160. // // string AgentProtocol = data["AgentProtocol"].ToString(); //委托结算协议
  161. // // string SignaturePicture = data["SignaturePicture"].ToString(); //商户签名图片
  162. // // string Support = data["Support"].ToString(); //辅助照片
  163. // string CheckstandImg = data["CheckstandImg"].ToString(); //收银台
  164. // // string ProductImg = data["ProductImg"].ToString(); //商品照片
  165. // // string Agreement = data["Agreement"].ToString(); //合同签名
  166. // // string TaxImage = data["TaxImage"].ToString(); //税务登记证
  167. // // string OrganizationCopy = data["OrganizationCopy"].ToString(); //组织机构证照片
  168. // string IndustryLicense1 = data["IndustryLicense1"].ToString(); //行业许可证
  169. // // string FaceRecognition = data["FaceRecognition"].ToString(); //正面人像图片
  170. // string Extra1 = data["Extra1"].ToString(); //补充资料
  171. // string BankCard = data["BankCard"].ToString(); //银行卡照片
  172. // string PersonWithIdCard = data["PersonWithIdCard"].ToString(); //手持身份证
  173. // // string TakeCreditCard = data["TakeCreditCard"].ToString(); //拍卡
  174. // string MchtNo = data["MchtNo"].ToString(); //收款商户号
  175. int Finish = int.Parse(function.CheckInt(data.getItem("Finish").ToString()));
  176. int UserId = int.Parse(function.CheckInt(data.getItem("UserId").ToString()));
  177. int MerchantAddInfoId = int.Parse(function.CheckInt(data.getItem("Id").ToString()));
  178. string BankBranchId = "";
  179. if (Finish == 1)
  180. {
  181. var openBank = OpenBankTableService.Query(" BankName='" + BankName + "'");
  182. if (openBank == null)
  183. {
  184. return new AppResultJson() { Status = "-1", Info = "开户银行全称不正确" };
  185. }
  186. BankBranchId = openBank.BankCode;
  187. }
  188. Dictionary<string, object> Obj = new Dictionary<string, object>();
  189. Dictionary<string, object> Fields = new Dictionary<string, object>();
  190. if (MerchantAddInfoId == 0)
  191. {
  192. if (SubjectType == "SUBJECT_TYPE_SMALL")
  193. {
  194. // CertMerchantName += function.MD5_16(Guid.NewGuid().ToString("N"));
  195. var check = MerchantAddInfoService.Query(" CertMerchantName like '" + CertMerchantName + "%' and Status<1 and QueryCount<1 and BrandId=" + BrandId);
  196. if (check.Id > 0)
  197. {
  198. return new AppResultJson() { Status = "-1", Info = "该商户已暂存或进件,勿重复进件!", Data = Obj };
  199. }
  200. CertMerchantName += function.get_Random(00000000, 99999999);
  201. }
  202. else
  203. {
  204. var query = MerchantAddInfoService.Query(" CertMerchantName='" + CertMerchantName + "' and BrandId=" + BrandId);
  205. if (query.Id == 0)
  206. {
  207. Dictionary<string, object> Fiel = new Dictionary<string, object>();
  208. Fiel.Add("CertMerchantName", CertMerchantName);
  209. Fields.Add("MchtNo", MchtNo); // 收款商户号
  210. MerchantAddInfoId = (int)MerchantAddInfoService.Add(Fiel, false).Data;
  211. Fiel = new Dictionary<string, object>();
  212. Fiel.Add("Id", MerchantAddInfoId);
  213. Fiel.Add("UserId", UserId);
  214. Fiel.Add("Name", CertMerchantName);
  215. MerchantInfoService.Add(Fiel, false);
  216. }
  217. else
  218. {
  219. return new AppResultJson() { Status = "-1", Info = "该商户已进件", Data = Obj };
  220. }
  221. }
  222. }
  223. else
  224. {
  225. if (SubjectType == "SUBJECT_TYPE_SMALL")
  226. {
  227. CertMerchantName = MerchantInfoService.Query(MerchantAddInfoId).Name;
  228. }
  229. else
  230. {
  231. Fields.Add("CertMerchantName", CertMerchantName);
  232. }
  233. }
  234. // var ActivitiesId = "20191030111cff5b5e";
  235. // var ActivitiesRate = "0.38";
  236. // MerchantAddInfoUtil.EditMerchantAddInfo(query.Id, ContactName, ContactIdNumber, MobilePhone, ContactEmail, SubjectType, LicenseCopy, LicenseNumber, CertLegalPerson, CertMerchantName, CertLegalPerson, ServicePhone, BizStoreName, BizAddressCode, BizStoreAddress, StoreEntrancePic, IndoorPic, QualificationType, SettlementId, BankAccountType, AccountName, AccountBank, BankAddressCode, BankName, BankBranchId, AccountNumber, IdCardCopy, IdCardNational, IdCardName, IdCardNumber, IdCardAddress, CardPeriodBegin, CardPeriodEnd, MerchantShortname, Qualifications, ActivitiesId, ActivitiesRate, AlipayAccount, AlipayMccCode, ChannelKind, SalesScenesType, OpenAccountLicenses, RentAgreement, OperatorMcht, AgentProtocol, SignaturePicture, Support, CheckstandImg, ProductImg, Agreement, TaxImage, OrganizationCopy, IndustryLicense1, FaceRecognition, Extra1, BankCard, PersonWithIdCard, TakeCreditCard, MchtNo);
  237. Fields.Add("LicenseCopy", LicenseCopy); //- 营业执照
  238. if (!Fields.ContainsKey("CertMerchantName")) Fields.Add("CertMerchantName", CertMerchantName); //- 商户名称
  239. Fields.Add("LicenseNumber", LicenseNumber); //- 商户信用代码
  240. Fields.Add("SubjectType", SubjectType); //- 主体类型
  241. var LicenceType = "";
  242. int BindStatus = 0;
  243. if (SubjectType == "SUBJECT_TYPE_ENTERPRISE")
  244. {
  245. LicenceType = "0";
  246. BindStatus = 2;
  247. } //- 企业公司
  248. if (SubjectType == "SUBJECT_TYPE_INDIVIDUAL")
  249. {
  250. LicenceType = "1";
  251. BindStatus = 1;
  252. } //- 个体工商户
  253. if (SubjectType == "SUBJECT_TYPE_SMALL") BindStatus = 3; //- 小微
  254. Fields.Add("LicenceType", LicenceType); //- 主体类型
  255. Fields.Add("MerchantShortname", MerchantShortname); //- 用户名称简写
  256. Fields.Add("ServicePhone", ServicePhone); //- 商户电话
  257. Fields.Add("QualificationType", SalesScenesType); //- 所属行业
  258. Fields.Add("SalesScenesType", SalesScenesTypeName); //- 所属行业
  259. Fields.Add("BusinessId", SalesScenesType); //- 所属行业Id
  260. Fields.Add("BizStoreName", BizStoreName); //- 门店名称
  261. Fields.Add("BizAddressCode", BizAddressCode); //- 门店区域
  262. Fields.Add("AreaNo", HaoDaAreaCodeService.Query("CityName like '%" + BizAddressCode + "%'").CityCode); //- 经营地区区域码
  263. Fields.Add("BizStoreAddress", BizStoreAddress); //- 门店地址
  264. Fields.Add("IdCardCopy", IdCardCopy); //- 身份证正面
  265. Fields.Add("IdCardNational", IdCardNational); //- 身份证反面
  266. Fields.Add("CertLegalPerson", CertLegalPerson); //- 真实姓名
  267. Fields.Add("IdCardNumber", IdCardNumber); //- 身份证号码
  268. Fields.Add("CardPeriodBegin", DateTime.Parse(CardPeriodBegin)); //- 身份证有效期开始
  269. Fields.Add("CardPeriodEnd", DateTime.Parse(CardPeriodEnd)); //- 身份证有效期结束
  270. Fields.Add("PeriodBegin", DateTime.Parse(PeriodBegin)); //- 营业执照有效期开始
  271. Fields.Add("PeriodEnd", DateTime.Parse(PeriodEnd)); //- 营业执照有效期结束
  272. Fields.Add("IdCardAddress", IdCardAddress); //身份证居住地址
  273. Fields.Add("MobilePhone", MobilePhone); //- 手机号码
  274. Fields.Add("AccountName", AccountName); //- 开户名称
  275. Fields.Add("ChannelKind", ChannelKind); // 商户类型
  276. Fields.Add("BankAccountType", BankAccountType); //- 账户类型
  277. var AccountType = "";
  278. if (BankAccountType == "BANK_ACCOUNT_TYPE_CORPORATE") AccountType = "0"; //- 对公
  279. if (BankAccountType == "BANK_ACCOUNT_TYPE_PERSONAL") AccountType = "1"; //- 对私
  280. Fields.Add("AccountType", AccountType); //- 账户类型
  281. Fields.Add("AccountNumber", AccountNumber); //- 银行卡号
  282. Fields.Add("AccountBank", AccountBank); //- 开户行
  283. Fields.Add("BankCard", BankCard); // 银行卡照片
  284. Fields.Add("openAccountLicenses", OpenAccountLicenses); // 开户许可证
  285. Fields.Add("BankName", BankName); //- 开户行全称
  286. //TODO:待修改
  287. Fields.Add("OpenBankAccout", OpenBankAccout); //- 开户许可证-银行卡号 企业商户必填(个体工商户对私不填)
  288. Fields.Add("OpenBankAccName", OpenBankAccName); //- 开户许可证-开户名 企业商户必填(个体工商户对私不填)
  289. //TODO:待修改
  290. var bankInfo = OpenBankAllService.Query(" BankChild='" + BankName + "'");
  291. var kbankInfo = OpenBankAllService.Query(" BankChild='" + OpenBankName + "'");
  292. Fields.Add("OpenUnionNo", kbankInfo.BankChildNo); //- 开户许可证-开户支行 企业商户必填(个体工商户对私不填)
  293. //TODO:待修改
  294. Fields.Add("OpenCollectBankCode", kbankInfo.BankParentNo); //- 开户许可证-银行代码(总行行号) 企业商户必填(个体工商户对私不填)
  295. //TODO:待修改
  296. Fields.Add("OpenBankRegionCode", HaoDaAreaCodeService.Query("CityName like '%" + OpenBankRegionCode + "%'").CityCode); //- 开户银行支行区域码 参考区域码表(联系对接人提供)
  297. Fields.Add("ZBankNo", bankInfo.BankChildNo); //- 开户银行支行号 参考支行号表(联系对接人提供)
  298. Fields.Add("BankAddressCode", BankAddressCode); //- 开户地区
  299. Fields.Add("ZbankRegionCode", HaoDaAreaCodeService.Query("CityName like '%" + BankAddressCode + "%'").CityCode); //- 开户地区
  300. Fields.Add("PersonWithIdCard", PersonWithIdCard); //- 手持身份证照片(小微)
  301. Fields.Add("StoreEntrancePic", StoreEntrancePic); // 门头照片组
  302. Fields.Add("IndoorPic", IndoorPic); // 环境照片组
  303. Fields.Add("checkstandImg", CheckstandImg); // 收银照片组
  304. Fields.Add("extra1", Extra1); // 补充资料照片组
  305. Fields.Add("industryLicense1", IndustryLicense1); //- 特殊资质照片组
  306. Fields.Add("ResserveMobile", ResserveMobile); //银行预留手机号
  307. Fields.Add("PlaceType", PlaceType); // 小微商户经营场所类型(0 固定场所 1 流动动摊贩)
  308. Fields.Add("BrandId", BrandId); // 品牌(0 银联 1 好哒)
  309. MerchantAddInfoId = (int)MerchantInfoUtil.EditMerchantInfo(MerchantAddInfoId, UserId, CertMerchantName, MobilePhone, BizAddressCode, BizStoreAddress, BindStatus, BrandId).Data;
  310. MerchantAddInfoUtil.EditMerchantAddInfo(Fields, MerchantAddInfoId);
  311. if (Finish == 1)
  312. {
  313. Dictionary<string, object> Fiel = new Dictionary<string, object>();
  314. Fiel.Add("Sort", 1);
  315. MerchantInfoService.Edit(Fiel, MerchantAddInfoId, false);
  316. // 如果提交完整资料,则发送到BsServer执行进件操作
  317. RedisDbconn.Instance.AddList("MerchantConfirmHdQueue", "{\"MerchantId\":\"" + MerchantAddInfoId + "\"}");
  318. }
  319. else
  320. {
  321. Dictionary<string, object> Fiel = new Dictionary<string, object>();
  322. Fiel.Add("Sort", 0);
  323. MerchantInfoService.Edit(Fiel, MerchantAddInfoId, false);
  324. }
  325. Obj.Add("Id", MerchantAddInfoId); //Id
  326. return new AppResultJson() { Status = "1", Info = "", Data = Obj };
  327. }
  328. #endregion
  329. #region 创客-首页-商户进件详情
  330. // [Authorize]
  331. public JsonResult Detail(string value)
  332. {
  333. value = DesDecrypt(value);
  334. JsonData data = JsonMapper.ToObject(value);
  335. Dictionary<string, object> Obj = DetailDo(value);
  336. return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
  337. }
  338. public Dictionary<string, object> DetailDo(string value)
  339. {
  340. JsonData data = JsonMapper.ToObject(value);
  341. int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
  342. return MerchantAddInfoUtil.MerchantAddInfoDetail(Id);
  343. }
  344. #endregion
  345. #region 创客-首页-经营范围
  346. // [Authorize]
  347. public JsonResult BusinessScope(string value)
  348. {
  349. value = DesDecrypt(value);
  350. JsonData data = JsonMapper.ToObject(value);
  351. List<Dictionary<string, object>> dataList = BusinessScopeDo(value);
  352. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  353. }
  354. public List<Dictionary<string, object>> BusinessScopeDo(string value)
  355. {
  356. JsonData data = JsonMapper.ToObject(value);
  357. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  358. List<RelationData> relationData = new List<RelationData>();
  359. List<Dictionary<string, object>> listf = BusinessScopeTypeService.List(relationData, "", 1, 99999);
  360. foreach (Dictionary<string, object> dicf in listf)
  361. {
  362. Dictionary<string, object> item = new Dictionary<string, object>();
  363. item.Add("value", dicf["Id"].ToString());
  364. item.Add("text", dicf["KindName"].ToString());
  365. List<Dictionary<string, object>> sublist = new List<Dictionary<string, object>>();
  366. List<Dictionary<string, object>> lists = BusinessScopeService.List(relationData, " and KindId='" + dicf["Id"].ToString() + "'", 1, 99999);
  367. foreach (Dictionary<string, object> dics in lists)
  368. {
  369. Dictionary<string, object> subitem = new Dictionary<string, object>();
  370. subitem.Add("value", dics["Id"].ToString());
  371. subitem.Add("text", dics["Name"].ToString());
  372. sublist.Add(subitem);
  373. }
  374. item.Add("children", sublist);
  375. dataList.Add(item);
  376. }
  377. return dataList;
  378. }
  379. #endregion
  380. #region 创客-首页-进件选项接口
  381. // [Authorize]
  382. public JsonResult Options(string value)
  383. {
  384. value = DesDecrypt(value);
  385. JsonData data = JsonMapper.ToObject(value);
  386. List<Dictionary<string, object>> dataList = OptionsDo(value);
  387. return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
  388. }
  389. public List<Dictionary<string, object>> OptionsDo(string value)
  390. {
  391. JsonData data = JsonMapper.ToObject(value);
  392. string Kind = data["Kind"].ToString(); //分类
  393. int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
  394. int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
  395. List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
  396. // if (Kind == "2")
  397. // {
  398. // dataList = GetPersonSettles();
  399. // }
  400. // else if (Kind == "21")
  401. // {
  402. // dataList = GetBusinessSettles();
  403. // }
  404. // if (!string.IsNullOrEmpty(Kind))
  405. if (Kind == "2" || Kind == "21")
  406. {
  407. Dictionary<string, object> item = new Dictionary<string, object>();
  408. var first = maindb.BusinessScopeType.OrderBy(m => m.Id).ToList();
  409. foreach (var itemf in first)
  410. {
  411. item.Add("Id", itemf.Id);
  412. item.Add("Name", itemf.KindName);
  413. var second = maindb.BusinessScope.Where(m => m.KindId == itemf.Id).OrderBy(m => m.Id).ToList();
  414. List<Dictionary<string, object>> sublist = new List<Dictionary<string, object>>();
  415. foreach (var items in second)
  416. {
  417. Dictionary<string, object> subitem = new Dictionary<string, object>();
  418. subitem.Add("Id", items.Id);
  419. subitem.Add("Name", items.Name);
  420. sublist.Add(subitem);
  421. }
  422. item.Add("Children", sublist);
  423. dataList.Add(item);
  424. }
  425. }
  426. else
  427. {
  428. Dictionary<string, string> query = new Dictionary<string, string>();
  429. if (Kind == "1")
  430. {
  431. query = MerchantAddInfoUtil.GetSubjects();
  432. }
  433. else if (Kind == "3")
  434. {
  435. query = MerchantAddInfoUtil.GetAccountTypes();
  436. }
  437. else if (Kind == "4")
  438. {
  439. query = GetBanks();
  440. }
  441. foreach (string key in query.Keys)
  442. {
  443. Dictionary<string, object> curData = new Dictionary<string, object>();
  444. curData.Add("text", query[key]); //文本
  445. curData.Add("value", key); //值
  446. dataList.Add(curData);
  447. }
  448. }
  449. return dataList;
  450. }
  451. public List<SettleData> GetSettles(string Kind)
  452. {
  453. if (Kind == "SUBJECT_TYPE_INDIVIDUAL")
  454. {
  455. return GetPersonSettleItems();
  456. }
  457. return GetBusinessSettleItems();
  458. }
  459. public List<SettleData> GetPersonSettleItems()
  460. {
  461. List<SettleData> dic = new List<SettleData>();
  462. dic.Add(new SettleData() { ptext = "食品生鲜", text = "肉、禽、蛋及水产品等", value = "719", code = "A0002_B0202" });
  463. dic.Add(new SettleData() { ptext = "健身运动服务", text = "健身房", value = "719", code = "A0004_B0064" });
  464. dic.Add(new SettleData() { ptext = "健身运动服务", text = "体育场馆", value = "719", code = "A0004_B0068" });
  465. dic.Add(new SettleData() { ptext = "居民生活服务", text = "公共交通", value = "719", code = "A0006_B0088" });
  466. dic.Add(new SettleData() { ptext = "景区/酒店", text = "旅行住宿", value = "719", code = "A0010_B0157" });
  467. dic.Add(new SettleData() { ptext = "居民生活服务", text = "生活服务", value = "719", code = "A0003_B0116" });
  468. dic.Add(new SettleData() { ptext = "零售", text = "百货商城", value = "719", code = "A0002_B0017" });
  469. dic.Add(new SettleData() { ptext = "服饰鞋包", text = "服饰鞋包", value = "719", code = "A0002_B0026" });
  470. dic.Add(new SettleData() { ptext = "零售", text = "家居家纺建材", value = "719", code = "A0002_B0216" });
  471. dic.Add(new SettleData() { ptext = "零售", text = "母婴玩具", value = "719", code = "A0002_B0032" });
  472. dic.Add(new SettleData() { ptext = "零售", text = "数码家电", value = "719", code = "A0003_B0051" });
  473. dic.Add(new SettleData() { ptext = "零售", text = "图书音像", value = "719", code = "A0002_B0031" });
  474. dic.Add(new SettleData() { ptext = "居民生活服务", text = "文化玩乐宠物", value = "719", code = "A0004_B0070" });
  475. dic.Add(new SettleData() { ptext = "咨询/娱乐票务", text = "娱乐票务", value = "719", code = "A0004_B0065" });
  476. dic.Add(new SettleData() { ptext = "零售", text = "办公用品", value = "719", code = "A0002_B0203" });
  477. dic.Add(new SettleData() { ptext = "零售", text = "工业产品", value = "719", code = "A0002_B0042" });
  478. dic.Add(new SettleData() { ptext = "咨询/娱乐票务", text = "专业咨询", value = "719", code = "A0008_B0139" });
  479. dic.Add(new SettleData() { ptext = "其他", text = "其他类别", value = "716", code = "A0002_B0043" });
  480. // dic.Add(new SettleData() { ptext = "餐饮", text = "餐饮", code = "C_C05_5814", value = "719", special = 0});
  481. // dic.Add(new SettleData() { ptext = "食品生鲜", text = "酒类", code = "C_C05_5921", value = "719", special = 1});
  482. // dic.Add(new SettleData() { ptext = "食品生鲜", text = "肉、禽、蛋及水产品等", code = "C_C05_5422", value = "719", special = 0});
  483. // dic.Add(new SettleData() { ptext = "私立/民营医院/诊所", text = "医疗服务", code = "P_P01_8011", value = "719", special = 1});
  484. // dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "药品、药品经营者(批发商)", code = "B_B04_5122", value = "719", special = 1});
  485. // dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "医疗器械", code = "B_B04_5047", value = "719", special = 1});
  486. // dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "游艺厅/KTV", code = "D_D01_7999", value = "719", special = 1});
  487. // dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "网吧", code = "D_D01_7999", value = "719", special = 1});
  488. // dic.Add(new SettleData() { ptext = "宠物医院", text = "宠物及宠物用品", code = "C_C10_5995", value = "719", special = 1});
  489. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "公共交通", code = "A_A01_4121", value = "719", special = 0});
  490. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "旅行住宿", code = "A_A04_7011", value = "719", special = 0});
  491. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "公共仓储、集装整理", code = "A_A02_4225", value = "719", special = 0});
  492. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "商业服务", code = "S_S05_7338", value = "719", special = 0});
  493. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "汽车租赁和服务", code = "S_S10_7512", value = "719", special = 0});
  494. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "生活服务", code = "S_S08_7295", value = "719", special = 0});
  495. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "百货商城", code = "C_C04_5411", value = "719", special = 0});
  496. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "服饰鞋包", code = "C_C06_5699", value = "719", special = 0});
  497. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "家居家纺建材", code = "C_C03_5211", value = "719", special = 0});
  498. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "母婴玩具", code = "C_C02_5641", value = "719", special = 0});
  499. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "数码家电", code = "C_C07_5732", value = "719", special = 0});
  500. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "图书音像", code = "C_C09_5942", value = "719", special = 0});
  501. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "文化玩乐宠物", code = "C_C10_5995", value = "719", special = 0});
  502. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "彩票", code = "D_D03_7995", value = "719", special = 0});
  503. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "娱乐票务", code = "D_D01_7999", value = "719", special = 0});
  504. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "法律咨询和律师事务所", code = "P_P04_8111", value = "719", special = 1});
  505. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "办公用品", code = "B_B01_5943", value = "719", special = 0});
  506. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "工业产品", code = "B_B02_5065", value = "719", special = 0});
  507. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "汽车和运输工具", code = "B_B03_5599", value = "719", special = 0});
  508. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/其他", text = "专业咨询", code = "P_P04_8999", value = "719", special = 0});
  509. // dic.Add(new SettleData() { ptext = "话费通讯", text = "话费充值与缴费", code = "D_D04_4815", value = "720", special = 1});
  510. // dic.Add(new SettleData() { ptext = "加油", text = "加油站、服务站", code = "B_B03_5541", value = "721", special = 1});
  511. return dic;
  512. }
  513. public List<Dictionary<string, object>> GetPersonSettles()
  514. {
  515. List<SettleData> dic = GetPersonSettleItems();
  516. int i = 0;
  517. List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
  518. foreach (string sub in dic.Select(m => m.ptext).Distinct().ToList())
  519. {
  520. i += 1;
  521. Dictionary<string, object> bigDic = new Dictionary<string, object>();
  522. bigDic.Add("value", i.ToString());
  523. bigDic.Add("text", sub);
  524. List<Dictionary<string, object>> children = new List<Dictionary<string, object>>();
  525. foreach (SettleData ssub in dic.Where(m => m.ptext == sub).ToList())
  526. {
  527. Dictionary<string, object> smallDic = new Dictionary<string, object>();
  528. smallDic.Add("value", ssub.value + "_" + ssub.code);
  529. smallDic.Add("text", ssub.text);
  530. smallDic.Add("special", ssub.special);
  531. children.Add(smallDic);
  532. }
  533. bigDic.Add("children", children);
  534. list.Add(bigDic);
  535. }
  536. return list;
  537. }
  538. public List<SettleData> GetBusinessSettleItems()
  539. {
  540. List<SettleData> dic = new List<SettleData>();
  541. dic.Add(new SettleData() { ptext = "餐饮", text = "餐饮", value = "716", code = "A0001_B0001" });
  542. dic.Add(new SettleData() { ptext = "食品生鲜", text = "肉、禽、蛋及水产品等", value = "716", code = "A0002_B0202" });
  543. dic.Add(new SettleData() { ptext = "健身运动服务", text = "健身房", value = "716", code = "A0004_B0064" });
  544. dic.Add(new SettleData() { ptext = "健身运动服务", text = "体育场馆", value = "716", code = "A0004_B0068" });
  545. dic.Add(new SettleData() { ptext = "城市公共交通", text = "公共交通", value = "716", code = "A0006_B0088" });
  546. dic.Add(new SettleData() { ptext = "景区/酒店", text = "旅行住宿", value = "716", code = "A0010_B0157" });
  547. dic.Add(new SettleData() { ptext = "居民生活服务", text = "生活服务", value = "716", code = "A0003_B0116" });
  548. dic.Add(new SettleData() { ptext = "零售", text = "百货商城", value = "716", code = "A0002_B0017" });
  549. dic.Add(new SettleData() { ptext = "服饰鞋包", text = "服饰鞋包", value = "716", code = "A0002_B0026" });
  550. dic.Add(new SettleData() { ptext = "零售", text = "家居家纺建材", value = "716", code = "A0002_B0216" });
  551. dic.Add(new SettleData() { ptext = "零售", text = "母婴玩具", value = "716", code = "A0002_B0032" });
  552. dic.Add(new SettleData() { ptext = "零售", text = "数码家电", value = "716", code = "A0003_B0051" });
  553. dic.Add(new SettleData() { ptext = "零售", text = "图书音像", value = "716", code = "A0002_B0031" });
  554. dic.Add(new SettleData() { ptext = "居民生活服务", text = "文化玩乐宠物", value = "716", code = "A0004_B0070" });
  555. dic.Add(new SettleData() { ptext = "咨询/娱乐票务", text = "娱乐票务", value = "716", code = "A0004_B0065" });
  556. dic.Add(new SettleData() { ptext = "零售", text = "办公用品", value = "716", code = "A0002_B0203" });
  557. dic.Add(new SettleData() { ptext = "零售", text = "工业产品", value = "716", code = "A0002_B0042" });
  558. dic.Add(new SettleData() { ptext = "婚介平台/就业信息平台/其他信息服务平台", text = "婚介服务", value = "720", code = "A0003_B0053" });
  559. dic.Add(new SettleData() { ptext = "零售", text = "其它类别", value = "716", code = "A0002_B0043" });
  560. // dic.Add(new SettleData() { ptext = "餐饮", text = "餐饮", code = "C_C05_5814", value = "716", special = 0});
  561. // dic.Add(new SettleData() { ptext = "电商平台", text = "电商平台", code = "C_C05_5814", value = "716", special = 0});
  562. // dic.Add(new SettleData() { ptext = "食品生鲜", text = "酒类", code = "C_C05_5921", value = "716", special = 1});
  563. // dic.Add(new SettleData() { ptext = "食品生鲜", text = "肉、禽、蛋及水产品等", code = "C_C05_5422", value = "716", special = 0});
  564. // dic.Add(new SettleData() { ptext = "电信运营商/宽带收费", text = "电信通讯", code = "D_D04_4814", value = "716", special = 1});
  565. // dic.Add(new SettleData() { ptext = "私立/民营医院/诊所", text = "医疗服务", code = "P_P01_8011", value = "716", special = 1});
  566. // dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "医疗器械", code = "B_B04_5047", value = "716", special = 1});
  567. // dic.Add(new SettleData() { ptext = "保健器械/医疗器械/非处方药品", text = "药品、药品经营者(批发商)", code = "B_B04_5122", value = "716", special = 1});
  568. // dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "游艺厅/KTV", code = "D_D01_7999", value = "716", special = 1});
  569. // dic.Add(new SettleData() { ptext = "游艺厅/KTV/网吧", text = "网吧", code = "D_D01_7999", value = "716", special = 1});
  570. // dic.Add(new SettleData() { ptext = "宠物医院", text = "宠物及宠物用品", code = "C_C10_5995", value = "716", special = 1});
  571. // dic.Add(new SettleData() { ptext = "旅行社", text = "旅行社和旅游服务", code = "A_A04_4722", value = "716", special = 1});
  572. // dic.Add(new SettleData() { ptext = "宗教组织", text = "宗教物品", code = "C_C10_5973", value = "716", special = 0});
  573. // dic.Add(new SettleData() { ptext = "宗教组织", text = "其他宗教服务", code = "P_P04_8999", value = "716", special = 1});
  574. // dic.Add(new SettleData() { ptext = "文物经营/文物复制品销售", text = "文物经营/文物复制品销售", code = "C_C10_5971", value = "716", special = 1});
  575. // dic.Add(new SettleData() { ptext = "拍卖典当", text = "典当行", code = "S_S04_5933", value = "716", special = 1});
  576. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "公共交通", code = "A_A01_4121", value = "716", special = 0});
  577. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "旅行住宿", code = "A_A04_7011", value = "716", special = 0});
  578. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "公共仓储、集装整理", code = "A_A02_4225", value = "716", special = 0});
  579. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "商业服务", code = "S_S05_7338", value = "716", special = 0});
  580. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "汽车租赁和服务", code = "S_S10_7512", value = "716", special = 0});
  581. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "生活服务", code = "S_S08_7295", value = "716", special = 0});
  582. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "百货商城", code = "C_C04_5411", value = "716", special = 0});
  583. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "服饰鞋包", code = "C_C06_5699", value = "716", special = 0});
  584. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "家居家纺建材", code = "C_C03_5211", value = "716", special = 0});
  585. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "母婴玩具", code = "C_C02_5641", value = "716", special = 0});
  586. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "数码家电", code = "C_C07_5732", value = "716", special = 0});
  587. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "图书音像", code = "C_C09_5942", value = "716", special = 0});
  588. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "文化玩乐宠物", code = "C_C10_5995", value = "716", special = 0});
  589. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "彩票", code = "D_D03_7995", value = "716", special = 0});
  590. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "娱乐票务", code = "D_D01_7999", value = "716", special = 0});
  591. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "法律咨询和律师事务所", code = "P_P04_8111", value = "716", special = 1});
  592. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "办公用品", code = "B_B01_5943", value = "716", special = 0});
  593. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "工业产品", code = "B_B02_5065", value = "716", special = 0});
  594. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "汽车和运输工具", code = "B_B03_5599", value = "716", special = 0});
  595. // dic.Add(new SettleData() { ptext = "零售批发/生活娱乐/网上商城/其他", text = "专业咨询", code = "P_P04_8999", value = "716", special = 0});
  596. // dic.Add(new SettleData() { ptext = "话费通讯", text = "话费充值与缴费", code = "D_D04_4815", value = "728", special = 1});
  597. // dic.Add(new SettleData() { ptext = "婚介平台/就业信息平台/其他", text = "婚介服务", code = "S_S08_7273", value = "728", special = 0});
  598. // dic.Add(new SettleData() { ptext = "门户论坛/网络广告及推广/软件开发/其他互联网服务", text = "计算机服务/其他", code = "D_D05_7372", value = "711", special = 0});
  599. // dic.Add(new SettleData() { ptext = "快递", text = "快递服务", code = "A_A02_4215", value = "717", special = 1});
  600. // dic.Add(new SettleData() { ptext = "加油", text = "加油站、服务站", code = "B_B03_5541", value = "717", special = 1});
  601. // dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业(电、气、水)", code = "S_S06_4900", value = "730", special = 1});
  602. // dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业-电力缴费", code = "S_S06_4901", value = "730", special = 1});
  603. // dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业-煤气缴费", code = "S_S06_4902", value = "730", special = 1});
  604. // dic.Add(new SettleData() { ptext = "公共事业(水电煤气)", text = "公共事业-自来水缴费", code = "S_S06_4903", value = "730", special = 1});
  605. return dic;
  606. }
  607. public List<Dictionary<string, object>> GetBusinessSettles()
  608. {
  609. List<SettleData> dic = GetBusinessSettleItems();
  610. int i = 0;
  611. List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
  612. foreach (string sub in dic.Select(m => m.ptext).Distinct().ToList())
  613. {
  614. i += 1;
  615. Dictionary<string, object> bigDic = new Dictionary<string, object>();
  616. bigDic.Add("value", i.ToString());
  617. bigDic.Add("text", sub);
  618. List<Dictionary<string, object>> children = new List<Dictionary<string, object>>();
  619. foreach (SettleData ssub in dic.Where(m => m.ptext == sub).ToList())
  620. {
  621. Dictionary<string, object> smallDic = new Dictionary<string, object>();
  622. smallDic.Add("value", ssub.value + "_" + ssub.code);
  623. smallDic.Add("text", ssub.text);
  624. smallDic.Add("special", ssub.special);
  625. children.Add(smallDic);
  626. }
  627. bigDic.Add("children", children);
  628. list.Add(bigDic);
  629. }
  630. return list;
  631. }
  632. public Dictionary<string, string> GetBanks()
  633. {
  634. Dictionary<string, string> dic = new Dictionary<string, string>();
  635. dic.Add("工商银行", "工商银行");
  636. dic.Add("农业银行", "农业银行");
  637. dic.Add("邮储银行", "邮储银行");
  638. dic.Add("建设银行", "建设银行");
  639. dic.Add("招商银行", "招商银行");
  640. dic.Add("中国银行", "中国银行");
  641. dic.Add("交通银行", "交通银行");
  642. dic.Add("浦发银行", "浦发银行");
  643. dic.Add("广发银行", "广发银行");
  644. dic.Add("民生银行", "民生银行");
  645. dic.Add("平安银行", "平安银行");
  646. dic.Add("光大银行", "光大银行");
  647. dic.Add("兴业银行", "兴业银行");
  648. dic.Add("中信银行", "中信银行");
  649. dic.Add("上海银行", "上海银行");
  650. dic.Add("其他银行", "其他银行");
  651. return dic;
  652. }
  653. #endregion
  654. #region 检查签名是否合法,合法返回1,不合法返回提示信息
  655. /// <summary>
  656. /// 检查签名是否合法,合法返回1,不合法返回提示信息
  657. /// </summary>
  658. /// <param name="value">请求的参数(json字符串)</param>
  659. /// <param name="signField">要签名的字段</param>
  660. /// <returns></returns>
  661. private string CheckSign(string value, string[] signField)
  662. {
  663. JsonData json = JsonMapper.ToObject(value);
  664. Dictionary<string, string> dic = new Dictionary<string, string>();
  665. for (int i = 0; i < signField.Length; i++)
  666. {
  667. dic.Add(signField[i], json[signField[i]].ToString());
  668. }
  669. string sign = json["sign"].ToString(); //客户端签名字符串
  670. return new Sign().sign(dic, sign);
  671. }
  672. #endregion
  673. }
  674. }