1.添加原材料入库的Model DTO Service层Controller层代码
2.修改质量管理-FQCService逻辑【抛光报表,包装报表】的生产投入数的计算方式(未确定)
This commit is contained in:
@@ -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}";
|
||||
|
||||
Reference in New Issue
Block a user