Browse Source

因为权限分配问题,更改了后端BOM定价服务

FoShanPG
44673626 3 years ago
parent
commit
c9b57ae7e7
  1. 44
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  2. 54
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  3. 8
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

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

@ -4,17 +4,21 @@ using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Job.Services.Report;
using Shouldly; using Shouldly;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using TaskJob.EventArgs;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.ImportMap; using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.Filter;
@ -32,15 +36,53 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
private readonly PriceListManager _mng; private readonly PriceListManager _mng;
private readonly IExcelImportAppService _excelImportService; private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _mapRepository; private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _mapRepository;
private readonly TaskJobService _service;
public PriceListAppService( public PriceListAppService(
IExcelImportAppService excelImportService, IExcelImportAppService excelImportService,
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> mapRepository, ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> mapRepository,
PriceListManager mng PriceListManager mng,
TaskJobService service
) )
{ {
_mapRepository = mapRepository; _mapRepository = mapRepository;
_excelImportService = excelImportService; _excelImportService = excelImportService;
_mng = mng; _mng = mng;
_service = service;
}
/// <summary>
/// 结算总成和ERP总成价格对比
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("BomDiffPrice-Make")]
[DisableRequestSizeLimit]
[Authorize(SettleAccountPermissions.PriceLists.Default)]
public async Task<string> SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode) ? string.Empty : customerCode });
var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
[HttpPost]
[Route("job/list")]
[Authorize(SettleAccountPermissions.PriceLists.Default)]
[UnitOfWork(false)]
virtual public async Task<List<JobDto>> GetListAsync(JobRequestDto input)
{
return await _service.GetListAsync(input);
} }
/// <summary> /// <summary>

54
src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -352,39 +352,39 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
} }
/// <summary> ///// <summary>
/// 结算总成和ERP总成价格对比 ///// 结算总成和ERP总成价格对比
/// </summary> ///// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param> ///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns> ///// <returns></returns>
[HttpGet] //[HttpGet]
[Route("BomDiffPrice-Make")] //[Route("BomDiffPrice-Make")]
[DisableRequestSizeLimit] //[DisableRequestSizeLimit]
public async Task<string> SettledPartAndErpPartPriceDiffMake(string version, string customerCode) //public async Task<string> SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
{ //{
//if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode)) // //if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
//{ // //{
// throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version)); // // throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version));
//} // //}
//if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode)) // //if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
//{ // //{
// throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version)); // // throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version));
//} // //}
List<CustomCondition> customConditionList = new List<CustomCondition>(); // List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" }); // customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version }); // customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode)?string.Empty: customerCode }); // customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode)?string.Empty: customerCode });
var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) => // var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
{ // {
}); // });
return _taskid; // return _taskid;
} //}

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

@ -280,7 +280,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//var listCompare = DbConnection.Query<CompareExtend>(sql2); //var listCompare = DbConnection.Query<CompareExtend>(sql2);
var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner]", null, null, true, 1200, CommandType.StoredProcedure); var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
@ -299,7 +299,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//"WHERE\n" + //"WHERE\n" +
//" B.Kanban IS NULL"; //" B.Kanban IS NULL";
var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin]", null, null, true, 1200, CommandType.StoredProcedure); var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
@ -827,10 +827,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
var _query = DbConnection.Query<HQUnSettledDetailDiff>("[dbo].[p_hq_unsettle_weijie]", new { begin = begin, end = end, version = version, iscontionversion = iscontionversion }, null, true, 1200, CommandType.StoredProcedure); var _query = DbConnection.Query<HQUnSettledDetailDiff>("[dbo].[p_hq_unsettle_weijie]", new { begin = begin, end = end, version = version, iscontionversion = iscontionversion }, null, true, 1200, CommandType.StoredProcedure);
_list = _query.ToList(); _list = _query.ToList();
var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner]", null, null, true, 1200, CommandType.StoredProcedure); var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin]", null, null, true, 1200, CommandType.StoredProcedure); var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
//发运数据比较 //发运数据比较

Loading…
Cancel
Save