/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/multibin/schedule.ashx
101 строка
4 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
<%@ WebHandler Language="VB" Class="getsqldata" %> Imports System Imports System.Web Imports Newtonsoft.Json Public Class getsqldata : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest context.Response.ContentType = "text/plain" With context.Request Dim sql As New StringBuilder Dim prod_date As String = .QueryString("prodDate") Dim line As String = .QueryString("line") sql.AppendLine("use SAPData") sql.AppendLine("select ") sql.AppendLine("[order] as po, model, qty, start_time ") sql.AppendLine(" from ( ") sql.AppendLine(" select t1.line, ") sql.AppendLine(" t1.model, ") sql.AppendLine(" t1.version, ") sql.AppendLine(" t1.start_time, ") sql.AppendLine(" t1.po as 'order', ") sql.AppendLine(" t1.qty, ") sql.AppendLine(" case t2.panel ") sql.AppendLine(" WHEN '' THEN ") sql.AppendLine(" case t2.lcm_assy ") sql.AppendLine(" WHEN '' THEN t2.product_lcd ") sql.AppendLine(" else t2.lcm_assy ") sql.AppendLine(" end ") sql.AppendLine(" else t2.panel ") sql.AppendLine(" end as panel, ") sql.AppendLine(" t2.ip_smps, ") sql.AppendLine(" t2.speaker, ") sql.AppendLine(" ") sql.AppendLine(" t2.stand, ") sql.AppendLine(" isnull(t2.stand_IMPORT,'N') as v1, ") sql.AppendLine(" t2.stand_mrpc_gerp as stand_GERP_MRP, ") sql.AppendLine(" ") sql.AppendLine(" case t2.front ") sql.AppendLine(" when '' then t2.assy_cover_pmiddle ") sql.AppendLine(" else t2.front ") sql.AppendLine(" end as front, ") sql.AppendLine(" isnull( ") sql.AppendLine(" case t2.front ") sql.AppendLine(" when '' then t2.pmiddle_IMPORT ") sql.AppendLine(" else t2.front_IMPORT ") sql.AppendLine(" end,'N') as v2, ") sql.AppendLine(" case t2.front ") sql.AppendLine(" when '' then t2.pmiddle_mrpc_gerp ") sql.AppendLine(" else t2.front_mrpc_gerp ") sql.AppendLine(" end as front_GERP_MRP, ") sql.AppendLine(" ") sql.AppendLine(" case t2.rear ") sql.AppendLine(" when '' then t2.rear ") sql.AppendLine(" else t2.rear ") sql.AppendLine(" end as rear, ") sql.AppendLine(" isnull( ") sql.AppendLine(" case t2.rear ") sql.AppendLine(" when '' then t2.rear_IMPORT ") sql.AppendLine(" else t2.rear_IMPORT ") sql.AppendLine(" end,'N') as v3, ") sql.AppendLine(" case t2.rear ") sql.AppendLine(" when '' then t2.rear_mrpc_gerp ") sql.AppendLine(" else t2.rear_mrpc_gerp ") sql.AppendLine(" end as rear_GERP_MRP ") sql.AppendLine(" ") sql.AppendLine("from daily_plan_with_version t1 ") sql.AppendLine("left join key_material_with_mrpc t2 ") sql.AppendLine("on t1.model = t2.model and t1.version = t2.version ") sql.AppendLine("where t1.plan_date = '" & prod_date & "' ") sql.AppendLine(") ttt ") sql.AppendLine("where line = '" & line & "' ") sql.AppendLine("order by start_time ") Dim sqlf As New sharedClasses.dbFunctions.SqlFunctions Dim dt As Data.DataTable = Nothing dt = sqlf.GetData(sql.ToString) Try context.Response.Write(JsonConvert.SerializeObject(dt, Formatting.None)) Catch ex As Exception context.Response.Write("") End Try End With End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class