| | |
| | | result.Message = $"退回删除条码不存在"; |
| | | return result; |
| | | } |
| | | result.Data = data_His.DeliveryNo; |
| | | var db = Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | result.IsSuccessed = false; |
| | | result.Message = $"退回删除条码异常"; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, "退回删除条码异常"); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 整单退回 |
| | | /// </summary> |
| | | /// <param name="deliveryNo"></param> |
| | | /// <returns></returns> |
| | | public async Task<ApiAction> ReturnWhole(string deliveryNo) |
| | | { |
| | | var result = new ApiAction(); |
| | | try |
| | | { |
| | | List<SNData_His> listHis = await Db.Queryable<SNData_His>().Where(x => x.DeliveryNo == deliveryNo).ToListAsync(); |
| | | if (listHis.Count == 0) |
| | | { |
| | | result.IsSuccessed = false; |
| | | result.Message = $"退回送货单[{deliveryNo}]查不到要删除的条码"; |
| | | return result; |
| | | } |
| | | List<SNData> sndatas = await Db.Queryable<SNData>().Where(x => x.DeliveryNo == deliveryNo).ToListAsync(); |
| | | if (sndatas.Count == 0) |
| | | { |
| | | result.IsSuccessed = false; |
| | | result.Message = $"退回送货单[{deliveryNo}]查不到要删除的条码"; |
| | | return result; |
| | | } |
| | | var db = Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Deleteable(listHis).ExecuteCommand(); |
| | | db.Deleteable(sndatas).ExecuteCommand(); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | result.IsSuccessed = false; |
| | | result.Message = $"退回删除条码异常"; |
| | | } |
| | | } |
| | |
| | | .WhereIF(!string.IsNullOrEmpty(strTime[1]) && strTime.Length == 2, x => Convert.ToDateTime(x.ScanTime) < Convert.ToDateTime(strTime[1])) |
| | | .WhereIF(!string.IsNullOrEmpty(strTime[2]), x => x.ModelCode.Equals(strTime[2])) |
| | | .WhereIF(!string.IsNullOrEmpty(strTime[3]), x => x.CustomerCode.Equals(strTime[3])) |
| | | .WhereIF(!string.IsNullOrEmpty(strTime[4]), x => x.DeliveryNo.Equals(strTime[4])) |
| | | .ToPageListAsync(pageList.pageIndex, pageList.pageSize, total); |
| | | pageList.totals = total; |
| | | } |
| | |
| | | .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.ScanTime) < EndTime) |
| | | .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ModelCode == where.model) |
| | | .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode)) |
| | | .WhereIF(!string.IsNullOrEmpty(where.deliveryNo), x => x.DeliveryNo.Equals(where.deliveryNo)) |
| | | .ToListAsync(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.CREATE_TIME) < EndTime) |
| | | .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ItemCode == where.model) |
| | | .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode)) |
| | | .ToListAsync(); |
| | | .WhereIF(!string.IsNullOrEmpty(where.deliveryNo), x => x.DeliveryNo.Equals(where.deliveryNo)) |
| | | .OrderBy(x=>x.CREATE_TIME).OrderBy(x => x.Scanner).ToListAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |