123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.AspNetCore.Http;
- using Microsoft.Extensions.Logging;
- using Microsoft.Extensions.Options;
- using Microsoft.AspNetCore.Authorization;
- using LitJson;
- using Library;
- using MySystem.Models.Main;
- using MySystem.Service.Main;
- namespace MySystem.Areas.Api.Controllers.v1
- {
- [Area("Api")]
- [Route("Api/v1/[controller]/[action]")]
- public class OpenBankTableController : BaseController
- {
- public OpenBankTableController(IHttpContextAccessor accessor) : base(accessor)
- {
- }
- #region 创客-首页-开户行查询
-
- public JsonResult List(string value)
- {
- value = DesDecrypt(value);
- value = value.Replace("null", "\"\"");
- JsonData data = JsonMapper.ToObject(value);
- List<Dictionary<string, object>> dataList = ListDo(value);
- return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
- }
- public List<Dictionary<string, object>> ListDo(string value)
- {
- JsonData data = JsonMapper.ToObject(value);
- string SearchKey = data.getItem("SearchKey").ToString();
- int PageSize = int.Parse(function.CheckInt(data.getItem("PageSize").ToString()));
- int PageNum = int.Parse(function.CheckInt(data.getItem("PageNum").ToString()));
- string condition = "";
- if (value.Contains("\"Areas\""))
- {
- if (!string.IsNullOrEmpty(data["Areas"].ToString()))
- {
- string Areas = data["Areas"].ToString();
- if (Areas.Contains(","))
- {
- string[] AreasList = Areas.Split(',');
- if (AreasList.Length == 3)
- {
- string p = AreasList[0];
- string c = AreasList[1];
- string a = AreasList[2];
- condition += " and (BankChild like '%" + p + "%' or BankChild like '%" + c + "%' or BankChild like '%" + a + "%')";
- }
- else if (AreasList.Length == 2)
- {
- string p = AreasList[0];
- string c = AreasList[1];
- condition += " and (BankChild like '%" + p + "%' or BankChild like '%" + c + "%')";
- }
- else
- {
- condition += " and BankChild like '%" + Areas + "%'";
- }
- }
- else
- {
- condition += " and BankChild like '%" + Areas + "%'";
- }
- }
- }
-
-
-
-
-
-
-
-
- if (!string.IsNullOrEmpty(SearchKey))
- {
- condition += " and BankChild like '%" + SearchKey + "%'";
- }
- List<RelationData> relationData = new List<RelationData>();
- List<Dictionary<string, object>> list = OpenBankAllService.List(relationData, condition, PageNum, PageSize);
- foreach (Dictionary<string, object> dic in list)
- {
- dic["BankName"] = dic["BankChild"].ToString();
- dic["BankCode"] = dic["BankChildNo"].ToString();
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return list;
- }
- #endregion
- #region 检查签名是否合法,合法返回1,不合法返回提示信息
-
-
-
-
-
-
- private string CheckSign(string value, string[] signField)
- {
- JsonData json = JsonMapper.ToObject(value);
- Dictionary<string, string> dic = new Dictionary<string, string>();
- for (int i = 0; i < signField.Length; i++)
- {
- dic.Add(signField[i], json[signField[i]].ToString());
- }
- string sign = json["sign"].ToString();
- return new Sign().sign(dic, sign);
- }
- #endregion
- }
- }
|