CutWeldService.cs
3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using ApkInfo;
using Hh.Mes.Common;
using Hh.Mes.Common.config;
using Hh.Mes.Common.Json;
using Hh.Mes.Common.log;
using Hh.Mes.Common.Redis;
using Hh.Mes.Pojo.System;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.EnumEntitys;
using Hh.Mes.POJO.Response;
using Hh.Mes.POJO.ViewModel;
using Hh.Mes.POJO.WebEntity;
using Hh.Mes.Service.Repository;
using Hh.Mes.Service.SystemAuth;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Hh.Mes.Service
{
public class CutWeldService : RepositorySqlSugar<dynamic>
{
/// <summary>
/// 管段工序完工调用
/// </summary>
/// <param name="BarCode">追踪码</param>
/// <param name="processesState">状态</param>
/// <returns></returns>
public void SendIWPTechnologylineProcess(string BarCode, int processesState)
{
ExceptionsHelp.Instance.ExecuteVoidFunc(() =>
{
if (string.IsNullOrWhiteSpace(BarCode)) return;
if (processesState != (int)EnumCutHeadState.已套料
|| processesState != (int)EnumCutHeadState.切割完成
|| processesState != (int)EnumCutHeadState.打磨完成
|| processesState != (int)EnumCutHeadState.组对完成
|| processesState != (int)EnumCutHeadState.焊接完成) return;
//切割完成处理,ECS完成时会更新套料方案,工单工序,这里只需要组织数据反馈上游
var oprSequenceCode = EnumoprSequenceCode.套料;
if (processesState == (int)EnumCutHeadState.切割完成)
oprSequenceCode = EnumoprSequenceCode.切割坡口;
if (processesState == (int)EnumCutHeadState.打磨完成)
oprSequenceCode = EnumoprSequenceCode.打磨;
if (processesState == (int)EnumCutHeadState.组对完成)
oprSequenceCode = EnumoprSequenceCode.组对;
if (processesState == (int)EnumCutHeadState.焊接完成)
oprSequenceCode = EnumoprSequenceCode.焊接;
var workOrderDetail = base.Context.Queryable<bus_workOrder_detail>().Where(x => x.oprSequenceCode == oprSequenceCode).First();
if (workOrderDetail == null) return;
var requestData = new
{
workOrderCode = workOrderDetail.workOrderCode,//工单
partCode = workOrderDetail.partCode,//管段号
barCode = workOrderDetail.barCode,//追踪码(管段码)
oprSequenceCode = workOrderDetail.oprSequenceCode,//工序
stationCode = workOrderDetail.stationCode,//工位
equipmentCode = workOrderDetail.equipmentCode,//生产设备
actualStartTime = workOrderDetail.actualStartTime,//开始时间
actualEndTime = workOrderDetail.actualEndTime,// 完成时间
cutMaterCode = workOrderDetail.cutMaterCode,//管段物料编码
weldNo = workOrderDetail.weldNo,//组对(焊接)焊口号
batchNo = workOrderDetail.batchNo,//组对(焊接)批次号
createBy = workOrderDetail.createBy,//操作人
};
//调用上游MES工序完工反馈
var url = GetDictionaryDictValue("UrlProcessFeedback", "GetUrl");
var WCSresponse = HttpManWCS(url, requestData, EnumLog.调用上游MES工序完工反馈.ToString(), method: "post");
});
}
}
}