liulb@mesnac.com 10 months ago
parent 6b2a635e6d
commit 70281a2672

@ -2618,7 +2618,7 @@
</member> </member>
<member name="P:Admin.Core.Model.ExecutePlanInfo.ExecuteStatus"> <member name="P:Admin.Core.Model.ExecutePlanInfo.ExecuteStatus">
<summary> <summary>
执行状态1-待执行2-执行中3-完成 执行状态1-待执行2-执行中3-完成,4-暂停
</summary> </summary>
</member> </member>
<member name="P:Admin.Core.Model.ExecutePlanInfo.CreatedTime"> <member name="P:Admin.Core.Model.ExecutePlanInfo.CreatedTime">

@ -67,16 +67,36 @@ namespace Admin.Core.Repository
/// <exception cref="System.NotImplementedException"></exception> /// <exception cref="System.NotImplementedException"></exception>
public async Task<List<SheetMetalTypeDataView>> GetSheetMetalTypeData(string productLineCode) public async Task<List<SheetMetalTypeDataView>> GetSheetMetalTypeData(string productLineCode)
{ {
string sql = @$" WITH CTT AS (SELECT MIN(START_TIME) START_TIME, MAX(END_TIME) END_TIME //string sql = @$" WITH CTT AS (SELECT MIN(START_TIME) START_TIME, MAX(END_TIME) END_TIME
FROM VIEW_CURRENT_TEAM_TIME) // FROM VIEW_CURRENT_TEAM_TIME)
SELECT FB.MATERIAL_CODE as MATERUALNAME, // SELECT FB.MATERIAL_CODE as MATERUALNAME,
SUM(CASE WHEN FB.BOX_TYPE = 1 THEN FB.OUTPUT_AMOUNT ELSE 0 END) FRONTPLATE_AMOUNT, // SUM(CASE WHEN FB.BOX_TYPE = 1 THEN FB.OUTPUT_AMOUNT ELSE 0 END) FRONTPLATE_AMOUNT,
SUM(CASE WHEN FB.BOX_TYPE = 2 THEN FB.OUTPUT_AMOUNT ELSE 0 END) REARPANEL_AMOUNT // SUM(CASE WHEN FB.BOX_TYPE = 2 THEN FB.OUTPUT_AMOUNT ELSE 0 END) REARPANEL_AMOUNT
FROM VIEW_RECORD_FRONT_BACK_COMP FB // FROM VIEW_RECORD_FRONT_BACK_COMP FB
CROSS JOIN CTT // CROSS JOIN CTT
WHERE FB.RECORD_TIME >= CTT.START_TIME // WHERE FB.RECORD_TIME >= CTT.START_TIME
AND FB.RECORD_TIME < CTT.END_TIME // AND FB.RECORD_TIME < CTT.END_TIME
GROUP BY FB.MATERIAL_CODE"; // GROUP BY FB.MATERIAL_CODE";
string sql = @$"WITH CTT AS (SELECT MIN(START_TIME) START_TIME, MAX(END_TIME) END_TIME
FROM VIEW_CURRENT_TEAM_TIME),
F AS(
SELECT * FROM VIEW_RECORD_FRONT_BACK_COMP FB
),
G AS(
SELECT *
FROM F FB,CTT
WHERE FB.RECORD_TIME >= CTT.START_TIME AND FB.RECORD_TIME < CTT.END_TIME
)
SELECT FB.MATERIAL_CODE as MATERUALNAME,
SUM(CASE WHEN FB.BOX_TYPE = 1 THEN FB.OUTPUT_AMOUNT ELSE 0 END) FRONTPLATE_AMOUNT,
SUM(CASE WHEN FB.BOX_TYPE = 2 THEN FB.OUTPUT_AMOUNT ELSE 0 END) REARPANEL_AMOUNT
FROM G FB
GROUP BY FB.MATERIAL_CODE
";
return await Db.CopyNew().Ado.SqlQueryAsync<SheetMetalTypeDataView>(sql); return await Db.CopyNew().Ado.SqlQueryAsync<SheetMetalTypeDataView>(sql);
} }

@ -272,7 +272,7 @@
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="18" Foreground="White" MinValue="0"> <lvc:Axis FontSize="18" Foreground="White" MinValue="0">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Step="10" Stroke="#404F56" > <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Step="500" Stroke="#404F56" >
</lvc:Separator> </lvc:Separator>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>
@ -397,7 +397,7 @@
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="18" Foreground="White" MinValue="0"> <lvc:Axis FontSize="18" Foreground="White" MinValue="0">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Step="10" Stroke="#404F56" > <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Step="500" Stroke="#404F56" >
</lvc:Separator> </lvc:Separator>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>

@ -298,7 +298,7 @@ namespace Aucma.Core.SheetMetalTasks
obj_sidePanel.plc.WriteInt16("D6022", SmProductId.ToString());//产品号 obj_sidePanel.plc.WriteInt16("D6022", SmProductId.ToString());//产品号
string processNumber = GetProcessNumberBy(planInfo.MaterialCode); string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
obj_sidePanel.plc.WriteString("D6010", planInfo.MaterialSpecificatons); obj_sidePanel.plc.WriteString("D6010", planInfo.MaterialSpecificatons);
// int surplus = planInfo.PlanAmount-planInfo.CompleteAmount; //int surplus = planInfo.PlanAmount-planInfo.CompleteAmount;
int surplus = planInfo.PlanAmount; int surplus = planInfo.PlanAmount;
obj_sidePanel.plc.WriteInt16("D6020", surplus.ToString()); obj_sidePanel.plc.WriteInt16("D6020", surplus.ToString());
Thread.Sleep(500); Thread.Sleep(500);
@ -602,15 +602,12 @@ namespace Aucma.Core.SheetMetalTasks
//{ //{
if (obj_backPanel != null) if (obj_backPanel != null)
{ {
//计划编号10个字D6000-D6009、物料编号10个字D6010-D6019、计划数量1个字D6020、应答字1个字D6021 //计划编号10个字D6000-D6009、物料编号10个字D6010-D6019、计划数量1个字D6020、应答字1个字D6021
obj_backPanel.plc.WriteString("D4000", planInfo.TaskCode); obj_backPanel.plc.WriteString("D4000", planInfo.TaskCode);
obj_backPanel.plc.WriteInt16("D4022", productId.ToString()); obj_backPanel.plc.WriteInt16("D4022", productId.ToString());
string processNumber = GetProcessNumberBy(planInfo.MaterialCode); string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
obj_backPanel.plc.WriteString("D4010", planInfo.MaterialSpecificatons); obj_backPanel.plc.WriteString("D4010", planInfo.MaterialSpecificatons);
// int surplus = planInfo.PlanAmount - planInfo.CompleteAmount;//剩余计划数量 //int surplus = planInfo.PlanAmount - planInfo.CompleteAmount;//剩余计划数量
int surplus = planInfo.PlanAmount;//剩余计划数量 int surplus = planInfo.PlanAmount;//剩余计划数量
obj_backPanel.plc.WriteInt16("D4020", surplus.ToString()); obj_backPanel.plc.WriteInt16("D4020", surplus.ToString());
Thread.Sleep(500); Thread.Sleep(500);
@ -1203,7 +1200,7 @@ namespace Aucma.Core.SheetMetalTasks
sidePanelComplate.OutPutAmount = complateAmount - lastComplateAmount; sidePanelComplate.OutPutAmount = complateAmount - lastComplateAmount;
sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount; sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount;
// sumComplateAmount = complateAmount; // 改为plc读取的数量 // sumComplateAmount = complateAmount; // 改为plc读取的数量
if (sidePanelComplate.OutPutAmount == 0) if (sidePanelComplate.OutPutAmount == 0)
{ {
Thread.Sleep(5000); Thread.Sleep(5000);
@ -1328,7 +1325,7 @@ namespace Aucma.Core.SheetMetalTasks
{ {
if (obj_backPanel != null) if (obj_backPanel != null)
{ {
//计划编号10个字D6000-D6009、物料编号10个字D6010-D6019、计划数量1个字D6020、应答字1个字D6021 //计划编号10个字D4000-D4009、物料编号10个字D4010-D4019、计划数量1个字D4020、应答字1个字D4021
obj_backPanel.plc.WriteString("D4000", planInfo.TaskCode); obj_backPanel.plc.WriteString("D4000", planInfo.TaskCode);
string processNumber = GetProcessNumberBy(planInfo.MaterialCode); string processNumber = GetProcessNumberBy(planInfo.MaterialCode);
obj_backPanel.plc.WriteString("D4010", planInfo.MaterialSpecificatons); obj_backPanel.plc.WriteString("D4010", planInfo.MaterialSpecificatons);
@ -1476,6 +1473,9 @@ namespace Aucma.Core.SheetMetalTasks
lastComplateAmount = backPanelComplates.First().CompleteAmount;//最新的完工数量 lastComplateAmount = backPanelComplates.First().CompleteAmount;//最新的完工数量
backPanelComplate.OutPutAmount = complateAmount - lastComplateAmount;//实际产量 backPanelComplate.OutPutAmount = complateAmount - lastComplateAmount;//实际产量
sumComplateAmount = backPanelComplates.Sum(x => x.OutPutAmount) + backPanelComplate.OutPutAmount; //计划总产量 sumComplateAmount = backPanelComplates.Sum(x => x.OutPutAmount) + backPanelComplate.OutPutAmount; //计划总产量
//sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount;
//sumComplateAmount = complateAmount; // 改为plc读取的数量
if (backPanelComplate.OutPutAmount == 0) if (backPanelComplate.OutPutAmount == 0)
{ {
Thread.Sleep(5000); Thread.Sleep(5000);

Loading…
Cancel
Save