Merge branch 'production' of https://gitee.com/doan-tech/shanghaigangxiangtuzhuangMES
# Conflicts: # ZR.Admin.WebApi/appsettings.development.json
This commit is contained in:
@@ -1,112 +0,0 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Server.HttpSys;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Model.MES.wm;
|
||||
using ZR.Service.mes.pro.IService;
|
||||
using ZR.Service.mes.qu.IService;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace ZR.Service.mes.qu
|
||||
{
|
||||
[AppService(ServiceType = typeof(IQcRoughService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class QcRoughService : BaseService<QcRough>, IQcRoughService
|
||||
{
|
||||
|
||||
public (List<Mr_QuRoughDTO>, int) GetStatisticslist(int pageNum, int pageSize, int year, int week, int date, int isSchedule)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmMaterialrequisition>()
|
||||
.AndIF(year > 0, wm => wm.Year == year)
|
||||
.AndIF(week > 0, wm => wm.Week == week)
|
||||
.AndIF(date > 0, wm => wm.Date == date)
|
||||
.ToExpression();
|
||||
|
||||
int totalCount = 0;
|
||||
|
||||
//联表查询
|
||||
List<Mr_QuRoughDTO> mr_QusList = Context.Queryable<WmMaterialrequisition>()
|
||||
.RightJoin<QcRough>((wm, qc) => wm.Id == qc.FkMaterialrequisitionId)
|
||||
.Where(predicate)
|
||||
.Select((wm, qc) => new Mr_QuRoughDTO
|
||||
{
|
||||
Id = qc.Id,
|
||||
FkMaterialrequisitionId = qc.FkMaterialrequisitionId,
|
||||
Workblankpartnumber = wm.Workblankpartnumber,
|
||||
Status = wm.Status,
|
||||
Year = wm.Year,
|
||||
Week = wm.Week,
|
||||
Date = wm.Date,
|
||||
RequireNum = qc.RequireNum,
|
||||
ActualNumber = qc.ActualNumber,
|
||||
RandomRate = qc.RandomRate,
|
||||
Oks = qc.Oks,
|
||||
Ngs = qc.Ngs,
|
||||
OksRatio = qc.OksRatio,
|
||||
IsFeeding = qc.IsFeeding
|
||||
})
|
||||
.ToPageList(pageNum, pageSize, ref totalCount);
|
||||
|
||||
return (mr_QusList, totalCount);
|
||||
}
|
||||
|
||||
public int UpdateStatisticsTable(string id, int actualNumber, int randomRate, int ngs, int oks, decimal oksRatio, int Isqualified)
|
||||
{
|
||||
UseTran(() =>
|
||||
{
|
||||
QcRough qr = Queryable().Where(it => it.Id == id).First();
|
||||
if (qr != null)
|
||||
{
|
||||
//更新 领料单状态
|
||||
if (Isqualified == 1)
|
||||
{
|
||||
Context.Updateable<WmMaterialrequisition>().SetColumns(it => it.Status == "1").Where(it => it.Id == qr.FkMaterialrequisitionId);
|
||||
}
|
||||
else if (Isqualified == 0)
|
||||
{
|
||||
//不合格,依然处于未领料
|
||||
|
||||
//新增退料单
|
||||
WmMaterialrequisition materialrequisition = Context.Queryable<WmMaterialrequisition>().Where(it => it.Id == qr.FkMaterialrequisitionId).First();
|
||||
|
||||
|
||||
WmMaterialreturn materialreturn = new WmMaterialreturn();
|
||||
materialreturn.Id = DateTime.Now.ToString("yyyyMMdd");
|
||||
materialreturn.FkMrqrId = qr.FkMaterialrequisitionId;
|
||||
materialreturn.Year = materialrequisition.Year;
|
||||
materialreturn.Week = materialrequisition.Week;
|
||||
materialreturn.Date = materialrequisition.Date;
|
||||
materialreturn.Workblankpartnumber = materialrequisition.Workblankpartnumber;
|
||||
materialreturn.Requirenum = materialrequisition.Requirenum;
|
||||
|
||||
Context.Insertable(materialrequisition).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
return Context.Updateable<QcRough>()
|
||||
.SetColumns(it => it.ActualNumber == actualNumber)
|
||||
.SetColumns(it => it.RandomRate == randomRate)
|
||||
.SetColumns(it => it.Ngs == ngs)
|
||||
.SetColumns(it => it.Oks == oks)
|
||||
.SetColumns(it => it.OksRatio == oksRatio)
|
||||
.Where(it => it.Id == id).ExecuteCommand();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user