From 7f6c0ad7fabeaa70eff846ac28ca741af1ae5b34 Mon Sep 17 00:00:00 2001
From: old yi <156663459@qq.com>
Date: Fri, 29 Mar 2024 22:14:59 +0800
Subject: [PATCH] bug fixed
---
New_College.Api/Dockerfile.original | 4 +-
New_College.Common/XiaoETong/XiaoEtongApp.cs | 13 ++-
.../V_CustomerInfoServices.cs | 96 ++++++++++---------
3 files changed, 63 insertions(+), 50 deletions(-)
diff --git a/New_College.Api/Dockerfile.original b/New_College.Api/Dockerfile.original
index 37e0a50..f2efb7e 100644
--- a/New_College.Api/Dockerfile.original
+++ b/New_College.Api/Dockerfile.original
@@ -1,4 +1,4 @@
-FROM swr.cn-south-1.myhuaweicloud.com/mcr/aspnet:3.1-alpine
+FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
@@ -32,5 +32,5 @@ RUN echo 'Asia/Shanghai' >/etc/timezone
#&& supervisord -c /etc/supervisord.conf
WORKDIR /app
COPY . .
-EXPOSE 8083
+EXPOSE 8082
ENTRYPOINT ["dotnet", "New_College.Api.dll","-b","0.0.0.0"]
\ No newline at end of file
diff --git a/New_College.Common/XiaoETong/XiaoEtongApp.cs b/New_College.Common/XiaoETong/XiaoEtongApp.cs
index 4dcd6ee..68544ee 100644
--- a/New_College.Common/XiaoETong/XiaoEtongApp.cs
+++ b/New_College.Common/XiaoETong/XiaoEtongApp.cs
@@ -41,10 +41,15 @@ namespace New_College
///
public static usersobject GetUsersList(UserRequest request)
{
- var access_token = xetong_token().data.access_token;
- request.access_token = access_token;
- var result = HttpHelper.PostApi(XIAOETongConfig.base_url + "xe.user.batch.get/1.0.0", request);
- return result;
+ var tokeninfo = xetong_token();
+ if (tokeninfo.data != null)
+ {
+ var access_token = tokeninfo.data.access_token;
+ request.access_token = access_token;
+ var result = HttpHelper.PostApi(XIAOETongConfig.base_url + "xe.user.batch.get/1.0.0", request);
+ return result;
+ } else
+ return null;
}
diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs
index 5f8434a..6e27344 100644
--- a/New_College.Services/V_CustomerInfoServices.cs
+++ b/New_College.Services/V_CustomerInfoServices.cs
@@ -355,7 +355,7 @@ namespace New_College.Services
string typename = "综合";
if (info.subjectgroupName != null)
{
- typename = info.subjectgroupName.Length > 2 ? "综合" : info.subjectgroupName;
+ typename = info.subjectgroupName.Length > 2 ? "综合" : info.subjectgroupName;
}
var batchlist = await t_BatchlineRepository.Query(c => c.Year == years && c.AreaName == info.AreaName && c.Type_name == typename);
@@ -425,57 +425,65 @@ namespace New_College.Services
///
private async Task SyncXET(V_CustomerInfo info)
{
- if (!string.IsNullOrWhiteSpace(info.Phone))
+ try
{
- var xet = XiaoEtongApp.GetUsersList(new UserRequest()
+ if (!string.IsNullOrWhiteSpace(info.Phone))
{
- phone = info.Phone,
- page = 1,
- page_size = 1,
- });
- if (xet != null && xet.data.list != null && xet.data.list.Count() > 0)
- {
- var xiaoetong = (await _XiaoEtongUserRepository.Query(e => e.collect_phone == info.Phone));
- if (!xiaoetong.Any())
+ var xet = XiaoEtongApp.GetUsersList(new UserRequest()
{
- await _XiaoEtongUserRepository.Add(new D_XiaoEtongUser()
+ phone = info.Phone,
+ page = 1,
+ page_size = 1,
+ });
+ if (xet != null && xet.data.list != null && xet.data.list.Count() > 0)
+ {
+ var xiaoetong = (await _XiaoEtongUserRepository.Query(e => e.collect_phone == info.Phone));
+ if (!xiaoetong.Any())
{
- 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);
+ 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);
+ }
}
}
}
- }
+
+ }
+ catch (Exception exx)
+ {
+
+ }
return info;
}