Compare commits

...

2 Commits

  1. 5
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs
  2. 31
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigDto.cs
  3. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.csproj
  4. 30
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml
  5. 81
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/BaseConfig/BaseGonfigService.cs
  6. 33
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  7. 26
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml
  8. 32
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/BaseConfig.cs
  9. 22
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/BaseGonfigDomainService.cs
  10. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContext.cs
  11. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs
  12. 8
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Web/appsettings.json

5
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs

@ -33,6 +33,11 @@ namespace WY.NewJit.Extends
/// </summary> /// </summary>
public virtual int EndHostSN { get; set; } public virtual int EndHostSN { get; set; }
/// <summary>
/// 打印条数
/// </summary>
public virtual int PrintCount { get; set; }
#region 重新打印、补打时使用 #region 重新打印、补打时使用
/// <summary> /// <summary>
/// 重新打印时使用。装箱单主表ID列表,报废时传入一个,重打时可传入多个 /// 重新打印时使用。装箱单主表ID列表,报废时传入一个,重打时可传入多个

31
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigDto.cs

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Application.Dtos;
namespace WY.NewJit.MsgBaseData
{
/// <summary>
/// 基础参数配置表
/// </summary>
[Serializable]
public class BaseConfigDto : EntityDto<Guid>
{
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual int State { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual int Remark { get; set; }
}
}

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

@ -32,4 +32,8 @@
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.3.3" /> <PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="4.3.3" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="MsgBaseData\BaseConfig\Interfaces\" />
</ItemGroup>
</Project> </Project>

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

@ -768,6 +768,11 @@
终止大众顺序号 终止大众顺序号
</summary> </summary>
</member> </member>
<member name="P:WY.NewJit.Extends.MenBanPrintInputDto.PrintCount">
<summary>
打印条数
</summary>
</member>
<member name="P:WY.NewJit.Extends.MenBanPrintInputDto.ReportIdList"> <member name="P:WY.NewJit.Extends.MenBanPrintInputDto.ReportIdList">
<summary> <summary>
重新打印时使用。装箱单主表ID列表,报废时传入一个,重打时可传入多个 重新打印时使用。装箱单主表ID列表,报废时传入一个,重打时可传入多个
@ -1499,6 +1504,31 @@
<param name="vehicleAssemblyId">整车总成Id</param> <param name="vehicleAssemblyId">整车总成Id</param>
<returns>Erp总成列表</returns> <returns>Erp总成列表</returns>
</member> </member>
<member name="T:WY.NewJit.MsgBaseData.BaseConfigDto">
<summary>
基础参数配置表
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.ParamName">
<summary>
参数名称
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.ParamValue">
<summary>
参数值
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.State">
<summary>
状态
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.Remark">
<summary>
备注
</summary>
</member>
<member name="T:WY.NewJit.MsgBaseData.DicItemDto"> <member name="T:WY.NewJit.MsgBaseData.DicItemDto">
<summary> <summary>
通用字典信息DTO 通用字典信息DTO

81
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/BaseConfig/BaseGonfigService.cs

@ -0,0 +1,81 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using WY.NewJit.Common;
namespace WY.NewJit.MsgBaseData
{
/// <summary>
/// 通用字典应用服务实现
/// </summary>
[Route("api/newjit/baseconfig")]
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.基础数据)]
public class BaseGonfigService : ApplicationService
{
private readonly IRepository<BaseConfig, Guid> _repository;
/// <summary>
/// 日志
/// </summary>
private ILogger<BaseGonfigService> _logger;
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
/// <summary>
/// 构造函数
/// </summary>
public BaseGonfigService(
IRepository<BaseConfig, Guid> repository,
ILogger<BaseGonfigService> logger
)
{
_repository = repository;
_logger = logger;
}
#region 公共方法
/// <summary>
/// 获取所有基本参数数据
/// </summary>
/// <returns></returns>
[HttpGet]
[UnitOfWork(false)]
[Route("list")]
public virtual async Task<ListResultDto<BaseConfigDto>> GetBaseConfigListAsync()
{
_logger.LogDebug(_errorMessagePrefix + "GetBaseConfigListAsync 进入");
try
{
var lst = await _repository.GetListAsync();
var items = ObjectMapper.Map<List<BaseConfig>, List<BaseConfigDto>>(lst);
return new ListResultDto<BaseConfigDto>(items);
}
catch (Exception ex)
{
string errMsg = _errorMessagePrefix + "GetBaseConfigListAsync 执行出错:" + ex.Message;
_logger.LogError(errMsg);
return new ListResultDto<BaseConfigDto>(new List<BaseConfigDto>());
}
}
#endregion
}
}

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

@ -336,20 +336,10 @@ namespace WY.NewJit.PrintTable
{ {
List<WaitPrint> billLst = new List<WaitPrint>(); List<WaitPrint> billLst = new List<WaitPrint>();
ListResultDto<WaitPrint> ret = new ListResultDto<WaitPrint>(billLst); ListResultDto<WaitPrint> ret = new ListResultDto<WaitPrint>(billLst);
if (input.PrintCount == 0) input.PrintCount = 10;//调试用的
int printBillCnt = 0;
if (input.PrintType == WY.NewJit.Extends.PaiGe.PrintTypeEnum.) if (input.PrintType == WY.NewJit.Extends.PaiGe.PrintTypeEnum.)
{ {
if ((input.BeginHostSN % 10000) > 1999)
{
throw new Exception("起始大众顺序号不能大于1999!");
}
if (input.BeginHostSN > input.EndHostSN)
{
throw new Exception("起始大众顺序号不能大于止大众顺序号!");
}
printBillCnt = input.EndHostSN - input.BeginHostSN + 1;
int minHostSN2 = await _waitPrintRepository.Where(itm => int minHostSN2 = await _waitPrintRepository.Where(itm =>
itm.BusinessType == BusinessTypeEnum.MenBan itm.BusinessType == BusinessTypeEnum.MenBan
@ -370,8 +360,7 @@ namespace WY.NewJit.PrintTable
&& itm.PrintType == PrintTypeEnum.OrderPrint //顺序打印 && itm.PrintType == PrintTypeEnum.OrderPrint //顺序打印
&& itm.HostSN2 >= minHostSN2) && itm.HostSN2 >= minHostSN2)
.OrderBy(itm => itm.HostSN2) .OrderBy(itm => itm.HostSN2)
.Take(printBillCnt).ToListAsync(); .Take(input.PrintCount).ToListAsync();
bool hasData = billLst.Any(); bool hasData = billLst.Any();
if (hasData == false) if (hasData == false)
{ {
@ -401,7 +390,7 @@ namespace WY.NewJit.PrintTable
/// <returns></returns> /// <returns></returns>
private List<MenBanPackingList> DoMBPrint(MenBanPrintInputDto input, int pageIdx, ref double maxBillNum, double maxSN, DateTime printTime, List<WaitPrint> billLst, string rightOrLeft) private List<MenBanPackingList> DoMBPrint(MenBanPrintInputDto input, int pageIdx, ref double maxBillNum, double maxSN, DateTime printTime, List<WaitPrint> billLst, string rightOrLeft)
{ {
const int _colNumberPerPage = 12; const int _colNumberPerPage = 10;
List<MenBanPackingList> retLst = new List<MenBanPackingList>(); List<MenBanPackingList> retLst = new List<MenBanPackingList>();
//取当前页内容 //取当前页内容
@ -566,7 +555,7 @@ namespace WY.NewJit.PrintTable
//装箱单号规则 1开头,11位,自增顺序号 //装箱单号规则 1开头,11位,自增顺序号
if (newSNStr.Length < 11) if (newSNStr.Length < 11)
{ {
return "F" + newSNStr.PadLeft(10, '0'); return "W" + newSNStr.PadLeft(10, '0');
} }
return newSNStr; return newSNStr;
} }
@ -610,7 +599,7 @@ namespace WY.NewJit.PrintTable
targetMain.BillNum = sourceObj.BillNum; //单据编号 targetMain.BillNum = sourceObj.BillNum; //单据编号
targetMain.State = 0; targetMain.State = 0;
targetMain.BillType = 206; //单据类型 targetMain.BillType = 206; //单据类型
targetMain.SubBillType = 21004; //单据子类型 targetMain.SubBillType = 21033; //红旗单据子类型
targetMain.BillTime = sourceObj.PrintDate; //单据时间 targetMain.BillTime = sourceObj.PrintDate; //单据时间
targetMain.OperName = sourceObj.CreatorId.ToString(); //操作员 targetMain.OperName = sourceObj.CreatorId.ToString(); //操作员
targetMain.DetailQty = 0; //明细数量 targetMain.DetailQty = 0; //明细数量
@ -663,8 +652,8 @@ namespace WY.NewJit.PrintTable
targetDetail.BillNum = sourceObj.BillNum; //单据编号 通过该字段和主表弱连接 targetDetail.BillNum = sourceObj.BillNum; //单据编号 通过该字段和主表弱连接
targetDetail.VinCode = sourceRec.VIN; //VIN码 targetDetail.VinCode = sourceRec.VIN; //VIN码
targetDetail.PartCode = sourceRec.BelowSAPMaterialNum; //物料号 targetDetail.PartCode = sourceRec.BelowSAPMaterialNum; //物料号
targetDetail.LineNum = (idx2 + 12); //行号 targetDetail.LineNum = (idx2 + 10); //行号
targetDetail.SeqNum = (idx2 + 12).ToString(); //顺序号sourceRec.HostSN.ToString() targetDetail.SeqNum = (idx2 + 10).ToString(); //顺序号sourceRec.HostSN.ToString()
//targetDetail.BarCode = sourceRec.TopBoxPositionNum; //箱码 //targetDetail.BarCode = sourceRec.TopBoxPositionNum; //箱码
targetDetail.ProjectId = ""; //车型 targetDetail.ProjectId = ""; //车型
targetDetail.State = "0"; //状态 targetDetail.State = "0"; //状态
@ -915,7 +904,7 @@ namespace WY.NewJit.PrintTable
sw.Stop(); sw.Stop();
_logger.LogWarning($"SaveMenBanReport读取数据 - {sw.ElapsedMilliseconds}毫秒"); _logger.LogWarning($"SaveMenBanReport读取数据 - {sw.ElapsedMilliseconds}毫秒");
sw.Start(); sw.Start();
int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数 int pageCnt = (int)Math.Ceiling(billLst.Count / 10.0); //每页打印10列,取打印页数
double maxBillNum = 0; double maxBillNum = 0;
@ -982,7 +971,7 @@ namespace WY.NewJit.PrintTable
return ret; return ret;
} }
int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数 int pageCnt = (int)Math.Ceiling(billLst.Count / 10.0); //每页打印10列,取打印页数
double maxBillNum = 0; double maxBillNum = 0;
@ -1067,7 +1056,7 @@ namespace WY.NewJit.PrintTable
foreach (var masterObj in targetLst) foreach (var masterObj in targetLst)
{ {
int trueCnt = masterObj.Details.Count; int trueCnt = masterObj.Details.Count;
int planCnt = 12; int planCnt = 10;
if (trueCnt > planCnt) if (trueCnt > planCnt)
{ {
throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}"); throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}");
@ -1182,7 +1171,7 @@ namespace WY.NewJit.PrintTable
foreach (var masterObj in targetLst) foreach (var masterObj in targetLst)
{ {
int trueCnt = masterObj.Details.Count; int trueCnt = masterObj.Details.Count;
int planCnt = 12; int planCnt = 10;
if (trueCnt > planCnt) if (trueCnt > planCnt)
{ {
throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}"); throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}");

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

@ -529,6 +529,32 @@
<param name="targetLst"></param> <param name="targetLst"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:WY.NewJit.MsgBaseData.BaseGonfigService">
<summary>
通用字典应用服务实现
</summary>
</member>
<member name="F:WY.NewJit.MsgBaseData.BaseGonfigService._logger">
<summary>
日志
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseGonfigService._errorMessagePrefix">
<summary>
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.BaseConfig,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.BaseGonfigService})">
<summary>
构造函数
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.GetBaseConfigListAsync">
<summary>
获取所有基本参数数据
</summary>
<returns></returns>
</member>
<member name="T:WY.NewJit.MsgBaseData.DicAppService"> <member name="T:WY.NewJit.MsgBaseData.DicAppService">
<summary> <summary>
通用字典应用服务实现 通用字典应用服务实现

32
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/BaseConfig.cs

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
namespace WY.NewJit.MsgBaseData
{
/// <summary>
/// 基础参数
/// </summary>
public class BaseConfig : AggregateRoot<Guid>
{
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual int State { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual int Remark { get; set; }
}
}

22
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/BaseGonfigDomainService.cs

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
namespace WY.NewJit.MsgBaseData
{
public class BaseGonfigDomainService : DomainService
{
private readonly IRepository<BaseConfig, Guid> _repository;
public BaseGonfigDomainService(IRepository<BaseConfig, Guid> repository)
{
_repository = repository;
}
}
}

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContext.cs

@ -59,6 +59,8 @@ namespace WY.NewJit.EntityFrameworkCore
public DbSet<PrintTemplateConfiguration> PrintTemplateConfigurations { get; set; } public DbSet<PrintTemplateConfiguration> PrintTemplateConfigurations { get; set; }
public DbSet<BaseConfig> BaseConfigs { get; set; }
#endregion #endregion
#region 报文解析及校验 #region 报文解析及校验

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs

@ -163,7 +163,16 @@ namespace WY.NewJit.EntityFrameworkCore
}); });
builder.Entity<BaseConfig>(b =>
{
b.ToTable(NewJitConsts.DbTablePrefix + nameof(BaseConfig)); //将Book实体映射到数据库表XXXBooks
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property("ParamName").HasMaxLength(50);
b.Property("ParamValue").HasMaxLength(50);
b.Property("State").HasPrecision(1);
b.Property("Remark").HasMaxLength(5000);
b.HasIndex(x => new { x.ParamName}).IsUnique();
});
#endregion #endregion

8
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Web/appsettings.json

@ -66,10 +66,10 @@
}, },
"ProductLineTimeoutRemind": { "ProductLineTimeoutRemind": {
"01": 30, "01": 40,
"05": 30, "05": 40,
"07": 30, "07": 40,
"08": 30 "08": 40
} }
}, },
"Serilog": { "Serilog": {

Loading…
Cancel
Save