Browse Source

20220902派格结算系统最新代码提交,新git

FoShanPG
44673626 2 years ago
parent
commit
87f259d0dd
  1. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  2. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  3. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs
  4. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  5. 29
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  6. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs
  7. 25
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs
  8. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  9. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs
  10. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  11. 29
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs

3
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -216,7 +216,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var entityList = ObjectMapper.Map<List<PriceListImportDto>, List<PriceList>>(result); var entityList = ObjectMapper.Map<List<PriceListImportDto>, List<PriceList>>(result);
var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault());
//只过滤类型为10的即正常价格,类型为20的是备件价格
_ls = _ls.Where(p => p.Type == 10).ToList();
foreach (var itm in _ls) foreach (var itm in _ls)
{ {

7
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -170,17 +170,16 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result); var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result);
var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault());
//只要类型为20的备件价格数据
_ls = _ls.Where(p => p.Type == 20).ToList();
foreach (var itm in _ls) foreach (var itm in _ls)
{ {
itm.Update(GuidGenerator.Create(),version); itm.Update(GuidGenerator.Create(),version);
} }
_ls=_ls.Where(p => p.Type == 20).ToList();
await _mng.ImportAsync(_ls.ToList(), version); await _mng.ImportAsync(_ls.ToList(), version);
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;
} }

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs

@ -505,7 +505,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{ {
WmsHQHKanbanOutPutDetial _detail = new WmsHQHKanbanOutPutDetial( WmsHQHKanbanOutPutDetial _detail = new WmsHQHKanbanOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
!string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty,
itm.Kanban, itm.Kanban,
itm.MaterialCode, itm.MaterialCode,
itm.MaterialDesc, itm.MaterialDesc,

4
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs

@ -806,7 +806,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{ {
WmsKanbanOutPutDetial _detail = new WmsKanbanOutPutDetial( WmsKanbanOutPutDetial _detail = new WmsKanbanOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
!string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty,
itm.Kanban, itm.Kanban,
itm.MaterialCode, itm.MaterialCode,
@ -815,7 +815,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
!string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty, !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty,//客户物料号
!string.IsNullOrEmpty(itm.Extend2) ? itm.Extend2 : string.Empty, !string.IsNullOrEmpty(itm.Extend2) ? itm.Extend2 : string.Empty,
version, version,
itm.MaterialCode, itm.MaterialCode,

29
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs

@ -269,10 +269,10 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
!string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty, !string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty,//客户物料号
string.Empty, string.Empty,
p.Version, p.Version,
p.MaterialCode, p.ParentMaterialCode,
_billNum, _billNum,
GuidGenerator.Create(), GuidGenerator.Create(),
string.Empty, string.Empty,
@ -318,8 +318,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
!string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty,
string.Empty, string.Empty,
string.Empty,
input.Version, input.Version,
p.MaterialCode, p.MaterialCode,
_billNum, _billNum,
@ -512,14 +512,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
} }
//和物料主数据中SAP物料号检验是否存在
//foreach (var itm in filteResult) foreach (var itm in filteResult)
//{ {
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) if (string.IsNullOrEmpty(itm.Extend1))
// { {
// checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("当前导入订单号{0}存在物料号为空情况,请检查!", itm.OrderBillNum), string.Empty));
// } }
//} }
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
@ -532,8 +532,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
{ {
WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial( WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
//itm.WmsBillNum, //itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum,
string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty,
//string.Empty,
itm.OrderBillNum, itm.OrderBillNum,
itm.MaterialCode, itm.MaterialCode,
@ -542,7 +543,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
string.Empty, !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty,//客户物料号
string.Empty, string.Empty,
version, version,
itm.ParentMaterialCode, itm.ParentMaterialCode,

2
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs

@ -10,6 +10,7 @@ using Volo.Abp.Dapper;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Volo.Abp.EventBus.RabbitMq; using Volo.Abp.EventBus.RabbitMq;
using Volo.Abp.RabbitMQ; using Volo.Abp.RabbitMQ;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount namespace Win.Sfs.SettleAccount
{ {
@ -22,6 +23,7 @@ namespace Win.Sfs.SettleAccount
typeof(AbpIdentityHttpApiClientModule), typeof(AbpIdentityHttpApiClientModule),
typeof(AbpAutoMapperModule), typeof(AbpAutoMapperModule),
typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreMvcModule),
typeof(AbpEntityFrameworkCoreModule),
typeof(AbpDapperModule) typeof(AbpDapperModule)
//typeof(AbpEventBusRabbitMqModule) //typeof(AbpEventBusRabbitMqModule)

25
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs

@ -23,6 +23,21 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <summary> /// <summary>
/// 主数据Dapper表 /// 主数据Dapper表
/// </summary> /// </summary>
//public class FisUpdateDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
//{
// public FisUpdateDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider) : base(dbContextProvider)
// {
// }
// [UnitOfWork(isTransactional: false)]
// public virtual void UpdateFisSettle()
// {
// DbConnection.Execute("EXEC sp_settle_fis_update", null, null, 1200, null);
// }
//}
public class FisUpdateDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency public class FisUpdateDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{ {
public FisUpdateDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider) : base(dbContextProvider) public FisUpdateDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider) : base(dbContextProvider)
@ -30,15 +45,15 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
} }
[UnitOfWork(isTransactional: false)] [UnitOfWork(isTransactional: false)]
public virtual void UpdateFisSettle() public virtual void UpdateFisSettle(string version)
{ {
DbConnection.Execute("EXEC sp_settle_fis_update", null, null, 1200, null); DbConnection.Execute(string.Format("EXEC sp_settle_fis_update N'{0}'", version), null, null, 1200, null);
} }
}
}
} }

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

@ -1845,7 +1845,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
var _sql = string.Format(str, version); var _sql = string.Format(str, version);
@ -1919,7 +1919,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n" +
" LEFT JOIN (\n" + " LEFT JOIN (\n" +
" SELECT SUM\n" + " SELECT SUM\n" +
" ( Amt ) / SUM ( Qty ) AS Price,\n" + " ( Amt ) / SUM ( Qty ) AS Price,\n" +

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs

@ -114,7 +114,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ( a.HQMKanBan <> 'BJ' ) \n" + " ( a.HQMKanBan <> 'BJ' ) \n" +
" AND a.Version= '{0}' {1} \n" + " AND a.Version= '{0}' {1} \n" +
" ) AS temp1\n" + " ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode"; " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) and Type=10) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition); var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQMSettledDetailDiff>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<HQMSettledDetailDiff>(_sql, null, null, true, 1200, null);
@ -206,7 +206,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
var _sql = string.Format(str, version, condition); var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQMSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<HQMSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null);

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

@ -1332,7 +1332,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) AS temp1\n" + " ) AS temp1\n" +
" LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" + " LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" +
" AND temp1.SAP编码= temp3.MaterialCode\n" + " AND temp1.SAP编码= temp3.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
" ) unint1 UNION ALL\n" + " ) unint1 UNION ALL\n" +
"SELECT\n" + "SELECT\n" +
" * \n" + " * \n" +
@ -1389,7 +1389,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) AS temp1\n" + " ) AS temp1\n" +
" LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" + " LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" +
" AND temp1.SAP编码= temp3.MaterialCode\n" + " AND temp1.SAP编码= temp3.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
" ) unint2;"; " ) unint2;";

29
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs

@ -11,6 +11,27 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report namespace SettleAccount.Job.Services.Report
{ {
//public class FisUpdateExportService : ITransientDependency, IExportJob
//{
// private readonly FisUpdateDapperRepository _dapperRepository;
// public FisUpdateExportService(
// FisUpdateDapperRepository dapperRepository
// )
// {
// _dapperRepository = dapperRepository;
// }
// [UnitOfWork(isTransactional: false)]
// public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
// {
// _dapperRepository.UpdateFisSettle();
// return id.ToString();
// }
//}
public class FisUpdateExportService : ITransientDependency, IExportJob public class FisUpdateExportService : ITransientDependency, IExportJob
{ {
private readonly FisUpdateDapperRepository _dapperRepository; private readonly FisUpdateDapperRepository _dapperRepository;
@ -19,15 +40,17 @@ namespace SettleAccount.Job.Services.Report
public FisUpdateExportService( public FisUpdateExportService(
FisUpdateDapperRepository dapperRepository FisUpdateDapperRepository dapperRepository
) )
{ {
_dapperRepository = dapperRepository; _dapperRepository = dapperRepository;
} }
[UnitOfWork(isTransactional: false)] [UnitOfWork(isTransactional: false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{ {
_dapperRepository.UpdateFisSettle(); var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
_dapperRepository.UpdateFisSettle(version);
return id.ToString(); return id.ToString();
} }
} }

Loading…
Cancel
Save