Compare commits
12 Commits
ae49652868
...
YanShi
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d9131db05 | |||
| 5f62962ac9 | |||
| b6bb5d8766 | |||
|
|
1919896d17 | ||
|
|
d2e2ea0303 | ||
| 5ceed55aad | |||
| e2b52a49e1 | |||
| 1bcee8a9c6 | |||
| da09858630 | |||
| 6f3401179e | |||
| fdf1d59f3e | |||
| b54c9d7d4e |
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -35,5 +36,18 @@ namespace MyCode.Project.Domain.Message.Response.LxmZHMDReport
|
|||||||
/// 入库总数量
|
/// 入库总数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal InStockQty { get; set; }
|
public decimal InStockQty { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 下单时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime FCreateDate { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料名称
|
||||||
|
/// </summary>
|
||||||
|
public string MaterialNames { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 生产车间
|
||||||
|
/// </summary>
|
||||||
|
public string Department { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace MyCode.Project.Domain.Message.Response.LxmZHMDReport
|
|||||||
public decimal FStockOutQty { get; set; }
|
public decimal FStockOutQty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库数量
|
/// 未出库数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal FRemainOutQty { get; set; }
|
public decimal FRemainOutQty { get; set; }
|
||||||
|
|
||||||
@@ -56,6 +56,17 @@ namespace MyCode.Project.Domain.Message.Response.LxmZHMDReport
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
public decimal FInvoiceAmount { get; set; }
|
public decimal FInvoiceAmount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单价税合计(本位币)
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public decimal FBILLALLAMOUNT_LC { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public string FCreateDate { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SalOrderDetailResp
|
public class SalOrderDetailResp
|
||||||
|
|||||||
@@ -25,21 +25,24 @@ namespace MyCode.Project.Repositories
|
|||||||
|
|
||||||
SearchCondition where = new SearchCondition();
|
SearchCondition where = new SearchCondition();
|
||||||
|
|
||||||
where.AddSqlCondition(" 1=1 ", true);
|
where.AddSqlCondition(" 1=1 and a.FStockOutQty<>0 ", true);
|
||||||
|
|
||||||
string sql = $@"
|
string sql = $@" select * from (
|
||||||
SELECT * ,(QTY-FStockOutQty) AS FRemainOutQty,OutboundPercentage=CONVERT(DECIMAL(18,2),(CASE WHEN QTY !=0 THEN FStockOutQty/QTY*1.00 ELSE 0 END))
|
SELECT * ,(QTY-FStockOutQty) AS FRemainOutQty,OutboundPercentage=CONVERT(DECIMAL(18,2),(CASE WHEN QTY !=0 THEN FStockOutQty/QTY*1.00 ELSE 0 END))
|
||||||
FROM (
|
FROM (
|
||||||
SELECT C.FNAME AS CustomerName,a.FBILLNO,a.FDATE,a.FID,FRceiveAmount,FInvoiceAmount2 AS FInvoiceAmount
|
SELECT C.FNAME AS CustomerName,a.FBILLNO,a.FDATE,a.FID,FRceiveAmount,FInvoiceAmount2 AS FInvoiceAmount
|
||||||
,(SELECT SUM(FStockOutQty) FROM T_SAL_ORDERENTRY_R g WHERE g.FID=a.FID) AS FStockOutQty
|
,(SELECT SUM(FStockOutQty) FROM T_SAL_ORDERENTRY_R g WHERE g.FID=a.FID) AS FStockOutQty
|
||||||
,(SELECT SUM(g.FQTY) FROM T_SAL_ORDERENTRY g WHERE g.FID=a.FID) AS QTY
|
,(SELECT SUM(g.FQTY) FROM T_SAL_ORDERENTRY g WHERE g.FID=a.FID) AS QTY
|
||||||
FROM T_SAL_ORDER A WITH(NOLOCK)
|
,fin.FBILLALLAMOUNT_LC, CONVERT(NVARCHAR(23),A.FCreateDate,23) AS FCreateDate
|
||||||
LEFT JOIN T_BD_CUSTOMER Cccc WITH(NOLOCK) ON Cccc.FCUSTID= A.FCUSTID
|
FROM T_SAL_ORDER A WITH(NOLOCK)
|
||||||
LEFT JOIN T_BD_CUSTOMER_L C WITH(NOLOCK) ON C.FCUSTID= A.FCUSTID AND C.FLOCALEID= 2052
|
LEFT JOIN dbo.T_SAL_ORDERFIN fin ON fin.fid=a.FID
|
||||||
WHERE a.FDOCUMENTSTATUS='C') a ";
|
LEFT JOIN T_BD_CUSTOMER Cccc WITH(NOLOCK) ON Cccc.FCUSTID= A.FCUSTID
|
||||||
|
LEFT JOIN T_BD_CUSTOMER_L C WITH(NOLOCK) ON C.FCUSTID= A.FCUSTID AND C.FLOCALEID= 2052
|
||||||
|
WHERE a.FDOCUMENTSTATUS='C'
|
||||||
|
) a ) a ";
|
||||||
|
|
||||||
|
|
||||||
var list = this.SelectListPage<SalOrderResp>(sql, where, search.Page, search.PageSize, $@"FDATE desc ");
|
var list = this.SelectListPage<SalOrderResp>(sql, where, search.Page, search.PageSize, $@"FDATE desc ");
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,24 +79,64 @@ SELECT
|
|||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
t1.FID Fid,
|
t1.FID Fid,
|
||||||
t1.FBILLNO FBillNo,
|
t1.FBILLNO FBillNo,
|
||||||
t1.FDATE FDate,
|
t1.FDATE FDate,
|
||||||
SUM(t1e.FQTY) Qty,
|
t1.FCREATEDATE FCreateDate,
|
||||||
SUM(
|
SUM(t1e.FQTY) Qty,
|
||||||
t1e_a.FSTOCKINFAILAUXQTY + t1e_a.FSTOCKINQUAAUXQTY
|
SUM(
|
||||||
) InStockQty
|
t1e_a.FSTOCKINFAILAUXQTY + t1e_a.FSTOCKINQUAAUXQTY
|
||||||
FROM
|
) InStockQty,
|
||||||
T_PRD_MO t1
|
ISNULL (
|
||||||
LEFT JOIN T_PRD_MOENTRY t1e ON t1.FID = t1e.FID
|
stuff (
|
||||||
LEFT JOIN T_PRD_MOENTRY_A t1e_a ON t1e.FENTRYID = t1e_a.FENTRYID
|
(
|
||||||
WHERE
|
select distinct
|
||||||
1 = 1
|
';' + tm_l.FNAME
|
||||||
AND t1.FDOCUMENTSTATUS = 'C'
|
from
|
||||||
GROUP BY
|
T_PRD_MOENTRY tt
|
||||||
t1.FID,
|
INNER JOIN T_BD_MATERIAL tm ON tt.FMATERIALID = tm.FMATERIALID
|
||||||
t1.FBILLNO,
|
LEFT JOIN T_BD_MATERIAL_L tm_l ON tm.FMATERIALID = tm_l.FMATERIALID
|
||||||
t1.FDATE
|
AND tm_l.FLOCALEID = 2052
|
||||||
|
where
|
||||||
|
tt.FID = t1.FID for xml path ('')
|
||||||
|
),
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
''
|
||||||
|
),
|
||||||
|
''
|
||||||
|
) MaterialNames,
|
||||||
|
ISNULL (
|
||||||
|
stuff (
|
||||||
|
(
|
||||||
|
select distinct
|
||||||
|
';' + tm_l.FNAME
|
||||||
|
from
|
||||||
|
T_PRD_MOENTRY tt
|
||||||
|
INNER JOIN T_BD_DEPARTMENT tm ON tt.FWORKSHOPID = tm.FDEPTID
|
||||||
|
LEFT JOIN T_BD_DEPARTMENT_L tm_l ON tm.FDEPTID = tm_l.FDEPTID
|
||||||
|
AND tm_l.FLOCALEID = 2052
|
||||||
|
where
|
||||||
|
tt.FID = t1.FID for xml path ('')
|
||||||
|
),
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
''
|
||||||
|
),
|
||||||
|
''
|
||||||
|
) Department
|
||||||
|
FROM
|
||||||
|
T_PRD_MO t1
|
||||||
|
LEFT JOIN T_PRD_MOENTRY t1e ON t1.FID = t1e.FID
|
||||||
|
LEFT JOIN T_PRD_MOENTRY_A t1e_a ON t1e.FENTRYID = t1e_a.FENTRYID
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
AND t1.FDOCUMENTSTATUS = 'C'
|
||||||
|
GROUP BY
|
||||||
|
t1.FID,
|
||||||
|
t1.FBILLNO,
|
||||||
|
t1.FDATE,
|
||||||
|
t1.FCREATEDATE
|
||||||
) t1Temp
|
) t1Temp
|
||||||
|
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ namespace MyCode.Project.Services.Implementation
|
|||||||
Year = datetimeTemp.Year,
|
Year = datetimeTemp.Year,
|
||||||
Month = datetimeTemp.Month,
|
Month = datetimeTemp.Month,
|
||||||
};
|
};
|
||||||
result.Add(_MOOrdersRepository.GetMoDataChartHeadByYearAndMonth(yearAndMonth));
|
result.Add(_MOOrdersRepository.GetMoDataChartHeadByYearAndMonth(yearAndMonthTemp));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Http;
|
||||||
|
|
||||||
namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||||
{
|
{
|
||||||
@@ -30,8 +30,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取生产订单
|
/// 获取生产订单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
public PageResult<PrdMoOrderResp> GetMoRespData(PagedSearch pagedSearch)
|
public PageResult<PrdMoOrderResp> GetMoRespData(PagedSearch pagedSearch)
|
||||||
{
|
{
|
||||||
return _prdOrderService.GetPrdMoPageList(pagedSearch);
|
return _prdOrderService.GetPrdMoPageList(pagedSearch);
|
||||||
@@ -40,8 +40,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取生产订单详情
|
/// 获取生产订单详情
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
|
|
||||||
public PageResult<PrdMoOrderEntryResp> GetMoEntryRespData(PagedSearch<IdAct> search)
|
public PageResult<PrdMoOrderEntryResp> GetMoEntryRespData(PagedSearch<IdAct> search)
|
||||||
{
|
{
|
||||||
@@ -51,8 +51,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取生产订单执行汇总报表数据
|
/// 获取生产订单执行汇总报表数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
public PageResult<PrdMOExecuteDetailRpt> GetMoExecuteSumRespData(PagedSearch pagedSearch)
|
public PageResult<PrdMOExecuteDetailRpt> GetMoExecuteSumRespData(PagedSearch pagedSearch)
|
||||||
{
|
{
|
||||||
return _prdOrderService.GetMoExecuteSumRespData(pagedSearch);
|
return _prdOrderService.GetMoExecuteSumRespData(pagedSearch);
|
||||||
@@ -63,8 +63,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="yearAndMonth"></param>
|
/// <param name="yearAndMonth"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
public PrdReportHead GetMoDataChartHeadByYearAndMonth(YearAndMonth yearAndMonth)
|
public PrdReportHead GetMoDataChartHeadByYearAndMonth(YearAndMonth yearAndMonth)
|
||||||
{
|
{
|
||||||
return _prdOrderService.GetMoDataChartHeadByYearAndMonth(yearAndMonth);
|
return _prdOrderService.GetMoDataChartHeadByYearAndMonth(yearAndMonth);
|
||||||
@@ -75,8 +75,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="yearAndMonth"></param>
|
/// <param name="yearAndMonth"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
public List<PrdReportHead> GetMoDataChartByYearAndMonth(YearAndMonth yearAndMonth)
|
public List<PrdReportHead> GetMoDataChartByYearAndMonth(YearAndMonth yearAndMonth)
|
||||||
{
|
{
|
||||||
return _prdOrderService.GetMoDataChartByYearAndMonth(yearAndMonth);
|
return _prdOrderService.GetMoDataChartByYearAndMonth(yearAndMonth);
|
||||||
@@ -87,8 +87,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="yearAndMonth"></param>
|
/// <param name="yearAndMonth"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
public List<MaterialAndQty> GetPrdInStockGroupByMaterial(YearAndMonth yearAndMonth)
|
public List<MaterialAndQty> GetPrdInStockGroupByMaterial(YearAndMonth yearAndMonth)
|
||||||
{
|
{
|
||||||
return _prdOrderService.GetPrdInStockGroupByMaterial(yearAndMonth);
|
return _prdOrderService.GetPrdInStockGroupByMaterial(yearAndMonth);
|
||||||
@@ -99,8 +99,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="yearAndMonth"></param>
|
/// <param name="yearAndMonth"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
public List<MaterialAndQty> GetPrdMoGroupByMaterial(YearAndMonth yearAndMonth)
|
public List<MaterialAndQty> GetPrdMoGroupByMaterial(YearAndMonth yearAndMonth)
|
||||||
{
|
{
|
||||||
return _prdOrderService.GetPrdMoGroupByMaterial(yearAndMonth);
|
return _prdOrderService.GetPrdMoGroupByMaterial(yearAndMonth);
|
||||||
@@ -110,8 +110,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||||||
/// 获取即时库存数据,主要用作饼图,展示各物料库存数量(库存数量)
|
/// 获取即时库存数据,主要用作饼图,展示各物料库存数量(库存数量)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
public List<MaterialAndQty> GetInventoryGroupByMaterial()
|
public List<MaterialAndQty> GetInventoryGroupByMaterial()
|
||||||
{
|
{
|
||||||
return _prdOrderService.GetInventoryGroupByMaterial();
|
return _prdOrderService.GetInventoryGroupByMaterial();
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
|
<PublishUrl>E:\演示API</PublishUrl>
|
||||||
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user