| | |
| | | using WebAPI.Models; |
| | | using System.Web; |
| | | using System.IO; |
| | | using WebAPI.Controllers.SCGL; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class LMESController : ApiController |
| | |
| | | //自定义34进制数组 |
| | | private static char[] lNCode = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; |
| | | string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"]; |
| | | |
| | | |
| | | #region 返回进站扫描列表|工序进站接收单列表 |
| | | [Route("LEMS/MES_StationInBillList_Json")] |
| | |
| | | // 反序列化子表数据 |
| | | var detailList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(msg3); |
| | | |
| | | // 3. 开始事务 |
| | | oCN.BeginTran(); |
| | | |
| | | foreach (var row in detailList) |
| | | { |
| | | // 3. 开始事务 |
| | | oCN.BeginTran(); |
| | | DataSet ds2 = null; |
| | | // 获取子表字段值 |
| | | string hSourceID = row.ContainsKey("HSourceID") ? row["HSourceID"] : "0"; |
| | | string hMoldID = row.ContainsKey("HMoldID") ? row["HMoldID"] : "0"; |
| | |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "华舟") |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "华舟") |
| | | { |
| | | oCN.RunProc("update Sc_ProcessExchangeBillMain set HMakeDate = GETDATE(),HRemark3='已派工',HMaker='" + msg4 + "' where HInterID = " + hSourceInterID); |
| | | LogService.Write("自动生成工作联系单..."); |
| | | |
| | | //自动生成工作联系单 |
| | | oCN.RunProc("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772); |
| | | } |
| | | ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772, "h_p_OA_WorkLinkBill_Create"); |
| | | } |
| | | } |
| | | oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=" + hSourceID + " where HInterID=" + hSourceInterID + " and HEntryID=" + hSourceEntryID); |
| | | // 插入生产状态临时表 |
| | |
| | | oCN.RunProc(SQL); |
| | | //插入工序流转卡派工单 |
| | | string SQL1 = $"exec h_p_Sc_ProcExchSendWorkBill_PG {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}"; |
| | | oCN.RunProc(SQL1); |
| | | oCN.RunProc(SQL1); |
| | | |
| | | // 7. 提交事务 |
| | | oCN.Commit(); |
| | | if (ds2 != null && ds2.Tables[0].Rows.Count > 0) |
| | | { |
| | | int HInterID = int.Parse(ds2.Tables[0].Rows[0]["NewHInterID"].ToString()); |
| | | LogService.Write("执行消息推送..." + HInterID); |
| | | |
| | | // 触发消息推送 |
| | | Service.GeTuiService.PubishSingle(HInterID); |
| | | } |
| | | } |
| | | |
| | | // 7. 提交事务 |
| | | oCN.Commit(); |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |