Commit a252a2e9 authored by 吴春's avatar 吴春
parents a2ca7659 8cf94c51
......@@ -8,6 +8,7 @@
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Module.User\Mall.Module.User.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
</ItemGroup>
......
This diff is collapsed.
......@@ -1678,7 +1678,7 @@ namespace Mall.Module.Product
})
}),
goods_stock = model.InventoryNum,
virtual_sales = model.SalesNum,
virtual_sales = (model.SalesNum ?? 0),
confine_count = model.LimitBuyGoodsNum,
pieces = model.FullNumPinkage,//满件包邮
forehead = model.FullMoneyPinkage,//满额包邮
......@@ -1714,7 +1714,7 @@ namespace Mall.Module.Product
area_type=x.AreaType
}) } },
form_id = model.FormsId,
sales = model.SalesNum + payment_num,//已售出数量 + 订单商品数量//
sales = (model.SalesNum ?? 0) + payment_num,//已售出数量 + 订单商品数量//
name = model.Name,
original_price = model.OriginalPrice,
cover_pic = model.CoverImage,
......
......@@ -325,8 +325,19 @@ namespace Mall.Module.User
string goodsName = orderGoodsList.FirstOrDefault().GoodsName;
if (orderGoodsList.Count > 1)
{
if (goodsName.Length > 12)
{
goodsName = goodsName.Substring(0, 12) + "..";
}
goodsName += "等" + orderGoodsList.Count + "件商品";
}
else
{
if (goodsName.Length > 18)
{
goodsName = goodsName.Substring(0, 18) + "..";
}
}
appletWeChatModule.SendOrderSucceedMsg(oldOrder.TenantId, oldOrder.MallBaseId, umodel.OpenId, oldOrder.OrderNo, oldOrder.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss"), (oldOrder.Income ?? 0).ToString(), goodsName);
}
return flag;
......
......@@ -1919,7 +1919,7 @@ namespace Mall.Module.User
}
};
bool flag = distributor_RemitRepository.Update(keyValues, wheres);
if (flag)
if (flag && uid == "1")
{
//提现审核通过 自动生成财务单据
OrderIncomeFinanceModule(remitId, Convert.ToInt32(uid), mallBaseId, remark);
......
......@@ -24,7 +24,7 @@ namespace Mall.Repository.Product
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetPageList(int pageIndex, int pageSize, out long count, RB_Goods_Comment_Extend dmodel)
{
string where = $" 1=1 ";
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.TenantId)}={dmodel.TenantId}";
......@@ -74,7 +74,7 @@ where {where} order by c.Id desc";
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetAppletPageList(int pageIndex, int pageSize, out long count, RB_Goods_Comment_Extend dmodel)
{
string where = $" 1=1 ";
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.TenantId)}={dmodel.TenantId}";
......@@ -123,7 +123,7 @@ where {where} order by c.Id desc";
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetAppletGoodsCommentStatistics(int goodsId, int tenantId, int mallBaseId)
{
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Is_Show)}=1";
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 and c.{nameof(RB_Goods_Comment.Is_Show)}=1";
if (tenantId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.TenantId)}={tenantId}";
......
......@@ -359,7 +359,7 @@ SELECT o.OrderId,o.Income FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7 GROUP BY o.OrderId)t";
string sql2 = $@"
SELECT SUM(od.Number) as GoodsNum FROM rb_goods_order o
SELECT SUM(od.Number) as OrderNum FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7";
string sql3 = $@"SELECT COUNT(UserId) AS OrderNum FROM(
......
......@@ -538,6 +538,86 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 后台订单强制取消
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetOrderForcedToCancel()
{
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int OrderId = parms.GetInt("OrderId", 0);
//string Remark = parms.GetStringValue("Remark");
if (OrderId <= 0)
{
return ApiResult.ParamIsNull();
}
var omodel = orderModule.GetOrderInfo(OrderId);
if (omodel == null)
{
return ApiResult.Failed("订单不存在");
}
if (omodel.Status == 1)
{
return ApiResult.Failed("订单已删除");
}
if (omodel.Recycled == 1)
{
return ApiResult.Failed("订单已进入回收站无法操作");
}
if (omodel.OrderStatus != OrderStatusEnum.NonPayment && omodel.OrderStatus != OrderStatusEnum.WaitSendGoods)
{
return ApiResult.Failed("该订单已无法取消");
}
int IsNormalServer = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IsNormalServer").Value);
if (IsNormalServer == 1 && omodel.OrderStatus == OrderStatusEnum.WaitSendGoods)
{
//获取小程序信息
var mallModel = orderModule.GetMiniProgramExtend(req.MallBaseId);
int RefundNum = orderModule.GetOrderRefundOnlineTradeNum(OrderId, req.TenantId, req.MallBaseId);
string RefundOrderNo = omodel.OrderNo + (RefundNum + 1);
var pram = new Common.Pay.WeChatPat.PayParam()
{
TotalFee = Convert.ToInt32((omodel.Income ?? 0) * 100),
RefundFee = Convert.ToInt32((omodel.Income ?? 0) * 100),
OrderNumber = omodel.MerchantsNo,
RefundNumber = RefundOrderNo
};
var Robj = new App_Code.PayUtil().Refund(pram, mallModel, _accessor);
if (Robj.IsSuccess)
{
bool flag = orderModule.SetOrderForcedToCancel(omodel, RefundOrderNo, req.TenantId, req.MallBaseId);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
else
{
LogHelper.Write(JsonConvert.SerializeObject(Robj));
return ApiResult.Failed();
}
}
else
{
bool flag = orderModule.SetOrderForcedToCancel(omodel, "", req.TenantId, req.MallBaseId);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
}
/// <summary>
/// 修改订单明细价格
/// </summary>
......@@ -1486,6 +1566,18 @@ namespace Mall.WebApi.Controllers.MallBase
//日志记录
LogHelper.Write("售后订单:" + ReOrderId + ",金额:" + Refund + " 退款记录失败");
}
var detailModel = orderModule.GetOrderDetailInfo(ReModel.OrderDetialId ?? 0);
string goodsName = detailModel?.GoodsName ?? "";
if (goodsName.Length > 18)
{
goodsName = goodsName.Substring(0, 18) + "..";
}
var umodel = orderModule.GetMemberUserInfo(orderModel.UserId ?? 0);
if (goodsName != "" && umodel != null)
{
new MiniProgramMsgModule().SendOrderRefundMsg(orderModel.TenantId, orderModel.MallBaseId, umodel.OpenId, "", orderModel.OrderNo, (Refund).ToString(), goodsName);
}
return ApiResult.Success("");
}
else
......
......@@ -1832,6 +1832,8 @@ namespace Mall.WebApi.Controllers.User
{
LogHelper.Write("提现:" + RemitId + ",失败");
}
new MiniProgramMsgModule().SendWithdrawSucceedMsg(model.TenantId, model.MallBaseId, umodel.OpenId, (model.RemitMoney ?? 0).ToString(), (model.Fee ?? 0).ToString(), (model.WithdrawalWay.GetEnumName()), "");
return ApiResult.Success();
}
else
......
......@@ -86,7 +86,7 @@ namespace Test.Helper
}
}
pageIndex++;
var ranDomNum = new Random().Next(3, 7);
var ranDomNum = new Random().Next(2, 5);
Thread.Sleep(1000 * ranDomNum);
}
}
......
......@@ -201,7 +201,7 @@ DiscountRate,IsMemberPrice,TenantId,MallBaseId,CreateDate,UpdateDate,IsComment,F
}
}
pageIndex++;
var ranDomNum = new Random().Next(3, 7);
var ranDomNum = new Random().Next(2, 5);
Thread.Sleep(1000 * ranDomNum);
}
}
......
......@@ -35,11 +35,11 @@ namespace Test.Helper
{
foreach (var subItem in tempImgList)
{
if (subItem.user_id >= 19992 && subItem.user_id <= 101706)
if (subItem.user_id > 101707 && subItem.user_id <= 106252)
{
StringBuilder stringBuilder = new StringBuilder();
//stringBuilder.AppendFormat("update rb_member_user set Photo = '{0}',Name='{1}',SuperiorId={2} where Id = {3}", subItem.avatar, subItem.nickname, subItem.parent_id, subItem.user_id);
stringBuilder.AppendFormat("update rb_member_user set SuperiorId={0} where Id = {1} and SuperiorId not in (5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)", subItem.parent_id, subItem.user_id);
stringBuilder.AppendFormat("update rb_member_user set Photo = '{0}',SuperiorId={1} where Id = {2} and SuperiorId not in (5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)", subItem.avatar, subItem.parent_id, subItem.user_id);
try
{
var newResult = MySqlHelper.ExecuteNonQuery(MySqlHelper.defaultConnection, System.Data.CommandType.Text, stringBuilder.ToString(), null);
......@@ -70,7 +70,7 @@ namespace Test.Helper
pageCount = 2;
List<UserImage> list = new List<UserImage>();
string newImaApi = "http://wx.weibaoge.cn/web/index.php?r=mall%2Fuser%2Findex&page=" + pageIndex + "&member_level=0&platform=0&keyword=";
cookie = "__login_route=%2Fadmin%2Fpassport%2Flogin; __login_role=admin; HJ_SESSION_ID=lgfv5vck57rj84nh4npn59b4pj; _csrf=1febe37678187521a164220da9a9293f67d6d638a1cc01acebf0d3123757216ea%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22e5vd7mYVeGAfqcBMV_m0lkeiJLXFghtc%22%3B%7D";
cookie = "search={'keyword':'','status':' - 1','sort_prop':'','sort_type':'','cats':[],'date_start':null,'date_end':null,'type':''}; _identity=c964edefdd891bb281844324071fea4e2c1e7d2b21aef031ed81730f4e753d06a%3A2%3A%7Bi%3A0%3Bs%3A9%3A%22_identity%22%3Bi%3A1%3Bs%3A48%3A%22%5B19740%2C%22Cktp5k6Wf3lVS_yjQI_uTgEEE6_ANe-5%22%2C86400%5D%22%3B%7D; HJ_SESSION_ID=tv09q5jnte4v44ca14bnvdi28s; _csrf=9a1b84c62ffd209719019cca9730bf48f33854d3acc2f31982a5ef51ceda400ca%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22QwYL8fmmakdUX981YM7R26-Y5YoMnXxU%22%3B%7D";
string jsonData = HttpGet(newImaApi, cookie);
if (jsonData != null && !string.IsNullOrEmpty(jsonData))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment