Commit 3e2900cf authored by 吴春's avatar 吴春

提交代码

parent f4b92651
......@@ -123,6 +123,8 @@ namespace Mall.WindowsService.Module
builder.AppendFormat($@" SELECT a.*,b.OrderNo from rb_goods_orderdetail as a LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId
where b.TenantId=1 and b.MallBaseId=1 and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{startDate}','%y-%m-%d')
and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') and b.OrderStatus in(2,3,4,5,6) ");
Helper.LogHelper.Write("sql语句:" + builder.ToString());
var goodsDetailList = goodsOrderDetailRepository.Get<RB_Goods_OrderDetail_Extend>(builder.ToString()).ToList();
var result = new List<RB_Goods_OrderDetail_Extend>();
......@@ -213,7 +215,7 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
{
record.FinanceId = frid;
int recordId = financeRecordRepository.Insert(record);
Helper.LogHelper.Write("财务单据ID:" + frid + ",记录id:"+ recordId + "订单数量:" + record.RecordDetailList.Count());
Helper.LogHelper.Write("财务单据ID:" + frid + ",记录id:" + recordId + "订单数量:" + record.RecordDetailList.Count());
record.RecordDetailList.ForEach(x => x.RecordId = recordId);
record.RecordDetailList.ForEach(x => x.FinanceId = frid);
flag = financeRecordDetailRepository.InsertBatch(record.RecordDetailList);
......@@ -245,7 +247,8 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
/// 自动取消订单
/// </summary>
/// <returns></returns>
public static bool AutoCancelOrder() {
public static bool AutoCancelOrder()
{
try
{
var list = mallBaseRepository.GetListRepository(new Mall.Model.Extend.BaseSetUp.RB_MallBase_Extend() { });
......@@ -258,7 +261,7 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
foreach (var qitem in olist)
{
try
{
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() { };
keyValues.Add(nameof(RB_Goods_Order_Extend.OrderStatus), OrderStatusEnum.Cancel);
keyValues.Add(nameof(RB_Goods_Order_Extend.CancelTime), DateTime.Now);
......@@ -450,7 +453,7 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
{
Helper.LogHelper.Write("AutoCancelOrder:" + ex.Message);
return false;
}
}
}
#endregion
......@@ -461,7 +464,8 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
/// 自动收货
/// </summary>
/// <returns></returns>
public static bool AutoReceivingOrder() {
public static bool AutoReceivingOrder()
{
try
{
var list = mallBaseRepository.GetListRepository(new Mall.Model.Extend.BaseSetUp.RB_MallBase_Extend() { });
......@@ -502,7 +506,7 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
bool flag = goods_OrderRepository.Update(keyValues, wheres);
if (flag)
{
goods_LogRepository.Insert(new Mall.Model.Entity.Product.RB_Goods_Log()
{
Id = 0,
......
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