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.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -35,5 +36,18 @@ namespace MyCode.Project.Domain.Message.Response.LxmZHMDReport
|
||||
/// 入库总数量
|
||||
/// </summary>
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// 出库数量
|
||||
/// 未出库数量
|
||||
/// </summary>
|
||||
public decimal FRemainOutQty { get; set; }
|
||||
|
||||
@@ -56,6 +56,17 @@ namespace MyCode.Project.Domain.Message.Response.LxmZHMDReport
|
||||
/// </summary>
|
||||
|
||||
public decimal FInvoiceAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单价税合计(本位币)
|
||||
/// </summary>
|
||||
|
||||
public decimal FBILLALLAMOUNT_LC { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public string FCreateDate { get; set; }
|
||||
}
|
||||
|
||||
public class SalOrderDetailResp
|
||||
|
||||
@@ -25,18 +25,21 @@ namespace MyCode.Project.Repositories
|
||||
|
||||
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))
|
||||
FROM (
|
||||
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
|
||||
FROM (
|
||||
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(g.FQTY) FROM T_SAL_ORDERENTRY g WHERE g.FID=a.FID) AS QTY
|
||||
FROM T_SAL_ORDER A WITH(NOLOCK)
|
||||
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 ";
|
||||
,fin.FBILLALLAMOUNT_LC, CONVERT(NVARCHAR(23),A.FCreateDate,23) AS FCreateDate
|
||||
FROM T_SAL_ORDER A WITH(NOLOCK)
|
||||
LEFT JOIN dbo.T_SAL_ORDERFIN fin ON fin.fid=a.FID
|
||||
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 ");
|
||||
|
||||
@@ -82,21 +82,61 @@ FROM
|
||||
t1.FID Fid,
|
||||
t1.FBILLNO FBillNo,
|
||||
t1.FDATE FDate,
|
||||
t1.FCREATEDATE FCreateDate,
|
||||
SUM(t1e.FQTY) Qty,
|
||||
SUM(
|
||||
t1e_a.FSTOCKINFAILAUXQTY + t1e_a.FSTOCKINQUAAUXQTY
|
||||
) InStockQty
|
||||
FROM
|
||||
) InStockQty,
|
||||
ISNULL (
|
||||
stuff (
|
||||
(
|
||||
select distinct
|
||||
';' + tm_l.FNAME
|
||||
from
|
||||
T_PRD_MOENTRY tt
|
||||
INNER JOIN T_BD_MATERIAL tm ON tt.FMATERIALID = tm.FMATERIALID
|
||||
LEFT JOIN T_BD_MATERIAL_L tm_l ON tm.FMATERIALID = tm_l.FMATERIALID
|
||||
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
|
||||
WHERE
|
||||
1 = 1
|
||||
AND t1.FDOCUMENTSTATUS = 'C'
|
||||
GROUP BY
|
||||
GROUP BY
|
||||
t1.FID,
|
||||
t1.FBILLNO,
|
||||
t1.FDATE
|
||||
t1.FDATE,
|
||||
t1.FCREATEDATE
|
||||
) t1Temp
|
||||
|
||||
";
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace MyCode.Project.Services.Implementation
|
||||
Year = datetimeTemp.Year,
|
||||
Month = datetimeTemp.Month,
|
||||
};
|
||||
result.Add(_MOOrdersRepository.GetMoDataChartHeadByYearAndMonth(yearAndMonth));
|
||||
result.Add(_MOOrdersRepository.GetMoDataChartHeadByYearAndMonth(yearAndMonthTemp));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
{
|
||||
@@ -30,8 +30,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// <summary>
|
||||
/// 获取生产订单
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public PageResult<PrdMoOrderResp> GetMoRespData(PagedSearch pagedSearch)
|
||||
{
|
||||
return _prdOrderService.GetPrdMoPageList(pagedSearch);
|
||||
@@ -40,8 +40,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// <summary>
|
||||
/// 获取生产订单详情
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
|
||||
public PageResult<PrdMoOrderEntryResp> GetMoEntryRespData(PagedSearch<IdAct> search)
|
||||
{
|
||||
@@ -51,8 +51,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// <summary>
|
||||
/// 获取生产订单执行汇总报表数据
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public PageResult<PrdMOExecuteDetailRpt> GetMoExecuteSumRespData(PagedSearch pagedSearch)
|
||||
{
|
||||
return _prdOrderService.GetMoExecuteSumRespData(pagedSearch);
|
||||
@@ -63,8 +63,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// </summary>
|
||||
/// <param name="yearAndMonth"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public PrdReportHead GetMoDataChartHeadByYearAndMonth(YearAndMonth yearAndMonth)
|
||||
{
|
||||
return _prdOrderService.GetMoDataChartHeadByYearAndMonth(yearAndMonth);
|
||||
@@ -75,8 +75,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// </summary>
|
||||
/// <param name="yearAndMonth"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public List<PrdReportHead> GetMoDataChartByYearAndMonth(YearAndMonth yearAndMonth)
|
||||
{
|
||||
return _prdOrderService.GetMoDataChartByYearAndMonth(yearAndMonth);
|
||||
@@ -87,8 +87,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// </summary>
|
||||
/// <param name="yearAndMonth"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public List<MaterialAndQty> GetPrdInStockGroupByMaterial(YearAndMonth yearAndMonth)
|
||||
{
|
||||
return _prdOrderService.GetPrdInStockGroupByMaterial(yearAndMonth);
|
||||
@@ -99,8 +99,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// </summary>
|
||||
/// <param name="yearAndMonth"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public List<MaterialAndQty> GetPrdMoGroupByMaterial(YearAndMonth yearAndMonth)
|
||||
{
|
||||
return _prdOrderService.GetPrdMoGroupByMaterial(yearAndMonth);
|
||||
@@ -110,8 +110,8 @@ namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
||||
/// 获取即时库存数据,主要用作饼图,展示各物料库存数量(库存数量)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public List<MaterialAndQty> 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