Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
@@ -10,6 +10,7 @@ using System.Linq;
|
||||
using System.ServiceModel;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.Erp.Customer;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
@@ -53,8 +54,10 @@ namespace WMS.Web.Api.Controllers
|
||||
[Route("hj")]
|
||||
public async Task<string> TestHJ()
|
||||
{
|
||||
var entity=await _takeStockRepositories.GetEntityList(new List<int>() {2 });
|
||||
var r= await _takeStockService.Loss_Profit(entity.First());
|
||||
List<ErpCustomerDto> list = null;
|
||||
var b= list.FirstOrDefault(f => f.Id == 123);
|
||||
//var entity=await _takeStockRepositories.GetEntityList(new List<int>() {2 });
|
||||
//var r= await _takeStockService.Loss_Profit(entity.First());
|
||||
//var list = await GetList();
|
||||
//var c = await _erpService.BillQueryForSubStock(null,null);
|
||||
//var bc2 = await _erpService.BillQueryForDeliveryNoticeOutStock(new List<string>() { "FHTZD8022232" }, DateTime.Now.AddDays(-10));
|
||||
|
||||
@@ -1607,11 +1607,11 @@
|
||||
解绑
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.OutStock(System.String,WMS.Web.Domain.Values.OutStockType,System.Int32)">
|
||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.OutStock(System.Collections.Generic.List{System.String},WMS.Web.Domain.Values.OutStockType,System.Int32)">
|
||||
<summary>
|
||||
出库
|
||||
</summary>
|
||||
<param name="outStockBillNo">出库单号</param>
|
||||
<param name="salBillNos">出库单号</param>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.InStock(System.String,WMS.Web.Domain.Values.InstockType)">
|
||||
<summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
@@ -110,13 +111,13 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// <summary>
|
||||
/// 出库
|
||||
/// </summary>
|
||||
/// <param name="outStockBillNo">出库单号</param>
|
||||
public void OutStock(string outStockBillNo, OutStockType type,int customerId)
|
||||
/// <param name="salBillNos">出库单号</param>
|
||||
public void OutStock(List<string> salBillNos, OutStockType type,int customerId)
|
||||
{
|
||||
this.BoxId = 0;
|
||||
if (type == OutStockType.Sal)
|
||||
{
|
||||
this.SalBillNo = outStockBillNo;
|
||||
this.SalBillNo = JsonConvert.SerializeObject(salBillNos);
|
||||
this.CustomerId = customerId;
|
||||
this.OutStockTime = DateTime.Now;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -194,7 +195,7 @@ namespace WMS.Web.Domain.Services
|
||||
var outstockDetail = outStock.Details.FirstOrDefault(f => f.MaterialId == entity.MaterialId);
|
||||
if (outstockDetail == null) continue;
|
||||
//修改序列号和箱绑定关系
|
||||
entity.OutStock(outStock.BillNo, outStock.Type, outStock.ReceiptCustomerId);
|
||||
entity.OutStock(outstockDetail.ErpDetails.Select(s => s.SaleBillNo).ToList(), outStock.Type, outStock.ReceiptCustomerId);
|
||||
|
||||
//记录序列号操作日志
|
||||
SerialNumberOperate op = new SerialNumberOperate()
|
||||
@@ -206,7 +207,7 @@ namespace WMS.Web.Domain.Services
|
||||
OperateTime = DateTime.Now,
|
||||
OperateType = OutStockTypeConvert(outStock.Type),
|
||||
OperateUser = userName,
|
||||
Remark = "来源单号:" + string.Join(",", outstockDetail.ErpDetails.Select(s=>s.SourceBillNo)) + "\r\n" + "出库单号:" + outStock.BillNo
|
||||
Remark = "来源单号:" + string.Join(",", outstockDetail.ErpDetails.Select(s => s.SourceBillNo)) + "\r\n" + "出库单号:" + outStock.BillNo
|
||||
};
|
||||
if (outStock.Type == OutStockType.Sal)
|
||||
{
|
||||
@@ -387,7 +388,7 @@ namespace WMS.Web.Domain.Services
|
||||
//if (backRecord.Type == BackRecordType.InstockOff)
|
||||
// entity.UnBind();
|
||||
if (backRecord.Type == BackRecordType.OutstockOn)
|
||||
entity.Bind(detail.BoxId,box.CompleteCartonTime);
|
||||
entity.Bind(detail.BoxId, box.CompleteCartonTime);
|
||||
|
||||
|
||||
//记录序列号操作日志
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Dto.Erp;
|
||||
using WMS.Web.Core.Dto.Erp.Customer;
|
||||
using WMS.Web.Core.Dto.SerialNumbers;
|
||||
using WMS.Web.Core.Help;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
@@ -99,15 +102,15 @@ namespace WMS.Web.Repositories
|
||||
/// <returns></returns>
|
||||
public async Task<SerialNumbersResponse> Get(string serialNumber)
|
||||
{
|
||||
List<ErpMaterialDto> materials = new List<ErpMaterialDto>();
|
||||
var materials_result = await _erpService.BillQueryForMaterial();
|
||||
if (!materials_result.IsSuccess)
|
||||
return null;
|
||||
var materials = materials_result.Data.ToList();
|
||||
if (materials_result.IsSuccess)
|
||||
materials = materials_result.Data.ToList();
|
||||
|
||||
List<ErpCustomerDto> customers = new List<ErpCustomerDto>();
|
||||
var customer_result = await _erpService.BillQueryForCustomer();
|
||||
if (!customer_result.IsSuccess)
|
||||
return null;
|
||||
var customers = customer_result.Data.ToList();
|
||||
if (customer_result.IsSuccess)
|
||||
customers = customer_result.Data.ToList();
|
||||
|
||||
var s = await _context.SerialNumbers
|
||||
.FirstOrDefaultAsync(f => serialNumber.Equals(f.SerialNumber));
|
||||
@@ -121,10 +124,20 @@ namespace WMS.Web.Repositories
|
||||
InStockTime = s.InStockTime.DateToStringSeconds(),
|
||||
OutStockTime = s.OutStockTime.DateToStringSeconds(),
|
||||
PurchaseBillNo = s.PurchaseBillNo,
|
||||
SalBillNo = s.SalBillNo,
|
||||
Customer = _erpBasicDataExtendService.GetCustomerName(customers, s.CustomerId),
|
||||
SerialNumber = s.SerialNumber
|
||||
};
|
||||
if (!string.IsNullOrEmpty(s.SalBillNo))
|
||||
{
|
||||
Random rd = new Random();
|
||||
var list = JsonConvert.DeserializeObject<List<string>>(s.SalBillNo);
|
||||
if (list.Count() > 0)
|
||||
{
|
||||
int index = rd.Next(0, list.Count);
|
||||
respone.SalBillNo = list[index];
|
||||
}
|
||||
}
|
||||
|
||||
return respone;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user