| | |
| | | { |
| | | try |
| | | { |
| | | string sql = @"SELECT b.HMouldID,c.HMouldNo 模具编码,c.HName 模具名称,c.HModel 模具型号 FROM Sc_ICMOBillStatus_Tmp a |
| | | LEFT JOIN( |
| | | SELECT *, ROW_NUMBER() OVER(PARTITION BY HSourceID ORDER BY HScanDate DESC) AS RowNum FROM Sc_MouldUpperBillSub |
| | | ) b ON a.HSourceID = b.HSourceID AND b.RowNum = 1 |
| | | left join Gy_MouldFileMain c on b.HMouldID = c.HInterID |
| | | where a.HSourceInterID ='" + HInterID + "' and a.HSourceEntryID ='" + HEntryID + "' and a.HSourceBillNo ='" + HBillNo + "'"; |
| | | ds = oCN.RunProcReturn(sql, "Sc_ICMOBillStatus_Tmp"); |
| | | ds = oCN.RunProcReturn("exec h_p_StationOutBill_Model '" + HInterID + "','"+ HEntryID + "' ,'" + HBillNo + "'", "h_p_StationOutBill_Model"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | if (ds.Tables[0].Rows.Count != 0 && ds != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "当前设备没有模具进行绑定!"; |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |