MerchantAddInfoController.cs 38 KB

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