83 lines
2.7 KiB
C#
83 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using HHWMS.Web.Models;
|
|
using MESTOWMSService;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Newtonsoft.Json;
|
|
using ServiceReference1;
|
|
using WalkingTec.Mvvm.Core;
|
|
using WalkingTec.Mvvm.Mvc;
|
|
|
|
namespace HHWMS.Web.Controllers;
|
|
|
|
[Area("xwms")]
|
|
[ActionDescription("销售订单列表")]
|
|
public class XWMSSOHController : BaseController
|
|
{
|
|
private readonly IUnitWork _unitWork;
|
|
|
|
public XWMSSOHController(IUnitWork unitWork)
|
|
{
|
|
_unitWork = unitWork;
|
|
}
|
|
|
|
#region Search
|
|
|
|
[ActionDescription("Sys.Search")]
|
|
public ActionResult Index()
|
|
{
|
|
return PartialView("Index");
|
|
}
|
|
|
|
[ActionDescription("Sys.Search")]
|
|
public ActionResult Search(string address, string billno, string cust, string materialcode)
|
|
{
|
|
var sql = @"select * from QREQ3.XWMSSOH where 1=1";
|
|
if (!string.IsNullOrEmpty(address))
|
|
{
|
|
sql += $" and SALFCY_0 = '{address}'";
|
|
}
|
|
if (!string.IsNullOrEmpty(billno))
|
|
{
|
|
sql += $" and SOHNUM_0 like '%{billno}%'";
|
|
}
|
|
if (!string.IsNullOrEmpty(cust))
|
|
{
|
|
sql += $" and BPCNAM_0 like '%{cust}%'";
|
|
}
|
|
if (!string.IsNullOrEmpty(materialcode))
|
|
{
|
|
sql += $"and ITMREF_0 like '%{materialcode}%'";
|
|
}
|
|
|
|
var data = OracleHelper.GetDataSet(sql).Tables[0];
|
|
|
|
var list = data.AsEnumerable().Select
|
|
(x => new
|
|
{
|
|
SALFCY_0 = x.Field<string>("SALFCY_0"),
|
|
ORDDAT_0 = x.Field<DateTime>("ORDDAT_0").ToShortDateString(),
|
|
BPCORD_0 = x.Field<string>("BPCORD_0"),
|
|
BPCNAM_0 = x.Field<string>("BPCNAM_0"),
|
|
SOHNUM_0 = x.Field<string>("SOHNUM_0"),
|
|
SOPLIN_0 = x.Field<Int64>("SOPLIN_0"),
|
|
ITMREF_0 = x.Field<string>("ITMREF_0"),
|
|
ITMDES1_0 = x.Field<string>("ITMDES1_0"),
|
|
ITMDES2_0 = x.Field<string>("ITMDES2_0"),
|
|
ITMDES3_0 = x.Field<string>("ITMDES3_0"),
|
|
YITMDES4_0 = x.Field<string>("YITMDES4_0"),
|
|
QTY_0 = x.Field<decimal>("QTY_0"),
|
|
NODLQTY_0 = x.Field<decimal>("NODLQTY_0"),
|
|
STU_0 = x.Field<string>("STU_0"),
|
|
BPAADD_0 = x.Field<string>("BPAADD_0")
|
|
}
|
|
).ToList();
|
|
return JsonMore(list);
|
|
}
|
|
|
|
#endregion Search
|
|
}
|