Compare commits

...

16 Commits

Author SHA1 Message Date
69c381cf4e 修改被删除的意外 2025-09-03 17:26:56 +08:00
326a616289 不再有暂存 2025-09-03 15:25:12 +08:00
7be6f47c02 删除掉暂存单 2025-09-03 15:15:07 +08:00
af4de76221 改了是否需要暂存 2025-09-02 15:14:50 +08:00
f9cfba7d51 改成不要暂存 2025-09-02 10:55:28 +08:00
f275c8a6a6 测试 2025-08-14 14:21:49 +08:00
884aaea83d 改了调入 2025-08-14 12:01:35 +08:00
d9708a6b00 采购上架入库加了为空限制 2025-08-13 15:43:06 +08:00
b7ae59c921 作废出库 2025-07-28 16:07:24 +08:00
eef9fc6b9d 改了为0 2025-07-18 10:47:46 +08:00
2c7dbd8a0e 改了生产入库 2025-07-17 17:27:53 +08:00
2971f55b32 修改入库 2025-07-17 16:41:14 +08:00
e0d44c9e57 修改了入库 2025-07-17 15:58:08 +08:00
3ae1d42bcd 修改了初始入库 2025-07-17 15:39:02 +08:00
5c7e037a6f 盘点 2025-07-16 17:57:15 +08:00
9448d5ae09 2025-07-16 17:39:43 +08:00
17 changed files with 262 additions and 142 deletions

View File

@@ -37,13 +37,26 @@
"PublicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx4RaUAcPIEzHkMA0dvp51SbvC+ASiitHw9h6sCq8blqh8Cmx+ZfldxmX+sGqUDL40Eo07tQGWpY8WTlUROCOB9PIfZC6Wb+ntM6x8FzvcW5xfiKDfd6tbp5+ztFHVvutde0ceYk4VjOw5Q1wGJENZoQxQGd6/tt/cHbyNKF3HeAPCLJkMriKBXn3k4r4kix5oetVpaacFABBMRS019n/k0S8fg2H+72WaPVJElRk/iCkQwBA6JIKt/iSVXR8qMe+K6NTRnND4j5i7Ai0TgEV8MRlRMRVK7q4MyO0TPky//0HtVULdhb+G/XbF08ZgIgXlFBroQCEEj0RqdLio0Bg9wIDAQAB", //公钥
"PrivateKey": "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDHhFpQBw8gTMeQwDR2+nnVJu8L4BKKK0fD2HqwKrxuWqHwKbH5l+V3GZf6wapQMvjQSjTu1AZaljxZOVRE4I4H08h9kLpZv6e0zrHwXO9xbnF+IoN93q1unn7O0UdW+6117Rx5iThWM7DlDXAYkQ1mhDFAZ3r+239wdvI0oXcd4A8IsmQyuIoFefeTiviSLHmh61WlppwUAEExFLTX2f+TRLx+DYf7vZZo9UkSVGT+IKRDAEDokgq3+JJVdHyox74ro1NGc0PiPmLsCLROARXwxGVExFUrurgzI7RM+TL//Qe1VQt2Fv4b9dsXTxmAiBeUUGuhAIQSPRGp0uKjQGD3AgMBAAECggEBAI/1MJDjtwdQPwJznKdobTXeJMdFwzrMpbhq34NzIojhfkziWNdFwTzhS6aTzEaXsK3hjTXx6C++jQa39dTIzdJZ/iSTo9IUFnbAWOWcuOv4i40+a/ALFsplNAwYNshNSkh3cH9FAlA4dd+fhY1ERA3/PeZBhB6V0+sa+AH/qwnzFY+lwOeuaUe4PNEjjnBVhzqV8XApca7HZNlrGmiTuO3J/e4k/FAP11iYYIf8e8JtgocinW1LIxJGBcp7Zyof37k4e+s25B0k5MkXiYlvveMsmlEcU+sYm+uLNtu8eG1R3b1qvi0H8ULdwoSParnKSyYMh0WlZTS8Ka3X33WeCOkCgYEA2Cc/nnJkwPaOXLiAbKg7/4hIne1X3rneVVbwCaebKXfSsCSGoVt5b8vBCgbVZNw79d8Z8ZLEf4e26ayLLXRz9QriMPiWyHUEr0XLZ4lq6E1EdZMBZWmjT9VY8NeAkB+eMPfCZLZe3OoVstuNQA0pGVFJgYXmXgcjJcidxzgIqU0CgYEA7EwAA6OP9DoQq4GcBCuIVGBjEWzbVekMt7f+WeLxGl3NYTWiXiaK6WjF/pvFv7AGQIqwOpnbKahWntpPj5DModhjQN8u/yonhzagubQbDTX0jR3w4gVsv/yyGgksPIwAQT/FW9cOqriqw8IGJG92VQw8dy6M1ZP9yK3yc41Q8VMCgYATH3XLaMdtIuL5ZQFHm6KjOsVh42uQstTuq+BUmlVp18X1+2VFxTf7IgWUA4LBh5JucCx1aMylk7Yk+jTd8p2HokzclEGSvneJoh0ardedcaiK1lSbSjs+htt1gztGhOWT43d5PYEq/jKpPi9C6WcnbD+ai+QTkYIUh6kdxOFPSQKBgQDltLfq0azWMUAVSYi+MQd1ZsHHpbfO2x+m1TFodgoFpJxL3JS7y+IMJvMaoJlqz5Y0Vd4dCYYZB/E0uWrQWGXlC3LpFE0edf85HWy/Ogt2GzZhnHKXdciTFfaZAsPDFCIHTBPyRKyYX655YHsSHly9Loj1HwZ/dT8nP5nKpNzDywKBgB3itp7eQ71y+6npr0MUcYF6cgjhPTLL03zVzJdR3ELzPFW+J69MFwqafoGu+xgGu43pDgIR6gVKqYhqfSk28oRl7YtO4fvk6KRcG5zrc1FyDw3S5XpVc5MhsxmBBXZj5ivBkoqxyDAOqu3MDCbHqg1J5inDu2gA8tbsgJ41pTER" //私钥
},
//"ErpOptions": {
// "EndpointAddress": "http://erp.orico.com.cn/k3cloud/ERPGW.asmx", //金蝶连接地址
// "UserName": "mes", //测试账号密码 mes/A1B2C3Dh/ce20210909/6723b1acf19987 正式账号密码 orico/A123321./Orico/663a26829afbdd //金蝶账户名
// // "UserName": "orico", //正式账号
// "Password": "A1B2C3Dh.", //测试金蝶密码
// // "Password": "A123321.", //正试金蝶密码
// // "ErpId": "ce20210909", //金蝶Id
// "ErpId": "Orico", //正式金蝶Id
// "ZhangTaoId": "6723b1acf19987" //测试金蝶账套Id
// // "ZhangTaoId": "663a26829afbdd" //正式金蝶账套Id
//},
"ErpOptions": {
"EndpointAddress": "http://erp.orico.com.cn/k3cloud/ERPGW.asmx", //金蝶连接地址
"UserName": "mes", //测试账号密码 mes/A1B2C3Dh/ce20210909/6723b1acf19987 正式账号密码 orico/A123321./Orico/663a26829afbdd //金蝶账户名
"Password": "A1B2C3Dh.", //金蝶密码
"ErpId": "ce20210909", //金蝶Id
"ZhangTaoId": "6723b1acf19987"//金蝶账套Id
"ZhangTaoId": "6723b1acf19987" //金蝶账套Id
},
"OpsOptions": {
"Url": "https://api.opsscm.test.f2b211.com/", //https://api.opsscm.test.f2b211.com/ //OPS供应链系统 测试http://127.0.0.1:8035
"UserName": "admin", //账户名 这是之前链接老ops 需要的用户名密码 现在链接 OPS供应链系统是不需要了
@@ -55,9 +68,9 @@
"AppSecret": "n/HUKD2wVdTbvhnFZbVBPw==" //领星授权
},
"JuShuiTanOptions": {
"Url": "https://openapi.jushuitan.com",//聚水潭连接地址
"AppKey": "17231841286c45f99eb9acf445404349",//聚水潭Key
"AppSecret": "5ce9641ae6db4abb8b96eea7df6a81e9",//聚水潭授权
"Url": "https://openapi.jushuitan.com", //聚水潭连接地址
"AppKey": "17231841286c45f99eb9acf445404349", //聚水潭Key
"AppSecret": "5ce9641ae6db4abb8b96eea7df6a81e9", //聚水潭授权
"AccessToken": "4605358c37374780a8a4395e6cdb1c3f" //一年后过期(2025/10/18)
},
"Qiniu": {
@@ -122,7 +135,7 @@
"QuartzTriggerDescription": "OpsJobTrigger"
},
"EmailOptions": {
"SmtpServer": "smtp.qiye.aliyun.com",//邮箱配置
"SmtpServer": "smtp.qiye.aliyun.com", //邮箱配置
"SmtpPort": 587,
"SenderName": "深圳市元创时代",
"SendTitle": "【深圳市元创时代】-产品入库通知",
@@ -130,7 +143,7 @@
"SenderEmailPwd": "K4h6GgxZYGMYV1Bb"
},
"SmsOptions": {
"AccessKeyId": "LTAI5tBJg6KeDV2V1NiS7Ngi",//短信配置
"AccessKeyId": "LTAI5tBJg6KeDV2V1NiS7Ngi", //短信配置
"AccessKeySecret": "MAC8bMovSFyCgRQGkfhVcL1jvLJ8cP",
"SignName": "深圳市元创时代",
"TemplateCode": "SMS_465408787"

View File

@@ -7106,11 +7106,6 @@
仓位
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.TakeStock.TakeStockQueryInfoResponse.BoxBillNo">
<summary>
箱号
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.TakeStock.TakeStockQueryInfoResponse.Erp_SubStock">
<summary>
子仓库

View File

@@ -7689,6 +7689,11 @@
盘点单
</summary>
</member>
<member name="F:WMS.Web.Domain.Values.OrderType.ProduceSotck_In">
<summary>
盘点单
</summary>
</member>
<member name="T:WMS.Web.Domain.Values.OutStockStatus">
<summary>
出库状态

View File

@@ -15,6 +15,12 @@ namespace WMS.Web.Core.Dto.Erp
this.FormId = formId;
this.Numbers =new List<string>() { number };
}
public ErpOperateDto(string formId, string number,string ids)
{
this.FormId = formId;
this.Numbers = new List<string>() { };
this.Ids = ids;
}
/// <summary>
/// 业务对象表单Id必录
/// </summary>
@@ -24,5 +30,7 @@ namespace WMS.Web.Core.Dto.Erp
/// 单据编码
/// </summary>
public List<string> Numbers { get; set; }
public string Ids { get; set; }
}
}

View File

@@ -49,10 +49,10 @@ namespace WMS.Web.Core.Dto.TakeStock
/// </summary>
[Column("仓位")]
public string SubStock { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string BoxBillNo { get; set; }
///// <summary>
///// 箱号
///// </summary>
//public string BoxBillNo { get; set; }
/// <summary>
/// 子仓库
/// </summary>

View File

@@ -1,4 +1,5 @@
using System;
using NPOI.OpenXmlFormats.Dml.Diagram;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
@@ -102,9 +103,18 @@ namespace WMS.Web.Domain.Entitys
public void Create(InstockType type, string sourceBillNo, DateTime createTime, int supplierId, string orgCode)
{
if (type == InstockType.Purchase)
{
this.Status = InstockStatus.Wait;
}
else if (type == InstockType.ProduceSotck)
{
this.Status = InstockStatus.Wait;
}
else
{
this.Status = InstockStatus.WaitInStock;
}
this.Type = type;
this.SourceBillNo = sourceBillNo;
this.SupplierId = supplierId;
@@ -202,6 +212,8 @@ namespace WMS.Web.Domain.Entitys
this.Status = InstockStatus.Already;
else if (totalReceiveQty <= 0 && this.Type == InstockType.Purchase)
this.Status = InstockStatus.Wait;
else if (totalReceiveQty <= 0 && this.Type == InstockType.ProduceSotck)
this.Status = InstockStatus.Wait;
else if (totalRealityQty <= 0)
this.Status = InstockStatus.WaitInStock;
else

View File

@@ -2016,6 +2016,9 @@ namespace WMS.Web.Domain.Services
return OrderType.Stkdirecttransfers_In;
case InstockType.StktransferInst:
return OrderType.StktransferInst_In;
case InstockType.ProduceSotck:
return OrderType.ProduceSotck_In;
default:
return OrderType.StktransferInst_In;
}

View File

@@ -1,10 +1,12 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Npoi.Mapper;
using NPOI.SS.Formula.Functions;
using StackExchange.Redis;
using System;
using System.Collections.Concurrent;
@@ -195,6 +197,10 @@ namespace WMS.Web.Domain.Services
{
t = InstockType.ProduceSotck;
}
else if(instock.instockType=="")
{
return Result.ReFailure(ResultCodes.ShelfNoPurchaseSave_InstokType_Error);
}
else
{
t = InstockType.Purchase;
@@ -951,7 +957,15 @@ namespace WMS.Web.Domain.Services
var sourceBillNos = entity.ErpDetails.GroupBy(x => x.SourceBillNo).Select(x => x.Key).ToList();
var erp_InStockErpDetails = await sc_inStockRepositories.GetErpDetails(sourceBillNos);
if (erpDetails.Count == 0)
{
for (int i = 0; i < entity.ErpDetails.Count; i++)
{
entity.SyncFail("失败,找不到数据,请检查采购订单是否反审核或是否有被删除", entity.ErpDetails[0].ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, SyncStatus.Fail);
}
}
else
{
foreach (var det in erpDetails)
{
var erpDto = new ErpPushDto()
@@ -960,7 +974,8 @@ namespace WMS.Web.Domain.Services
FormId = FormIdParam.PUR_PurchaseOrder.ToString(),
TargetFormId = FormIdParam.STK_InStock.ToString(),
DetailsId = det.ErpDetailId.ToString(),
IsDraftWhenSaveFail = true//是否需要暂存
IsDraftWhenSaveFail = true//是否需要暂存fa
//IsDraftWhenSaveFail = false//是否需要暂存
};
var erp_InStockBillNos = erp_InStockErpDetails.Where(x => x.SourceBillNo == det.SourceBillNo).Select(x => x.ErpSyncBillNo).ToList();
@@ -986,7 +1001,7 @@ namespace WMS.Web.Domain.Services
else
{
//下推金蝶
var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories,"pur");
var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories, "pur");
if (res.result.IsSuccess)
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
else
@@ -997,6 +1012,7 @@ namespace WMS.Web.Domain.Services
}
}
//最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱
var isSuccess = await sc_InStockRepositories.Update(entity, true);
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
@@ -1040,7 +1056,15 @@ namespace WMS.Web.Domain.Services
var sourceBillNos = entity.ErpDetails.GroupBy(x => x.SourceBillNo).Select(x => x.Key).ToList();
var erp_InStockErpDetails = await sc_inStockRepositories.GetErpDetails(sourceBillNos);
if (erpDetails.Count == 0)
{
for (int i = 0; i < entity.ErpDetails.Count; i++)
{
entity.SyncFail("失败,找不到数据,请检查生产汇报单是否反审核或是否有被删除", entity.ErpDetails[0].ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, SyncStatus.Fail);
}
}
else
{
foreach (var det in erpDetails)
{
var erpDto = new ErpPushDto()
@@ -1051,6 +1075,7 @@ namespace WMS.Web.Domain.Services
TargetFormId = FormIdParam.PRD_INSTOCK.ToString(),
DetailsId = det.ErpDetailId.ToString(),
IsDraftWhenSaveFail = true//是否需要暂存
//IsDraftWhenSaveFail = false//是否需要暂存
};
var erp_InStockBillNos = erp_InStockErpDetails.Where(x => x.SourceBillNo == det.SourceBillNo).Select(x => x.ErpSyncBillNo).ToList();
@@ -1084,6 +1109,7 @@ namespace WMS.Web.Domain.Services
//记录金蝶入库单明细ID
det.RecodErpInStockDetailId(res.instockDetailId);
}
}
}
@@ -1160,6 +1186,9 @@ namespace WMS.Web.Domain.Services
var res_s = await sc_erpService.Save<ErpProduceInStockSaveDto>(purchaseInStock, formId);
if (!res_s.IsSuccess)
{
ErpOperateDto o_dto1 = new ErpOperateDto(dto.TargetFormId, null, id);//res_s.Data
//如果有错,就删除相关单据
var del_res = await sc_erpService.Delete(o_dto1, dto.TargetFormId);
_logger.LogInformation($"入库单->保存失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{res_s.Message}");
return (Result.ReFailure(res_s.Message, res_s.Status), SyncStatus.SubmitFail, "", purchaseInStock.Details[0].DetailId);
}

View File

@@ -78,6 +78,11 @@ namespace WMS.Web.Domain.Services
var result = await this.SsynPurchaseInStock(billNos, isTransaction);
if (!result.IsSuccess) isRollback = true;
}
else if(task.Type==InstockType.ProduceSotck)
{
var result = await this.SsynProduceSotck(billNos, isTransaction);
if (!result.IsSuccess) isRollback = true;
}
else if (task.Type == InstockType.Miscellaneous)
{
var result = await this.SysnMiscellaneous(billNos, isTransaction);
@@ -261,6 +266,12 @@ namespace WMS.Web.Domain.Services
// var beginTime = DateTime.Now.AddDays(-200);//默认拉去8小时以内的数据ALTER BY YZH这里要改回去
//4.同步数据:分步式入库单
var Transferin_result = await this.SysnTransferin(null, isTransaction, beginTime);
if (!Transferin_result.IsSuccess)
return Result.ReFailure(Transferin_result.Message, Transferin_result.Status);
//6.同步数据:生产入库单
var ProduceSotck_result = await this.SsynProduceSotck(null, isTransaction, beginTime);
if (!ProduceSotck_result.IsSuccess)
@@ -268,10 +279,6 @@ namespace WMS.Web.Domain.Services
//4.同步数据:分步式入库单
var Transferin_result = await this.SysnTransferin(null, isTransaction, beginTime);
if (!Transferin_result.IsSuccess)
return Result.ReFailure(Transferin_result.Message, Transferin_result.Status);
@@ -308,7 +315,7 @@ namespace WMS.Web.Domain.Services
List<string> TransferDirect_sourceBillNos = new List<string>();
List<string> Transferin_sourceBillNos = new List<string>();
List<string> AssembledApp_sourceBillNos = new List<string>();
List<string> ProduceStock_sourceBillNos = new List<string>();
var taskList = await _inStockTaskRepositories.GetListBy(billNos);
foreach (var entity in taskList)
{
@@ -322,6 +329,10 @@ namespace WMS.Web.Domain.Services
AssembledApp_sourceBillNos.Add(entity.SourceBillNo);
else if (entity.Type == InstockType.Miscellaneous)
Miscellaneous_sourceBillNos.Add(entity.SourceBillNo);
else if (entity.Type == InstockType.ProduceSotck)
ProduceStock_sourceBillNos.Add(entity.SourceBillNo);
}
if (Instock_sourceBillNos.Count() > 0)
@@ -359,6 +370,15 @@ namespace WMS.Web.Domain.Services
if (!AssembledApp_result.IsSuccess)
return Result.ReFailure(AssembledApp_result.Message, AssembledApp_result.Status);
}
if (ProduceStock_sourceBillNos.Count() > 0)
{
//5.同步数据:生产汇报单
var ProduceStock_result = await this.SsynPurchaseInStock(ProduceStock_sourceBillNos, isTransaction);
if (!ProduceStock_result.IsSuccess)
return Result.ReFailure(ProduceStock_result.Message, ProduceStock_result.Status);
}
}
return Result.ReSuccess();
}
@@ -629,18 +649,18 @@ namespace WMS.Web.Domain.Services
bool IsAny = details_Groups.Any(d => d.RealityQtyTotal != 0 && d.AccruedQtyTotal > d.RealityQtyTotal);
if (IsAny)
order.Status = InstockStatus.Part;
else if (details_Groups.Sum(x => x.ReceiveQtyTotal) <= 0 && order.Type == InstockType.Purchase)
else if (details_Groups.Sum(x => x.ReceiveQtyTotal) <= 0 && (order.Type == InstockType.Purchase || order.Type == InstockType.ProduceSotck))
order.Status = InstockStatus.Wait;
else if (details_Groups.Sum(x => x.RealityQtyTotal) <= 0)
{
if (order.Type == InstockType.ProduceSotck)
{
order.Status = InstockStatus.Wait;
}
else
{
//if (order.Type == InstockType.ProduceSotck)
//{
// order.Status = InstockStatus.Wait;
//}
//else
//{
order.Status = InstockStatus.WaitInStock;
}
//}
}
else if (details_Groups.Sum(x => x.RealityQtyTotal) >= details_Groups.Sum(x => x.AccruedQtyTotal))
order.Status = InstockStatus.Already;
@@ -800,7 +820,7 @@ namespace WMS.Web.Domain.Services
List<string> TransferDirect_sourceBillNos = new List<string>();
List<string> Transferin_sourceBillNos = new List<string>();
List<string> AssembledApp_sourceBillNos = new List<string>();
// List<string> ProduceSotck_sourceBillNos = new List<string>();//生产入库
List<string> ProduceSotck_sourceBillNos = new List<string>();//生产入库
foreach (var entity in list)
{
@@ -814,17 +834,24 @@ namespace WMS.Web.Domain.Services
AssembledApp_sourceBillNos.Add(entity.SourceBillNo);
else if (entity.Type == InstockType.Miscellaneous)
Miscellaneous_sourceBillNos.Add(entity.SourceBillNo);
//else if (entity.Type == InstockType.ProduceSotck)
// ProduceSotck_sourceBillNos.Add(entity.SourceBillNo);
else if (entity.Type == InstockType.ProduceSotck)
ProduceSotck_sourceBillNos.Add(entity.SourceBillNo);
}
if (Transferin_sourceBillNos.Count() > 0)
{
var erp_result = await _erpService.BillQueryForTransferin(Transferin_sourceBillNos, null);
if (!erp_result.IsSuccess)
return Result<List<ErpInStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
erp_list.AddRange(erp_result.Data);
}
//if (ProduceSotck_sourceBillNos.Count() > 0)//生产入库
//{
// var erp_result = await _erpService.BillQueryForProduceSotckin(ProduceSotck_sourceBillNos, null);
// if (!erp_result.IsSuccess)
// return Result<List<ErpInStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
// erp_list.AddRange(erp_result.Data);
//}
if (ProduceSotck_sourceBillNos.Count() > 0)//生产入库
{
var erp_result = await _erpService.BillQueryForProduceSotckin(ProduceSotck_sourceBillNos, null);
if (!erp_result.IsSuccess)
return Result<List<ErpInStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
erp_list.AddRange(erp_result.Data);
}
if (Instock_sourceBillNos.Count() > 0)
{
@@ -847,13 +874,7 @@ namespace WMS.Web.Domain.Services
return Result<List<ErpInStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
erp_list.AddRange(erp_result.Data);
}
if (Transferin_sourceBillNos.Count() > 0)
{
var erp_result = await _erpService.BillQueryForTransferin(Transferin_sourceBillNos, null);
if (!erp_result.IsSuccess)
return Result<List<ErpInStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
erp_list.AddRange(erp_result.Data);
}
if (AssembledApp_sourceBillNos.Count() > 0)
{
var erp_result_ass = await _erpService.BillQueryForAssembledApp_Assembly(AssembledApp_sourceBillNos, null);

View File

@@ -756,9 +756,9 @@ namespace WMS.Web.Domain.Services
var detailsB = response.Details.Where(f => f.MaterialCount > 1)
//.ThenByDescending(s => s.Method)
// .ThenByDescending(s => s.Specifications)
//.ThenByDescending(s => s.BoxBillNo).ThenBy(s => s.BoxLength)
.OrderByDescending(s => s.BoxBillNo).ThenByDescending(s => s.Method).ThenByDescending(s => s.Specifications).ThenByDescending(s => s.Qty).ToList();
.OrderByDescending(s => s.BoxBillNo).ThenByDescending(s => s.Method).ThenByDescending(s => s.Qty).ToList();
detailsA.AddRange(detailsB);
response.Details=detailsA;
@@ -956,6 +956,9 @@ namespace WMS.Web.Domain.Services
List<string> TransferOut_Nos = new List<string>();
List<string> AssembledApp_Nos = new List<string>();
List<string> MisDeliveryOut_Nos = new List<string>();
List<string> PickingOut_Nos = new List<string>();//生产入库
foreach (var entity in list)
{
if (entity.Type == OutStockType.Sal)
@@ -968,8 +971,19 @@ namespace WMS.Web.Domain.Services
AssembledApp_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
else if (entity.Type == OutStockType.Miscellaneous)
MisDeliveryOut_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
else if (entity.Type == OutStockType.PickingOut)
PickingOut_Nos.AddRange(entity.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo));
}
if (PickingOut_Nos.Count() > 0)
{
var erp_result = await _erpService.BillQueryForPickingOutStock(PickingOut_Nos, null);
if (!erp_result.IsSuccess)
return Result<List<ErpDeliveryNoticeOutStockResultDto>>.ReFailure(erp_result.Message, erp_result.Status);
erp_list.AddRange(erp_result.Data);
}
if (SalOutStock_Nos.Count() > 0)
{
var erp_result = await _erpService.BillQueryForSalOutStock(SalOutStock_Nos, null);

View File

@@ -597,15 +597,16 @@ namespace WMS.Web.Domain.Services.Public
//2.时间条件:可能还有其它条件
//var beginTime = DateTime.Now.AddDays(-2).ToString("yyyy-MM-dd 00:00:00");
// var beginStr = DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd HH:mm:ss");
var beginStr = DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd HH:mm:ss");
// var beginStr = DateTime.Now.AddDays(-180).ToString("yyyy-MM-dd HH:mm:ss");
// var beginStr = DateTime.Now.AddDays(-180).ToString("yyyy-MM-dd HH:mm:ss");
// var beginStr = DateTime.Now.AddDays(-10).ToString("yyyy-MM-dd HH:mm:ss");
if (beginTime != null) beginStr = beginTime?.ToString("yyyy-MM-dd HH:mm:ss");
// beginStr = DateTime.Now.AddDays(-10).ToString("yyyy-MM-dd HH:mm:ss");
var endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//3.获取金蝶分步式入库订单:拼接参数和条件
var query = new ErpBillQueryDto(token_result.Data);
var param = new ErpBillQueryParamDto(FormIdParam.STK_TRANSFERIN.ToString());
param.FieldKeys = "FBillNo,FStockOrgID,FMaterialID.FNumber,FDestStockID,FDestStockID.FNumber,FQty,FCreateDate,FEntryNote,FStockOrgID.FNumber,FSTKTRSINENTRY_FEntryID";
param.FieldKeys = "FSrcBillType,FBillNo,FStockOrgID,FMaterialID.FNumber,FDestStockID,FDestStockID.FNumber,FQty,FCreateDate,FEntryNote,FStockOrgID.FNumber,FSTKTRSINENTRY_FEntryID";
param.Limit = 10000;
//查询条件:备注其中的条件值以金蝶的值为准!!!
//1.创建时间在两天前和当天时间之间
@@ -615,7 +616,8 @@ namespace WMS.Web.Domain.Services.Public
//当金蝶系统物料明细行调出仓库和调入仓库相同, 数据不需要拉取
//param.FilterString = " FDocumentStatus='C' and FBillTypeID='e65a4f29743a44b7b67dc8145e1f9c92'";
param.FilterString = " 1=1";
param.FilterString += " and FSrcBillType<>'STK_TRANSFERIN'";
// param.FilterString += " and FSrcBillType<>'STK_TRANSFERIN' and FBillNo='FBDR226242'";
param.FilterString += " and FSrcBillType<>'STK_TransferDirect'";
if (isCheck) param.FilterString += " and FDocumentStatus='C'";
param.FilterString += " and FSrcStockId!=FDestStockId";
for (int i = 0; i < stocks.Count(); i++)
@@ -651,7 +653,7 @@ namespace WMS.Web.Domain.Services.Public
}//注意:当有单据编号的查询的时候,时间条件去掉;不然就查不到数据了
else
{
//param.FilterString = param.FilterString + " and FCreateDate>='" + beginTime + "' and FCreateDate<='" + endTime + "'";
// param.FilterString = param.FilterString + " and FCreateDate>='" + beginStr + "' and FCreateDate<='" + endTime + "'";
param.FilterString = param.FilterString + " and FApproveDate>='" + beginStr + "' and FApproveDate<='" + endTime + "'";
}
@@ -795,6 +797,7 @@ namespace WMS.Web.Domain.Services.Public
lis.ErpDetailId = Convert.ToInt32(item[12]);
lis.Type = (int)InstockType.ProduceSotck;
lis.SaleBillNo = item[1];
erp_list.Add(lis);
}
//_logger.LogInformation("分步式调入条数:" + erp_list.Count);
@@ -1898,6 +1901,8 @@ namespace WMS.Web.Domain.Services.Public
}
var msg = jobject["Result"]["ResponseStatus"]["Errors"][0]["Message"].ToString();
return Result<string>.ReFailure(msg, 10002);
}
catch (Exception ex)
@@ -2014,7 +2019,7 @@ namespace WMS.Web.Domain.Services.Public
var token_result = await this.Init();
if (!token_result.IsSuccess)
return token_result;
var query = new ErpBillQueryDto(token_result.Data);
var query = new ErpBillQueryDto(token_result.Data,formId);
//提交
query.Data = JsonConvert.SerializeObject(dto);
@@ -2040,6 +2045,7 @@ namespace WMS.Web.Domain.Services.Public
/// <returns></returns>
public async Task<Result<string>> Push(ErpPushDto dto)
{
string id = "";
try
{
var token_result = await this.Init();
@@ -2054,10 +2060,11 @@ namespace WMS.Web.Domain.Services.Public
JObject jobject = (JObject)JsonConvert.DeserializeObject(result_json);
var isSuccess = jobject["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToLower();
if (jobject["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToLower() == "true")
{
//保存成功后返回Id 后续操作根据Id操作
string id = jobject["Result"]["ResponseStatus"]["SuccessEntitys"][0]["Id"].ToString();
id = jobject["Result"]["ResponseStatus"]["SuccessEntitys"][0]["Id"].ToString();
return Result<string>.ReSuccess(id);
}
@@ -2066,6 +2073,8 @@ namespace WMS.Web.Domain.Services.Public
}
catch (Exception ex)
{
return Result<string>.ReFailure(ex.ToString(), 10002);
}
}

View File

@@ -80,5 +80,12 @@ namespace WMS.Web.Domain.Values
/// </summary>
[EnumRemark("盘点单")]
Take = 14,
/// <summary>
/// 盘点单
/// </summary>
[EnumRemark("生产入库")]
ProduceSotck_In = 15,
}
}

View File

@@ -26,6 +26,7 @@ namespace WMS.Web.Domain.Values
public static ValueTuple<int, string> Concurrent_Instock = (80005, "该来源单正在处理中");
/// <summary>
/// 没有菜单权限,无法登录
/// </summary>
@@ -83,7 +84,7 @@ namespace WMS.Web.Domain.Values
public static ValueTuple<int, string> InventoryDetailsWriteError = (800014, "写入即时库存明细失败!");
public static ValueTuple<int, string> MoveInventoryError = (800015, "箱已经上架,不能重复上架");
public static ValueTuple<int, string> BoxInventoryChangeBoxError = (800016, "箱已上架不支持再次装箱");
public static ValueTuple<int, string> ShelfNoPurchaseSave_InstokType_Error = (80017, "类型不能为空值");
public static ValueTuple<int, string> SerialNumbersNoData = (610000, "序列号不存在");
public static ValueTuple<int, string> SerialNumbersBoxError = (610002, "序列号已经绑定箱");

View File

@@ -405,18 +405,21 @@ namespace WMS.Web.Repositories
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
.GroupJoin(_context.Box, p => p.order.BoxId, t => t.Id, (p, ts) => new { p.detail, p.order, ts })
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.detail, p.order, box })
.Where(adv => 1 == 1 && adv.box.BoxBillNo.Equals(dto.BoxBillNo));
.Where(adv => 1 == 1 && adv.detail.Qty>0 && adv.box.BoxBillNo.Equals(dto.BoxBillNo));
if (!string.IsNullOrEmpty(dto.StockCode))
{
var splitStrs = dto.StockCode.Split("_$");
query = query.Where(w => w.order.StockCode == splitStrs[0] && w.order.OrgCode == splitStrs[1]);
}
GetPagedListBoxByBoxResponse response = new GetPagedListBoxByBoxResponse();
response.BoxBillNo = dto.BoxBillNo;
response.TotalCount = await query.CountAsync();
response.TotalQty = await query.SumAsync(s => s.detail.Qty);
response.Details = await query.Select(s => new GetPagedListBoxByBoxDetailsResponse()
{
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialNumber),

View File

@@ -515,7 +515,7 @@ namespace WMS.Web.Repositories
//这里只查状态为:部分入库和等待收货
var task_query = _context.InStockTask
.Where(w => EF.Functions.Like(w.SourceBillNo, "%" + dto.SourceBillNo + "%") && w.Type != InstockType.Purchase && (w.Status == InstockStatus.Part || w.Status == InstockStatus.Wait || w.Status == InstockStatus.WaitInStock));
.Where(w => EF.Functions.Like(w.SourceBillNo, "%" + dto.SourceBillNo + "%") && w.Type != InstockType.Purchase && w.Type!=InstockType.ProduceSotck && (w.Status == InstockStatus.Part || w.Status == InstockStatus.Wait || w.Status == InstockStatus.WaitInStock));
//找到头列表
var taskList = await task_query

View File

@@ -270,7 +270,7 @@ namespace WMS.Web.Repositories
BeforeQty = s.detail.BeforeQty,
AfterQty = s.detail.AfterQty,
FinalQty = s.detail.FinalQty,
BoxBillNo=s.box.BoxBillNo,
// BoxBillNo=s.box.BoxBillNo,
ResultType = s.order.ResultType.GetRemark(),
Remark = s.detail.Remark,
FailRemark = s.order.FailRemark,