增加志愿填报兑换码
parent
10f98cf350
commit
68f2d3e466
|
|
@ -200,9 +200,12 @@ namespace New_College.Api.Controllers.Front
|
|||
{
|
||||
try
|
||||
{
|
||||
|
||||
await DistrFanc(request.SaleId, customerinfo.Id);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await DistrFanc(request.SaleId, customerinfo.Id);
|
||||
});
|
||||
newId = await updatesync(customerinfo.Phone);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -383,7 +386,11 @@ namespace New_College.Api.Controllers.Front
|
|||
{
|
||||
if (query.Score != customersingle.Expectedscore)
|
||||
{
|
||||
await _userSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 0, CustomerId = query.StudentId });//修改参数次数
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await _userSetting.UpdateSingleCustomerSetting(new UserBaseSettingUpdateDTO() { UType = 0, CustomerId = query.StudentId });//修改参数次数
|
||||
|
||||
});
|
||||
}
|
||||
var token = JwtHelper.IssueJwt(new TokenModelJwt() { Uid = result.Id, Role = "学生" });
|
||||
result.Token = token;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using New_College.Model.ViewModels;
|
||||
using New_College.Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Text.Json;
|
||||
using System.Xml.Linq;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace New_College.Api.Controllers
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 小鹅通
|
||||
/// </summary>
|
||||
[Route("api/front/[controller]/[action]")]
|
||||
[ApiController]
|
||||
public class XETongController : ControllerBase
|
||||
{
|
||||
|
||||
public XETongController()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 回调
|
||||
/// </summary>
|
||||
/// <param name="objreq"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<MessageModel<string>> hooks()
|
||||
{
|
||||
using (var reader = new StreamReader(Request.Body))
|
||||
{
|
||||
try
|
||||
{
|
||||
var builder = reader.ReadToEnd();
|
||||
if (string.IsNullOrEmpty(builder.ToString())) { return new MessageModel<string>() { response = "XML data is empty or not provided.", success = true, msg = "ok" }; }
|
||||
// 使用XDocument解析XML字符串
|
||||
XDocument xdoc = XDocument.Parse(builder.ToString());
|
||||
// 访问XML元素
|
||||
var encryptElement = xdoc.Root.Element("Encrypt");
|
||||
var encryptValue = encryptElement?.Value;
|
||||
var msgSignatureElement = xdoc.Root.Element("MsgSignature");
|
||||
var msgSignatureValue = msgSignatureElement?.Value;
|
||||
var timeStampElement = xdoc.Root.Element("TimeStamp");
|
||||
var timeStampValue = timeStampElement?.Value;
|
||||
var nonceElement = xdoc.Root.Element("Nonce");
|
||||
var nonceValue = nonceElement?.Value; // 这里可以根据需要处理解析后的数据,例如保存到数据库或进行其他业务逻辑处理
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return new MessageModel<string>()
|
||||
{
|
||||
msg = "ok",
|
||||
response = "ok",
|
||||
success = true,
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new MessageModel<string>()
|
||||
{
|
||||
response = ex.Message,
|
||||
msg = "ok"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,11 +14,13 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>..\New_College.Api\New_College.xml</DocumentationFile>
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
<Optimize>True</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DocumentationFile>..\New_College\New_College.xml</DocumentationFile>
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -109,6 +111,10 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Log\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1099,6 +1099,18 @@
|
|||
<param name="single"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:New_College.Api.Controllers.XETongController">
|
||||
<summary>
|
||||
小鹅通
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:New_College.Api.Controllers.XETongController.hooks">
|
||||
<summary>
|
||||
回调
|
||||
</summary>
|
||||
<param name="objreq"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:New_College.Api.Controllers.SysRegionController.#ctor(New_College.IServices.ISysRegionServices,New_College.IRepository.UnitOfWork.IUnitOfWork,AutoMapper.IMapper)">
|
||||
<summary>
|
||||
省市区操作类
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Reflection;
|
||||
using New_College.Model.ViewModels;
|
||||
|
||||
|
|
@ -91,6 +89,11 @@ namespace New_College
|
|||
ThridConfig.secretKey = Appsettings.app(new string[] { "ThridConfig", "secretKey" });
|
||||
ThridConfig.Url = Appsettings.app(new string[] { "ThridConfig", "Url" });
|
||||
|
||||
//小鹅通
|
||||
XIAOETongConfig.app_id = Appsettings.app(new string[] { "XiaoETONG", "app_id" });
|
||||
XIAOETongConfig.client_id = Appsettings.app(new string[] { "XiaoETONG", "client_id" });
|
||||
XIAOETongConfig.secret_key = Appsettings.app(new string[] { "XiaoETONG", "secret_key" });
|
||||
XIAOETongConfig.base_url = Appsettings.app(new string[] { "XiaoETONG", "basurl" });
|
||||
|
||||
services.AddMemoryCacheSetup();
|
||||
services.AddSqlsugarSetup();
|
||||
|
|
|
|||
|
|
@ -252,6 +252,12 @@
|
|||
"SHanDongTel": {
|
||||
"Tel": "15662627992|18724728603|17362186261|15264182912"
|
||||
|
||||
},
|
||||
"XiaoETONG": {
|
||||
"app_id": "appn9m3yups9098",
|
||||
"client_id": "xopvGAr405P6261",
|
||||
"secret_key": "AeHT1p4GzDYZuaBLZYOBa0r2Npp22uWv",
|
||||
"basurl": "https://api.xiaoe-tech.com/"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,6 +247,11 @@
|
|||
},
|
||||
"SHanDongTel": {
|
||||
"Tel": "15662627992|18724728603|17362186261|15264182912"
|
||||
|
||||
},
|
||||
"XiaoETONG": {
|
||||
"app_id": "appn9m3yups9098",
|
||||
"client_id": "xopvGAr405P6261",
|
||||
"secret_key": "AeHT1p4GzDYZuaBLZYOBa0r2Npp22uWv",
|
||||
"basurl": "https://api.xiaoe-tech.com/"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College.Common
|
||||
{
|
||||
public class XIAOETongConfig
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static string app_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static string client_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static string secret_key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static string grant_type { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static string base_url { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
using System.Web;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
namespace New_College.Common.Helper
|
||||
{
|
||||
public static class ModelToUrIHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Model对象转换为uri网址参数形式
|
||||
/// </summary>
|
||||
/// <param name="obj">Model对象</param>
|
||||
/// <param name="url">前部分网址</param>
|
||||
/// <returns></returns>
|
||||
public static string ModelToUriParam(this object obj, string url = "")
|
||||
{
|
||||
PropertyInfo[] propertis = obj.GetType().GetProperties();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(url);
|
||||
//sb.Append("?");
|
||||
foreach (var p in propertis)
|
||||
{
|
||||
var v = p.GetValue(obj, null);
|
||||
if (v == null)
|
||||
continue;
|
||||
sb.Append(p.Name);
|
||||
sb.Append("=");
|
||||
sb.Append(HttpUtility.UrlEncode(v.ToString()));
|
||||
sb.Append("&");
|
||||
}
|
||||
sb.Remove(sb.Length - 1, 1);
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
using MathNet.Numerics.Random;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// aes解密
|
||||
/// </summary>
|
||||
public static class RSAHelper
|
||||
{
|
||||
/// <summary>
|
||||
///aes解密
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="AesKey"></param>
|
||||
/// <param name="AesIV"></param>
|
||||
/// <returns></returns>
|
||||
public static string AESDecrypt(string text, string AesKey, string AesIV)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
//判断是否是16位 如果不够补0
|
||||
//text = tests(text);
|
||||
//16进制数据转换成byte
|
||||
byte[] encryptedData = Convert.FromBase64String(text); // strToToHexByte(text);
|
||||
RijndaelManaged rijndaelCipher = new RijndaelManaged();
|
||||
rijndaelCipher.Key = Convert.FromBase64String(AesKey); // Encoding.UTF8.GetBytes(AesKey);
|
||||
rijndaelCipher.IV = Convert.FromBase64String(AesIV);// Encoding.UTF8.GetBytes(AesIV);
|
||||
rijndaelCipher.Mode = CipherMode.CBC;
|
||||
rijndaelCipher.Padding = PaddingMode.PKCS7;
|
||||
ICryptoTransform transform = rijndaelCipher.CreateDecryptor();
|
||||
byte[] plainText = transform.TransformFinalBlock(encryptedData, 0, encryptedData.Length);
|
||||
string result = Encoding.Default.GetString(plainText);
|
||||
//int index = result.LastIndexOf('>');
|
||||
//result = result.Remove(index + 1);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///获取随机数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetRandomStr()
|
||||
{
|
||||
const string baseChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
Random random = new Random();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
int index = random.Next(baseChars.Length);
|
||||
sb.Append(baseChars[index]);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College
|
||||
{
|
||||
public class ETongModel
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class app_token
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string app_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string client_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string secret_key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string grant_type { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class app_response
|
||||
{
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public Data data { get; set; }
|
||||
}
|
||||
|
||||
public class Data
|
||||
{
|
||||
public string access_token { get; set; }
|
||||
public int expires_in { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class usersobject
|
||||
{
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public userData data { get; set; }
|
||||
}
|
||||
|
||||
public class userData
|
||||
{
|
||||
public uList[] list { get; set; }
|
||||
public int total { get; set; }
|
||||
}
|
||||
|
||||
public class uList
|
||||
{
|
||||
public string avatar { get; set; }
|
||||
public string bind_phone { get; set; }
|
||||
public string collect_phone { get; set; }
|
||||
public string from { get; set; }
|
||||
public int pay_sum { get; set; }
|
||||
public int punch_count { get; set; }
|
||||
public string user_created_at { get; set; }
|
||||
public string user_id { get; set; }
|
||||
public string user_nickname { get; set; }
|
||||
public string wx_app_open_id { get; set; }
|
||||
public string wx_open_id { get; set; }
|
||||
public string wx_union_id { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class UserRequest
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string access_token { get; set; }
|
||||
public int page { get; set; }
|
||||
public int page_size { get; set; }
|
||||
public string phone { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
public class XETOrdersRequest
|
||||
{
|
||||
public string access_token { get; set; }
|
||||
public int page { get; set; }
|
||||
public int page_size { get; set; }
|
||||
public string user_id { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class XETOrdersResponse
|
||||
{
|
||||
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public XETOrdersData data { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class XETOrdersData
|
||||
{
|
||||
public List<OrderItem> list { get; set; }
|
||||
public int page { get; set; }
|
||||
public int page_size { get; set; }
|
||||
public int total { get; set; }
|
||||
}
|
||||
|
||||
public class OrderItem
|
||||
{
|
||||
public Buyer_Info buyer_info { get; set; }
|
||||
public Good_List[] good_list { get; set; }
|
||||
public Order_Info order_info { get; set; }
|
||||
public Payment_Info payment_info { get; set; }
|
||||
public Price_Info price_info { get; set; }
|
||||
public Ship_Info ship_info { get; set; }
|
||||
}
|
||||
|
||||
public class Buyer_Info
|
||||
{
|
||||
public string avatar_url { get; set; }
|
||||
public string comment { get; set; }
|
||||
public string nickname { get; set; }
|
||||
public string phone_number { get; set; }
|
||||
}
|
||||
|
||||
public class Order_Info
|
||||
{
|
||||
public int?[] activity_type_bitmap { get; set; }
|
||||
public int actual_fee { get; set; }
|
||||
public int aftersale_show_state { get; set; }
|
||||
public string aftersale_show_state_time { get; set; }
|
||||
public string app_id { get; set; }
|
||||
public string channel_bus_id { get; set; }
|
||||
public int channel_type { get; set; }
|
||||
public int check_state { get; set; }
|
||||
public string created_time { get; set; }
|
||||
public int deduct_amount { get; set; }
|
||||
public int discount_amount { get; set; }
|
||||
public object[] distribute_type_bitmap { get; set; }
|
||||
public int freight_actual_price { get; set; }
|
||||
public int freight_original_price { get; set; }
|
||||
public int goods_buy_num { get; set; }
|
||||
public string goods_name { get; set; }
|
||||
public int goods_original_total_price { get; set; }
|
||||
public string goods_spu_sub_type { get; set; }
|
||||
public int goods_spu_type { get; set; }
|
||||
public int modified_amount { get; set; }
|
||||
public int order_close_type { get; set; }
|
||||
public string order_id { get; set; }
|
||||
public int order_state { get; set; }
|
||||
public string order_state_time { get; set; }
|
||||
public int order_type { get; set; }
|
||||
public int pay_state { get; set; }
|
||||
public string pay_state_time { get; set; }
|
||||
public int pay_type { get; set; }
|
||||
public int refund_fee { get; set; }
|
||||
public string refund_time { get; set; }
|
||||
public string relation_order_appid { get; set; }
|
||||
public string relation_order_id { get; set; }
|
||||
public int relation_order_type { get; set; }
|
||||
public int settle_state { get; set; }
|
||||
public string settle_state_time { get; set; }
|
||||
public int share_type { get; set; }
|
||||
public string share_user_id { get; set; }
|
||||
public int ship_way_choose_type { get; set; }
|
||||
public int sub_order_type { get; set; }
|
||||
public string trade_id { get; set; }
|
||||
public string update_time { get; set; }
|
||||
public int use_collection { get; set; }
|
||||
public string user_id { get; set; }
|
||||
public int wx_app_type { get; set; }
|
||||
}
|
||||
|
||||
public class Payment_Info
|
||||
{
|
||||
public string out_order_id { get; set; }
|
||||
public string third_order_id { get; set; }
|
||||
}
|
||||
|
||||
public class Price_Info
|
||||
{
|
||||
public int actual_price { get; set; }
|
||||
public int freight_modified_price { get; set; }
|
||||
public int freight_price { get; set; }
|
||||
public int origin_price { get; set; }
|
||||
public int total_modified_amount { get; set; }
|
||||
public int total_price { get; set; }
|
||||
}
|
||||
|
||||
public class Ship_Info
|
||||
{
|
||||
public string city { get; set; }
|
||||
public string company { get; set; }
|
||||
public string confirm_time { get; set; }
|
||||
public string county { get; set; }
|
||||
public string detail { get; set; }
|
||||
public string express_id { get; set; }
|
||||
public string invalid_time { get; set; }
|
||||
public string phone { get; set; }
|
||||
public string province { get; set; }
|
||||
public string receiver { get; set; }
|
||||
public string remark { get; set; }
|
||||
public string ship_time { get; set; }
|
||||
public string user_id { get; set; }
|
||||
}
|
||||
|
||||
public class Good_List
|
||||
{
|
||||
public int buy_num { get; set; }
|
||||
public int check_state { get; set; }
|
||||
public Discounts_Info discounts_info { get; set; }
|
||||
public string expire_desc { get; set; }
|
||||
public string expire_end { get; set; }
|
||||
public string expire_start { get; set; }
|
||||
public string goods_desc { get; set; }
|
||||
public string goods_image { get; set; }
|
||||
public string goods_name { get; set; }
|
||||
public string goods_sn { get; set; }
|
||||
public string goods_spec_desc { get; set; }
|
||||
public int period_type { get; set; }
|
||||
public int refund_state { get; set; }
|
||||
public string refund_state_desc { get; set; }
|
||||
public string relation_goods_id { get; set; }
|
||||
public int relation_goods_type { get; set; }
|
||||
public string relation_goods_type_desc { get; set; }
|
||||
public string resource_id { get; set; }
|
||||
public int resource_type { get; set; }
|
||||
public int ship_state { get; set; }
|
||||
public string ship_state_desc { get; set; }
|
||||
public string sku_id { get; set; }
|
||||
public string sku_spec_code { get; set; }
|
||||
public string spu_id { get; set; }
|
||||
public string spu_type { get; set; }
|
||||
public int total_price { get; set; }
|
||||
public int unit_price { get; set; }
|
||||
}
|
||||
|
||||
public class Discounts_Info
|
||||
{
|
||||
public int discount_amount_total { get; set; }
|
||||
public int discount_count { get; set; }
|
||||
public object[] discount_detail { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
using New_College.Common;
|
||||
using New_College.Common.Helper;
|
||||
using New_College.Common.HttpRestSharp;
|
||||
using NPOI.POIFS.Crypt;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class XiaoEtongApp
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取token
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static app_response xetong_token()
|
||||
{
|
||||
var request = new app_token()
|
||||
{
|
||||
app_id = XIAOETongConfig.app_id,
|
||||
client_id = XIAOETongConfig.client_id,
|
||||
secret_key = XIAOETongConfig.secret_key,
|
||||
grant_type = "client_credential"
|
||||
};
|
||||
var result = HttpHelper.GetApi<app_response>(XIAOETongConfig.base_url, "token", ModelToUrIHelper.ModelToUriParam(request));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户列表
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static usersobject GetUsersList(UserRequest request)
|
||||
{
|
||||
var access_token = xetong_token().data.access_token;
|
||||
request.access_token = access_token;
|
||||
var result = HttpHelper.PostApi<usersobject>(XIAOETongConfig.base_url + "xe.user.batch.get/1.0.0", request);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户订单列表
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static XETOrdersResponse GetOrdersList(XETOrdersRequest request)
|
||||
{
|
||||
var access_token = xetong_token().data.access_token;
|
||||
request.access_token = access_token;
|
||||
var result = HttpHelper.PostApi<XETOrdersResponse>(XIAOETongConfig.base_url + "xe.ecommerce.order.list/1.0.0", request);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College.Model.Models
|
||||
{
|
||||
public class D_XiaoEtongUser: RootEntity
|
||||
{
|
||||
public string avatar { get; set; }
|
||||
public string bind_phone { get; set; }
|
||||
public string collect_phone { get; set; }
|
||||
public string from { get; set; }
|
||||
public int pay_sum { get; set; }
|
||||
public int punch_count { get; set; }
|
||||
public string user_created_at { get; set; }
|
||||
public string user_id { get; set; }
|
||||
public string user_nickname { get; set; }
|
||||
public string wx_app_open_id { get; set; }
|
||||
public string wx_open_id { get; set; }
|
||||
public string wx_union_id { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
using New_College.IRepository.UnitOfWork;
|
||||
using New_College.IRepository;
|
||||
using New_College.Model.Models;
|
||||
using New_College.Repository.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College.Repository
|
||||
{
|
||||
public class D_XiaoEtongUserRepository : BaseRepository<D_XiaoEtongUser>, ID_XiaoEtongUserRepository
|
||||
{
|
||||
public D_XiaoEtongUserRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using New_College.IRepository.Base;
|
||||
using New_College.Model.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace New_College.Repository
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface ID_XiaoEtongUserRepository : IBaseRepository<D_XiaoEtongUser>
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ using New_College.IRepository.Base;
|
|||
using New_College.Model.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
using New_College.Common;
|
||||
using static New_College.Common.AliyunSmsSender;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -15,12 +14,10 @@ using New_College.Model;
|
|||
using LinqKit;
|
||||
using New_College.Model.Request;
|
||||
using New_College.IRepository;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using New_College.Common.HttpRestSharp;
|
||||
using System.Data.Entity;
|
||||
using StackExchange.Profiling.Internal;
|
||||
using New_College.Repository;
|
||||
|
||||
namespace New_College.Services
|
||||
{
|
||||
|
|
@ -30,13 +27,15 @@ namespace New_College.Services
|
|||
private readonly IT_BatchlineRepository t_BatchlineRepository;
|
||||
private readonly ICasdoorUserRepository _casdoorUserRepository;
|
||||
private readonly ID_UserSettingBaseServices _userSetting;
|
||||
public V_CustomerInfoServices(IBaseRepository<V_CustomerInfo> dal, IT_BatchlineRepository t_Batchline, ICasdoorUserRepository casdoorUserRepository, ID_UserSettingBaseServices userSetting)
|
||||
private readonly ID_XiaoEtongUserRepository _XiaoEtongUserRepository;
|
||||
public V_CustomerInfoServices(IBaseRepository<V_CustomerInfo> dal, IT_BatchlineRepository t_Batchline, ICasdoorUserRepository casdoorUserRepository, ID_UserSettingBaseServices userSetting, ID_XiaoEtongUserRepository d_XiaoEtongUserRepository)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
t_BatchlineRepository = t_Batchline;
|
||||
_casdoorUserRepository = casdoorUserRepository;
|
||||
_userSetting = userSetting;
|
||||
_XiaoEtongUserRepository = d_XiaoEtongUserRepository;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -322,6 +321,61 @@ namespace New_College.Services
|
|||
return new MessageModel<CustomerInfoResult>() { success = false, msg = "获取失败,用户信息为空" };
|
||||
var years = info.Year > 2023 ? 2023 : info.Year;
|
||||
var batchlist = await t_BatchlineRepository.Query(c => c.Year == years && c.AreaName == info.AreaName && c.Type_name == "综合");
|
||||
if (!string.IsNullOrWhiteSpace(info.Phone))
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
var xet = XiaoEtongApp.GetUsersList(new UserRequest()
|
||||
{
|
||||
phone = info.Phone,
|
||||
page = 1,
|
||||
page_size = 1,
|
||||
});
|
||||
if (xet.data.list != null && xet.data.list.Count() > 0)
|
||||
{
|
||||
var xiaoetong = (await _XiaoEtongUserRepository.Query(e => e.bind_phone == info.Phone));
|
||||
if (!xiaoetong.Any())
|
||||
{
|
||||
await _XiaoEtongUserRepository.Add(new D_XiaoEtongUser()
|
||||
{
|
||||
avatar = xet.data.list.First().avatar,
|
||||
bind_phone = xet.data.list.First().bind_phone,
|
||||
collect_phone = xet.data.list.First().collect_phone,
|
||||
CreateBy = "system",
|
||||
CreateTime = DateTime.Now,
|
||||
from = xet.data.list.First().from,
|
||||
IsDelete = false,
|
||||
ModifyBy = "system",
|
||||
ModifyTime = DateTime.Now,
|
||||
OrderSort = 0,
|
||||
pay_sum = xet.data.list.First().pay_sum,
|
||||
punch_count = xet.data.list.First().punch_count,
|
||||
user_created_at = xet.data.list.First().user_created_at,
|
||||
user_nickname = xet.data.list.First().user_nickname,
|
||||
wx_app_open_id = xet.data.list.First().wx_app_open_id,
|
||||
wx_open_id = xet.data.list.First().wx_open_id,
|
||||
wx_union_id = xet.data.list.First().wx_union_id,
|
||||
user_id = xet.data.list.First().user_id
|
||||
});
|
||||
var orders = XiaoEtongApp.GetOrdersList(new XETOrdersRequest()
|
||||
{
|
||||
page = 1,
|
||||
page_size = 30,
|
||||
user_id = xet.data.list.First().user_id
|
||||
});
|
||||
if (orders.data.list.Any() && orders.data.list.Count() > 0 && !info.IsVIP)
|
||||
{
|
||||
var isvip = orders.data.list.Select(c => c.order_info).Where(e => e.activity_type_bitmap.Contains(11));
|
||||
info.IsVIP = isvip.Count() > 0 ? true : false;
|
||||
info.ModifyTime = DateTime.Now;
|
||||
|
||||
await _dal.Update(info);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return new MessageModel<CustomerInfoResult>()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
using HtmlAgilityPack;
|
||||
using New_College.Common.Helper;
|
||||
using New_Spider;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
|
@ -9,10 +10,19 @@ using System.Text.RegularExpressions;
|
|||
//HtmlAgMajorHelper agMajorHelper = new HtmlAgMajorHelper();
|
||||
//agMajorHelper.DownloadTypeListFile();
|
||||
//agMajorHelper.DownloadChildTypeListFile();
|
||||
HtmlAgNewsHelper agNewsHelper = new HtmlAgNewsHelper();
|
||||
//HtmlAgNewsHelper agNewsHelper = new HtmlAgNewsHelper();
|
||||
|
||||
//agNewsHelper.HtmlCreatePageData();
|
||||
agNewsHelper.HtmlSpiderYangGuangData();
|
||||
//agNewsHelper.HtmlSpiderYangGuangData();
|
||||
|
||||
//var result = XIAO_ETONG.Xiao_EtongApp.xiao_Etong_token(new XIAO_ETONG.app_token()
|
||||
//{
|
||||
// app_id = "appn9m3yups9098",
|
||||
// client_id = "xopvGAr405P6261",
|
||||
// grant_type = "client_credential",
|
||||
// secret_key = "AeHT1p4GzDYZuaBLZYOBa0r2Npp22uWv"
|
||||
//}, "https://api.xiaoe-tech.com/");
|
||||
//Console.WriteLine(result.ToJson());
|
||||
Console.Read();
|
||||
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
|
|
|||
Loading…
Reference in New Issue