123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Threading.Tasks;
- using CZFW.Core;
- using CZFW.Core.Security;
- using CZKJ.GBRS2.Model;
- using CZKJ.GBRS2.ViewModel;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Configuration;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using System.Reflection;
- using Microsoft.AspNetCore.Mvc.Filters;
- using Microsoft.AspNetCore.Http;
- using CZKJ.GBRS2.Interface;
- using System.Net;
- namespace CZKJ.GBRS2.WebMVC.Controllers
- {
- public class QueryController : Controller
- {
- ICustomerQuery _logic;
- public QueryController(ICustomerQuery logic)
- {
- _logic = logic;
- }
- public IActionResult HuaWeiToekn()
- {
- string str = _logic.GetHuaWeiToken("1010100005153469999").Result;
- HuaWeiDownLoadModel downLoadModel = JsonConvert.DeserializeObject<HuaWeiDownLoadModel>(str);
- if (downLoadModel.Code == 500)
- {
- return Content("该保单无法下载");
- }
- HttpWebRequest request;
- request = WebRequest.Create(downLoadModel.Data.v4TemporarySignatureResponse.signedUrl) as HttpWebRequest;
- request.Method = "GET";
-
- request.Accept = "*/*";
- request.Timeout = 15000;
- request.AllowAutoRedirect = false;
- var response = request.GetResponse();
- return File(response.GetResponseStream(), "application/x-jpg", "保单详情.jpg");
- }
- public IActionResult HuaWei()
- {
- string getToeknUrl = $"{ConfigHelper.GetValue<string>("HuaWei:Url")}/cloud/api/apply/token?appId={ConfigHelper.GetValue<string>("HuaWei:AppId")}&appKey={ConfigHelper.GetValue<string>("HuaWei:AppKey")}";
- var responseString = HttpHelper.HttpPostAsync(getToeknUrl).Result;
- return Content(responseString);
- }
- public IActionResult PolicyDetail(string contNo)
- {
- return View( _logic.QueryReprot(ConfigHelper.GetValue<string>("CoreQuery:ConNo")));
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public IActionResult Comprehensive(string ContNo)
- {
- SentParams para = new SentParams();
- TransData model = new TransData();
- model.ContentData = new ContentData { BusinessNo= "1010100005153469999", BusinessType="1",PrintType="1" };
- model.HeadData = new HeadData { REQ_APP_ID = "2", RESP_APP_ID = "1", ID = Utility.GetUnixTimeTick().ToString() , TRANS_ID = "QRY033", TRANS_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff", new CultureInfo("en-US")) };
- para.TransData = model;
- string sign = DesEncrypt.JavaMD5(JsonConvert.SerializeObject(para) + ConfigHelper.GetValue<string>("CoreQuery:Key"));
- string url = $"http://{ConfigHelper.GetValue<string>("CoreQuery:IP")}/officialWebsiteHttpServer?sign=" + sign;
- var res = HttpHelper.HttpPost2(url, JsonConvert.SerializeObject(para)).Result;
- return Content(res);
- }
- #region
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #endregion
- }
- }
|