MerchantAddInfoController.cs 52 KB

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