MerchantAddInfoController.cs 56 KB

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