1.添加原材料入库的Model DTO Service层Controller层代码
2.修改质量管理-FQCService逻辑【抛光报表,包装报表】的生产投入数的计算方式(未确定)
This commit is contained in:
parent
2d4128c5c5
commit
3a609eaa3e
@ -7,17 +7,17 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<PublishUrl>bin\Release\net7.0\publish\</PublishUrl>
|
||||
<PublishUrl>bin\Debug\net7.0\publish\</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ProjectGuid>e5497bb4-b0c1-4794-9fae-163f626ec399</ProjectGuid>
|
||||
<SelfContained>true</SelfContained>
|
||||
<SelfContained>false</SelfContained>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<EnvironmentName>production</EnvironmentName>
|
||||
<EnvironmentName>production</EnvironmentName>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@ -10,6 +10,7 @@
|
||||
"dbConfigs": [
|
||||
{
|
||||
//"Conn": "Data Source=147.116.122.230;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
//"Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
"Conn": "Data Source=127.0.0.1;Port=3306;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||
"ConfigId": "0", //多租户唯一标识
|
||||
|
||||
@ -19,6 +19,21 @@ namespace ZR.Model.MES.wm.DTO
|
||||
/// </summary>
|
||||
public string FkWorkorderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品描述
|
||||
/// </summary>
|
||||
public string ProductDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 颜色
|
||||
/// </summary>
|
||||
public string Colour { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格
|
||||
/// </summary>
|
||||
public string Specifications { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单号排序
|
||||
/// </summary>
|
||||
|
||||
@ -1392,7 +1392,8 @@ namespace ZR.Service.mes.qc
|
||||
first.Remark = "抛光";
|
||||
first.Remark2 = 1;
|
||||
int paoguang_total = 0; //抛光总数
|
||||
|
||||
//XXX20240223:记录首检后的抛光数
|
||||
int paoguang_by_first = 0;
|
||||
List<QcFirstinspectionRecord> firstrecordList = Context.Queryable<QcFirstinspectionRecord>().Where(it => it.FKWorkorderId == workorderID).Where(it => SqlFunc.Contains(it.FKInpectionId, "_1_")).ToList();
|
||||
if (firstrecordList != null && firstrecordList.Count > 0)
|
||||
{
|
||||
@ -1570,16 +1571,14 @@ namespace ZR.Service.mes.qc
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// XXX20240223: 记录首检时抛光数
|
||||
paoguang_by_first = paoguang_total;
|
||||
first.CreatedTime = DateTime.Now;
|
||||
first.UpdatedTime = DateTime.Now;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 打磨
|
||||
QcQualityStatisticsFirst first2 = new QcQualityStatisticsFirst();
|
||||
first2.Id = SnowFlakeSingle.Instance.NextId().ToString();
|
||||
@ -1785,16 +1784,11 @@ namespace ZR.Service.mes.qc
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
first2.CreatedTime = DateTime.Now;
|
||||
first2.UpdatedTime = DateTime.Now;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 报废
|
||||
QcQualityStatisticsFirst first3 = new QcQualityStatisticsFirst();
|
||||
first3.Id = SnowFlakeSingle.Instance.NextId().ToString();
|
||||
@ -1810,18 +1804,11 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
first3.Team = team;
|
||||
|
||||
|
||||
first3.EndTime = DateTime.Now;
|
||||
first3.Remark = "报废";
|
||||
first3.Remark2 = 3;
|
||||
int baofei_total = 0;
|
||||
|
||||
List<QcFirstinspectionRecord> firstrecordList3 = Context.Queryable<QcFirstinspectionRecord>().Where(it => it.FKWorkorderId == workorderID).Where(it => SqlFunc.Contains(it.FKInpectionId, "_3_")).ToList();
|
||||
if (firstrecordList3 != null && firstrecordList3.Count > 0)
|
||||
{
|
||||
@ -2002,13 +1989,9 @@ namespace ZR.Service.mes.qc
|
||||
|
||||
first3.CreatedTime = DateTime.Now;
|
||||
first3.UpdatedTime = DateTime.Now;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 计算汇总
|
||||
int qualifiedNumber_No_all = paoguang_total + damo_total + baofei_total;
|
||||
|
||||
@ -2022,7 +2005,6 @@ namespace ZR.Service.mes.qc
|
||||
var x = Context.Storageable(first).WhereColumns(it => new { it.WorkorderId, it.Remark2 }).ToStorage();
|
||||
x.AsInsertable.ExecuteCommand();//不存在插入
|
||||
x.AsUpdateable.IgnoreColumns(z => z.CreatedTime).ExecuteCommand();//存在更新
|
||||
|
||||
first2.QualifiedNumber = first2.RequireNumber - qualifiedNumber_No_all;
|
||||
first2.QualifiedRate = Math.Round(((decimal)first2.QualifiedNumber / (decimal)first2.RequireNumber) * 100, 3);
|
||||
first2.PaoguangTotal = paoguang_total;
|
||||
@ -2061,10 +2043,10 @@ namespace ZR.Service.mes.qc
|
||||
{
|
||||
again2.FinishedPartNumber = workorder_again2.FinishedPartNumber;
|
||||
again2.ProductDescription = workorder_again2.ProductDescription;
|
||||
again2.RequireNumber = workorder_again2.PreviousNumber;
|
||||
// XXX:二检入参修改为一检抛光记录值
|
||||
//again2.RequireNumber = workorder_again2.PreviousNumber;
|
||||
again2.RequireNumber = paoguang_total;
|
||||
again2.StartTime = workorder_again2.CreatedTime;//这地方是不妥的
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2276,7 +2258,9 @@ namespace ZR.Service.mes.qc
|
||||
{
|
||||
again3.FinishedPartNumber = workorder_again3.FinishedPartNumber;
|
||||
again3.ProductDescription = workorder_again3.ProductDescription;
|
||||
again3.RequireNumber = workorder_again3.PreviousNumber;
|
||||
// XXX:二检(抛光)报废分数据上件数为首检抛光数
|
||||
again3.RequireNumber = paoguang_total;
|
||||
// again3.RequireNumber = workorder_again3.PreviousNumber;
|
||||
again3.StartTime = workorder_again3.CreatedTime;//这地方是不妥的
|
||||
|
||||
|
||||
@ -2519,7 +2503,9 @@ namespace ZR.Service.mes.qc
|
||||
{
|
||||
final2.FinishedPartNumber = workorder_final2.FinishedPartNumber;
|
||||
final2.ProductDescription = workorder_final2.ProductDescription;
|
||||
final2.RequireNumber = workorder_final2.PreviousNumber;
|
||||
|
||||
// XXX:三检(包装),生产投入数为(一检投入数 - (一检报废数 + 二检报废数))
|
||||
final2.RequireNumber = workorder_final2.PreviousNumber - (baofei_total + baofei_total_again3);
|
||||
final2.StartTime = workorder_final2.CreatedTime;//这地方是不妥的
|
||||
|
||||
|
||||
@ -2734,7 +2720,9 @@ namespace ZR.Service.mes.qc
|
||||
{
|
||||
final3.FinishedPartNumber = workorder_final3.FinishedPartNumber;
|
||||
final3.ProductDescription = workorder_final3.ProductDescription;
|
||||
final3.RequireNumber = workorder_final3.PreviousNumber;
|
||||
// XXX:三检(包装-投入数)
|
||||
final3.RequireNumber = workorder_final3.PreviousNumber - (baofei_total + baofei_total_again3);
|
||||
//final3.RequireNumber = workorder_final3.PreviousNumber;
|
||||
final3.StartTime = workorder_final3.CreatedTime;//这地方是不妥的
|
||||
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ namespace ZR.Service.mes.qc
|
||||
int totalNum = 0;
|
||||
var predicate = Expressionable.Create<QcQualityStatisticsFirst>()
|
||||
.AndIF(starttime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.StartTime >= starttime)
|
||||
//XXX:修改查询日期查询的字段
|
||||
.AndIF(endTime > new DateTime(2023, 1, 1, 0, 0, 0), it => it.EndTime <= endTime)
|
||||
.AndIF(!string.IsNullOrEmpty(workorderid), it => it.WorkorderId.Equals(workorderid))
|
||||
.AndIF(!string.IsNullOrEmpty(partnumber), it => it.FinishedPartNumber.Equals(partnumber))
|
||||
|
||||
@ -26,6 +26,7 @@ namespace ZR.Service.mes.wm
|
||||
.AndIF(year > 0, pw2 => pw2.Year == year)
|
||||
.AndIF(week > 0, pw2 => pw2.Week == week)
|
||||
.AndIF(date > 0, pw2 => pw2.Date == date)
|
||||
//.And(pw2=>pw2.Status == 2)
|
||||
.ToExpression();
|
||||
|
||||
int totalCount = 0;
|
||||
@ -35,9 +36,12 @@ namespace ZR.Service.mes.wm
|
||||
pw2.Id == wmr.FkWorkorder2Id
|
||||
})
|
||||
.Where(predicate)
|
||||
.Select((pw2,wmr) => new WmMaterialReceiptDTO
|
||||
.Select((pw2, wmr) => new WmMaterialReceiptDTO
|
||||
{
|
||||
FkWorkorderId = pw2.Id,
|
||||
ProductDescription = pw2.ProductDescription,
|
||||
Colour = pw2.Colour,
|
||||
Specifications = pw2.Specifications,
|
||||
BlankNumber = pw2.BlankNumber,
|
||||
PreviousNumber = pw2.PreviousNumber,
|
||||
Sort = pw2.Sort,
|
||||
@ -46,7 +50,7 @@ namespace ZR.Service.mes.wm
|
||||
SampleNumber = wmr.SampleNumber,
|
||||
QualifiedNumber = wmr.QualifiedNumber,
|
||||
PassRate = wmr.PassRate,
|
||||
Status=wmr.Status
|
||||
Status = wmr.Status
|
||||
})
|
||||
.OrderBy(pw2 => pw2.Sort)
|
||||
.ToPageList(pageNum, pageSize, ref totalCount);
|
||||
@ -97,7 +101,7 @@ namespace ZR.Service.mes.wm
|
||||
wmMaterialReceipt.Id = wmMaterialReceiptDTO.Id;
|
||||
wmMaterialReceipt.UpdatedBy = wmMaterialReceiptDTO.Operator;
|
||||
wmMaterialReceipt.UpdatedTime = DateTime.Now;
|
||||
int effectId = Context.Updateable(wmMaterialReceipt).ExecuteCommand();
|
||||
int effectId = Context.Updateable(wmMaterialReceipt).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommand();
|
||||
return effectId;
|
||||
}
|
||||
}
|
||||
@ -106,15 +110,16 @@ namespace ZR.Service.mes.wm
|
||||
/// </summary>
|
||||
public string SavePageMaterialReceipts(List<WmMaterialReceiptDTO> list)
|
||||
{
|
||||
int successCount = 0;
|
||||
int totalCount = list.Count;
|
||||
if(list == null || list.Count == 0)
|
||||
if (list == null || list.Count == 0)
|
||||
{
|
||||
return $"保存成功:无数据变动!";
|
||||
}
|
||||
int successCount = 0;
|
||||
int totalCount = list.Count;
|
||||
|
||||
for(int index = 1; index <= list.Count; index++)
|
||||
{
|
||||
int effectId = SaveOneMaterialReceipt(list[index]);
|
||||
int effectId = SaveOneMaterialReceipt(list[index-1]);
|
||||
if (effectId < 1)
|
||||
{
|
||||
return $"保存异常:总共{totalCount}条数据已成功保存{successCount}条数据,异常行数{index}";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user