From 557c2711a3e103ebc3d0492344eca9730d5e92b2 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期一, 17 二月 2025 10:47:47 +0800
Subject: [PATCH] 增加司机配送单超时处理任务,防止一直不停手机定位信息,
---
CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs | 101 ++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 88 insertions(+), 13 deletions(-)
diff --git a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs
index ac11b32..903a804 100644
--- a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs
+++ b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs
@@ -1,10 +1,10 @@
/***********************************************************************
- * Project: CoreCms
- * ProjectName: 鏍稿績鍐呭绠$悊绯荤粺
- * Web: https://www.corecms.net
- * Author: 澶х伆鐏�
- * Email: jianweie@163.com
- * CreateTime: 2021/1/31 21:45:10
+ * Project: baifenBinfa
+ * ProjectName: 鐧惧垎鍏垫硶绠$悊绯荤粺
+ * Web: http://chuanyin.com
+ * Author:
+ * Email:
+ * CreateTime: 202403/02
* Description: 鏆傛棤
***********************************************************************/
@@ -12,11 +12,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.DTO.ComponentsDTO;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
+using CoreCms.Net.IServices.baifenbingfa;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
@@ -53,12 +55,26 @@
private readonly ICoreCmsPinTuanRuleServices _pinTuanRuleServices;
private readonly ICoreCmsServicesServices _servicesServices;
private readonly ICoreCmsGoodsCategoryExtendServices _goodsCategoryExtendServices;
-
-
+ private readonly IHttpContextUser _contextUser;
+ private readonly IBfbfComAPIService _bfbfComAPIService;
private readonly IUnitOfWork _unitOfWork;
+
public CoreCmsPagesServices(IUnitOfWork unitOfWork
, ICoreCmsPagesRepository dal
- , ICoreCmsPagesItemsRepository pagesItemsRepository, ICoreCmsPromotionServices promotionServices, ICoreCmsNoticeServices noticeServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsSettingServices settingServices, ICoreCmsGoodsServices goodsServices, ICoreCmsArticleServices articleServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsPinTuanRuleServices pinTuanRuleServices, ICoreCmsServicesServices servicesServices, ICoreCmsArticleTypeServices articleTypeServices, ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices)
+ , ICoreCmsPagesItemsRepository pagesItemsRepository,
+ ICoreCmsPromotionServices promotionServices,
+ ICoreCmsNoticeServices noticeServices,
+ ICoreCmsGoodsCategoryServices goodsCategoryServices,
+ ICoreCmsSettingServices settingServices,
+ ICoreCmsGoodsServices goodsServices,
+ ICoreCmsArticleServices articleServices,
+ ICoreCmsPromotionConditionServices promotionConditionServices,
+ ICoreCmsPinTuanRuleServices pinTuanRuleServices,
+ ICoreCmsServicesServices servicesServices,
+ ICoreCmsArticleTypeServices articleTypeServices,
+ ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices,
+ IHttpContextUser httpContextUser,
+ IBfbfComAPIService bfbfComAPIService)
{
this._dal = dal;
_pagesItemsRepository = pagesItemsRepository;
@@ -75,6 +91,8 @@
_goodsCategoryExtendServices = goodsCategoryExtendServices;
base.BaseDal = dal;
_unitOfWork = unitOfWork;
+ _contextUser= httpContextUser;
+ _bfbfComAPIService = bfbfComAPIService;
}
@@ -138,7 +156,8 @@
/// <returns></returns>
public async Task<WebApiCallBack> GetPageConfig(string code)
{
-
+ var userID= _contextUser.ID;
+
var jm = new WebApiCallBack();
var wherePage = PredicateBuilder.True<CoreCmsPages>();
@@ -265,6 +284,7 @@
break;
case "goodTabBar":
{
+ bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID);
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
if (parameters != null && parameters.ContainsKey("list"))
{
@@ -305,7 +325,17 @@
limit = limit > 0 ? limit : 10;
var goods = await _goodsServices.QueryListByComponentsAsync(where, limit, p => p.createTime, OrderByType.Desc, true, true, 60);
-
+ if(goods!=null)
+ {
+ //鐧惧垎鍏垫硶缁忛攢鍟嗕慨鏀逛环鏍�
+ if(isDic)
+ {
+ foreach (var gd in goods)
+ {
+ gd.price = gd.distributionPrice;
+ }
+ }
+ }
if (goods != null && goods.Any())
{
var result = JArray.FromObject(goods);
@@ -370,7 +400,11 @@
}
case "goods":
{
+
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
+
+
+
var where = PredicateBuilder.True<GoodListDTO>();
if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "auto")
{
@@ -380,6 +414,15 @@
var classifyId = parameters["classifyId"].ObjectToInt(0);
var gc = await _goodsCategoryServices.GetCaChe();
var childCats = gc.Where(p => p.parentId == classifyId).ToList();
+ //鑾峰彇褰撳墠閰嶇疆鐨勫晢鍝佸垎绫�
+ var tgc = gc.Where(x => x.id == classifyId).FirstOrDefault();
+
+ //缁欒繑鍥炲弬鏁板鍔爇ey
+ if(!string.IsNullOrEmpty(tgc?.key))
+
+ //澧炲姞鍟嗗搧鍒嗙被鐨刱ey
+ parameters.Add("key",tgc?.key??"" );
+
var catIds = childCats != null && childCats.Any()
? childCats.Select(p => p.id).ToList()
: new List<int>();
@@ -417,7 +460,19 @@
}
limit = limit > 0 ? limit : 10;
- var goods = await _goodsServices.QueryListByComponentsAsync(where, limit, " sort desc,id desc ", true, true, 60);
+ var goods = await _goodsServices.QueryListByComponentsAsync(where, limit, " sort asc,id asc ", true, true, 60);
+ if (goods != null)
+ {
+ bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID);
+ //鐧惧垎鍏垫硶缁忛攢鍟嗕慨鏀逛环鏍�
+ if (isDic)
+ {
+ foreach (var gd in goods)
+ {
+ gd.price = gd.distributionPrice;
+ }
+ }
+ }
if (goods != null && goods.Any())
{
var result = JArray.FromObject(goods);
@@ -464,6 +519,18 @@
count = goodids.Count;
}
var goods = await _goodsServices.QueryListByComponentsAsync(where, count, orderBy, true, true, 60);
+ if (goods != null)
+ {
+ bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID);
+ //鐧惧垎鍏垫硶缁忛攢鍟嗕慨鏀逛环鏍�
+ if (isDic)
+ {
+ foreach (var gd in goods)
+ {
+ gd.price = gd.distributionPrice;
+ }
+ }
+ }
if (goods != null && goods.Any())
{
var result = JArray.FromObject(goods);
@@ -516,6 +583,10 @@
break;
case "groupPurchase":
{
+ //鍥㈣喘 鍙栨秷
+ bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID);
+ if (isDic)
+ continue;
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
if (parameters != null && parameters.ContainsKey("list"))
{
@@ -548,7 +619,7 @@
break;
}
case "seckill":
- {
+ {//绉掓潃
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
if (parameters != null && parameters.ContainsKey("list"))
{
@@ -584,6 +655,10 @@
break;
case "pinTuan":
{
+ //鎷煎洟
+ bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID);
+ if (isDic)
+ continue;
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
if (parameters != null && parameters.ContainsKey("list"))
{
--
Gitblit v1.9.1