Browse Source

Merge branch 'master' of http://dev.ccwin-in.com:3000/BoXu.Zheng/BeiJinSettleAccount

master
mahao 1 year ago
parent
commit
ef2b1731e1
  1. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
  2. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md
  3. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  4. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js
  5. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  6. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs
  7. 49
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj

@ -91,6 +91,9 @@
<None Remove="EntityFrameworkCore\**" /> <None Remove="EntityFrameworkCore\**" />
<None Remove="Logs\**" /> <None Remove="Logs\**" />
<None Remove="Migrations\**" /> <None Remove="Migrations\**" />
<Content Include="scripts\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md

@ -0,0 +1,3 @@
# 数据库存储过程和自定义函数说明

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js

@ -383,7 +383,7 @@ export default [
createButton( createButton(
"sync", "sync",
"title=同步到QAD&isTop=true", "title=同步到QAD&isTop=true",
(_, q) => q.filters.some((o) => o.column === "state" && o.value === 4) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1) (_, q) => q.filters.some((o) => o.column === "state" && o.value === 5) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
), ),
], ],
}, },

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js

@ -26,7 +26,7 @@ export default {
: item.path === "reject" : item.path === "reject"
? `确认退回选中的${rows.length}行数据吗?` ? `确认退回选中的${rows.length}行数据吗?`
: `确认选中的${rows.length}行数据客户已收票吗?`; : `确认选中的${rows.length}行数据客户已收票吗?`;
const data = rows.map((o) => o.invbillNum); const data = rows.map((o) => o.billNum);
const url = config.edit.approvalUrl; const url = config.edit.approvalUrl;
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true); await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
} }

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -587,6 +587,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
.GroupBy(p => new { p.LU, p.SettleGroupNum }) .GroupBy(p => new { p.LU, p.SettleGroupNum })
.Select(p => new JIT_UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) }); .Select(p => new JIT_UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) });
entity.JIT_UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p => p.GroupNum).ThenBy(p => p.LU).ToList(); entity.JIT_UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p => p.GroupNum).ThenBy(p => p.LU).ToList();
entity.INVOICE_MAP_GROUP =mdtos;
} }
if (first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO) if (first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO)
{ {
@ -750,6 +755,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
_excel.Append(jitunsettle, "未结零件汇总"); _excel.Append(jitunsettle, "未结零件汇总");
} }
if (m != null)
{
_excel.Append(m, "发票结算分组对应");
}
} }
//jis业务,发票分组对应关系,未结数据,调整数据 //jis业务,发票分组对应关系,未结数据,调整数据
if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO) if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO)

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp; using Volo.Abp;
@ -111,7 +112,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
break; break;
} }
await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); //await _repository.UpdateAsync(p_entiy).ConfigureAwait(false);
await _repository.DbContext.BulkUpdateAsync(new List<HBPO_CAN_SA> { p_entiy }).ConfigureAwait(false);
return true; return true;
} }
return false; return false;

49
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NPOI.SS.Formula.Functions;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp; using Volo.Abp;
@ -1192,8 +1193,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
dic.Add(itm.GroupNum, itm.Amt); dic.Add(itm.GroupNum, itm.Amt);
copyDic.Add(itm.GroupNum, itm.Amt); copyDic.Add(itm.GroupNum, itm.Amt);
} }
Dictionary<string, List<string>> invoiceMap = new Dictionary<string, List<string>>(); Dictionary<string, List<string>> invoiceMap = new Dictionary<string, List<string>>();
var first=p_list.FirstOrDefault();
foreach (var itm in dic) foreach (var itm in dic)
{ {
string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV"); string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV");
@ -1202,6 +1209,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
decimal sum = itm.Value;//初始分组合计金额 decimal sum = itm.Value;//初始分组合计金额
// List<string> luList = dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类 // List<string> luList = dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU).Distinct().ToList(); //初始LU种类
if (copyDic.ContainsKey(itm.Key) == true)//是否存在分组 if (copyDic.ContainsKey(itm.Key) == true)//是否存在分组
{
if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO)
{ {
foreach (var _itm1 in copyDic) foreach (var _itm1 in copyDic)
{ {
@ -1230,6 +1239,44 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
copyDic.Remove(rem); copyDic.Remove(rem);
} }
} }
else
{
int count = 1;
foreach (var _itm1 in copyDic)
{
if (itm.Key == _itm1.Key)//相同结算分组项不计算,已初始化
{
invoiceGroupNumList.Add(itm.Key);
continue;
}
if (count > 14)
{
break;
}
//var grouplist = dtos.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU).Distinct().ToList();//每项LU种类
//luList.AddRange(grouplist);
//luList = luList.Distinct().ToList();
//if (luList.Count > 20)//累加零件不超过20种
//{
// continue;
//}
sum += _itm1.Value;
if (sum > 10000000)
{
break;
}
invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系
count++;
}
invoiceMap.Add(invoiceBillNum, invoiceGroupNumList);//记录发票对应关系
foreach (var rem in invoiceGroupNumList)//移除
{
copyDic.Remove(rem);
}
}
}
} }
if (invoiceMap.Keys.Count > 0) if (invoiceMap.Keys.Count > 0)
{ {
@ -1452,8 +1499,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
//} //}
_invls = invlist.Select(p => p.InvbillNum).ToList(); _invls = invlist.Select(p => p.InvbillNum).ToList();
} }
return _invls; return _invls;
} }

Loading…
Cancel
Save