dytyqx
4 天以前 9f7b0ecace9c80ff2a1d95f4343058b3b031bd22
WebAPI/Controllers/LMESController.cs
@@ -871,7 +871,18 @@
                    if (hSourceID == "0" || hMoldID == "0")
                    {
                        continue;
                    }
                    }
                    //保存前判断流转卡同一个工序派工是否排了两次
                    string SQ = "select * from Sc_ICMOBillStatus_Tmp where HSourceInterID=" + hSourceInterID + " and HSourceEntryID=" + hSourceEntryID + " and HSourceID=" + hSourceID + " and HMouldID=" + hMoldID + "";
                    ds2 = oCN.RunProcReturn(SQ, "Sc_ICMOBillStatus_Tmp");
                    if (ds2.Tables[0].Rows.Count > 0)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "同一工单不能再相同产线相同模具上重复派工!";
                        return objJsonResult;
                    }
                    //更新流转卡子表生产资源
                    oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=" + hSourceID + " where HInterID=" + hSourceInterID + " and HEntryID=" + hSourceEntryID);
                    // 插入生产状态临时表
@@ -879,6 +890,7 @@
                    oCN.RunProc(SQL);
                    //插入工序流转卡派工单
                    string SQL1 = $"exec h_p_Sc_ProcExchSendWorkBill_PG {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}";
                    oCN.RunProc(SQL1);
                    string sReturn = "";
                    if (oSystemParameter.ShowBill(ref sReturn) == true)
@@ -886,8 +898,8 @@
                        if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                        {
                            oCN.RunProc("update Sc_ProcessExchangeBillMain set HMakeDate = GETDATE(),HRemark3='已派工',HMaker='" + msg4 + "' where HInterID = " + hSourceInterID);
                            LogService.Write("自动生成工作联系单...");
                            LogService.Write("派工自动生成工作联系单..."+ hSourceInterID);
                            //自动生成工作联系单
                            ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772, "h_p_OA_WorkLinkBill_Create");
                        }