Browse Source

报废、补打方法修改

master
lvzb 1 year ago
parent
commit
05f394de27
  1. 22
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/QueryWaitPrintDto.cs
  2. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Interfaces/IWaitPrintAppService.cs
  3. 20
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml
  4. 137
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/MenBanPackingRecService.cs
  5. 88
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  6. 19
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

22
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/QueryWaitPrintDto.cs

@ -37,7 +37,29 @@ namespace WY.NewJit.PrintTable.Dtos
public int? HostSNEnd { get; set; }
}
[Serializable]
public class QueryReplenishPrintDto : QueryWaitPrintDto
{
/// <summary>
/// 底牌号起
/// </summary>
public string VINBegin { get; set; }
/// <summary>
/// 底牌号止
/// </summary>
public string VINEnd { get; set; }
/// <summary>
/// 上线时间起
/// </summary>
public DateTime? OnlineTimeBegin { get; set; }
/// <summary>
/// 上线时间止
/// </summary>
public DateTime? OnlineTimeEnd { get; set; }
}
[Serializable]
public class QueryAlreadyPrintDto : QueryWaitPrintDto

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Interfaces/IWaitPrintAppService.cs

@ -3,17 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Uow;
using WY.NewJit.PrintTable.Dtos;
namespace WY.NewJit.PrintTable
{
public interface IWaitPrintAppService
{
/// <summary>
/// 根据生产线获取正常打印单据的起始大众顺序号
/// </summary>
/// <param name="productLine">生产线</param>
/// <returns>起始大众顺序号</returns>
//Task<ObjectResultDto<int?>> GetPrintStartHostSN2(string productLine, string isZhuHuBan, string GroupName = null);
Task<PagedResultDto<WaitPrintDto>> GetReplenishPrintListAsync(QueryReplenishPrintDto input);
}
}

20
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml

@ -3517,6 +3517,26 @@
大众顺序号止
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.Dtos.QueryReplenishPrintDto.VINBegin">
<summary>
底牌号起
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.Dtos.QueryReplenishPrintDto.VINEnd">
<summary>
底牌号止
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.Dtos.QueryReplenishPrintDto.OnlineTimeBegin">
<summary>
上线时间起
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.Dtos.QueryReplenishPrintDto.OnlineTimeEnd">
<summary>
上线时间止
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.Dtos.QueryAlreadyPrintDto.KNRBegin">
<summary>
KNR起

137
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/MenBanPackingRecService.cs

@ -32,6 +32,7 @@ using WY.NewJit.Extends.PaiGe.WMS;
using WY.NewJit.Filter;
using WY.NewJit.MsgBaseData;
using WY.NewJit.MsgCheck;
using WY.NewJit.PrintTable;
namespace Win.Sfs.SettleAccount.FISes
{
@ -54,6 +55,8 @@ namespace Win.Sfs.SettleAccount.FISes
private readonly LineSNDomianService _lineSNDomianServic;
private readonly IRepository<FisTB_BILL_SCRAP> _tbBillScrapRepository;
private readonly IRepository<AlreadyPrint> _alreadyPrintRepository;
private readonly IRepository<WaitPrint> _waitPrintRepository;
/// <summary>
/// 门板装箱单仓储明细
@ -63,7 +66,9 @@ namespace Win.Sfs.SettleAccount.FISes
IRepository<BillM100, Guid> billM100Repository,
WMSDapperRepository wmsRepository,
LineSNDomianService lineSNDomianServic,
IRepository<FisTB_BILL_SCRAP> tbBillScrapRepository
IRepository<FisTB_BILL_SCRAP> tbBillScrapRepository,
IRepository<AlreadyPrint> alreadyPrintRepository,
IRepository<WaitPrint> waitPrintRepository
)
{
_menBanPackingListRepository = menBanPackingListRepository;
@ -71,6 +76,8 @@ namespace Win.Sfs.SettleAccount.FISes
_wmsRepository = wmsRepository;
_lineSNDomianServic = lineSNDomianServic;
_tbBillScrapRepository = tbBillScrapRepository;
_alreadyPrintRepository = alreadyPrintRepository;
_waitPrintRepository = waitPrintRepository;
}
private void DelOrScrapWMSInterface(string billNum, bool isSynchronousMode = false)
@ -263,7 +270,7 @@ namespace Win.Sfs.SettleAccount.FISes
/// <returns>是否执行成功</returns>
[HttpPost]
[Route("scrap")]
[UnitOfWork(isTransactional: false)]
[UnitOfWork]
public virtual async Task<List<string>> ScrapAsync(List<Guid> ids)
{
var selLst = await _menBanPackingListRepository.Where(p => ids.Contains(p.Id)).ToListAsync();
@ -335,17 +342,30 @@ namespace Win.Sfs.SettleAccount.FISes
//批量改为未打印
var _childList = await _menBanPackingListRepository.Where(p => idList.Contains(p.Id)).SelectMany(p => p.Details).ToListAsync();
var _child = _childList.Select(p => p.M100BillId).Distinct().ToList();
var m100Lst = await _billM100Repository.Where(p => _child.Contains(p.Id)).ToListAsync();
m100Lst.ForEach(p =>
var _apList = await _alreadyPrintRepository.Where(p => _child.Contains(p.Id)).ToListAsync();
List<WaitPrint> _wpList = new List<WaitPrint>();
foreach (var ap in _apList)
{
if (p.BillStatus == BillStatusEnum.Publish)
var item = await _waitPrintRepository.GetListAsync(r => r.HostSN2 == ap.HostSN2);
if (item.Count == 0)
{
p.SetBillStatus(BillStatusEnum.Match);
var wp = ObjectMapper.Map<AlreadyPrint, WaitPrint>(ap);
_wpList.Add(wp);
}
p.PrintTime = null;
});
await _billM100Repository.UpdateManyAsync(m100Lst);
else if(item.Count==1)
{
if(ap.BillStatus== BillStatusEnum.BreakNum&&item[0].BillStatus== BillStatusEnum.BreakNum)
{
throw new BusinessException("1001", "未打印列表和已打印列表出现都是断号的情况号码未【"+ ap.HostSN2 + "】,不能报废!");
}
}
else if (item.Count > 1)
{
throw new BusinessException("1001", "未打印列表里出现大众顺序号重复号码为【"+ ap.HostSN2+ "】请检查后在报废!");
}
}
await _alreadyPrintRepository.DeleteManyAsync(_apList);
await _waitPrintRepository.InsertManyAsync(_wpList);
}
else
{
@ -354,6 +374,103 @@ namespace Win.Sfs.SettleAccount.FISes
return wmsLst.Select(p => p.BillNum).ToList();
}
///// <summary>
///// 报废
///// </summary>
///// <param name="ids">IDs</param>
///// <returns>是否执行成功</returns>
//[HttpPost]
//[Route("scrap")]
//[UnitOfWork(isTransactional: false)]
//public virtual async Task<List<string>> ScrapAsync(List<Guid> ids)
//{
// var selLst = await _menBanPackingListRepository.Where(p => ids.Contains(p.Id)).ToListAsync();
// if (selLst == null || selLst.Count == 0)
// {
// throw new BusinessException("1001", "没有选中要作废的已打印装箱单!");
// }
// foreach (var _obj in selLst)
// {
// string maxBillNum = await _menBanPackingListRepository.Where(itm => itm.ProductLine == _obj.ProductLine && itm.ReportStatus == ReportStatusEnum.已打印).MaxAsync(itm => itm.BillNum); //取当前生产线的最大装箱单号
// if (string.IsNullOrEmpty(maxBillNum) == false)
// {
// MenBanPackingList firObj = await _menBanPackingListRepository.FirstOrDefaultAsync(itm => itm.BillNum == maxBillNum);
// if (firObj != null)
// {
// if (_obj.SortId != firObj.SortId)
// {
// throw new BusinessException("1001", "只能报废当前生产线的最后打印单据,要报废的单据不是最后打印单据!");
// }
// }
// }
// }
// var sortList = selLst.Select(p => p.SortId).Distinct().ToList();//筛选出匹配门板
// List<MenBanPackingList> pairlist = _menBanPackingListRepository.Where(p => sortList.Contains(p.SortId)).ToList();
// var idList = pairlist.Select(p => p.Id).ToList();
// var _ls = pairlist.Select(p => p.BillNum).ToList();
// var _strList = new List<string>();
// _ls.ForEach(p => {
// _strList.Add(string.Format("'{0}'", p));
// });
// string str = string.Join(",", _strList.ToArray());
// var wmsLst = _wmsRepository.GetListBySql<TB_BILL>(string.Format("select top 100 * from TB_BILL with(nolock) where (state=1 or state=2) and BillNum in ({0}) ", str));
// if (wmsLst.Count() == 0) //库存没有排序
// {
// //调用库存系统接口
// List<string> billNumLst = pairlist.Select(itm => itm.BillNum).Distinct().ToList();
// foreach (string billNumStr in billNumLst)
// {
// DelOrScrapWMSInterface(billNumStr, true);
// }
// #region 作废时单据序号减一
// string curProductLine = selLst[0].ProductLine;
// DateTime curPrintDate = selLst[0].PrintDate;
// //string curPartType = selLst[0].PartType;
// var priorLst = _menBanPackingListRepository.Where(itm => itm.ReportStatus == ReportStatusEnum.已打印 && itm.ProductLine == curProductLine && idList.Contains(itm.Id) == false);
// if (priorLst.Any())
// {
// string maxBillNum = priorLst.Max(itm => itm.BillNum); //除去要作废记录,取当前生产线的最大单据号
// MenBanPackingList priorObj = priorLst.FirstOrDefault(itm => itm.BillNum == maxBillNum); //除去要作废记录,取当前生产线的最后打印记录
// double updRecCnt = await _lineSNDomianServic.SetMaxSN(ProductTypeEnum.门板, curProductLine, "", priorObj.PrintDate, priorObj.BillSerialNum.TryToDoubleZero(), null); //调用减号接口
// }
// else
// {
// double updRecCnt2 = await _lineSNDomianServic.SetMaxSN(ProductTypeEnum.门板, curProductLine, "", curPrintDate, 0, null); //调用减号接口,没有上条记录时 单据号传0
// }
// #endregion
// foreach (var itm in pairlist)
// {
// itm.ReportStatus = WY.NewJit.Extends.PaiGe.ReportStatusEnum.已作废;
// }
// await _menBanPackingListRepository.UpdateManyAsync(pairlist);
// //批量改为未打印
// var _childList = await _menBanPackingListRepository.Where(p => idList.Contains(p.Id)).SelectMany(p => p.Details).ToListAsync();
// var _child = _childList.Select(p => p.M100BillId).Distinct().ToList();
// var m100Lst = await _billM100Repository.Where(p => _child.Contains(p.Id)).ToListAsync();
// m100Lst.ForEach(p =>
// {
// if (p.BillStatus == BillStatusEnum.Publish)
// {
// p.SetBillStatus(BillStatusEnum.Match);
// }
// p.PrintTime = null;
// });
// await _billM100Repository.UpdateManyAsync(m100Lst);
// }
// else
// {
// throw new BusinessException("1001", "WMS已经排序,不能报废!");
// }
// return wmsLst.Select(p => p.BillNum).ToList();
//}
}
}

88
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs

@ -280,29 +280,29 @@ namespace WY.NewJit.PrintTable
return ret;
}
/// <summary>
/// 查询柱护板
/// </summary>
/// <param name="input"></param>
/// <param name="page"></param>
/// <returns></returns>
private async Task<PagedResultDto<WaitPrintDto>> QueryZHBByConditionAsync(QueryWaitPrintDto input, PagedAndSortedBase page)
{
PagedResultDto<WaitPrintDto> ret = new PagedResultDto<WaitPrintDto>();
var qryAlreadyPrintDto = ObjectMapper.Map<QueryWaitPrintDto, QueryAlreadyPrintDto>(input);
string where = GetWhere(qryAlreadyPrintDto);
ret.TotalCount = await GetEntityCountAsync("FisWaitPrint", where);
//计算分页
int fromRec = page.SkipCount + 1;
int ToRec = page.SkipCount + page.MaxResultCount;
var lst = await GetEntityListFromToAsync<WaitPrintDto>("FisWaitPrint", where, "HostSN2", fromRec, ToRec);
ret.Items = lst;
return ret;
}
///// <summary>
///// 查询柱护板
///// </summary>
///// <param name="input"></param>
///// <param name="page"></param>
///// <returns></returns>
//private async Task<PagedResultDto<WaitPrintDto>> QueryZHBByConditionAsync(QueryWaitPrintDto input, PagedAndSortedBase page)
//{
// PagedResultDto<WaitPrintDto> ret = new PagedResultDto<WaitPrintDto>();
// var qryAlreadyPrintDto = ObjectMapper.Map<QueryWaitPrintDto, QueryAlreadyPrintDto>(input);
// string where = GetWhere(qryAlreadyPrintDto);
// ret.TotalCount = await GetEntityCountAsync("FisWaitPrint", where);
// //计算分页
// int fromRec = page.SkipCount + 1;
// int ToRec = page.SkipCount + page.MaxResultCount;
// var lst = await GetEntityListFromToAsync<WaitPrintDto>("FisWaitPrint", where, "HostSN2", fromRec, ToRec);
// ret.Items = lst;
// return ret;
//}
private static string GetTrueString(string str)
{
@ -480,7 +480,7 @@ namespace WY.NewJit.PrintTable
//填充门板装箱单明细
MenBanPackingRec mbRec = new MenBanPackingRec();
mbRec.SetId(GuidGenerator.Create());
mbRec.M100BillId = billObj.Id;
mbRec.M100BillId = billObj.Id; //传未打印列表id
mbRec.KNR = billObj.KNR; //KNR订单号
mbRec.VIN = billObj.VIN; //底牌号
mbRec.HostSN = billObj.HostSN.ToString(); //大众顺序号
@ -768,10 +768,10 @@ namespace WY.NewJit.PrintTable
if (input.BusinessType == BusinessTypeEnum.MenBan)
{
ret = await QueryByConditionAsync(input, (PagedAndSortedBase)input);
}
else if (input.BusinessType == BusinessTypeEnum.OtherZhuHuBan || input.BusinessType == BusinessTypeEnum.ZhuHuBan)
{
ret = await QueryZHBByConditionAsync(input, (PagedAndSortedBase)input);
//}
//else if (input.BusinessType == BusinessTypeEnum.OtherZhuHuBan || input.BusinessType == BusinessTypeEnum.ZhuHuBan)
//{
// ret = await QueryZHBByConditionAsync(input, (PagedAndSortedBase)input);
}
else
{
@ -1159,6 +1159,38 @@ namespace WY.NewJit.PrintTable
}
#endregion
/// <summary>
/// 获取补账打印列表
/// </summary>
/// <param name="input">输入查询条件</param>
/// <returns>返回符合条件的排序分页列表</returns>
[HttpGet]
[UnitOfWork(false)]
[Route("replenish-print-list")]
public virtual async Task<PagedResultDto<WaitPrintDto>> GetReplenishPrintListAsync(QueryReplenishPrintDto input)
{
_logger.LogDebug(_errorMessagePrefix + "GetReplenishPrintListAsync 进入");
try
{
PagedResultDto<WaitPrintDto> ret = new PagedResultDto<WaitPrintDto>();
var qryAlreadyPrintDto = ObjectMapper.Map<QueryWaitPrintDto, QueryAlreadyPrintDto>(input);
string where = GetWhere(qryAlreadyPrintDto);
ret.TotalCount = await GetEntityCountAsync("FisWaitPrint", where);
//计算分页
int fromRec = input.SkipCount + 1;
int ToRec = input.SkipCount + input.MaxResultCount;
var lst = await GetEntityListFromToAsync<WaitPrintDto>("FisWaitPrint", where, "HostSN2", fromRec, ToRec);
ret.Items = lst;
return ret;
}
catch (Exception ex)
{
string errMsg = _errorMessagePrefix + "GetReplenishPrintListAsync 执行出错:" + ex.Message;
_logger.LogError(errMsg);
return new PagedResultDto<WaitPrintDto>(0, new List<WaitPrintDto>());
}
}
}
}

19
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

@ -1089,6 +1089,8 @@
<member name="M:WY.NewJit.MsgCheck.BillM100AppService.ProductLineTimeoutRemind_New(WY.NewJit.MsgCheck.TimeOutRemindInputDto)">
<summary>
生产线超时提醒(新)
先取未打印列表然后更新缓存列表,如果未打印列表为空取m100更新缓存列表
当未打印列表没有数据,则取缓存列表返回
</summary>
<param name="input">生产线编号列表</param>
<returns>生产线超时情况</returns>
@ -1952,14 +1954,6 @@
根据筛选条件获取实体列表
</summary>
</member>
<member name="M:WY.NewJit.PrintTable.WaitPrintAppService.QueryZHBByConditionAsync(WY.NewJit.PrintTable.Dtos.QueryWaitPrintDto,WY.NewJit.Common.PagedAndSortedBase)">
<summary>
查询柱护板
</summary>
<param name="input"></param>
<param name="page"></param>
<returns></returns>
</member>
<member name="M:WY.NewJit.PrintTable.WaitPrintAppService.GetMBReportDetailList(WY.NewJit.Extends.MenBanPrintInputDto,System.Boolean)">
<summary>
根据条件取用于打印的门板单据列表
@ -2017,6 +2011,13 @@
<param name="input"></param>
<returns>断号时Item不为空</returns>
</member>
<member name="M:WY.NewJit.PrintTable.WaitPrintAppService.GetReplenishPrintListAsync(WY.NewJit.PrintTable.Dtos.QueryReplenishPrintDto)">
<summary>
获取补账打印列表
</summary>
<param name="input">输入查询条件</param>
<returns>返回符合条件的排序分页列表</returns>
</member>
<member name="M:WY.NewJit.PrintTable.WaitPrintAppService.DoZHBPrint_3x8_LRMerge(System.String,WY.NewJit.Extends.ZhuHuBanPrintInputDto,System.Int64,System.Double,System.DateTime,System.Collections.Generic.List{WY.NewJit.PrintTable.WaitPrint},System.String)">
<summary>
打印柱护板(3*8 左右合并成一个单元格)A上C上
@ -2115,7 +2116,7 @@
区域相关应用服务
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.FISes.MenBanPackingRecService.#ctor(Win.Sfs.SettleAccount.Repository.NewJitEfCoreRepository1{WY.NewJit.Extends.MenBanPackingList,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100,System.Guid},WY.NewJit.EntityFrameworkCore.WMSDapperRepository,WY.NewJit.MsgBaseData.LineSNDomianService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.WMS.FisTB_BILL_SCRAP})">
<member name="M:Win.Sfs.SettleAccount.FISes.MenBanPackingRecService.#ctor(Win.Sfs.SettleAccount.Repository.NewJitEfCoreRepository1{WY.NewJit.Extends.MenBanPackingList,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100,System.Guid},WY.NewJit.EntityFrameworkCore.WMSDapperRepository,WY.NewJit.MsgBaseData.LineSNDomianService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.WMS.FisTB_BILL_SCRAP},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.PrintTable.AlreadyPrint},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.PrintTable.WaitPrint})">
<summary>
门板装箱单仓储明细
</summary>

Loading…
Cancel
Save