Administrator
3 years ago
4 changed files with 157 additions and 8 deletions
@ -0,0 +1,109 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using TaskJob.EventArgs; |
||||
|
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
||||
|
|
||||
|
namespace SettleAccount.Job.Services.Report |
||||
|
{ |
||||
|
public class UnSettledSumService |
||||
|
{ |
||||
|
|
||||
|
private readonly UnSettledDetailDapperRepository _dapper; |
||||
|
private readonly OutputService _outputService; |
||||
|
private readonly ErpPartDapperRepository _erpDapper; |
||||
|
public UnSettledSumService( |
||||
|
UnSettledDetailDapperRepository dapper, |
||||
|
OutputService outputService, |
||||
|
ErpPartDapperRepository erpDapper |
||||
|
) |
||||
|
{ |
||||
|
_dapper = dapper; |
||||
|
_outputService = outputService; |
||||
|
_erpDapper = erpDapper; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//public string GetFisSum(Guid id, List<string> exportName, List<CustomCondition> p_list)
|
||||
|
//{
|
||||
|
// var _first = exportName.FirstOrDefault();
|
||||
|
// var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
|
||||
|
// var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value;
|
||||
|
// var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
|
||||
|
// var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
|
||||
|
// var sapcode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value;
|
||||
|
// var begin = p_list.Where(p => p.Name == "Begin").FirstOrDefault().Value;
|
||||
|
// var end = p_list.Where(p => p.Name == "End").FirstOrDefault().Value;
|
||||
|
// var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value;
|
||||
|
// var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value;
|
||||
|
// var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
|
||||
|
|
||||
|
|
||||
|
// //var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value;
|
||||
|
// //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value;
|
||||
|
|
||||
|
|
||||
|
// var _list = _dapper.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, customerCode, version, materailCode, materialGroup, sapcode);
|
||||
|
// var _ls = _list.Where(p => p.Flag != "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
|
||||
|
// var _lst = _erpDapper.GetSapList(_ls, version, false);
|
||||
|
// _lst.ForEach(p =>
|
||||
|
// {
|
||||
|
|
||||
|
// p.Qty = 1;
|
||||
|
// p.DiffAMT = Math.Round(p.Qty * p.Price, 2);
|
||||
|
// p.DiffQty = 1;
|
||||
|
// }
|
||||
|
// );
|
||||
|
|
||||
|
// if (!string.IsNullOrEmpty(materialGroup))
|
||||
|
// {
|
||||
|
// var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
|
||||
|
// if (_groupList.Count() > 0)
|
||||
|
// {
|
||||
|
// _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
|
||||
|
// }
|
||||
|
// }
|
||||
|
// if (!string.IsNullOrEmpty(kenncode))
|
||||
|
// {
|
||||
|
// var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList();
|
||||
|
// if (_groupList.Count() > 0)
|
||||
|
// {
|
||||
|
// _list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList();
|
||||
|
// }
|
||||
|
// }
|
||||
|
// if (!string.IsNullOrEmpty(chassisNumber))
|
||||
|
// {
|
||||
|
// var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList();
|
||||
|
// if (_groupList.Count() > 0)
|
||||
|
// {
|
||||
|
// _list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
|
||||
|
// }
|
||||
|
// }
|
||||
|
// if (!string.IsNullOrEmpty(sapCode))
|
||||
|
// {
|
||||
|
// var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
|
||||
|
// if (_groupList.Count() > 0)
|
||||
|
// {
|
||||
|
// _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
|
||||
|
// }
|
||||
|
// }
|
||||
|
// if (!string.IsNullOrEmpty(materailCode))
|
||||
|
// {
|
||||
|
// var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList();
|
||||
|
// if (_groupList.Count() > 0)
|
||||
|
// {
|
||||
|
// _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
|
||||
|
// }
|
||||
|
// }
|
||||
|
// _lst.GroupBy(p=>sapcode).Select()
|
||||
|
|
||||
|
|
||||
|
//}
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue