Compare commits
162 Commits
Syncfusion
...
cb71d6abed
| Author | SHA1 | Date | |
|---|---|---|---|
| cb71d6abed | |||
| 9cedf4402e | |||
| 8e9a2a0975 | |||
| 51a96f6c6a | |||
| 7d37b7744c | |||
| a26a52b078 | |||
| 2f80dbc13c | |||
| 929e41e312 | |||
| 1e7c6a6694 | |||
| 6297ae92eb | |||
| 14b83bf9d2 | |||
| 2c97c5054e | |||
| 6fed42ee64 | |||
| 1321c88a31 | |||
| 38ff2c1673 | |||
| 070b538cb2 | |||
| d832f1b960 | |||
| db03b35292 | |||
| 6f9b94a97c | |||
| c4a99e3c35 | |||
| 1e796e2c13 | |||
| 26d00213d2 | |||
| 03b28eed6e | |||
| 0baee2be8b | |||
| a49efec313 | |||
| 96bfccdd55 | |||
| 1f3a29b293 | |||
| 49f685f109 | |||
| 2c196c68d7 | |||
| f0c4fef3cb | |||
| 2b3bc03049 | |||
| 913a1ce49d | |||
| eb8dc3cd4f | |||
| 4368129802 | |||
| 5d64abace3 | |||
| 1f9ae3998c | |||
| 3c62579a49 | |||
| 9f0f0d703e | |||
| dae2a08390 | |||
| 0649c85e76 | |||
| 4f40f33666 | |||
| 7d6c3d9fd6 | |||
| 0407205b5d | |||
| 212a1feafc | |||
| c8b300336e | |||
| 653ab748e7 | |||
| e354881309 | |||
| 107f5b173c | |||
| 4788830d72 | |||
| aa1bd5167e | |||
| 398e0d5796 | |||
| 21d6c76f37 | |||
| 21336e8dc6 | |||
| b87b574b7d | |||
| cfbaaf85ac | |||
| ac8213ff04 | |||
| b290ff47f2 | |||
| bc968a1a0f | |||
| fc72354331 | |||
| 8defd33651 | |||
| dfeecd59d8 | |||
| ae982f59e3 | |||
| be8102c777 | |||
| c9217867df | |||
| e7e5e7fbb0 | |||
| 568d2d3918 | |||
| a301ca1ecc | |||
| 4c3397f5c5 | |||
| f3977428ef | |||
| e04f133b49 | |||
| 6770e41a6e | |||
| 04a43d6f04 | |||
| b336dfe483 | |||
| 4e94cccc88 | |||
| 06491eea1f | |||
| ea018f2da3 | |||
| c17387acde | |||
| 9a4fb30d07 | |||
| 9294b538da | |||
| e844cbfb02 | |||
| d40caafce2 | |||
| 890ab7a67f | |||
| a50e202786 | |||
| 9cc874322a | |||
| 8d8099f9e2 | |||
| 1d8c709910 | |||
| d62212d3ed | |||
| df9ec74142 | |||
| 96a61f306f | |||
| c35060f4d3 | |||
| 1e889f6e9a | |||
| e9a3e91082 | |||
| c4b1561cbc | |||
| 6f477ee174 | |||
| be26bf9b6e | |||
| e57713fabc | |||
| 166eec9181 | |||
| da71596fad | |||
| 309044cb0c | |||
| 9163f330aa | |||
| 8cfded48ae | |||
| f6cc62d6c8 | |||
| 08171522b9 | |||
| e2c5de40b5 | |||
| 01350f0146 | |||
| 50a25ff996 | |||
| 89792d3d28 | |||
| f45baa31a5 | |||
| 85d571ed7f | |||
| bfe325df82 | |||
| d3694ad0c4 | |||
| 0199467f72 | |||
| 47f37d016d | |||
| 23c26b4c65 | |||
| f6deaa3da0 | |||
| 8b67aa3851 | |||
| cd3d939efe | |||
| f0b94bea74 | |||
| de9f6e53aa | |||
| eb756eedec | |||
| 81aae81016 | |||
| 3fd97b10eb | |||
| 9b13c8e099 | |||
| 764ba68f56 | |||
| 8c646d4bc7 | |||
| eb40cc35fe | |||
| a0c7c2f6aa | |||
| f400c35c60 | |||
| d7210417f5 | |||
| 88daf6d392 | |||
| 6139ce97d7 | |||
| 1842fd6146 | |||
| e69b10398f | |||
| 96a6d7772e | |||
| 4392cce6c9 | |||
| 4cfb422ad4 | |||
| 82cb7a3dbe | |||
| d3e6c815ac | |||
| 2bf87c0091 | |||
| 52439e73cb | |||
| 30d2984add | |||
| a8e3a8be66 | |||
| e96bcc95ba | |||
| e55a3926ff | |||
| 9cb7210aa5 | |||
| 24e2836f77 | |||
| 269d9c87a4 | |||
| 53d99bf65f | |||
| ad641560ea | |||
| 1a4ff2ef6d | |||
| 393db2cc7c | |||
| f58d2ab04c | |||
| 71dd78cbd7 | |||
| f4195a540c | |||
| 6ab3960e50 | |||
| bc28c5d63d | |||
| 55f7ed76fd | |||
| da1eae8ca9 | |||
| 1f08ae05f0 | |||
| 9f38998135 | |||
| 04e18374da | |||
| edc4aef0db |
192
.gitea/workflows/build-and-publish.yml
Normal file
192
.gitea/workflows/build-and-publish.yml
Normal file
@@ -0,0 +1,192 @@
|
||||
name: Build, Test & Publish DataModels + Apps
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
create: # nowe tagi
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
workflow_dispatch: # ręczne uruchomienie
|
||||
|
||||
jobs:
|
||||
restore-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # potrzebne do MinVer i git describe
|
||||
repository: FA/FA_WEB # ← nazwa repozytorium (organizacja/repo)
|
||||
ref: ${{ github.ref }} # lub ${{ gitea.ref }} – w Gitea obie działają
|
||||
# Najważniejsze – nadpisz domyślny URL
|
||||
url: http://srv51.mikr.us:20120/git/FA/FA_WEB.git
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x' # zmień na swoją wersję jeśli inna
|
||||
|
||||
- name: Restore all projects
|
||||
run: |
|
||||
echo "=== Restore wszystkich projektów ==="
|
||||
find . -name "*.csproj" -type f -exec dotnet restore "{}" \;
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
echo "=== Uruchamianie testów ==="
|
||||
dotnet test --no-restore --configuration Release --logger "trx"
|
||||
|
||||
pack-datamodels:
|
||||
runs-on: ubuntu-latest
|
||||
needs: restore-and-test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Install MinVer CLI
|
||||
run: dotnet tool install --global minver-cli
|
||||
|
||||
- name: Pack DataModel projects
|
||||
env:
|
||||
MINVER_AUTO_INCREMENT: patch
|
||||
MINVER_MINIMUM_MAJOR_MINOR: 2.0
|
||||
MINVER_DEFAULT_PRE_RELEASE_IDENTIFIERS: alpha.0
|
||||
run: |
|
||||
echo "=== Obliczona wersja przez MinVer ==="
|
||||
MINVER_VERSION=$(minver --verbosity detailed)
|
||||
echo "Wersja: $MINVER_VERSION"
|
||||
|
||||
mkdir -p nupkg
|
||||
|
||||
echo "=== Pełniejsze fetch git (tags) ==="
|
||||
git fetch --prune --tags --force
|
||||
|
||||
echo "=== Dostępne tagi ==="
|
||||
git tag -l
|
||||
|
||||
echo "=== Aktualny opis commitu ==="
|
||||
git describe --tags --always --dirty || echo "Brak tagów"
|
||||
|
||||
echo "=== Pakowanie projektów z PackageId ==="
|
||||
find . -name "*.csproj" -type f | while read -r csproj; do
|
||||
if grep -q '<PackageId>' "$csproj"; then
|
||||
PROJECT_NAME=$(basename "$csproj" .csproj)
|
||||
echo "→ Pakuję $PROJECT_NAME"
|
||||
dotnet pack "$csproj" \
|
||||
--no-restore \
|
||||
--configuration Release \
|
||||
-o "./nupkg" \
|
||||
/p:PackageVersion="$MINVER_VERSION"
|
||||
else
|
||||
echo "→ Pomijam $(basename "$csproj" .csproj) – brak PackageId"
|
||||
fi
|
||||
done
|
||||
|
||||
ls -la nupkg/ || echo "Brak wygenerowanych pakietów"
|
||||
|
||||
- name: Upload NuGet packages as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: nuget-packages
|
||||
path: nupkg/*.nupkg
|
||||
retention-days: 3
|
||||
|
||||
publish-to-baget:
|
||||
runs-on: ubuntu-latest
|
||||
needs: pack-datamodels
|
||||
steps:
|
||||
- uses: actions/checkout@v4 # potrzebne tylko jeśli chcesz logować coś z repo
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Download built packages
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nuget-packages
|
||||
path: nupkg/
|
||||
|
||||
- name: Create custom NuGet.config (allow HTTP)
|
||||
run: |
|
||||
cat > NuGet.Config <<EOF
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="BaGet" value="http://baget:80/v3/index.json" protocolVersion="3" allowInsecureConnections="true" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
EOF
|
||||
|
||||
- name: Publish packages to BaGet
|
||||
env:
|
||||
BAGET_API_KEY: ${{ secrets.BAGET_API_KEY }}
|
||||
run: |
|
||||
echo "=== Publikacja do BaGet ==="
|
||||
find nupkg -name "*.nupkg" -type f | while read -r pkg; do
|
||||
echo "→ Push $(basename "$pkg")"
|
||||
dotnet nuget push "$pkg" \
|
||||
--source "BaGet" \
|
||||
--api-key "$BAGET_API_KEY" \
|
||||
--skip-duplicate
|
||||
done
|
||||
|
||||
build-and-publish-apps:
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish-to-baget
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '8.0.x'
|
||||
|
||||
- name: Restore (with latest DataModels)
|
||||
run: |
|
||||
echo "=== Restore z najnowszymi pakietami z BaGet ==="
|
||||
dotnet restore
|
||||
|
||||
- name: Publish selected applications
|
||||
run: |
|
||||
echo "=== Publish aplikacji z DeployToCentral ==="
|
||||
find . -name "*.csproj" -type f | while read -r csproj; do
|
||||
PROJECT_NAME=$(basename "$csproj" .csproj)
|
||||
PROJECT_DIR=$(dirname "$csproj")
|
||||
|
||||
if [[ "$PROJECT_NAME" == *"Api"* ]] || [[ "$PROJECT_NAME" == *"Blazor"* ]] || \
|
||||
[[ "$PROJECT_DIR" == *"/Api/"* ]] || [[ "$PROJECT_DIR" == *"/Blazor/"* ]]; then
|
||||
|
||||
DEPLOY_TO_CENTRAL=$(dotnet msbuild "$csproj" -getProperty:DeployToCentral -nologo 2>/dev/null || echo "false")
|
||||
|
||||
if [ "$DEPLOY_TO_CENTRAL" != "true" ]; then
|
||||
echo "Pomijam $PROJECT_NAME (DeployToCentral ≠ true)"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "→ Publishing $PROJECT_NAME"
|
||||
dotnet publish "$csproj" \
|
||||
--no-restore \
|
||||
--configuration Release \
|
||||
-o "./publish-$PROJECT_NAME"
|
||||
|
||||
# Tutaj możesz dodać deployment (np. rsync, scp, docker build+push itp.)
|
||||
# Przykład (zakomentowany):
|
||||
# rsync -avz --delete ./publish-$PROJECT_NAME/ user@server:/path/to/app/
|
||||
else
|
||||
echo "Pomijam $PROJECT_NAME (nie Api/Blazor)"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Pipeline zakończony"
|
||||
154
.woodpecker.yml
Normal file
154
.woodpecker.yml
Normal file
@@ -0,0 +1,154 @@
|
||||
skip_clone: true
|
||||
|
||||
when:
|
||||
event: pull_request
|
||||
action:
|
||||
- merge
|
||||
branch: master
|
||||
|
||||
steps:
|
||||
debug-location:
|
||||
image: alpine
|
||||
commands:
|
||||
- pwd # gdzie aktualnie jesteśmy
|
||||
- ls -la # co jest w bieżącym katalogu
|
||||
- find /woodpecker -maxdepth 4 -type d 2>/dev/null
|
||||
clone-manual:
|
||||
image: woodpeckerci/plugin-git
|
||||
settings:
|
||||
remote: http://gitea:3000/FA/FA_WEB.git
|
||||
branch: master
|
||||
depth: 1
|
||||
|
||||
restore:
|
||||
image: mcr.microsoft.com/dotnet/sdk:latest
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "Aktualna ścieżka: $(pwd)"
|
||||
echo "=== Restore wszystkich projektów ==="
|
||||
find . -name "*.csproj" -type f -exec dotnet restore "{}" \;
|
||||
|
||||
test:
|
||||
image: mcr.microsoft.com/dotnet/sdk:latest
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Uruchamianie testów ==="
|
||||
dotnet test --no-restore --configuration Release --logger "trx"
|
||||
depends_on: [restore]
|
||||
|
||||
pack-datamodels:
|
||||
image: mcr.microsoft.com/dotnet/sdk:latest
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Instalacja MinVer CLI ==="
|
||||
dotnet tool install --tool-path /tmp/minver minver-cli
|
||||
echo "=== Obliczona wersja przez MinVer ==="
|
||||
MINVER_VERSION=$(/tmp/minver/minver \
|
||||
--auto-increment patch \
|
||||
--minimum-major-minor 2.0 \
|
||||
--default-pre-release-identifiers alpha.0 \
|
||||
--verbosity info)
|
||||
|
||||
echo "Wersja: $MINVER_VERSION"
|
||||
|
||||
mkdir -p nupkg
|
||||
echo "=== Pełniejsze fetch git (unshallow + tags) ==="
|
||||
git fetch --prune --unshallow || echo "Już full clone – OK"
|
||||
git fetch --tags
|
||||
|
||||
# Diagnostyka – sprawdź czy tag jest widoczny
|
||||
echo "=== Dostępne tagi ==="
|
||||
git tag -l
|
||||
echo "=== Aktualny commit i opis ==="
|
||||
git describe --tags --always --dirty
|
||||
echo "=== Diagnostyka projektów ==="
|
||||
find . -name "*.csproj" -type f | sort
|
||||
mkdir -p nupkg
|
||||
echo "=== Pakowanie projektów DataModel (wykrywane po obecności <PackageId>) ==="
|
||||
find . -name "*.csproj" -type f | while read csproj; do
|
||||
if grep -q '<PackageId>' "$csproj"; then
|
||||
PROJECT_NAME=$(basename "$csproj" .csproj)
|
||||
echo "→ Pakuję $PROJECT_NAME ($csproj)"
|
||||
dotnet pack "$csproj" \
|
||||
--configuration Release \
|
||||
-o "./nupkg" \
|
||||
/p:PackageVersion=$MINVER_VERSION
|
||||
else
|
||||
PROJECT_NAME=$(basename "$csproj" .csproj)
|
||||
echo "→ Pomijam $PROJECT_NAME – brak <PackageId> (nie jest to biblioteka NuGet)"
|
||||
fi
|
||||
done
|
||||
echo "=== Spakowane pakiety (.nupkg) ==="
|
||||
ls -la nupkg/ || echo "Brak spakowanych pakietów!"
|
||||
depends_on: [test]
|
||||
|
||||
publish-datamodels-to-baget:
|
||||
image: mcr.microsoft.com/dotnet/sdk:latest
|
||||
environment:
|
||||
BAGETTER_API_KEY:
|
||||
from_secret: baget_api_key
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Test połączenia z BaGetter ==="
|
||||
curl -f http://baget:80/v3/index.json || echo "Nie można połączyć się z BaGetter!"
|
||||
# Tworzymy minimalny NuGet.Config tylko po to, żeby odblokować HTTP dla nazwanego źródła
|
||||
cat <<EOF > NuGet.Config
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="BaGet" value="http://baget:80/v3/index.json" allowInsecureConnections="true" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
EOF
|
||||
echo "=== Użyty NuGet.Config (tylko do odblokowania HTTP) ==="
|
||||
cat NuGet.Config
|
||||
echo "=== Publikacja pakietów do BaGetter ==="
|
||||
find ./nupkg -name "*.nupkg" -type f | while read pkg; do
|
||||
echo "→ Push $(basename "$pkg")"
|
||||
dotnet nuget push "$pkg" \
|
||||
--source "BaGet" \
|
||||
--api-key "$BAGETTER_API_KEY" \
|
||||
--skip-duplicate
|
||||
done
|
||||
echo "Wszystkie pakiety DataModel opublikowane w BaGetter!"
|
||||
depends_on: [pack-datamodels]
|
||||
|
||||
build-and-publish-apps:
|
||||
image: mcr.microsoft.com/dotnet/sdk:latest
|
||||
commands:
|
||||
- |
|
||||
set -euf
|
||||
cd "${CI_WORKSPACE}"
|
||||
echo "=== Ponowny restore aplikacji (z najnowszymi pakietami z BaGetter) ==="
|
||||
find . -name "*.csproj" -type f -exec dotnet restore "{}" \;
|
||||
echo "=== Publish aplikacji ==="
|
||||
find . -name "*.csproj" -type f | while read csproj; do
|
||||
PROJECT_NAME=$(basename "$csproj" .csproj)
|
||||
PROJECT_DIR=$(dirname "$csproj")
|
||||
if [[ "$PROJECT_NAME" == *"Api"* ]] || [[ "$PROJECT_NAME" == *"Blazor"* ]] || [[ "$PROJECT_DIR" == *"/Api/"* ]] || [[ "$PROJECT_DIR" == *"/Blazor/"* ]]; then
|
||||
DEPLOY_TO_CENTRAL=$(dotnet msbuild "$csproj" -getProperty:DeployToCentral -noLogo 2>/dev/null || echo "false")
|
||||
if [ "$DEPLOY_TO_CENTRAL" != "true" ]; then
|
||||
echo "Pomijam $PROJECT_NAME (DeployToCentral ≠ true)"
|
||||
continue
|
||||
fi
|
||||
echo "→ Publish $PROJECT_NAME ($csproj)"
|
||||
dotnet publish "$csproj" --no-restore -c Release -o "./publish-$PROJECT_NAME"
|
||||
# ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
|
||||
# Tu wstaw swój kod deployu (rsync/ssh itp.)
|
||||
# ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
|
||||
else
|
||||
echo "Pomijam $PROJECT_NAME (nie jest to Api ani Blazor)"
|
||||
fi
|
||||
done
|
||||
echo "Pipeline zakończony pomyślnie!"
|
||||
depends_on: [publish-datamodels-to-baget]
|
||||
17
FaKrosnoApi/Controllers/CustomerController.cs
Normal file
17
FaKrosnoApi/Controllers/CustomerController.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class CustomerController(ICustomerService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<CustomerDto>>> GetAllCustomers()
|
||||
{
|
||||
IList<CustomerDto> customers = await service.GetAllCustomers();
|
||||
return Ok(customers);
|
||||
}
|
||||
}
|
||||
@@ -12,15 +12,96 @@ namespace FaKrosnoApi.Controllers
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<CustomerOrderDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<CustomerOrderDto?> ediCustomerOrders = await service.GetAll();
|
||||
return Ok(ediCustomerOrders);
|
||||
IEnumerable<CustomerOrderDto?> customerOrders = await service.GetAll();
|
||||
return Ok(customerOrders);
|
||||
}
|
||||
|
||||
[HttpGet("by-order-number")]
|
||||
public async Task<ActionResult<CustomerOrderDto?>> GetByCustomerOrderNumber([FromQuery] Guid customerOrderNumber)
|
||||
public async Task<ActionResult<CustomerOrderDto?>> GetByCustomerOrderNumber(
|
||||
[FromQuery] Guid customerOrderNumber)
|
||||
{
|
||||
CustomerOrderDto? scheduleOrder = await service.GetByOrderNumber(customerOrderNumber);
|
||||
return scheduleOrder != null ? Ok(scheduleOrder) : NotFound();
|
||||
CustomerOrderDto? customerOrder = await service.GetByOrderNumber(customerOrderNumber);
|
||||
return customerOrder != null ? Ok(customerOrder) : NotFound();
|
||||
}
|
||||
|
||||
[HttpGet("by-co-number")]
|
||||
public async Task<ActionResult<CustomerOrderDto?>> GetByCoNumber([FromQuery] string customerOrderNumber)
|
||||
{
|
||||
CustomerOrderDto? customerOrder = await service.GetByCoNumber(customerOrderNumber);
|
||||
return customerOrder != null ? Ok(customerOrder) : NotFound();
|
||||
}
|
||||
|
||||
[HttpGet("lines-by-co-number")]
|
||||
public async Task<ActionResult<IEnumerable<CustomerOrderLineDto>?>> GetLinesByCoNumber(
|
||||
[FromQuery] string customerOrderNumber)
|
||||
{
|
||||
var customerOrderLines = await service.GetLinesByCoNumber(customerOrderNumber);
|
||||
return customerOrderLines != null ? Ok(customerOrderLines) : NotFound();
|
||||
}
|
||||
|
||||
[HttpGet("items-by-co-number")]
|
||||
public async Task<ActionResult<IEnumerable<CustomerOrderLineItemDto>?>> GetItemsByCoNumber(
|
||||
[FromQuery] string customerOrderNumber)
|
||||
{
|
||||
var customerOrderLineItems = await service.GetItemsByCoNumber(customerOrderNumber);
|
||||
return customerOrderLineItems != null ? Ok(customerOrderLineItems) : NotFound();
|
||||
}
|
||||
|
||||
[HttpGet("by-customer-and-po")]
|
||||
public async Task<ActionResult<CustomerOrderDto?>> GetByCustomerAndPo([FromQuery] string customerNumber,
|
||||
[FromQuery] int customerSequence, [FromQuery] string poNumber)
|
||||
{
|
||||
CustomerOrderDto? customerOrder =
|
||||
await service.GetByCustomerAndPo(customerNumber, customerSequence, poNumber);
|
||||
return customerOrder != null ? Ok(customerOrder) : NotFound();
|
||||
}
|
||||
|
||||
[HttpGet("by-po")]
|
||||
public async Task<ActionResult<CustomerOrderDto?>> GetByPo([FromQuery] string poNumber)
|
||||
{
|
||||
CustomerOrderDto? customerOrder = await service.GetByPo(poNumber);
|
||||
return customerOrder != null ? Ok(customerOrder) : NotFound();
|
||||
}
|
||||
|
||||
[HttpGet("list-by-customer-and-po")]
|
||||
public async Task<ActionResult<IList<CustomerOrderDto?>>> GetListByCustomerAndPo(
|
||||
[FromQuery] string customerNumber, [FromQuery] int customerSequence, [FromQuery] string poNumber)
|
||||
{
|
||||
IList<CustomerOrderDto> customerOrders =
|
||||
await service.GetListByCustomerAndPo(customerNumber, customerSequence, poNumber);
|
||||
|
||||
foreach (CustomerOrderDto customerOrder in customerOrders)
|
||||
{
|
||||
customerOrder.CustomerOrderLines = await service.GetLinesByCoNumber(customerOrder.CoNum) ?? [];
|
||||
|
||||
foreach (CustomerOrderLineDto customerOrderLine in customerOrder.CustomerOrderLines)
|
||||
{
|
||||
customerOrderLine.CustomerOrderLineItems =
|
||||
await service.GetItemsByCoNumber(customerOrder.CoNum) ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(customerOrders);
|
||||
}
|
||||
|
||||
[HttpGet("list-by-customer")]
|
||||
public async Task<ActionResult<IList<CustomerOrderDto?>>> GetListByCustomer([FromQuery] string customerNumber,
|
||||
[FromQuery] int customerSequence)
|
||||
{
|
||||
IList<CustomerOrderDto> customerOrders = await service.GetListByCustomer(customerNumber, customerSequence);
|
||||
|
||||
foreach (CustomerOrderDto customerOrder in customerOrders)
|
||||
{
|
||||
customerOrder.CustomerOrderLines = await service.GetLinesByCoNumber(customerOrder.CoNum) ?? [];
|
||||
|
||||
foreach (CustomerOrderLineDto customerOrderLine in customerOrder.CustomerOrderLines)
|
||||
{
|
||||
customerOrderLine.CustomerOrderLineItems =
|
||||
await service.GetItemsByCoNumber(customerOrder.CoNum) ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(customerOrders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
FaKrosnoApi/Controllers/CustomerTpController.cs
Normal file
17
FaKrosnoApi/Controllers/CustomerTpController.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class CustomerTpController(ICustomerTpService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<CustomerTpDto>>> GetAllCustomers()
|
||||
{
|
||||
IList<CustomerTpDto> customers = await service.GetAllCustomersTp();
|
||||
return Ok(customers);
|
||||
}
|
||||
}
|
||||
35
FaKrosnoApi/Controllers/EdiCustomerOrderImportController.cs
Normal file
35
FaKrosnoApi/Controllers/EdiCustomerOrderImportController.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class EdiCustomerOrderImportController(IEdiCustomerOrderImportService service) : Controller
|
||||
{
|
||||
[HttpGet("last-update-date")]
|
||||
public async Task<ActionResult<DateTime>> GetLastUpdateDate()
|
||||
{
|
||||
DateTime lastUpdateDate = await service.GetLastUpdateDate();
|
||||
return Ok(lastUpdateDate);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> Add([FromBody] EdiCustomerOrderImportDto ediCustomerOrderImport)
|
||||
{
|
||||
var result = await service.AddEdiCustomerOrderImport(ediCustomerOrderImport);
|
||||
return result
|
||||
? Ok("Utworzono rekord w tabeli EdiCustomerOrderImport.")
|
||||
: BadRequest($"Nie mogę utworzyć rekordu w tabeli EdiCustomerOrderImport.");
|
||||
}
|
||||
|
||||
[HttpPost("add-bulk")]
|
||||
public async Task<ActionResult> Add([FromBody] IList<EdiCustomerOrderImportDto> ediCustomerOrderImports)
|
||||
{
|
||||
var result = await service.AddEdiCustomerOrderImports(ediCustomerOrderImports);
|
||||
return result
|
||||
? Ok("Utworzono rekordy w tabeli EdiCustomerOrderImport.")
|
||||
: BadRequest($"Nie mogę utworzyć rekordów w tabeli EdiCustomerOrderImport.");
|
||||
}
|
||||
}
|
||||
@@ -30,11 +30,33 @@ namespace FaKrosnoApi.Controllers
|
||||
return scheduleOrder != null ? Ok(scheduleOrder) : NotFound();
|
||||
}
|
||||
|
||||
[HttpGet("last-order-number")]
|
||||
public async Task<ActionResult<int>> GetLastOrderNumber()
|
||||
{
|
||||
int lastOrderNumber = await service.GetLastOrderNumber();
|
||||
return Ok(lastOrderNumber);
|
||||
}
|
||||
|
||||
[HttpPost("send-to-syteline")]
|
||||
public async Task<ActionResult<int>> SendOrderToSyteline([FromQuery] Guid customerOrderNumber)
|
||||
{
|
||||
int result = await service.SendOrderToSyteline(customerOrderNumber);
|
||||
return result > 0 ? Ok() : BadRequest();
|
||||
}
|
||||
|
||||
[HttpPost("save-orders")]
|
||||
public async Task<ActionResult> SaveOrdersWithDetails([FromBody] List<EdiCustomerOrderDto> ediCustomerOrders)
|
||||
{
|
||||
if (!ediCustomerOrders.Any())
|
||||
{
|
||||
return BadRequest("The list of orders cannot be null or empty.");
|
||||
}
|
||||
|
||||
var result = await service.SaveOrdersWithDetails(ediCustomerOrders);
|
||||
|
||||
return result.Item1
|
||||
? Ok(result)
|
||||
: BadRequest($"Failed to save orders. Error: {result.Item2}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
19
FaKrosnoApi/Controllers/EdiLogController.cs
Normal file
19
FaKrosnoApi/Controllers/EdiLogController.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class EdiLogController(IEdiLogService service) : Controller
|
||||
{
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> Add([FromBody] EdiLogDto ediLog)
|
||||
{
|
||||
var result = await service.AddEdiLog(ediLog);
|
||||
return result
|
||||
? Ok("Utworzono rekord w tabeli EdiLog.")
|
||||
: BadRequest($"Nie mogę utworzyć rekordu w tabeli EdiLog.");
|
||||
}
|
||||
}
|
||||
224
FaKrosnoApi/Controllers/ExcelGeneratorController.cs
Normal file
224
FaKrosnoApi/Controllers/ExcelGeneratorController.cs
Normal file
@@ -0,0 +1,224 @@
|
||||
using System.Net;
|
||||
using System.Net.Mail;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Syncfusion.Drawing;
|
||||
using Syncfusion.XlsIO;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ExcelGeneratorController(IWzHeaderService wzHeaderService, IWzClientService wzClientService, IMaterialTransactionService materialTransactionService, IConfiguration configuration) : Controller
|
||||
{
|
||||
[HttpGet("generate-meyle")]
|
||||
public async Task GeneratePackListForMeyle(Guid packListId)
|
||||
{
|
||||
WzHeaderDto wzHeader = await wzHeaderService.GetById(packListId);
|
||||
MaterialTransactionDto? materialTransaction = await materialTransactionService.GetByWzNumber(wzHeader.WzRowsMeyle.First().WzNumber);
|
||||
|
||||
using ExcelEngine excelEngine = new ExcelEngine();
|
||||
IApplication application = excelEngine.Excel;
|
||||
application.DefaultVersion = ExcelVersion.Xlsx;
|
||||
|
||||
IWorkbook workbook = application.Workbooks.Create(1);
|
||||
IWorksheet worksheet = workbook.Worksheets[0];
|
||||
|
||||
IStyle boldFontStyle = workbook.Styles.Add("BoldFontStyle");
|
||||
boldFontStyle.Font.Bold = true;
|
||||
|
||||
var mainHeaders = new List<string>
|
||||
{ "Numer zamówienia Meyle", "Meyle Numer", "Ilość w dostawie", "Numer Palety", "Nr Wz", "Nr Partii" };
|
||||
|
||||
worksheet["B1"].Value = "Packing List";
|
||||
worksheet["B1"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B3"].Value = "Supplier Name";
|
||||
worksheet["B3"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["D3"].Value = "FA KROSNO";
|
||||
worksheet["D3"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B4"].Value = "Packing List nr";
|
||||
worksheet["B4"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B6"].Value = "Related delivery note";
|
||||
worksheet["B6"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["D6"].Value = string.Join(", ", wzHeader.WzRowsMeyle.Select(x => x.WzNumber).Distinct());
|
||||
worksheet["D6"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B9"].Value = "Forwarder";
|
||||
worksheet["B9"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B10"].Value = "Date";
|
||||
worksheet["B10"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["D10"].DateTime = materialTransaction?.CreateDate ?? DateTime.Now;
|
||||
|
||||
int currentRow = 12;
|
||||
|
||||
for (int i = 0; i < mainHeaders.Count; i++)
|
||||
{
|
||||
string columnLetter = GetColumnLetter(i);
|
||||
worksheet.Range[$"{columnLetter}{currentRow}"].Text = mainHeaders[i];
|
||||
worksheet.Range[$"{columnLetter}{currentRow}"].CellStyle = boldFontStyle;
|
||||
}
|
||||
|
||||
currentRow++;
|
||||
|
||||
foreach (var wzRow in wzHeader.WzRowsMeyle)
|
||||
{
|
||||
worksheet.Range[$"A{currentRow}"].Text = wzRow.OrderNumber;
|
||||
worksheet.Range[$"B{currentRow}"].Text = wzRow.ItemNumber;
|
||||
worksheet.Range[$"C{currentRow}"].Number = (double)wzRow.Quantity!;
|
||||
worksheet.Range[$"D{currentRow}"].Number = (double)wzRow.PalletNumber!;
|
||||
worksheet.Range[$"E{currentRow}"].Text = wzRow.WzNumber;
|
||||
worksheet.Range[$"F{currentRow}"].Text = wzRow.PartNumber;
|
||||
|
||||
currentRow++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
worksheet.AutofitColumn(i + 1);
|
||||
}
|
||||
|
||||
using MemoryStream stream = new MemoryStream();
|
||||
workbook.SaveAs(stream);
|
||||
stream.Position = 0;
|
||||
|
||||
SendEmail(stream, wzHeader, "Meyle");
|
||||
}
|
||||
|
||||
[HttpGet("generate-marelli")]
|
||||
public async Task GeneratePackListForMarelli(Guid packListId)
|
||||
{
|
||||
WzHeaderDto wzHeader = await wzHeaderService.GetByIdMarelli(packListId);
|
||||
WzClientDto? wzClient = await wzClientService.GetById(wzHeader.FK_Client ?? Guid.NewGuid());
|
||||
MaterialTransactionDto? materialTransaction = await materialTransactionService.GetByWzNumber(wzHeader.WzRowsMarelli.First().WzNumber);
|
||||
|
||||
using ExcelEngine excelEngine = new ExcelEngine();
|
||||
IApplication application = excelEngine.Excel;
|
||||
application.DefaultVersion = ExcelVersion.Xlsx;
|
||||
|
||||
IWorkbook workbook = application.Workbooks.Create(1);
|
||||
IWorksheet worksheet = workbook.Worksheets[0];
|
||||
|
||||
IStyle boldFontStyle = workbook.Styles.Add("BoldFontStyle");
|
||||
boldFontStyle.Font.Bold = true;
|
||||
|
||||
var mainHeaders = new List<string>
|
||||
{ "", "ColliNr", "Magneti Marelli Sales nr", "Engineer number", "Quantity", "Order nr", "Supplier Comments" };
|
||||
|
||||
worksheet.Range["A1:B1"].Merge();
|
||||
worksheet.Range["A1"].Text = "PACKING LIST";
|
||||
worksheet.Range["A1"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["A3"].Value = "Supplier Name";
|
||||
worksheet["A3"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B3"].Value = "FA KROSNO";
|
||||
worksheet["B3"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["A4"].Value = "Packing List nr";
|
||||
worksheet["A4"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B4"].Value = string.Join(", ", wzHeader.WzRowsMarelli.Select(x => x.WzNumber).Distinct());
|
||||
worksheet["B4"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["A6"].Value = "Date";
|
||||
worksheet["A6"].CellStyle = boldFontStyle;
|
||||
|
||||
worksheet["B6"].DateTime = materialTransaction?.CreateDate ?? DateTime.Now;
|
||||
|
||||
if (!string.IsNullOrEmpty(wzClient?.LogoBase64))
|
||||
{
|
||||
byte[] logoBytes = Convert.FromBase64String(wzClient.LogoBase64);
|
||||
|
||||
worksheet.Range["D1:F6"].Merge();
|
||||
|
||||
using MemoryStream imageStream = new MemoryStream(logoBytes);
|
||||
worksheet.Pictures.AddPicture(1, 4, imageStream);
|
||||
}
|
||||
|
||||
int currentRow = 12;
|
||||
|
||||
for (int i = 0; i < mainHeaders.Count; i++)
|
||||
{
|
||||
string columnLetter = GetColumnLetter(i);
|
||||
worksheet.Range[$"{columnLetter}{currentRow}"].Text = mainHeaders[i];
|
||||
worksheet.Range[$"{columnLetter}{currentRow}"].CellStyle = boldFontStyle;
|
||||
}
|
||||
|
||||
currentRow++;
|
||||
|
||||
foreach (var wzRow in wzHeader.WzRowsMarelli)
|
||||
{
|
||||
worksheet.Range[$"A{currentRow}"].Text = "MIX";
|
||||
worksheet.Range[$"B{currentRow}"].Number = (double)wzRow.PalletNumber!;
|
||||
worksheet.Range[$"C{currentRow}"].Text = wzRow.ItemNumber;
|
||||
worksheet.Range[$"D{currentRow}"].Text = wzRow.EngineerNumber;
|
||||
worksheet.Range[$"E{currentRow}"].Number = (double)wzRow.Quantity!;
|
||||
worksheet.Range[$"F{currentRow}"].Text = wzRow.OrderNumber;
|
||||
worksheet.Range[$"G{currentRow}"].Text = wzRow.WzNumber;
|
||||
|
||||
currentRow++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
worksheet.AutofitColumn(i + 1);
|
||||
}
|
||||
|
||||
using MemoryStream stream = new MemoryStream();
|
||||
workbook.SaveAs(stream);
|
||||
stream.Position = 0;
|
||||
|
||||
SendEmail(stream, wzHeader, "Marelli Magneti");
|
||||
}
|
||||
|
||||
private static string GetColumnLetter(int columnIndex)
|
||||
{
|
||||
string columnName = string.Empty;
|
||||
while (columnIndex >= 0)
|
||||
{
|
||||
columnName = (char)('A' + (columnIndex % 26)) + columnName;
|
||||
columnIndex = (columnIndex / 26) - 1;
|
||||
}
|
||||
|
||||
return columnName;
|
||||
}
|
||||
|
||||
private void SendEmail(MemoryStream stream, WzHeaderDto wzHeader, string client)
|
||||
{
|
||||
IConfigurationSection smtpSettings = configuration.GetSection("EmailSettings");
|
||||
string smtpHost = smtpSettings["SmtpServer"] ?? string.Empty;
|
||||
int smtpPort = int.Parse(smtpSettings["Port"] ?? "0");
|
||||
string smtpUsername = smtpSettings["SenderEmail"] ?? string.Empty;
|
||||
string smtpPassword = smtpSettings["SenderPassword"] ?? string.Empty;
|
||||
string fromEmail = smtpSettings["SenderEmail"] ?? string.Empty;
|
||||
List<string> toEmail = wzHeader.EmailAddresses?.Split(',')?.ToList() ??
|
||||
(smtpSettings["RecipientEmail"] ?? string.Empty).Split(',').ToList();
|
||||
string subject = $"{client}: Packing List";
|
||||
string body =
|
||||
$"W załączeniu znajduje się Packing List dla klienta ${client} wygenerowany {DateTime.Now:dd.MM.yyyy HH:mm:ss}";
|
||||
|
||||
using var mailMessage = new MailMessage();
|
||||
mailMessage.From = new MailAddress(fromEmail);
|
||||
mailMessage.Subject = subject;
|
||||
mailMessage.Body = body;
|
||||
mailMessage.IsBodyHtml = false;
|
||||
|
||||
mailMessage.Attachments.Add(new Attachment(stream, $"PackingList_{client}_{DateTime.Now:yyyyMMddHHmmss}.xlsx",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"));
|
||||
|
||||
toEmail.ForEach(x => mailMessage.To.Add(x));
|
||||
|
||||
using var smtpClient = new SmtpClient(smtpHost, smtpPort);
|
||||
smtpClient.EnableSsl = true;
|
||||
smtpClient.Credentials = new NetworkCredential(smtpUsername, smtpPassword);
|
||||
smtpClient.Send(mailMessage);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ using System.Diagnostics;
|
||||
using FaKrosnoApi.Models;
|
||||
using Hangfire;
|
||||
using Hangfire.Storage;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using OrdersManagementDataModel.Dtos;
|
||||
using OrdersManagementDataModel.Services;
|
||||
@@ -16,7 +15,6 @@ public class HangfireJobsController(
|
||||
IRecurringJobManager recurringJobManager,
|
||||
ITaskSchedulerService service) : Controller
|
||||
{
|
||||
[HttpGet("GetJobsToRun")]
|
||||
public async Task<ActionResult<IEnumerable<JobModel>>> GetJobsToRun()
|
||||
{
|
||||
IList<JobModel> jobsToRun = new List<JobModel>();
|
||||
@@ -102,6 +100,22 @@ public class HangfireJobsController(
|
||||
return Ok("Zadanie zostało usunięte.");
|
||||
}
|
||||
|
||||
[HttpPost("update")]
|
||||
public async Task<IActionResult> UpdateTask([FromBody] TaskSchedulerDto taskSchedulerDto)
|
||||
{
|
||||
int result = await service.UpdateTaskScheduler(taskSchedulerDto);
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
return BadRequest("Nie udało się uaktualnic zadania.");
|
||||
}
|
||||
|
||||
recurringJobManager.AddOrUpdate(taskSchedulerDto.Name, () => RunConsoleApplication(taskSchedulerDto.Path),
|
||||
taskSchedulerDto.CronOptions, new RecurringJobOptions { TimeZone = TimeZoneInfo.Local });
|
||||
|
||||
return Ok("Zadanie zostało zaktualizowane.");
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<TaskSchedulerDto>>> GetTasks()
|
||||
{
|
||||
|
||||
17
FaKrosnoApi/Controllers/ItemController.cs
Normal file
17
FaKrosnoApi/Controllers/ItemController.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ItemController(IItemService service) : Controller
|
||||
{
|
||||
[HttpGet("by-number")]
|
||||
public async Task<ActionResult<ItemDto>> Get([FromQuery] string itemNumber)
|
||||
{
|
||||
ItemDto item = await service.GetItem(itemNumber);
|
||||
return Ok(item);
|
||||
}
|
||||
}
|
||||
16
FaKrosnoApi/Controllers/ItemCustController.cs
Normal file
16
FaKrosnoApi/Controllers/ItemCustController.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ItemCustController(IItemCustService service) : Controller
|
||||
{
|
||||
public async Task<ActionResult<ItemCustDto>> GetItem([FromQuery] string itemNumber, [FromQuery] string customerNumber)
|
||||
{
|
||||
ItemCustDto item = await service.GetItem(itemNumber, customerNumber);
|
||||
return item != null ? Ok(item) : NotFound();
|
||||
}
|
||||
}
|
||||
23
FaKrosnoApi/Controllers/ItemCustPriceAllController.cs
Normal file
23
FaKrosnoApi/Controllers/ItemCustPriceAllController.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ItemCustPriceAllController(IItemCustPriceAllService service, IMapper mapper) : Controller
|
||||
{
|
||||
[HttpGet("by-parameters")]
|
||||
public async Task<ActionResult<ItemCustPriceAllDto>> GetItemCustPriceAll([FromQuery] string itemNumber, [FromQuery] string customerNumber)
|
||||
{
|
||||
var result = await service.GetItemCustPriceAllAsync(itemNumber, customerNumber);
|
||||
if (result == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return Ok(mapper.Map<ItemCustPriceAllDto>(result));
|
||||
}
|
||||
}
|
||||
42
FaKrosnoApi/Controllers/MaterialTransactionsController.cs
Normal file
42
FaKrosnoApi/Controllers/MaterialTransactionsController.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class MaterialTransactionsController(IMaterialTransactionService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<IEnumerable<MaterialTransactionDto>> GetAll()
|
||||
{
|
||||
return await service.GetAll();
|
||||
}
|
||||
|
||||
[HttpGet("by-wz-number")]
|
||||
public Task<MaterialTransactionDto?> GetByWzNumber([FromQuery] string wzNumber)
|
||||
{
|
||||
return service.GetByWzNumber(wzNumber);
|
||||
}
|
||||
|
||||
[HttpGet("list-by-wz-numbers")]
|
||||
public Task<IEnumerable<MaterialTransactionDto>> GetListByWzNumber([FromBody] ISet<string> wzNumbers)
|
||||
{
|
||||
return service.GetOrderNumbersByWz(wzNumbers);
|
||||
}
|
||||
|
||||
[HttpGet("by-order-number")]
|
||||
public Task<IEnumerable<MaterialTransactionDto>> GetByOrderNumber([FromQuery] string orderNumber)
|
||||
{
|
||||
return service.GetByOrderNumber(orderNumber);
|
||||
}
|
||||
|
||||
// public Task<IEnumerable<MaterialTransactionDto>> GetOrderNumbersByWz(ISet<string> wzNumbers);
|
||||
// public Task<IEnumerable<MaterialTransactionDto>> GetByCustomerNumber(string customerNumber, int customerSequence);
|
||||
// public Task<MaterialTransactionDto?> GetByPartNumber(string partNumber);
|
||||
// public Task<IEnumerable<MaterialTransactionDto>> GetWithPartNumber();
|
||||
|
||||
|
||||
}
|
||||
25
FaKrosnoApi/Controllers/VatCodeAssociationController.cs
Normal file
25
FaKrosnoApi/Controllers/VatCodeAssociationController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class VatCodeAssociationController(IVatCodeAssociationService service, IMapper mapper) : Controller
|
||||
{
|
||||
[HttpGet("by-parameters")]
|
||||
public async Task<ActionResult<VatCodeAssociationDto>> GetVatCodesAssociation(string customerDoInvoice,
|
||||
string endUserType, string productCode)
|
||||
{
|
||||
var result = await service.GetVatCodesAssociation(customerDoInvoice, endUserType, productCode);
|
||||
if (result == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return Ok(mapper.Map<VatCodeAssociationDto>(result));
|
||||
}
|
||||
|
||||
}
|
||||
24
FaKrosnoApi/Controllers/WzClientController.cs
Normal file
24
FaKrosnoApi/Controllers/WzClientController.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class WzClientController(IWzClientService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<WzClientDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<WzClientDto> wzClients = await service.GetAll();
|
||||
return Ok(wzClients);
|
||||
}
|
||||
|
||||
[HttpGet("by-id")]
|
||||
public async Task<ActionResult<WzClientDto>> GetById(Guid id)
|
||||
{
|
||||
WzClientDto? wzClient = await service.GetById(id);
|
||||
return Ok(wzClient);
|
||||
}
|
||||
}
|
||||
67
FaKrosnoApi/Controllers/WzHeaderController.cs
Normal file
67
FaKrosnoApi/Controllers/WzHeaderController.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class WzHeaderController(IWzHeaderService service, IMaterialTransactionService materialTransactionService) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<WzHeaderDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<WzHeaderDto> wzHeaders = await service.GetAll();
|
||||
return Ok(wzHeaders);
|
||||
}
|
||||
|
||||
[HttpGet("by-customer-number")]
|
||||
public async Task<ActionResult<IEnumerable<MaterialTransactionDto>>> GetByCustomerNumber(
|
||||
[FromQuery] string customerNumber, [FromQuery] int customerSequence)
|
||||
{
|
||||
IEnumerable<MaterialTransactionDto> materialTransactions =
|
||||
await materialTransactionService.GetByCustomerNumber(customerNumber, customerSequence);
|
||||
return Ok(materialTransactions);
|
||||
}
|
||||
|
||||
[HttpGet("all-wz-headers")]
|
||||
public async Task<ActionResult<IEnumerable<MaterialTransactionDto>>> GetHeadersByCustomerNumber(
|
||||
[FromQuery] string customerNumber, [FromQuery] int customerSequence)
|
||||
{
|
||||
IEnumerable<WzHeaderDto> wzHeaders =
|
||||
await service.GetByCustomerNumber(customerNumber, customerSequence);
|
||||
|
||||
return Ok(wzHeaders.OrderByDescending(x => x.CreatedDate));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> CreateHeader([FromBody] WzHeaderDto wzHeader)
|
||||
{
|
||||
if (wzHeader == null)
|
||||
{
|
||||
return BadRequest("WzHeader cannot be null.");
|
||||
}
|
||||
|
||||
await service.CreateHeader(wzHeader);
|
||||
return CreatedAtAction(nameof(CreateHeader), wzHeader);
|
||||
}
|
||||
|
||||
[HttpGet("by-id")]
|
||||
public async Task<ActionResult<WzHeaderDto>> GetById([FromQuery] Guid id)
|
||||
{
|
||||
WzHeaderDto? wzHeader = await service.GetById(id);
|
||||
return wzHeader != null ? Ok(wzHeader) : NotFound();
|
||||
}
|
||||
|
||||
[HttpPost("add-emails")]
|
||||
public async Task<IActionResult> AddEmailsToWzHeader([FromQuery] Guid id, [FromBody] string emailAddresses)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(emailAddresses))
|
||||
{
|
||||
return BadRequest("Email addresses cannot be empty.");
|
||||
}
|
||||
|
||||
await service.AddEmailsToWzHeader(id, emailAddresses);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
62
FaKrosnoApi/Controllers/WzRowMarelliController.cs
Normal file
62
FaKrosnoApi/Controllers/WzRowMarelliController.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class WzRowMarelliController(IWzRowMareliService service, IMaterialTransactionService materialTransactionService) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<WzRowMarelliDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<WzRowMarelliDto> wzRows = await service.GetAll();
|
||||
return Ok(wzRows);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> CreateRows([FromBody] IEnumerable<WzRowMarelliDto> rows)
|
||||
{
|
||||
if (rows == null || !rows.Any())
|
||||
{
|
||||
return BadRequest("No rows provided.");
|
||||
}
|
||||
|
||||
await service.CreateRows(rows);
|
||||
return CreatedAtAction(nameof(GetAll), new { count = rows.Count() }, rows);
|
||||
}
|
||||
|
||||
[HttpGet("by-wz-header-id")]
|
||||
public async Task<ActionResult<IEnumerable<WzRowMarelliDto>>> GetByWzHeaderId(Guid wzHeaderId)
|
||||
{
|
||||
IEnumerable<WzRowMarelliDto> wzRows = await service.GetByWzHeaderId(wzHeaderId);
|
||||
return Ok(wzRows);
|
||||
}
|
||||
|
||||
[HttpGet("by-part-number")]
|
||||
public async Task<ActionResult<MaterialTransactionDto>> GetByPartNumber([FromQuery] string partNumber)
|
||||
{
|
||||
MaterialTransactionDto materialTransaction = await materialTransactionService.GetByPartNumber(partNumber);
|
||||
return Ok(materialTransaction);
|
||||
}
|
||||
|
||||
[HttpGet("transactions-with-part-number")]
|
||||
public async Task<ActionResult<MaterialTransactionDto>> GetTransactionsWithPartNumber()
|
||||
{
|
||||
IEnumerable<MaterialTransactionDto> materialTransactions = await materialTransactionService.GetWithPartNumber();
|
||||
return Ok(materialTransactions);
|
||||
}
|
||||
|
||||
[HttpPut]
|
||||
public async Task<ActionResult> UpdateRows([FromBody] IEnumerable<WzRowMarelliDto> rows)
|
||||
{
|
||||
if (rows == null || !rows.Any())
|
||||
{
|
||||
return BadRequest("No rows provided.");
|
||||
}
|
||||
|
||||
await service.UpdateRows(rows);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
62
FaKrosnoApi/Controllers/WzRowMeyleController.cs
Normal file
62
FaKrosnoApi/Controllers/WzRowMeyleController.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class WzRowMeyleController(IWzRowMeyleService service, IMaterialTransactionService materialTransactionService) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<WzRowMeyleDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<WzRowMeyleDto> wzRows = await service.GetAll();
|
||||
return Ok(wzRows);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> CreateRows([FromBody] IEnumerable<WzRowMeyleDto> rows)
|
||||
{
|
||||
if (rows == null || !rows.Any())
|
||||
{
|
||||
return BadRequest("No rows provided.");
|
||||
}
|
||||
|
||||
await service.CreateRows(rows);
|
||||
return CreatedAtAction(nameof(GetAll), new { count = rows.Count() }, rows);
|
||||
}
|
||||
|
||||
[HttpGet("by-wz-header-id")]
|
||||
public async Task<ActionResult<IEnumerable<WzRowMeyleDto>>> GetByWzHeaderId(Guid wzHeaderId)
|
||||
{
|
||||
IEnumerable<WzRowMeyleDto> wzRows = await service.GetByWzHeaderId(wzHeaderId);
|
||||
return Ok(wzRows);
|
||||
}
|
||||
|
||||
[HttpGet("by-part-number")]
|
||||
public async Task<ActionResult<MaterialTransactionDto>> GetByPartNumber([FromQuery] string partNumber)
|
||||
{
|
||||
MaterialTransactionDto materialTransaction = await materialTransactionService.GetByPartNumber(partNumber);
|
||||
return Ok(materialTransaction);
|
||||
}
|
||||
|
||||
[HttpGet("transactions-with-part-number")]
|
||||
public async Task<ActionResult<MaterialTransactionDto>> GetTransactionsWithPartNumber()
|
||||
{
|
||||
IEnumerable<MaterialTransactionDto> materialTransactions = await materialTransactionService.GetWithPartNumber();
|
||||
return Ok(materialTransactions);
|
||||
}
|
||||
|
||||
[HttpPut]
|
||||
public async Task<ActionResult> UpdateRows([FromBody] IEnumerable<WzRowMeyleDto> rows)
|
||||
{
|
||||
if (rows == null || !rows.Any())
|
||||
{
|
||||
return BadRequest("No rows provided.");
|
||||
}
|
||||
|
||||
await service.UpdateRows(rows);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ProjectType>Api</ProjectType>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BCrypt.Net-Core" Version="1.6.0" />
|
||||
<PackageReference Include="FaKrosnoEfDataModel" Version="2.0.1-alpha.0.65" />
|
||||
<PackageReference Include="Hangfire" Version="1.8.17" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.11" />
|
||||
@@ -18,13 +20,10 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
|
||||
<PackageReference Include="NSwag.AspNetCore" Version="14.2.0" />
|
||||
<PackageReference Include="OrdersManagementDataModel" Version="2.0.0-alpha.0" />
|
||||
<PackageReference Include="Syncfusion.XlsIO.Net.Core" Version="29.2.4" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FaKrosnoEfDataModel\FaKrosnoEfDataModel.csproj" />
|
||||
<ProjectReference Include="..\OrdersManagementDataModel\OrdersManagementDataModel.csproj" />
|
||||
<ProjectReference Include="..\SytelineSaAppEfDataModel\SytelineSaAppEfDataModel.csproj" />
|
||||
<PackageReference Include="SytelineSaAppEfDataModel" Version="2.0.1-alpha.0.65" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.Text;
|
||||
using FaKrosnoApi.Models;
|
||||
using FaKrosnoApi.Services;
|
||||
using FaKrosnoEfDataModel;
|
||||
using FaKrosnoEfDataModel.Services;
|
||||
using Hangfire;
|
||||
using Hangfire.SqlServer;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using OrdersManagementDataModel;
|
||||
using OrdersManagementDataModel.Services;
|
||||
using SytelineSaAppEfDataModel;
|
||||
@@ -100,9 +97,24 @@ builder.Services.AddScoped<IRoleService, RoleService>();
|
||||
builder.Services.AddScoped<IFunctionService, FunctionService>();
|
||||
builder.Services.AddScoped<IUserRoleService, UserRoleService>();
|
||||
builder.Services.AddScoped<IProductService, ProductService>();
|
||||
builder.Services.AddScoped<IMaterialTransactionService, MaterialTransactionService>();
|
||||
builder.Services.AddScoped<IWzClientService, WzClientService>();
|
||||
builder.Services.AddScoped<IWzHeaderService, WzHeaderService>();
|
||||
builder.Services.AddScoped<IWzRowMeyleService, WzRowMeyleService>();
|
||||
builder.Services.AddScoped<IItemCustService, ItemCustService>();
|
||||
builder.Services.AddScoped<IEdiCustomerOrderImportService, EdiCustomerOrderImportService>();
|
||||
builder.Services.AddScoped<ICustomerService, CustomerService>();
|
||||
builder.Services.AddScoped<ICustomerTpService, CustomerTpService>();
|
||||
builder.Services.AddScoped<IItemService, ItemService>();
|
||||
builder.Services.AddScoped<IVatCodeAssociationService, VatCodeAssociationService>();
|
||||
builder.Services.AddScoped<IItemCustPriceAllService, ItemCustPriceAllService>();
|
||||
builder.Services.AddScoped<IEdiLogService, EdiLogService>();
|
||||
builder.Services.AddScoped<IWzRowMareliService, WzRowMareliService>();
|
||||
|
||||
builder.Services.AddHostedService<TimedHostedService>();
|
||||
|
||||
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NRAiBiAaIQQuGjN/V09+XU9HdVRDX3xKf0x/TGpQb19xflBPallYVBYiSV9jS3tTckVgWHldc3ZUR2lfVE90Vg==");
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseOpenApi();
|
||||
|
||||
@@ -6,4 +6,7 @@ public class ProductDto : DtoBase
|
||||
public int RecipientID { get; set; }
|
||||
public string RecipientIdx { get; set; }
|
||||
public string FaIdx { get; set; }
|
||||
public string RecipientName { get; set; }
|
||||
|
||||
public RecipientDto Recipient { get; set; }
|
||||
}
|
||||
@@ -6,4 +6,6 @@ public class Product : EntityBase
|
||||
public int RecipientID { get; set; }
|
||||
public string RecipientIdx { get; set; }
|
||||
public string FaIdx { get; set; }
|
||||
|
||||
public Recipient Recipient { get; set; }
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageId>FaKrosnoEfDataModel</PackageId>
|
||||
<Authors>Piotr Kus</Authors>
|
||||
<Description>FaKrosno Entity Framework Data Model</Description>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ProjectType>DataModel</ProjectType>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<MinVerAutoIncrement>patch</MinVerAutoIncrement>
|
||||
<MinVerMinimumMajorMinor>1.0</MinVerMinimumMajorMinor>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -20,6 +27,10 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
|
||||
<PackageReference Include="MinVer" Version="6.0.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -5,12 +5,9 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FaKrosnoEfDataModel.Services;
|
||||
|
||||
public class ProductService : ServiceBase<ProductDto>, IProductService
|
||||
public class ProductService(FaKrosnoDbContext context, IMapper mapper)
|
||||
: ServiceBase<ProductDto>(context, mapper), IProductService
|
||||
{
|
||||
public ProductService(FaKrosnoDbContext context, IMapper mapper) : base(context, mapper)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<ProductDto?>> GetEntities()
|
||||
{
|
||||
IList<ProductDto> products = (await GetAll()).ToList();
|
||||
@@ -20,9 +17,32 @@ public class ProductService : ServiceBase<ProductDto>, IProductService
|
||||
|
||||
public async Task<IEnumerable<ProductDto?>> GetEntitiesToFix(string indexName)
|
||||
{
|
||||
IList<RecipientDto> recipients =
|
||||
(await Context.Recipients.ToListAsync()).Select(x => Mapper.Map<RecipientDto>(x)).ToList();
|
||||
IList<PurchaserDto> purchasers = (await Context.Purchasers.ToListAsync()).Select(x => Mapper.Map<PurchaserDto>(x)).ToList();
|
||||
IList<ProductDto> products = (await GetAll()).ToList();
|
||||
|
||||
return products.Where(x => x?.FaIdx == indexName);
|
||||
IEnumerable<ProductDto> productDtos = products.Where(x => x.FaIdx == indexName).ToList();
|
||||
|
||||
foreach (ProductDto productDto in productDtos)
|
||||
{
|
||||
RecipientDto? recipient = recipients.FirstOrDefault(x => x.ID == productDto.RecipientID);
|
||||
|
||||
if (recipient != null)
|
||||
{
|
||||
productDto.Recipient = recipient;
|
||||
productDto.RecipientName = recipient.RecipientDesc;
|
||||
}
|
||||
|
||||
PurchaserDto? purchaser = purchasers.FirstOrDefault(x => x.ID == productDto.Recipient.PurchaserID);
|
||||
|
||||
if (purchaser != null)
|
||||
{
|
||||
productDto.Recipient.Purchaser = purchaser;
|
||||
}
|
||||
}
|
||||
|
||||
return productDtos;
|
||||
}
|
||||
|
||||
public async Task UpdateEntity(ProductDto entity)
|
||||
|
||||
@@ -34,14 +34,15 @@
|
||||
<MenuItems>
|
||||
<MenuItem Text="Zamówienia DELFOR" Url="/" IconCss="fa-solid fa-landmark"></MenuItem>
|
||||
<MenuItem Text="Zarządzanie Indeksami" Url="/Products" IconCss="fa-solid fa-basket-shopping"></MenuItem>
|
||||
@* <MenuItem Text="Zamówienia klienta EDI" Url="/EdiCustomerOrders" IconCss="fa-solid fa-list-check"></MenuItem> *@
|
||||
@* <MenuItem Text="Zamówienia klienta" Url="/CustomerOrders" IconCss="fa-solid fa-database"></MenuItem> *@
|
||||
@if (UserName == "pkus")
|
||||
<MenuItem Text="Magazyn" Url="/Warehouse" IconCss="fa-solid fa-warehouse"></MenuItem>
|
||||
@if (IsAdminRoute())
|
||||
{
|
||||
<MenuItem Text="Admin" IconCss="fa-solid fa-screwdriver-wrench">
|
||||
<MenuItem Text="Administracja" Url="/Admin/PK" IconCss="fa-solid fa-screwdriver-wrench">
|
||||
<MenuItems>
|
||||
<MenuItem Text = "Użytkownicy" Url = "/Admin/UsersManager" IconCss="fa-solid fa-user-tie"></MenuItem>
|
||||
<MenuItem Text= "Scheduler" Url = "/Admin/Scheduler" IconCss="fa-solid fa-calendar-week"></MenuItem>
|
||||
<MenuItem Text="Użytkownicy" Url = "/Admin/PK/UsersManager" IconCss="fa-solid fa-user-tie"></MenuItem>
|
||||
<MenuItem Text="Scheduler" Url = "/Admin/PK/Scheduler" IconCss="fa-solid fa-calendar-week"></MenuItem>
|
||||
<MenuItem Text="Zamówienia klienta EDI" Url="/Admin/PK/EdiCustomerOrders" IconCss="fa-solid fa-list-check"></MenuItem>
|
||||
<MenuItem Text="Zamówienia klienta" Url="/Admin/PK/CustomerOrders" IconCss="fa-solid fa-database"></MenuItem>
|
||||
</MenuItems>
|
||||
</MenuItem>
|
||||
}
|
||||
@@ -63,6 +64,12 @@
|
||||
private bool IsAuthenticated { get; set; }
|
||||
private string UserName { get; set; } = string.Empty;
|
||||
|
||||
private bool IsAdminRoute()
|
||||
{
|
||||
var path = new Uri(NavigationManager.Uri).AbsolutePath;
|
||||
return path.StartsWith("/admin", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// ClaimsPrincipal currentUser = AuthenticationStateProvider.GetCurrentUser();
|
||||
|
||||
@@ -94,3 +94,12 @@ main {
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
|
||||
.e-grid .e-row.e-selection {
|
||||
background-color: #D3D3D3 !important; /* Jasny szary */
|
||||
}
|
||||
|
||||
/* Domyślny styl dla wierszy (na wszelki wypadek) */
|
||||
.e-grid .e-row {
|
||||
background-color: #FFFFFF; /* Biały, domyślny kolor */
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/Admin/Scheduler"
|
||||
@page "/Admin/PK/Scheduler"
|
||||
|
||||
@using System.Security.Claims
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@@ -93,6 +93,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateTask(TaskSchedulerDto taskSchedulerDto)
|
||||
{
|
||||
var response = await HangfireService.UpdateTaskSchedulerAsync(taskSchedulerDto);
|
||||
if (response == 1)
|
||||
{
|
||||
await LoadTasks();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task LoadTasks()
|
||||
{
|
||||
Tasks = (await HangfireService.GetTaskSchedulersAsync() ?? Array.Empty<TaskSchedulerDto>()).ToList();
|
||||
@@ -108,6 +119,9 @@
|
||||
case Action.Save when args.Data.Id == 0:
|
||||
await AddTask(args.Data);
|
||||
break;
|
||||
case Action.Save when args.Data.Id != 0:
|
||||
await UpdateTask(args.Data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/admin/UsersManager"
|
||||
@page "/Admin/PK/UsersManager"
|
||||
|
||||
@using System.Security.Claims
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/CustomerOrder/{CustomerOrderId:guid}"
|
||||
@page "/Admin/PK/CustomerOrder/{CustomerOrderId:guid}"
|
||||
|
||||
@inject CustomerOrderService CustomerOrderService
|
||||
@inject ScheduleOrderService ScheduleOrderService
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/CustomerOrders"
|
||||
@page "/Admin/PK/CustomerOrders"
|
||||
|
||||
@inject CustomerOrderService CustomerOrderService
|
||||
@inject NavigationManager NavigationManager
|
||||
@@ -109,7 +109,7 @@
|
||||
{
|
||||
Guid customerOrderId = obj.RowData.RowPointer;
|
||||
|
||||
NavigationManager.NavigateTo($"/CustomerOrder/{customerOrderId}");
|
||||
NavigationManager.NavigateTo($"/Admin/PK/CustomerOrder/{customerOrderId}");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/CustomerOrdersTranslations"
|
||||
@page "/admin/pk"
|
||||
|
||||
@using SytelineSaAppEfDataModel.Dtos
|
||||
@using Syncfusion.Blazor.Cards
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/EdiCustomerOrder/{CustomerOrderId:guid}"
|
||||
@page "/Admin/PK/EdiCustomerOrder/{CustomerOrderId:guid}"
|
||||
|
||||
@inject EdiCustomerOrderService EdiCustomerOrderService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@page "/EdiCustomerOrders"
|
||||
@page "/Admin/PK/EdiCustomerOrders"
|
||||
|
||||
@inject EdiCustomerOrderService EdiCustomerOrderService
|
||||
@inject NavigationManager NavigationManager
|
||||
@@ -161,7 +161,7 @@
|
||||
{
|
||||
Guid customerOrderId = obj.RowData.RowPointer;
|
||||
|
||||
NavigationManager.NavigateTo($"/EdiCustomerOrder/{customerOrderId}");
|
||||
NavigationManager.NavigateTo($"/Admin/PK/EdiCustomerOrder/{customerOrderId}");
|
||||
}
|
||||
|
||||
private async Task<bool> SendOrderToSyteLine()
|
||||
|
||||
@@ -0,0 +1,468 @@
|
||||
@page "/Warehouse/Marelli/PackList/{WzHeader:guid}"
|
||||
|
||||
@using OrdersManagement.Models
|
||||
@using Syncfusion.Blazor.Cards
|
||||
@using Syncfusion.Blazor.Grids
|
||||
@using SytelineSaAppEfDataModel.Dtos
|
||||
@using Syncfusion.Blazor.Navigations
|
||||
@using Syncfusion.Blazor.Popups
|
||||
@using Syncfusion.Blazor.Inputs
|
||||
@using FilterType = Syncfusion.Blazor.Grids.FilterType
|
||||
@using Syncfusion.Blazor.Buttons
|
||||
@using SelectionType = Syncfusion.Blazor.Grids.SelectionType
|
||||
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject WarehouseService WarehouseService
|
||||
|
||||
<div class="h-100 d-flex justify-content-center align-items-start">
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h3 class="text-primary">Packing List</h3>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
@* <SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;"> *@
|
||||
@* <CardContent> *@
|
||||
@* <SfButton CssClass="e-primary" IsPrimary="true" @onclick="ChangeView">Zmień widok</SfButton> *@
|
||||
@* </CardContent> *@
|
||||
@* </SfCard> *@
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Adresy Email do Wysyłki raportu:</label>
|
||||
<SfTextBox ID="textBox" Placeholder="Wprowadź adresy..." @bind-Value="@EmailAddresses"
|
||||
CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Numer WZ:</label>
|
||||
<SfTextBox ID="textBox" @bind-Value=@WzNumber CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Wprowadź numer palety:</label>
|
||||
<SfTextBox ID="palletNumber" Type="InputType.Number" @bind-Value="@PalletNumber"
|
||||
CssClass="e-outline"/>
|
||||
<label for="textBox" class="form-label">Zeskanowana wartość:</label>
|
||||
<SfTextBox ID="scannedValue" ValueChange="ScanValue" @bind-Value="ScannedValue"
|
||||
CssClass="e-outline" @ref="_scanner"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfGrid @ref="_grid"
|
||||
AllowFiltering="true"
|
||||
AllowPaging="true"
|
||||
AllowSorting="true"
|
||||
AllowSelection="true"
|
||||
TValue="WzRowMarelliDto"
|
||||
DataSource="@WzRowsMarelli"
|
||||
EnableAdaptiveUI="true">
|
||||
<SfToolbar>
|
||||
<ToolbarItems>
|
||||
<ToolbarItem Type="ItemType.Button" Text="Zapisz zmiany" Id="SaveButton"
|
||||
PrefixIcon="e-icons e-save" OnClick="SaveChanges"/>
|
||||
<ToolbarItem Type="ItemType.Button" Id="Generuj XLS i Wyślij" PrefixIcon="e-icons e-export-xls"
|
||||
Text="Generuj XLS i Wyślij" OnClick="ExportXls"/>
|
||||
</ToolbarItems>
|
||||
</SfToolbar>
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(WzRowMarelliDto.ID) IsPrimaryKey="true" Visible="false" AllowEditing="false"
|
||||
TextAlign="TextAlign.Center" HeaderText="ID" Width="70"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMarelliDto.PalletNumber) AllowEditing="true"
|
||||
TextAlign="TextAlign.Center" HeaderText="Nr Palety" Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMarelliDto.ItemNumber) AllowEditing="false"
|
||||
TextAlign="TextAlign.Center" HeaderText="Numer Indeksu Marelli"
|
||||
Width="70"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMarelliDto.EngineerNumber) AllowEditing="false" AllowFiltering="true"
|
||||
TextAlign="TextAlign.Center" HeaderText="Numer Inżynieryjny" Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMarelliDto.Quantity) AllowEditing="false" TextAlign="TextAlign.Center"
|
||||
HeaderText="Ilość w Dostawie" Width="80"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMarelliDto.OrderNumber) AllowEditing="true" TextAlign="TextAlign.Center"
|
||||
HeaderText="Nr Zamówienia" Width="80"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMarelliDto.WzNumber) AllowEditing="true" TextAlign="TextAlign.Center"
|
||||
HeaderText="Nr WZ" Width="80"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridEditSettings AllowDeleting="false"
|
||||
AllowAdding="false"
|
||||
AllowEditing="true"
|
||||
AllowNextRowEdit="true"
|
||||
AllowEditOnDblClick="true"
|
||||
ShowConfirmDialog="false"
|
||||
Mode="EditMode.Batch">
|
||||
</GridEditSettings>
|
||||
<GridFilterSettings Type="FilterType.Excel"/>
|
||||
<GridPageSettings PageSize="10"/>
|
||||
<GridSelectionSettings Mode="SelectionMode.Row" Type="SelectionType.Single"/>
|
||||
<GridEvents RowSelected="OnRowSelected" OnBatchSave="OnBatchSave" TValue="WzRowMarelliDto"></GridEvents>
|
||||
</SfGrid>
|
||||
</CardContent>
|
||||
|
||||
<SfDialog Width="500px" Title="Informacja" IsModal="true" @bind-Visible="Visibility" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
@if (_isValid)
|
||||
{
|
||||
<p>Packing List został wygenerowany i wysłany!</p>
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
<p>Błąd: Proszę wprowadzić przynajmniej jeden <b>ADRES EMAIL</b> do wysyłki raportu!</p>
|
||||
}
|
||||
else if (!_isValid)
|
||||
{
|
||||
<p>Błąd: Nie Wszystkie linie mają wypełniony <b>NUMER PALETY</b>.<br/>Packing List nie zostanie
|
||||
wygenerowany!</p>
|
||||
}
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityPalletNumber"
|
||||
AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd skanowania! <b>Wybierz NUMER PALETY większy niż 0</b> (Aktualnie '@PalletNumber'):</p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityIndexQty"
|
||||
AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Nie znaleziono indeksu z ilością sztuk ('<b>@IndexWithQty</b>') odpowiadającemu skanowanym wartościom!</p>
|
||||
<p>Znaleziono indeks, który ma ilość sztuk: '<b>@IndexQty</b>'!</p>
|
||||
<p><b>Uzupełnij numer palety ręcznie i kliknij 'Zapisz'!</b></p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityNotFound"
|
||||
AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Na liście nie znaleziono skanowanego numeru partii '<b>@NotFoundItem</b>'!</p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
<CardFooter>
|
||||
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
|
||||
</CardFooter>
|
||||
</SfCard>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid WzHeader { get; set; }
|
||||
|
||||
private SfGrid<WzRowMarelliDto> _grid;
|
||||
private List<WzRowMarelliDto> WzRowsMarelli { get; set; } = new();
|
||||
private IDictionary<string, List<TransactionModel>> TransactionModelsByPartNumber { get; set; } = new Dictionary<string, List<TransactionModel>>();
|
||||
private List<WzRowMarelliDto> ChangedRecords = new();
|
||||
private WzHeaderDto _wzHeader;
|
||||
private SfTextBox _scanner;
|
||||
|
||||
private WzRowMarelliDto? SelectedRow { get; set; }
|
||||
private List<WzRowMarelliDto> SelectedRows { get; set; } = new();
|
||||
|
||||
private string WzNumber { get; set; } = string.Empty;
|
||||
|
||||
private bool _isValid;
|
||||
|
||||
private bool Visibility { get; set; }
|
||||
private bool VisibilityPalletNumber { get; set; }
|
||||
private bool VisibilityIndexQty { get; set; }
|
||||
private bool VisibilityNotFound { get; set; }
|
||||
|
||||
private string? EmailAddresses { get; set; } = string.Empty;
|
||||
private string PalletNumber { get; set; } = "0";
|
||||
|
||||
private string LastScannedValue { get; set; } = string.Empty;
|
||||
private string ScannedValue { get; set; } = string.Empty;
|
||||
|
||||
private bool IsDisabled => SelectedRow == null;
|
||||
|
||||
private string IndexWithQty { get; set; } = string.Empty;
|
||||
private string IndexQty { get; set; } = string.Empty;
|
||||
private string NotFoundItem { get; set; } = string.Empty;
|
||||
|
||||
private void HideModal()
|
||||
{
|
||||
Visibility = false;
|
||||
VisibilityPalletNumber = false;
|
||||
VisibilityIndexQty = false;
|
||||
VisibilityNotFound = false;
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
IndexQty = string.Empty;
|
||||
IndexWithQty = string.Empty;
|
||||
NotFoundItem = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
_wzHeader = await WarehouseService.GetWzHeaderByIdAsync(WzHeader);
|
||||
WzRowsMarelli = (await WarehouseService.GetWzRowsMarelliByWzHeaderId(WzHeader)).ToList();
|
||||
|
||||
TransactionModelsByPartNumber = await GetTransactionModels();
|
||||
|
||||
EmailAddresses = _wzHeader.EmailAddresses;
|
||||
|
||||
WzNumber = _wzHeader.WzNumbers ?? string.Empty;
|
||||
|
||||
await _scanner.FocusAsync();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveChanges()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
}
|
||||
|
||||
if (ChangedRecords.Any())
|
||||
{
|
||||
await UpdateRows(ChangedRecords);
|
||||
}
|
||||
|
||||
await _grid.EndEditAsync();
|
||||
await _grid.ClearSelectionAsync();
|
||||
}
|
||||
|
||||
private async Task OnBatchSave(BeforeBatchSaveArgs<WzRowMarelliDto> obj)
|
||||
{
|
||||
var changes = obj.BatchChanges;
|
||||
List<WzRowMarelliDto> changedRecords = changes.ChangedRecords;
|
||||
|
||||
if (!changedRecords.Any()) return;
|
||||
|
||||
await UpdateRows(changedRecords);
|
||||
}
|
||||
|
||||
private async Task ExportXls()
|
||||
{
|
||||
int count = WzRowsMarelli.Count(x => x.PalletNumber == null);
|
||||
_isValid = count == 0;
|
||||
_isValid = _isValid && !string.IsNullOrWhiteSpace(EmailAddresses);
|
||||
|
||||
if (_isValid)
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
await WarehouseService.GenerateXlsForMarelliAsync(WzHeader);
|
||||
}
|
||||
|
||||
Visibility = true;
|
||||
}
|
||||
|
||||
private void ScanValue(ChangedEventArgs obj)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(obj.Value)) return;
|
||||
if (int.Parse(PalletNumber) <= 0)
|
||||
{
|
||||
VisibilityPalletNumber = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ScannedValue = obj.Value.Trim();
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
TransactionModelsByPartNumber.TryGetValue(obj.Value.Trim(), out List<TransactionModel>? materialTransactionsByPartNumber);
|
||||
TransactionModel? materialTransactionByPartNumber = materialTransactionsByPartNumber?.FirstOrDefault();
|
||||
|
||||
_grid.Query = null;
|
||||
_grid.ClearFilteringAsync();
|
||||
|
||||
if (materialTransactionByPartNumber != null)
|
||||
{
|
||||
SelectedRows.Clear();
|
||||
FillPalletNumber(materialTransactionByPartNumber, obj.Value.Trim());
|
||||
}
|
||||
else
|
||||
{
|
||||
NotFoundItem = ScannedValue;
|
||||
VisibilityNotFound = true;
|
||||
}
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task FillPalletNumber(TransactionModel materialTransactionByPartNumber, string scannedValue)
|
||||
{
|
||||
await _grid.ClearSelectionAsync();
|
||||
await _grid.Refresh();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
List<int> selectedIndices = new List<int>();
|
||||
int palletNumber = int.Parse(PalletNumber);
|
||||
int rowIndex = WzRowsMarelli.FindIndex(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber && x.Quantity == materialTransactionByPartNumber.Quantity);
|
||||
|
||||
switch (rowIndex)
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
SelectedRows = WzRowsMarelli.Where(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber).ToList();
|
||||
|
||||
rowIndex = WzRowsMarelli.FindIndex(x => x.FaIndex == SelectedRows.First().FaIndex && x.Quantity == SelectedRows.First().Quantity);
|
||||
|
||||
var validCombinations = FindCombinations(SelectedRows, (int?)materialTransactionByPartNumber.Quantity ?? 0);
|
||||
|
||||
if (!validCombinations.Any() && SelectedRows.Count > 0)
|
||||
{
|
||||
IndexWithQty = $"{materialTransactionByPartNumber.ItemNumber}, Qty = {materialTransactionByPartNumber.Quantity}";
|
||||
IndexQty = SelectedRows.First().Quantity.ToString() ?? "0";
|
||||
VisibilityIndexQty = true;
|
||||
|
||||
await ApplyFilter(SelectedRows);
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var combination in validCombinations)
|
||||
{
|
||||
foreach (var record in combination)
|
||||
{
|
||||
record.PalletNumber = palletNumber;
|
||||
ChangedRecords.Add(record);
|
||||
|
||||
int index = WzRowsMarelli.IndexOf(record);
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
selectedIndices.Add(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SelectedRows.Clear();
|
||||
SelectedRows.AddRange(ChangedRecords);
|
||||
|
||||
SelectedRow = SelectedRows.FirstOrDefault();
|
||||
|
||||
await ApplyFilter(ChangedRecords);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
SelectedRow = WzRowsMarelli[rowIndex];
|
||||
selectedIndices.Add(rowIndex);
|
||||
|
||||
SelectedRow.PalletNumber = palletNumber;
|
||||
|
||||
if (ChangedRecords.All(x => x.TransactionNumber != SelectedRow.TransactionNumber))
|
||||
{
|
||||
ChangedRecords.Add(SelectedRow);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await SaveChanges();
|
||||
ChangedRecords.Clear();
|
||||
|
||||
if (selectedIndices.Any())
|
||||
{
|
||||
await _grid.SelectRowsAsync(selectedIndices.ToArray());
|
||||
}
|
||||
|
||||
await _grid.Refresh();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
FocusGridRow(rowIndex);
|
||||
await _scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private void FocusGridRow(int rowIndex)
|
||||
{
|
||||
if (_grid.AllowPaging)
|
||||
{
|
||||
int pageSize = _grid.PageSettings.PageSize;
|
||||
int targetPage = (rowIndex / pageSize) + 1;
|
||||
_grid.GoToPageAsync(targetPage);
|
||||
|
||||
rowIndex %= pageSize;
|
||||
}
|
||||
|
||||
_grid.SelectRowAsync(rowIndex);
|
||||
_grid.ScrollIntoViewAsync(rowIndex: rowIndex);
|
||||
_grid.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task<IDictionary<string, List<TransactionModel>>> GetTransactionModels()
|
||||
{
|
||||
return await WarehouseService.GetTransactionsModels();
|
||||
}
|
||||
|
||||
private async Task UpdateRows(IList<WzRowMarelliDto> changedRecords)
|
||||
{
|
||||
await WarehouseService.UpdateWzRowsMarelliAsync(changedRecords);
|
||||
|
||||
WzRowsMarelli = (await WarehouseService.GetWzRowsMarelliByWzHeaderId(WzHeader)).ToList();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await _grid.Refresh();
|
||||
}
|
||||
|
||||
private void OnRowSelected(RowSelectEventArgs<WzRowMarelliDto> obj)
|
||||
{
|
||||
SelectedRow = obj.Data;
|
||||
}
|
||||
|
||||
private List<List<WzRowMarelliDto>> FindCombinations(List<WzRowMarelliDto> records, int targetSum)
|
||||
{
|
||||
var result = new List<List<WzRowMarelliDto>>();
|
||||
var currentCombination = new List<WzRowMarelliDto>();
|
||||
|
||||
void Backtrack(int start, int currentSum)
|
||||
{
|
||||
if (currentSum == targetSum)
|
||||
{
|
||||
result.Add([..currentCombination]);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = start; i < records.Count; i++)
|
||||
{
|
||||
if (currentSum + records[i].Quantity <= targetSum)
|
||||
{
|
||||
currentCombination.Add(records[i]);
|
||||
Backtrack(i + 1, currentSum + records[i].Quantity ?? 0);
|
||||
currentCombination.RemoveAt(currentCombination.Count - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Backtrack(0, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
private async Task ApplyFilter(IList<WzRowMarelliDto> selectedRecords)
|
||||
{
|
||||
await _grid.FilterByColumnAsync(nameof(WzRowMarelliDto.ItemNumber), "equal", selectedRecords.First().ItemNumber);
|
||||
}
|
||||
|
||||
private void ChangeView()
|
||||
{
|
||||
NavigationManager.NavigateTo($"/Warehouse/Marelli/PackList/{WzHeader}/Simple");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
@page "/Warehouse/Marelli/PackList/{WzHeader:guid}/Simple"
|
||||
@using OrdersManagement.Models
|
||||
@using Syncfusion.Blazor.Cards
|
||||
@using SytelineSaAppEfDataModel.Dtos
|
||||
@using Syncfusion.Blazor.Popups
|
||||
@using Syncfusion.Blazor.Inputs
|
||||
@using Syncfusion.Blazor.Buttons
|
||||
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject WarehouseService WarehouseService
|
||||
|
||||
<div class="h-100 d-flex justify-content-center align-items-start">
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h3 class="text-primary">Packing List</h3>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;" Orientation="CardOrientation.Horizontal">
|
||||
<CardContent>
|
||||
<SfButton CssClass="e-primary" IsPrimary="true" @onclick="ChangeView">Zmień widok</SfButton>
|
||||
<SfButton CssClass="e-primary" IsPrimary="true" @onclick="ExportXls">Generuj XLS i Wyślij</SfButton>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Adresy Email do Wysyłki raportu:</label>
|
||||
<SfTextBox ID="textBox" Placeholder="Wprowadź adresy..." @bind-Value="@EmailAddresses"
|
||||
CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Numer WZ:</label>
|
||||
<SfTextBox ID="textBox" @bind-Value=@WzNumber CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Wprowadź numer palety:</label>
|
||||
<SfTextBox ID="palletNumber" Type="InputType.Number" @bind-Value="@PalletNumber"
|
||||
CssClass="e-outline"/>
|
||||
<label for="textBox" class="form-label">Zeskanowana wartość:</label>
|
||||
<SfTextBox ID="scannedValue" ValueChange="ScanValue" @bind-Value="ScannedValue"
|
||||
CssClass="e-outline" @ref="_scanner"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Numer Indeksu FA:</label>
|
||||
<SfTextBox ID="itemNumber" @bind-Value="@ItemNumber"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
<label for="textBox" class="form-label">Ilość w Dostawie:</label>
|
||||
<SfTextBox ID="qty" Type="InputType.Number" @bind-Value="@Qty"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
<label for="textBox" class="form-label">Numer Palety:</label>
|
||||
<SfTextBox ID="palletNumberOutput" Type="InputType.Number" @bind-Value="@PalletNumberOutput"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
</CardContent>
|
||||
|
||||
<SfDialog Width="500px" Title="Informacja" IsModal="true" @bind-Visible="Visibility" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
@if (_isValid)
|
||||
{
|
||||
<p>Packing List został wygenerowany i wysłany!</p>
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
<p>Błąd: Proszę wprowadzić przynajmniej jeden <b>ADRES EMAIL</b> do wysyłki raportu!</p>
|
||||
}
|
||||
else if (!_isValid)
|
||||
{
|
||||
<p>Błąd: Nie Wszystkie linie mają wypełniony <b>NUMER PALETY</b>.<br/>Packing List nie zostanie
|
||||
wygenerowany!</p>
|
||||
}
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityPalletNumber"
|
||||
AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd skanowania! <b>Wybierz NUMER PALETY większy niż 0</b> (Aktualnie '@PalletNumber'):</p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<CardFooter>
|
||||
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
|
||||
</CardFooter>
|
||||
</SfCard>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid WzHeader { get; set; }
|
||||
|
||||
private List<WzRowMarelliDto> WzRowsMarelli { get; set; } = new();
|
||||
private IDictionary<string, List<TransactionModel>> TransactionModelsByPartNumber { get; set; } = new Dictionary<string, List<TransactionModel>>();
|
||||
private List<WzRowMarelliDto> ChangedRecords = new();
|
||||
private WzHeaderDto _wzHeader;
|
||||
private SfTextBox _scanner;
|
||||
|
||||
private string ItemNumber { get; set; } = string.Empty;
|
||||
private string Qty { get; set; } = "0";
|
||||
private string PalletNumberOutput { get; set; } = "0";
|
||||
|
||||
private string WzNumber { get; set; } = string.Empty;
|
||||
|
||||
private WzRowMarelliDto? SelectedRow { get; set; }
|
||||
private List<WzRowMarelliDto> SelectedRows { get; set; } = new();
|
||||
|
||||
private bool _isValid;
|
||||
|
||||
public bool Visibility { get; set; }
|
||||
public bool VisibilityPalletNumber { get; set; }
|
||||
|
||||
private string? EmailAddresses { get; set; } = string.Empty;
|
||||
private string PalletNumber { get; set; } = "0";
|
||||
|
||||
private string LastScannedValue { get; set; } = string.Empty;
|
||||
private string ScannedValue { get; set; } = string.Empty;
|
||||
|
||||
private void HideModal()
|
||||
{
|
||||
VisibilityPalletNumber = false;
|
||||
Visibility = false;
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
_wzHeader = await WarehouseService.GetWzHeaderByIdAsync(WzHeader);
|
||||
WzRowsMarelli = (await WarehouseService.GetWzRowsMarelliByWzHeaderId(WzHeader)).ToList();
|
||||
|
||||
TransactionModelsByPartNumber = await GetTransactionModels();
|
||||
|
||||
EmailAddresses = _wzHeader.EmailAddresses;
|
||||
|
||||
WzNumber = _wzHeader.WzNumbers ?? string.Empty;
|
||||
|
||||
await _scanner.FocusAsync();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveChanges()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
}
|
||||
|
||||
if (ChangedRecords.Any())
|
||||
{
|
||||
await UpdateRows(ChangedRecords);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ExportXls()
|
||||
{
|
||||
int count = WzRowsMarelli.Count(x => x.PalletNumber == null);
|
||||
|
||||
_isValid = count == 0;
|
||||
_isValid = _isValid && !string.IsNullOrWhiteSpace(EmailAddresses);
|
||||
|
||||
if (_isValid)
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
await WarehouseService.GenerateXlsForMarelliAsync(WzHeader);
|
||||
}
|
||||
|
||||
Visibility = true;
|
||||
}
|
||||
|
||||
private void ScanValue(ChangedEventArgs obj)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(obj.Value)) return;
|
||||
if (int.Parse(PalletNumber) <= 0)
|
||||
{
|
||||
VisibilityPalletNumber = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ScannedValue = obj.Value.Trim();
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
TransactionModelsByPartNumber.TryGetValue(obj.Value.Trim(), out List<TransactionModel>? materialTransactionsByPartNumber);
|
||||
TransactionModel? materialTransactionByPartNumber = materialTransactionsByPartNumber?.FirstOrDefault();
|
||||
|
||||
if (materialTransactionByPartNumber != null)
|
||||
{
|
||||
FillPalletNumber(materialTransactionByPartNumber, obj.Value.Trim());
|
||||
}
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task FillPalletNumber(TransactionModel materialTransactionByPartNumber, string scannedValue)
|
||||
{
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
int palletNumber = int.Parse(PalletNumber);
|
||||
int rowIndex = WzRowsMarelli.FindIndex(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber && x.Quantity == materialTransactionByPartNumber.Quantity);
|
||||
|
||||
switch (rowIndex)
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
SelectedRows = WzRowsMarelli.Where(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber).ToList();
|
||||
|
||||
var validCombinations = FindCombinations(SelectedRows, (int?)materialTransactionByPartNumber.Quantity ?? 0);
|
||||
|
||||
foreach (var combination in validCombinations)
|
||||
{
|
||||
foreach (var record in combination)
|
||||
{
|
||||
record.PalletNumber = palletNumber;
|
||||
ChangedRecords.Add(record);
|
||||
}
|
||||
}
|
||||
|
||||
SelectedRows.Clear();
|
||||
SelectedRows.AddRange(ChangedRecords);
|
||||
|
||||
SelectedRow = SelectedRows.FirstOrDefault();
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
SelectedRow = WzRowsMarelli[rowIndex];
|
||||
|
||||
SelectedRow.PalletNumber = palletNumber;
|
||||
|
||||
if (ChangedRecords.All(x => x.TransactionNumber != SelectedRow.TransactionNumber))
|
||||
{
|
||||
ChangedRecords.Add(SelectedRow);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await SaveChanges();
|
||||
ChangedRecords.Clear();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
await _scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task<IDictionary<string, List<TransactionModel>>> GetTransactionModels()
|
||||
{
|
||||
return await WarehouseService.GetTransactionsModels();
|
||||
}
|
||||
|
||||
private async Task UpdateRows(IList<WzRowMarelliDto> changedRecords)
|
||||
{
|
||||
await WarehouseService.UpdateWzRowsMarelliAsync(changedRecords);
|
||||
|
||||
WzRowsMarelli = (await WarehouseService.GetWzRowsMarelliByWzHeaderId(WzHeader)).ToList();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private List<List<WzRowMarelliDto>> FindCombinations(List<WzRowMarelliDto> records, int targetSum)
|
||||
{
|
||||
var result = new List<List<WzRowMarelliDto>>();
|
||||
var currentCombination = new List<WzRowMarelliDto>();
|
||||
|
||||
void Backtrack(int start, int currentSum)
|
||||
{
|
||||
if (currentSum == targetSum)
|
||||
{
|
||||
result.Add(new List<WzRowMarelliDto>(currentCombination));
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = start; i < records.Count; i++)
|
||||
{
|
||||
if (currentSum + records[i].Quantity <= targetSum)
|
||||
{
|
||||
currentCombination.Add(records[i]);
|
||||
Backtrack(i + 1, currentSum + records[i].Quantity ?? 0);
|
||||
currentCombination.RemoveAt(currentCombination.Count - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Backtrack(0, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void ChangeView()
|
||||
{
|
||||
NavigationManager.NavigateTo($"/Warehouse/Marelli/PackList/{WzHeader}");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,568 @@
|
||||
@page "/Warehouse/Meyle/PackList/{WzHeader:guid}"
|
||||
|
||||
@using OrdersManagement.Models
|
||||
@using Syncfusion.Blazor.Cards
|
||||
@using Syncfusion.Blazor.Grids
|
||||
@using SytelineSaAppEfDataModel.Dtos
|
||||
@using Syncfusion.Blazor.Navigations
|
||||
@using Syncfusion.Blazor.Popups
|
||||
@using Syncfusion.Blazor.Inputs
|
||||
@using FilterType = Syncfusion.Blazor.Grids.FilterType
|
||||
@using Syncfusion.Blazor.Buttons
|
||||
@using SelectionType = Syncfusion.Blazor.Grids.SelectionType
|
||||
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject WarehouseService WarehouseService
|
||||
|
||||
<div class="h-100 d-flex justify-content-center align-items-start">
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h3 class="text-primary">Packing List</h3>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<SfButton CssClass="e-primary" IsPrimary="true" @onclick="ChangeView">Zmień widok</SfButton>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Adresy Email do Wysyłki raportu:</label>
|
||||
<SfTextBox ID="textBox" Placeholder="Wprowadź adresy..." @bind-Value="@EmailAddresses"
|
||||
CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Numer WZ:</label>
|
||||
<SfTextBox ID="textBox" @bind-Value=@WzNumber CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Wprowadź numer palety:</label>
|
||||
<SfTextBox ID="palletNumber" Type="InputType.Number" @bind-Value="@PalletNumber"
|
||||
CssClass="e-outline"/>
|
||||
<label for="textBox" class="form-label">Zeskanowana wartość:</label>
|
||||
<SfTextBox ID="scannedValue" ValueChange="ScanValue" @bind-Value="ScannedValue"
|
||||
CssClass="e-outline" @ref="_scanner"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfGrid @ref="_grid"
|
||||
AllowFiltering="true"
|
||||
AllowPaging="true"
|
||||
AllowSorting="true"
|
||||
AllowSelection="true"
|
||||
TValue="WzRowMeyleDto"
|
||||
DataSource="@WzRowsMeyle"
|
||||
EnableAdaptiveUI="true">
|
||||
<SfToolbar>
|
||||
<ToolbarItems>
|
||||
<ToolbarItem Type="ItemType.Button" Text="Zapisz zmiany" Id="SaveButton"
|
||||
PrefixIcon="e-icons e-save" OnClick="SaveChanges"/>
|
||||
<ToolbarItem Type="ItemType.Button" Text="Podziel Linię" Id="SplitLineButton"
|
||||
PrefixIcon="e-icons e-split-horizontal" OnClick="ShowSplitDialog"
|
||||
Disabled="IsDisabled"/>
|
||||
<ToolbarItem Type="ItemType.Button" Id="Generuj XLS i Wyślij" PrefixIcon="e-icons e-export-xls"
|
||||
Text="Generuj XLS i Wyślij" OnClick="ExportXls"/>
|
||||
</ToolbarItems>
|
||||
</SfToolbar>
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.ID) IsPrimaryKey="true" Visible="false" AllowEditing="false"
|
||||
TextAlign="TextAlign.Center" HeaderText="ID" Width="70"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.OrderNumber) AllowEditing="false"
|
||||
TextAlign="TextAlign.Center" HeaderText="Numer Zamówienia Meyle"
|
||||
Width="70"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.FaIndex) AllowEditing="false" AllowFiltering="true"
|
||||
TextAlign="TextAlign.Center" HeaderText="Numer Indeksu FA" Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.ItemNumber) AllowEditing="false"
|
||||
TextAlign="TextAlign.Center" HeaderText="Numer Indeksu Meyle" Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.Quantity) AllowEditing="false" TextAlign="TextAlign.Center"
|
||||
HeaderText="Ilość w Dostawie" Width="80"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.PalletNumber) AllowEditing="true"
|
||||
TextAlign="TextAlign.Center" HeaderText="Nr Palety" Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.PartNumberSl) AllowEditing="true"
|
||||
TextAlign="TextAlign.Center"
|
||||
HeaderText="Nr Partii SL" Width="80"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzRowMeyleDto.PartNumber) AllowEditing="true" TextAlign="TextAlign.Center"
|
||||
HeaderText="Nr Partii Meyle" Width="80"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridEditSettings AllowDeleting="false"
|
||||
AllowAdding="false"
|
||||
AllowEditing="true"
|
||||
AllowNextRowEdit="true"
|
||||
AllowEditOnDblClick="true"
|
||||
ShowConfirmDialog="false"
|
||||
Mode="EditMode.Batch">
|
||||
</GridEditSettings>
|
||||
<GridFilterSettings Type="FilterType.Excel"/>
|
||||
<GridPageSettings PageSize="10"/>
|
||||
<GridSelectionSettings Mode="SelectionMode.Row" Type="SelectionType.Single"/>
|
||||
<GridEvents RowSelected="OnRowSelected" OnBatchSave="OnBatchSave" TValue="WzRowMeyleDto"></GridEvents>
|
||||
</SfGrid>
|
||||
</CardContent>
|
||||
|
||||
<SfDialog Width="500px" Title="Informacja" IsModal="true" @bind-Visible="Visibility" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
@if (_isValid)
|
||||
{
|
||||
<p>Packing List został wygenerowany i wysłany!</p>
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
<p>Błąd: Proszę wprowadzić przynajmniej jeden <b>ADRES EMAIL</b> do wysyłki raportu!</p>
|
||||
}
|
||||
else if (!_isValid)
|
||||
{
|
||||
<p>Błąd: Nie Wszystkie linie mają wypełniony <b>NUMER PALETY</b>.<br/>Packing List nie zostanie
|
||||
wygenerowany!</p>
|
||||
}
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityValidation" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd skanowania! Wystąpił jeden z wyjątków (Zeskanowana wartość '<b>@ScannedValue</b>'):</p>
|
||||
<ul>
|
||||
<li><p>Zeskanowano niepoprawny Numer Partii SL (nieistniejący w tabeli)</p></li>
|
||||
<li><p>Zeskanowano niepoprawny numer Partii Meyle (niezaczynający się od
|
||||
<b>@($"{DateTime.Now.Year - 2000}X")</b>)</p></li>
|
||||
<li><p>Numer Palety nie jest większy niż 0 (aktualnie wybrany numer palety:
|
||||
'<b>@PalletNumber</b>')</p></li>
|
||||
</ul>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityPalletNumber"
|
||||
AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd skanowania! <b>Wybierz NUMER PALETY większy niż 0</b> (Aktualnie '@PalletNumber'):</p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Podziel Linię" IsModal="true" @bind-Visible="VisibilityLineSplitter"
|
||||
AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<label for="textBox" class="form-label">Podziel linię <b>@SelectedRow?.FaIndex</b> podając ilość
|
||||
sztuk dla nowej linii:</label>
|
||||
<SfTextBox ID="newQuantity" Type="InputType.Number" @bind-Value="@NewQuantity"
|
||||
CssClass="e-outline"/>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="Zapisz" IsPrimary="true" OnClick="@SplitLine"/>
|
||||
<DialogButton Content="Anuluj" OnClick="@HideModal"></DialogButton>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<CardFooter>
|
||||
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
|
||||
</CardFooter>
|
||||
</SfCard>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid WzHeader { get; set; }
|
||||
|
||||
private SfGrid<WzRowMeyleDto> _grid;
|
||||
private List<WzRowMeyleDto> WzRowsMeyle { get; set; } = new();
|
||||
private IDictionary<string, List<TransactionModel>> TransactionModelsByPartNumber { get; set; } = new Dictionary<string, List<TransactionModel>>();
|
||||
private List<WzRowMeyleDto> ChangedRecords = new();
|
||||
private WzHeaderDto _wzHeader;
|
||||
private SfTextBox _scanner;
|
||||
|
||||
private WzRowMeyleDto? SelectedRow { get; set; }
|
||||
private List<WzRowMeyleDto> SelectedRows { get; set; } = new();
|
||||
|
||||
private string WzNumber { get; set; } = string.Empty;
|
||||
|
||||
private bool _isValid;
|
||||
|
||||
private bool Visibility { get; set; }
|
||||
private bool VisibilityValidation { get; set; }
|
||||
private bool VisibilityLineSplitter { get; set; }
|
||||
public bool VisibilityPalletNumber { get; set; }
|
||||
|
||||
private string? EmailAddresses { get; set; } = string.Empty;
|
||||
private string PalletNumber { get; set; } = "0";
|
||||
|
||||
private string LastScannedValue { get; set; } = string.Empty;
|
||||
private string ScannedValue { get; set; } = string.Empty;
|
||||
|
||||
private string NewQuantity { get; set; } = "0";
|
||||
|
||||
private bool IsDisabled => SelectedRow == null;
|
||||
|
||||
private void HideModal()
|
||||
{
|
||||
Visibility = false;
|
||||
VisibilityValidation = false;
|
||||
VisibilityLineSplitter = false;
|
||||
VisibilityPalletNumber = false;
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
_wzHeader = await WarehouseService.GetWzHeaderByIdAsync(WzHeader);
|
||||
WzRowsMeyle = (await WarehouseService.GetWzRowsMeyleByWzHeaderId(WzHeader)).ToList();
|
||||
|
||||
TransactionModelsByPartNumber = await GetTransactionModels();
|
||||
|
||||
EmailAddresses = _wzHeader.EmailAddresses;
|
||||
|
||||
WzNumber = _wzHeader.WzNumbers ?? string.Empty;
|
||||
|
||||
await _scanner.FocusAsync();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveChanges()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
}
|
||||
|
||||
if (ChangedRecords.Any())
|
||||
{
|
||||
await UpdateRows(ChangedRecords);
|
||||
}
|
||||
|
||||
await _grid.EndEditAsync();
|
||||
}
|
||||
|
||||
private async Task OnBatchSave(BeforeBatchSaveArgs<WzRowMeyleDto> obj)
|
||||
{
|
||||
var changes = obj.BatchChanges;
|
||||
List<WzRowMeyleDto> changedRecords = changes.ChangedRecords;
|
||||
|
||||
if (!changedRecords.Any()) return;
|
||||
|
||||
await UpdateRows(changedRecords);
|
||||
}
|
||||
|
||||
private async Task ExportXls()
|
||||
{
|
||||
int count = WzRowsMeyle.Count(x => x.PalletNumber == null);
|
||||
|
||||
_isValid = count == 0;
|
||||
_isValid = _isValid && !string.IsNullOrWhiteSpace(EmailAddresses);
|
||||
|
||||
if (_isValid)
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
await WarehouseService.GenerateXlsForMeyleAsync(WzHeader);
|
||||
}
|
||||
|
||||
Visibility = true;
|
||||
}
|
||||
|
||||
private void ScanValue(ChangedEventArgs obj)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(obj.Value)) return;
|
||||
if (int.Parse(PalletNumber) <= 0)
|
||||
{
|
||||
VisibilityPalletNumber = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ScannedValue = obj.Value.Trim();
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
TransactionModelsByPartNumber.TryGetValue(obj.Value.Trim(), out List<TransactionModel>? materialTransactionsByPartNumber);
|
||||
TransactionModel? materialTransactionByPartNumber = materialTransactionsByPartNumber?.FirstOrDefault();
|
||||
|
||||
if (materialTransactionByPartNumber == null && IsValidScannedValue(obj.Value))
|
||||
{
|
||||
FillMeylePartNumber(ScannedValue);
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_grid.Query = null;
|
||||
_grid.ClearFilteringAsync();
|
||||
|
||||
if (materialTransactionByPartNumber != null)
|
||||
{
|
||||
SelectedRows.Clear();
|
||||
FillFaPartNumberAndPalletNumber(materialTransactionByPartNumber, obj.Value.Trim());
|
||||
}
|
||||
|
||||
if (materialTransactionByPartNumber == null)
|
||||
{
|
||||
ShowValidationMessage();
|
||||
return;
|
||||
}
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private bool IsValidScannedValue(string scannedValue)
|
||||
{
|
||||
int year = DateTime.Now.Year - 2000;
|
||||
|
||||
string format = $"{year}X";
|
||||
|
||||
return scannedValue.StartsWith(format);
|
||||
}
|
||||
|
||||
private async Task FillMeylePartNumber(string scannedValue)
|
||||
{
|
||||
var rowIndex = WzRowsMeyle.FindIndex(x => x.FaIndex == SelectedRow?.FaIndex && x.Quantity == SelectedRow?.Quantity);
|
||||
|
||||
if (SelectedRow != null && !SelectedRows.Any())
|
||||
{
|
||||
SelectedRow.PartNumber = scannedValue;
|
||||
ChangedRecords.Add(SelectedRow);
|
||||
}
|
||||
|
||||
foreach (WzRowMeyleDto wzRowMeyleDto in SelectedRows)
|
||||
{
|
||||
wzRowMeyleDto.PartNumber = scannedValue;
|
||||
ChangedRecords.Add(wzRowMeyleDto);
|
||||
}
|
||||
|
||||
await SaveChanges();
|
||||
|
||||
ChangedRecords.Clear();
|
||||
SelectedRows.Clear();
|
||||
|
||||
FocusGridRow(rowIndex);
|
||||
await _scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task FillFaPartNumberAndPalletNumber(TransactionModel materialTransactionByPartNumber, string scannedValue)
|
||||
{
|
||||
await _grid.ClearSelectionAsync();
|
||||
await _grid.Refresh();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
List<int> selectedIndices = new List<int>();
|
||||
int palletNumber = int.Parse(PalletNumber);
|
||||
int rowIndex = WzRowsMeyle.FindIndex(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber && x.Quantity == materialTransactionByPartNumber.Quantity);
|
||||
|
||||
switch (rowIndex)
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
SelectedRows = WzRowsMeyle.Where(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber).ToList();
|
||||
|
||||
if (SelectedRows.Count == 0)
|
||||
{
|
||||
ShowValidationMessage();
|
||||
return;
|
||||
}
|
||||
|
||||
rowIndex = WzRowsMeyle.FindIndex(x => x.FaIndex == SelectedRows.First().FaIndex && x.Quantity == SelectedRows.First().Quantity);
|
||||
|
||||
var validCombinations = FindCombinations(SelectedRows, (int?)materialTransactionByPartNumber.Quantity ?? 0);
|
||||
|
||||
foreach (var combination in validCombinations)
|
||||
{
|
||||
foreach (var record in combination)
|
||||
{
|
||||
record.PartNumberSl = scannedValue;
|
||||
record.PalletNumber = palletNumber;
|
||||
ChangedRecords.Add(record);
|
||||
|
||||
int index = WzRowsMeyle.IndexOf(record);
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
selectedIndices.Add(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SelectedRows.Clear();
|
||||
SelectedRows.AddRange(ChangedRecords);
|
||||
|
||||
SelectedRow = SelectedRows.FirstOrDefault();
|
||||
|
||||
await ApplyFilter(ChangedRecords);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
SelectedRow = WzRowsMeyle[rowIndex];
|
||||
selectedIndices.Add(rowIndex);
|
||||
|
||||
SelectedRow.PartNumberSl = scannedValue;
|
||||
SelectedRow.PalletNumber = palletNumber;
|
||||
|
||||
if (ChangedRecords.All(x => x.TransactionNumber != SelectedRow.TransactionNumber))
|
||||
{
|
||||
ChangedRecords.Add(SelectedRow);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await SaveChanges();
|
||||
ChangedRecords.Clear();
|
||||
|
||||
if (selectedIndices.Any())
|
||||
{
|
||||
await _grid.SelectRowsAsync(selectedIndices.ToArray());
|
||||
}
|
||||
|
||||
await _grid.Refresh();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
FocusGridRow(rowIndex);
|
||||
await _scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private void FocusGridRow(int rowIndex)
|
||||
{
|
||||
if (_grid.AllowPaging)
|
||||
{
|
||||
int pageSize = _grid.PageSettings.PageSize;
|
||||
int targetPage = (rowIndex / pageSize) + 1;
|
||||
_grid.GoToPageAsync(targetPage);
|
||||
|
||||
rowIndex %= pageSize;
|
||||
}
|
||||
|
||||
_grid.SelectRowAsync(rowIndex);
|
||||
_grid.ScrollIntoViewAsync(rowIndex: rowIndex);
|
||||
_grid.FocusAsync();
|
||||
}
|
||||
|
||||
private void ShowValidationMessage()
|
||||
{
|
||||
VisibilityValidation = true;
|
||||
|
||||
ChangedRecords.Clear();
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task<IDictionary<string, List<TransactionModel>>> GetTransactionModels()
|
||||
{
|
||||
return await WarehouseService.GetTransactionsModels();
|
||||
}
|
||||
|
||||
private async Task UpdateRows(IList<WzRowMeyleDto> changedRecords)
|
||||
{
|
||||
await WarehouseService.UpdateWzRowsMeyleAsync(changedRecords);
|
||||
|
||||
WzRowsMeyle = (await WarehouseService.GetWzRowsMeyleByWzHeaderId(WzHeader)).ToList();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await _grid.Refresh();
|
||||
}
|
||||
|
||||
private async Task SplitLine(MouseEventArgs arg)
|
||||
{
|
||||
int newQuantity = int.Parse(NewQuantity);
|
||||
|
||||
if (newQuantity > 0 && SelectedRow != null)
|
||||
{
|
||||
WzRowMeyleDto splitRow = new WzRowMeyleDto
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
FK_Header = SelectedRow.FK_Header,
|
||||
Quantity = newQuantity,
|
||||
FaIndex = SelectedRow.FaIndex,
|
||||
ItemNumber = SelectedRow.ItemNumber,
|
||||
OrderNumber = SelectedRow.OrderNumber,
|
||||
PalletNumber = SelectedRow.PalletNumber,
|
||||
WzNumber = SelectedRow.WzNumber,
|
||||
TransactionNumber = SelectedRow.TransactionNumber += 10000,
|
||||
PartNumberSl = SelectedRow.PartNumberSl,
|
||||
PartNumber = SelectedRow.PartNumber
|
||||
};
|
||||
|
||||
WzRowsMeyle.Add(splitRow);
|
||||
SelectedRow.Quantity -= newQuantity;
|
||||
|
||||
ChangedRecords.Add(SelectedRow);
|
||||
|
||||
await WarehouseService.CreateWzRowsMeyleAsync(new List<WzRowMeyleDto> { splitRow });
|
||||
await UpdateRows(ChangedRecords);
|
||||
}
|
||||
|
||||
VisibilityLineSplitter = false;
|
||||
}
|
||||
|
||||
private void ShowSplitDialog(ClickEventArgs obj)
|
||||
{
|
||||
VisibilityLineSplitter = true;
|
||||
NewQuantity = "0";
|
||||
}
|
||||
|
||||
private void OnRowSelected(RowSelectEventArgs<WzRowMeyleDto> obj)
|
||||
{
|
||||
SelectedRow = obj.Data;
|
||||
}
|
||||
|
||||
private List<List<WzRowMeyleDto>> FindCombinations(List<WzRowMeyleDto> records, int targetSum)
|
||||
{
|
||||
var result = new List<List<WzRowMeyleDto>>();
|
||||
var currentCombination = new List<WzRowMeyleDto>();
|
||||
|
||||
void Backtrack(int start, int currentSum)
|
||||
{
|
||||
if (currentSum == targetSum)
|
||||
{
|
||||
result.Add(new List<WzRowMeyleDto>(currentCombination));
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = start; i < records.Count; i++)
|
||||
{
|
||||
if (currentSum + records[i].Quantity <= targetSum)
|
||||
{
|
||||
currentCombination.Add(records[i]);
|
||||
Backtrack(i + 1, currentSum + records[i].Quantity ?? 0);
|
||||
currentCombination.RemoveAt(currentCombination.Count - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Backtrack(0, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
private async Task ApplyFilter(IList<WzRowMeyleDto> selectedRecords)
|
||||
{
|
||||
await _grid.FilterByColumnAsync(nameof(WzRowMeyleDto.FaIndex), "equal", selectedRecords.First().FaIndex);
|
||||
}
|
||||
|
||||
private void ChangeView()
|
||||
{
|
||||
NavigationManager.NavigateTo($"/Warehouse/Meyle/PackList/{WzHeader}/Simple");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
@page "/Warehouse/Meyle/PackList/{WzHeader:guid}/Simple"
|
||||
@using OrdersManagement.Models
|
||||
@using Syncfusion.Blazor.Cards
|
||||
@using Syncfusion.Blazor.Grids
|
||||
@using SytelineSaAppEfDataModel.Dtos
|
||||
@using Syncfusion.Blazor.Popups
|
||||
@using Syncfusion.Blazor.Inputs
|
||||
@using Syncfusion.Blazor.Buttons
|
||||
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject WarehouseService WarehouseService
|
||||
|
||||
<div class="h-100 d-flex justify-content-center align-items-start">
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h3 class="text-primary">Packing List</h3>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;" Orientation="CardOrientation.Horizontal">
|
||||
<CardContent>
|
||||
<SfButton CssClass="e-primary" IsPrimary="true" @onclick="ChangeView">Zmień widok</SfButton>
|
||||
<SfButton CssClass="e-primary" IsPrimary="true" @onclick="ExportXls">Generuj XLS i Wyślij</SfButton>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Adresy Email do Wysyłki raportu:</label>
|
||||
<SfTextBox ID="textBox" Placeholder="Wprowadź adresy..." @bind-Value="@EmailAddresses"
|
||||
CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Numer WZ:</label>
|
||||
<SfTextBox ID="textBox" @bind-Value=@WzNumber CssClass="e-outline"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Wprowadź numer palety:</label>
|
||||
<SfTextBox ID="palletNumber" Type="InputType.Number" @bind-Value="@PalletNumber"
|
||||
CssClass="e-outline"/>
|
||||
<label for="textBox" class="form-label">Zeskanowana wartość:</label>
|
||||
<SfTextBox ID="scannedValue" ValueChange="ScanValue" @bind-Value="ScannedValue"
|
||||
CssClass="e-outline" @ref="_scanner"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardContent>
|
||||
<label for="textBox" class="form-label">Numer Indeksu FA:</label>
|
||||
<SfTextBox ID="itemNumber" @bind-Value="@ItemNumber"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
<label for="textBox" class="form-label">Ilość w Dostawie:</label>
|
||||
<SfTextBox ID="qty" Type="InputType.Number" @bind-Value="@Qty"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
<label for="textBox" class="form-label">Numer Palety:</label>
|
||||
<SfTextBox ID="palletNumberOutput" Type="InputType.Number" @bind-Value="@PalletNumberOutput"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
<label for="textBox" class="form-label">Nr Partii SL:</label>
|
||||
<SfTextBox ID="partNumberSl" @bind-Value="@PartNumberSl"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
<label for="textBox" class="form-label">Numer Partii Meyle:</label>
|
||||
<SfTextBox ID="partNumberMeyle" @bind-Value="@PartNumberMeyle"
|
||||
CssClass="e-outline" Readonly="true"/>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
</CardContent>
|
||||
|
||||
<SfDialog Width="500px" Title="Informacja" IsModal="true" @bind-Visible="Visibility" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
@if (_isValid)
|
||||
{
|
||||
<p>Packing List został wygenerowany i wysłany!</p>
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
<p>Błąd: Proszę wprowadzić przynajmniej jeden <b>ADRES EMAIL</b> do wysyłki raportu!</p>
|
||||
}
|
||||
else if (!_isValid)
|
||||
{
|
||||
<p>Błąd: Nie Wszystkie linie mają wypełniony <b>NUMER PALETY</b>.<br/>Packing List nie zostanie
|
||||
wygenerowany!</p>
|
||||
}
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityValidation" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd skanowania! Wystąpił jeden z wyjątków (Zeskanowana wartość '<b>@ScannedValue</b>'):</p>
|
||||
<ul>
|
||||
<li><p>Zeskanowano niepoprawny Numer Partii SL (nieistniejący w tabeli)</p></li>
|
||||
<li><p>Zeskanowano niepoprawny numer Partii Meyle (niezaczynający się od
|
||||
<b>@($"{DateTime.Now.Year - 2000}X")</b>)</p></li>
|
||||
<li><p>Numer Palety nie jest większy niż 0 (aktualnie wybrany numer palety:
|
||||
'<b>@PalletNumber</b>')</p></li>
|
||||
</ul>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityPalletNumber"
|
||||
AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd skanowania! <b>Wybierz NUMER PALETY większy niż 0</b> (Aktualnie '@PalletNumber'):</p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<CardFooter>
|
||||
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
|
||||
</CardFooter>
|
||||
</SfCard>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid WzHeader { get; set; }
|
||||
|
||||
private List<WzRowMeyleDto> WzRowsMeyle { get; set; } = new();
|
||||
private IDictionary<string, List<TransactionModel>> TransactionModelsByPartNumber { get; set; } = new Dictionary<string, List<TransactionModel>>();
|
||||
private List<WzRowMeyleDto> ChangedRecords = new();
|
||||
private WzHeaderDto _wzHeader;
|
||||
private SfTextBox _scanner;
|
||||
|
||||
private string ItemNumber { get; set; } = string.Empty;
|
||||
private string Qty { get; set; } = "0";
|
||||
private string PalletNumberOutput { get; set; } = "0";
|
||||
private string PartNumberSl { get; set; } = string.Empty;
|
||||
private string PartNumberMeyle { get; set; } = string.Empty;
|
||||
|
||||
private string WzNumber { get; set; } = string.Empty;
|
||||
|
||||
private WzRowMeyleDto? SelectedRow { get; set; }
|
||||
private List<WzRowMeyleDto> SelectedRows { get; set; } = new();
|
||||
|
||||
private bool _isValid;
|
||||
|
||||
private bool Visibility { get; set; }
|
||||
private bool VisibilityValidation { get; set; }
|
||||
private bool VisibilityLineSplitter { get; set; }
|
||||
public bool VisibilityPalletNumber { get; set; }
|
||||
|
||||
private string? EmailAddresses { get; set; } = string.Empty;
|
||||
private string PalletNumber { get; set; } = "0";
|
||||
|
||||
private string LastScannedValue { get; set; } = string.Empty;
|
||||
private string ScannedValue { get; set; } = string.Empty;
|
||||
|
||||
private void HideModal()
|
||||
{
|
||||
Visibility = false;
|
||||
VisibilityValidation = false;
|
||||
VisibilityLineSplitter = false;
|
||||
VisibilityPalletNumber = false;
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
_wzHeader = await WarehouseService.GetWzHeaderByIdAsync(WzHeader);
|
||||
WzRowsMeyle = (await WarehouseService.GetWzRowsMeyleByWzHeaderId(WzHeader)).ToList();
|
||||
|
||||
TransactionModelsByPartNumber = await GetTransactionModels();
|
||||
|
||||
EmailAddresses = _wzHeader.EmailAddresses;
|
||||
|
||||
WzNumber = _wzHeader.WzNumbers ?? string.Empty;
|
||||
|
||||
await _scanner.FocusAsync();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveChanges()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(EmailAddresses))
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
}
|
||||
|
||||
if (ChangedRecords.Any())
|
||||
{
|
||||
await UpdateRows(ChangedRecords);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnBatchSave(BeforeBatchSaveArgs<WzRowMeyleDto> obj)
|
||||
{
|
||||
var changes = obj.BatchChanges;
|
||||
List<WzRowMeyleDto> changedRecords = changes.ChangedRecords;
|
||||
|
||||
if (!changedRecords.Any()) return;
|
||||
|
||||
await UpdateRows(changedRecords);
|
||||
}
|
||||
|
||||
private async Task ExportXls()
|
||||
{
|
||||
int count = WzRowsMeyle.Count(x => x.PalletNumber == null);
|
||||
|
||||
_isValid = count == 0;
|
||||
_isValid = _isValid && !string.IsNullOrWhiteSpace(EmailAddresses);
|
||||
|
||||
if (_isValid)
|
||||
{
|
||||
await WarehouseService.AddEmailsToWzHeaderAsync(WzHeader, EmailAddresses);
|
||||
await WarehouseService.GenerateXlsForMeyleAsync(WzHeader);
|
||||
}
|
||||
|
||||
Visibility = true;
|
||||
}
|
||||
|
||||
private void ScanValue(ChangedEventArgs obj)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(obj.Value)) return;
|
||||
if (int.Parse(PalletNumber) <= 0)
|
||||
{
|
||||
VisibilityPalletNumber = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ScannedValue = obj.Value.Trim();
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
TransactionModelsByPartNumber.TryGetValue(obj.Value.Trim(), out List<TransactionModel>? materialTransactionsByPartNumber);
|
||||
TransactionModel? materialTransactionByPartNumber = materialTransactionsByPartNumber?.FirstOrDefault();
|
||||
|
||||
if (materialTransactionByPartNumber == null && IsValidScannedValue(obj.Value))
|
||||
{
|
||||
FillMeylePartNumber(ScannedValue);
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (materialTransactionByPartNumber != null)
|
||||
{
|
||||
FillFaPartNumberAndPalletNumber(materialTransactionByPartNumber, obj.Value.Trim());
|
||||
}
|
||||
|
||||
if (materialTransactionByPartNumber == null)
|
||||
{
|
||||
ShowValidationMessage();
|
||||
return;
|
||||
}
|
||||
|
||||
LastScannedValue = ScannedValue;
|
||||
ScannedValue = string.Empty;
|
||||
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private bool IsValidScannedValue(string scannedValue)
|
||||
{
|
||||
int year = DateTime.Now.Year - 2000;
|
||||
|
||||
string format = $"{year}X";
|
||||
|
||||
return scannedValue.StartsWith(format);
|
||||
}
|
||||
|
||||
private async Task FillMeylePartNumber(string scannedValue)
|
||||
{
|
||||
if (SelectedRow != null && !SelectedRows.Any())
|
||||
{
|
||||
SelectedRow.PartNumber = scannedValue;
|
||||
ChangedRecords.Add(SelectedRow);
|
||||
|
||||
PartNumberMeyle = scannedValue;
|
||||
}
|
||||
|
||||
foreach (WzRowMeyleDto wzRowMeyleDto in SelectedRows)
|
||||
{
|
||||
wzRowMeyleDto.PartNumber = scannedValue;
|
||||
ChangedRecords.Add(wzRowMeyleDto);
|
||||
}
|
||||
|
||||
await SaveChanges();
|
||||
|
||||
ChangedRecords.Clear();
|
||||
SelectedRows.Clear();
|
||||
|
||||
await _scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task FillFaPartNumberAndPalletNumber(TransactionModel materialTransactionByPartNumber, string scannedValue)
|
||||
{
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
int palletNumber = int.Parse(PalletNumber);
|
||||
int rowIndex = WzRowsMeyle.FindIndex(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber && x.Quantity == materialTransactionByPartNumber.Quantity);
|
||||
|
||||
switch (rowIndex)
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
SelectedRows = WzRowsMeyle.Where(x => x.FaIndex == materialTransactionByPartNumber.ItemNumber).ToList();
|
||||
|
||||
if (SelectedRows.Count == 0)
|
||||
{
|
||||
ShowValidationMessage();
|
||||
return;
|
||||
}
|
||||
|
||||
var validCombinations = FindCombinations(SelectedRows, (int?)materialTransactionByPartNumber.Quantity ?? 0);
|
||||
|
||||
foreach (var combination in validCombinations)
|
||||
{
|
||||
foreach (var record in combination)
|
||||
{
|
||||
record.PartNumberSl = scannedValue;
|
||||
record.PalletNumber = palletNumber;
|
||||
ChangedRecords.Add(record);
|
||||
}
|
||||
}
|
||||
|
||||
SelectedRows.Clear();
|
||||
SelectedRows.AddRange(ChangedRecords);
|
||||
|
||||
SelectedRow = SelectedRows.FirstOrDefault();
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
SelectedRow = WzRowsMeyle[rowIndex];
|
||||
|
||||
SelectedRow.PartNumberSl = scannedValue;
|
||||
SelectedRow.PalletNumber = palletNumber;
|
||||
|
||||
if (ChangedRecords.All(x => x.TransactionNumber != SelectedRow.TransactionNumber))
|
||||
{
|
||||
ChangedRecords.Add(SelectedRow);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PartNumberSl = SelectedRow?.PartNumberSl ?? string.Empty;
|
||||
PalletNumberOutput = SelectedRow?.PalletNumber.ToString() ?? "0";
|
||||
ItemNumber = SelectedRow?.FaIndex ?? string.Empty;
|
||||
Qty = SelectedRow?.Quantity.ToString() ?? "0";
|
||||
|
||||
await SaveChanges();
|
||||
ChangedRecords.Clear();
|
||||
await _scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private void ShowValidationMessage()
|
||||
{
|
||||
VisibilityValidation = true;
|
||||
|
||||
ChangedRecords.Clear();
|
||||
_scanner.FocusAsync();
|
||||
}
|
||||
|
||||
private async Task<IDictionary<string, List<TransactionModel>>> GetTransactionModels()
|
||||
{
|
||||
return await WarehouseService.GetTransactionsModels();
|
||||
}
|
||||
|
||||
private async Task UpdateRows(IList<WzRowMeyleDto> changedRecords)
|
||||
{
|
||||
await WarehouseService.UpdateWzRowsMeyleAsync(changedRecords);
|
||||
|
||||
WzRowsMeyle = (await WarehouseService.GetWzRowsMeyleByWzHeaderId(WzHeader)).ToList();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private List<List<WzRowMeyleDto>> FindCombinations(List<WzRowMeyleDto> records, int targetSum)
|
||||
{
|
||||
var result = new List<List<WzRowMeyleDto>>();
|
||||
var currentCombination = new List<WzRowMeyleDto>();
|
||||
|
||||
void Backtrack(int start, int currentSum)
|
||||
{
|
||||
if (currentSum == targetSum)
|
||||
{
|
||||
result.Add(new List<WzRowMeyleDto>(currentCombination));
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = start; i < records.Count; i++)
|
||||
{
|
||||
if (currentSum + records[i].Quantity <= targetSum)
|
||||
{
|
||||
currentCombination.Add(records[i]);
|
||||
Backtrack(i + 1, currentSum + records[i].Quantity ?? 0);
|
||||
currentCombination.RemoveAt(currentCombination.Count - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Backtrack(0, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void ChangeView()
|
||||
{
|
||||
NavigationManager.NavigateTo($"/Warehouse/Meyle/PackList/{WzHeader}");
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
Toolbar="@(new List<string> { "Update" })">
|
||||
<GridColumns>
|
||||
<GridColumn Field="@nameof(ProductDto.ID)" AllowEditing="false" IsPrimaryKey="true" HeaderText="ID" Width="70"></GridColumn>
|
||||
<GridColumn Field="@nameof(ProductDto.RecipientID)" AllowEditing="false" HeaderText="Odbiorca" Width="100"></GridColumn>
|
||||
<GridColumn Field="@nameof(ProductDto.RecipientName)" AllowEditing="false" HeaderText="Odbiorca" Width="100"></GridColumn>
|
||||
<GridColumn Field="@nameof(ProductDto.RecipientIdx)" AllowEditing="false" HeaderText="Indeks odbiorcy" Width="100"></GridColumn>
|
||||
<GridColumn Field="@nameof(ProductDto.FaIdx)" HeaderText="Kod FA" Width="100"></GridColumn>
|
||||
</GridColumns>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="h-100 d-flex justify-content-center align-items-start">
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h3 class="text-primary">Zamówienie DELFOR nr @(ScheduleOrderDto?.PONum ?? "Brak numeru")</h3>
|
||||
<h3 class="text-primary">Zamówienie DELFOR nr @(ScheduleOrderDto?.PONum ?? "Brak numeru") (ID: @ScheduleOrderDto?.ID)</h3>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<SfListView Id="ScheduleOrderMiscs"
|
||||
|
||||
@@ -39,17 +39,17 @@
|
||||
</ToolbarItems>
|
||||
</SfToolbar>
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.PONum) HeaderText="Zamówienie Klienta" Width="150"
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.PONum) HeaderText="Zamówienie Klienta" Width="120" AllowResizing="true"
|
||||
AllowFiltering="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.PurchaserCode) HeaderText="Klient" Width="100"
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.PurchaserCode) HeaderText="Klient" Width="100" AllowResizing="true"
|
||||
AllowFiltering="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.RecipientName) HeaderText="Odbiorca" Width="100"
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.RecipientName) HeaderText="Odbiorca" Width="150" AllowResizing="true"
|
||||
AllowFiltering="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.RecipientCode) HeaderText="Kod odbiorcy" Width="100"
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.RecipientCode) HeaderText="Kod odbiorcy" Width="120" AllowResizing="true"
|
||||
AllowFiltering="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.LastUpdateDate) HeaderText="Data Utworzenia" Format="d"
|
||||
Type="ColumnType.Date" Width="130" AllowFiltering="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.DocType) HeaderText="Typ Dokumentu" Width="100"
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.LastUpdateDate) HeaderText="Data" Format="d"
|
||||
Type="ColumnType.Date" Width="80" AllowResizing="true" AllowFiltering="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDto.DocType) HeaderText="Typ Dokumentu" Width="100" AllowResizing="true"
|
||||
AllowFiltering="true"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridTemplates>
|
||||
@@ -67,18 +67,18 @@
|
||||
AdaptiveUIMode="AdaptiveMode.Both">
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDto.OrderNumber)
|
||||
HeaderText="Numer Zamówienia" Width="100"></GridColumn>
|
||||
HeaderText="Numer Zamówienia" Width="100" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDto.PurchaserName) HeaderText="Klient"
|
||||
Width="100"></GridColumn>
|
||||
Width="100" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDto.RecipientName)
|
||||
HeaderText="Odbiorca" Width="100"></GridColumn>
|
||||
HeaderText="Odbiorca" Width="100" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDto.RecipientCode)
|
||||
HeaderText="Kod odbiorcy" Width="100"
|
||||
AllowFiltering="true"></GridColumn>
|
||||
AllowFiltering="true" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDto.Sc_productCode)
|
||||
HeaderText="Pozycja" Width="100"></GridColumn>
|
||||
HeaderText="Pozycja Klienta" Width="100" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDto.Sh_productCode)
|
||||
HeaderText="Pozycja Klienta" Width="100"></GridColumn>
|
||||
HeaderText="Pozycja" Width="100" AllowResizing="true"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridTemplates>
|
||||
<DetailTemplate Context="detail">
|
||||
@@ -94,17 +94,17 @@
|
||||
AdaptiveUIMode="AdaptiveMode.Both">
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDetailDto.DateFrom)
|
||||
HeaderText="Data Od" Width="100"></GridColumn>
|
||||
HeaderText="Data Od" Width="100" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDetailDto.DateTo)
|
||||
HeaderText="Data Do" Width="100"></GridColumn>
|
||||
HeaderText="Data Do" Width="100" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDetailDto.Qty)
|
||||
TextAlign="TextAlign.Right" HeaderText="Ilość Sztuk"
|
||||
Width="50"></GridColumn>
|
||||
Width="50" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDetailDto.QtyType)
|
||||
TextAlign="TextAlign.Right" HeaderText="Typ Qty"
|
||||
Width="50"></GridColumn>
|
||||
Width="50" AllowResizing="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ScheduleOrderDetailDetailDto.QtyDesc)
|
||||
HeaderText="Opis Typu" Width="100"></GridColumn>
|
||||
HeaderText="Opis Typu" Width="100" AllowResizing="true"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridFilterSettings Type="FilterType.Excel"/>
|
||||
<GridPageSettings PageSize="10"/>
|
||||
@@ -210,7 +210,7 @@
|
||||
|
||||
private void OnRowDataBound(RowDataBoundEventArgs<ScheduleOrderDetailDetailDto> args)
|
||||
{
|
||||
if (args.Data.QtyType == "83" || args.Data.QtyType == "84")
|
||||
if (new[] { "54", "83", "84" }.Any(x => x == args.Data.QtyType))
|
||||
{
|
||||
args.Row.AddClass(["highlight-red"]);
|
||||
}
|
||||
|
||||
280
OrdersManagement/Components/Pages/Warehouse.razor
Normal file
280
OrdersManagement/Components/Pages/Warehouse.razor
Normal file
@@ -0,0 +1,280 @@
|
||||
@page "/Warehouse"
|
||||
|
||||
@using Blazored.LocalStorage
|
||||
@using Syncfusion.Blazor.Cards
|
||||
@using Syncfusion.Blazor.Grids
|
||||
@using SytelineSaAppEfDataModel.Dtos
|
||||
@using Syncfusion.Blazor.DropDowns
|
||||
@using FilterType = Syncfusion.Blazor.Grids.FilterType
|
||||
@using SelectionMode = Syncfusion.Blazor.Grids.SelectionMode
|
||||
@using Syncfusion.Blazor.Navigations
|
||||
@using Syncfusion.Blazor.Popups
|
||||
|
||||
@inject WarehouseService WarehouseService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject ILocalStorageService LocalStorage
|
||||
|
||||
<div class="h-100 d-flex justify-content-center align-items-start">
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h3 class="text-primary">Dokumenty WZ na Magazynie</h3>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<h5 class="text-primary mb-3">Klient</h5>
|
||||
<SfDropDownList @ref="_dropdown" TValue="Guid?" TItem="WzClientDto" DataSource="@_clients" Placeholder="Wybierz Klienta">
|
||||
<DropDownListFieldSettings Value="ID" Text="Name"/>
|
||||
<DropDownListEvents TValue="Guid?" TItem="WzClientDto" ValueChange="OnValueChange"/>
|
||||
</SfDropDownList>
|
||||
@if (_isVisible)
|
||||
{
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h5 class="text-primary mb-3">Dokumenty WZ</h5>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<SfGrid @ref="_grid"
|
||||
AllowFiltering="true"
|
||||
AllowPaging="true"
|
||||
AllowSorting="true"
|
||||
AllowSelection="true"
|
||||
TValue="MaterialTransactionDto"
|
||||
DataSource="@_dataSource"
|
||||
EnableAdaptiveUI="true">
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(MaterialTransactionDto.MTGroupNum) HeaderText="Numer WZ" TextAlign="TextAlign.Center" Width="110"></GridColumn>
|
||||
<GridColumn Field=@nameof(MaterialTransactionDto.CreateDate) HeaderText="Data utworzenia" TextAlign="TextAlign.Center" Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(MaterialTransactionDto.RefNum) HeaderText="Numer zamówienia" TextAlign="TextAlign.Center" Width="110"></GridColumn>
|
||||
</GridColumns>
|
||||
<SfToolbar>
|
||||
<ToolbarItems>
|
||||
<ToolbarItem Type="ItemType.Button" Text="Utwórz Packing List" Id="CreatePackingList"
|
||||
PrefixIcon="e-icons e-save" OnClick="CreatePackingList"/>
|
||||
</ToolbarItems>
|
||||
</SfToolbar>
|
||||
<GridFilterSettings Type="FilterType.Excel"/>
|
||||
<GridPageSettings PageSize="5"/>
|
||||
<GridSelectionSettings Mode="SelectionMode.Row" Type="SelectionType.Multiple"/>
|
||||
</SfGrid>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
<SfCard CssClass="shadow" style="width: 100%; max-width: 1200px;">
|
||||
<CardHeader>
|
||||
<h5 class="text-primary mb-3">Packling Listy</h5>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<SfGrid AllowFiltering="true"
|
||||
AllowPaging="true"
|
||||
AllowSorting="true"
|
||||
AllowSelection="true"
|
||||
TValue="WzHeaderDto"
|
||||
DataSource="@_wzHeaders"
|
||||
EnableAdaptiveUI="true">
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(WzHeaderDto.ID) HeaderText="ID" TextAlign="TextAlign.Center" Width="110"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzHeaderDto.WzNumbers) HeaderText="Numery WZ" TextAlign="TextAlign.Center" Width="100"></GridColumn>
|
||||
<GridColumn Field=@nameof(WzHeaderDto.CreatedDate) HeaderText="Data utworzenia" TextAlign="TextAlign.Center" Width="100"></GridColumn>
|
||||
</GridColumns>
|
||||
<GridFilterSettings Type="FilterType.Excel"/>
|
||||
<GridPageSettings PageSize="5"/>
|
||||
<GridSelectionSettings Mode="SelectionMode.Row" Type="SelectionType.Single"/>
|
||||
<GridEvents TValue="WzHeaderDto" OnRecordDoubleClick="OnRowDoubleClick"/>
|
||||
</SfGrid>
|
||||
</CardContent>
|
||||
</SfCard>
|
||||
}
|
||||
</CardContent>
|
||||
|
||||
<SfDialog Width="500px" Title="Informacja" IsModal="true" @bind-Visible="Visibility" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd: Zaznacz przynajmniej jeden rekord, żeby wygenerowac Pack List!</p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<SfDialog Width="500px" Title="Błąd" IsModal="true" @bind-Visible="VisibilityError" AllowPrerender="true">
|
||||
<DialogTemplates>
|
||||
<Content>
|
||||
<p>Błąd: Dla zaznaczonego rekordu istnieje już PackingList!</p>
|
||||
</Content>
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@HideModal"/>
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
<CardFooter>
|
||||
<small class="text-muted">FA Krosno Manager © @(DateTime.Now.Year)</small>
|
||||
</CardFooter>
|
||||
</SfCard>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private SfGrid<MaterialTransactionDto> _grid;
|
||||
private IEnumerable<WzClientDto> _clients = new List<WzClientDto>();
|
||||
private IEnumerable<MaterialTransactionDto> _materialTransactions = new List<MaterialTransactionDto>();
|
||||
private IEnumerable<MaterialTransactionDto> _dataSource = new List<MaterialTransactionDto>();
|
||||
private IEnumerable<WzHeaderDto> _wzHeaders = new List<WzHeaderDto>();
|
||||
|
||||
private WzClientDto? _selectedClient;
|
||||
|
||||
private WzHeaderDto? _selectedHeader;
|
||||
private SfDropDownList<Guid?, WzClientDto> _dropdown;
|
||||
private bool _isVisible;
|
||||
|
||||
private bool Visibility { get; set; }
|
||||
private bool VisibilityError { get; set; }
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
_clients = await WarehouseService.GetAllClientsAsync();
|
||||
_clients = _clients.Where(x => new[] { "MAGNETI MARELLI", "MEYLE" }.Any(y => y.Equals(x.Name, StringComparison.OrdinalIgnoreCase))).ToList();
|
||||
|
||||
StateHasChanged();
|
||||
|
||||
var savedClientId = await LocalStorage.GetItemAsync<Guid?>("SelectedClientId");
|
||||
|
||||
if (savedClientId != null && _clients.FirstOrDefault(c => c.ID == savedClientId) is {} savedClient)
|
||||
{
|
||||
await OnValueChange(new ChangeEventArgs<Guid?, WzClientDto>() { Value = savedClient.ID });
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnValueChange(ChangeEventArgs<Guid?, WzClientDto> args)
|
||||
{
|
||||
if (args.Value.HasValue)
|
||||
{
|
||||
_selectedClient = args.ItemData ?? _clients.FirstOrDefault(x => x.ID == args.Value);
|
||||
|
||||
if (_selectedClient == null) { return; }
|
||||
|
||||
_isVisible = true;
|
||||
_materialTransactions = await WarehouseService.GetAllClientWzsAsync(_selectedClient.CustomerNumber, _selectedClient.CustomerSequence ?? 0);
|
||||
_dataSource = _materialTransactions.GroupBy(x => x.MTGroupNum).Select(x => x.First()).ToList();
|
||||
_wzHeaders = await WarehouseService.GetAllClientWzHeadersAsync(_selectedClient.CustomerNumber, _selectedClient.CustomerSequence ?? 0);
|
||||
|
||||
await LocalStorage.SetItemAsync("SelectedClientId", _selectedClient.ID);
|
||||
|
||||
_dropdown.Value = _selectedClient.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
_selectedClient = null;
|
||||
_isVisible = false;
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void OnRowDoubleClick(RecordDoubleClickEventArgs<WzHeaderDto> obj)
|
||||
{
|
||||
if (_selectedClient is null) return;
|
||||
|
||||
Guid headerId = obj.RowData.ID;
|
||||
|
||||
NavigationManager.NavigateTo($"/Warehouse/{_selectedClient.ShortName}/PackList/" + headerId);
|
||||
}
|
||||
|
||||
private async Task CreatePackingList()
|
||||
{
|
||||
var selectedRecords = await _grid.GetSelectedRecordsAsync();
|
||||
|
||||
if (!selectedRecords.Any())
|
||||
{
|
||||
Visibility = true;
|
||||
return;
|
||||
}
|
||||
|
||||
string wzNumbers = string.Join(", ",selectedRecords.Select(x => x.MTGroupNum).Distinct());
|
||||
|
||||
if (_wzHeaders.Any(x => x.WzNumbers == wzNumbers))
|
||||
{
|
||||
VisibilityError = true;
|
||||
return;
|
||||
}
|
||||
|
||||
WzHeaderDto wzHeader = new WzHeaderDto
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
FK_Client = _selectedClient?.ID,
|
||||
CreatedDate = DateTime.Now,
|
||||
WzNumbers = wzNumbers
|
||||
};
|
||||
|
||||
await WarehouseService.CreateWzHeaderAsync(wzHeader);
|
||||
|
||||
switch (_selectedClient?.ShortName.ToUpper())
|
||||
{
|
||||
case "MEYLE":
|
||||
IList<WzRowMeyleDto> meyleRows = new List<WzRowMeyleDto>();
|
||||
IList<MaterialTransactionDto> meyleMaterialTransactions = _materialTransactions.Where(x => selectedRecords.Any(y => y.MTGroupNum == x.MTGroupNum)).ToList();
|
||||
|
||||
foreach (MaterialTransactionDto materialTransactionDto in meyleMaterialTransactions)
|
||||
{
|
||||
CustomerOrderDto customerOrder = await WarehouseService.GetCustomerOrder(materialTransactionDto.RefNum ?? string.Empty);
|
||||
ItemCustDto item = await WarehouseService.GetItem(materialTransactionDto.Item ?? string.Empty, customerOrder.CustNum);
|
||||
|
||||
meyleRows.Add(new WzRowMeyleDto
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
Quantity = Math.Abs((int?)materialTransactionDto.Qty ?? 0),
|
||||
ItemNumber = item.CustItem,
|
||||
OrderNumber = customerOrder.CustPo,
|
||||
WzNumber = materialTransactionDto.MTGroupNum ?? string.Empty,
|
||||
FK_Header = wzHeader.ID,
|
||||
TransactionNumber = (int?)materialTransactionDto.TransNum ?? 0,
|
||||
PartNumberSl = materialTransactionDto.NR_KARTY_KONTROLNEJ,
|
||||
FaIndex = item.Item
|
||||
});
|
||||
}
|
||||
|
||||
await WarehouseService.CreateWzRowsMeyleAsync(meyleRows);
|
||||
|
||||
NavigationManager.NavigateTo("/Warehouse/Meyle/PackList/" + wzHeader.ID);
|
||||
|
||||
break;
|
||||
case "MARELLI":
|
||||
IList<WzRowMarelliDto> marelliRows = new List<WzRowMarelliDto>();
|
||||
IList<MaterialTransactionDto> marelliMaterialTransactions = _materialTransactions.Where(x => selectedRecords.Any(y => y.MTGroupNum == x.MTGroupNum)).ToList();
|
||||
|
||||
foreach (MaterialTransactionDto materialTransactionDto in marelliMaterialTransactions)
|
||||
{
|
||||
CustomerOrderDto customerOrder = await WarehouseService.GetCustomerOrder(materialTransactionDto.RefNum ?? string.Empty);
|
||||
ItemCustDto item = await WarehouseService.GetItem(materialTransactionDto.Item ?? string.Empty, customerOrder.CustNum);
|
||||
|
||||
marelliRows.Add(new WzRowMarelliDto
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
Quantity = Math.Abs((int?)materialTransactionDto.Qty ?? 0),
|
||||
ItemNumber = item.CustItem,
|
||||
OrderNumber = customerOrder.CustPo,
|
||||
WzNumber = materialTransactionDto.MTGroupNum ?? string.Empty,
|
||||
FKHeader = wzHeader.ID,
|
||||
TransactionNumber = (int?)materialTransactionDto.TransNum ?? 0,
|
||||
Type = "MIX",
|
||||
FaIndex = item.Item,
|
||||
EngineerNumber = item.Uf_FKR_CustItem2
|
||||
});
|
||||
}
|
||||
|
||||
await WarehouseService.CreateWzRowsMarelliAsync(marelliRows);
|
||||
|
||||
NavigationManager.NavigateTo("/Warehouse/Marelli/PackList/" + wzHeader.ID);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void HideModal()
|
||||
{
|
||||
Visibility = false;
|
||||
VisibilityError = false;
|
||||
}
|
||||
}
|
||||
29
OrdersManagement/Models/RowMeyleModel.cs
Normal file
29
OrdersManagement/Models/RowMeyleModel.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace OrdersManagement.Models;
|
||||
|
||||
public class RowMeyleModel : IEquatable<RowMeyleModel>
|
||||
{
|
||||
public string ItemNumber {get; set;} = string.Empty;
|
||||
public string WzNumber { get; set; } = string.Empty;
|
||||
public string? PartNumberSl { get; set; }
|
||||
public int? TransactionNumber { get; set; }
|
||||
|
||||
public bool Equals(RowMeyleModel? other)
|
||||
{
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return ItemNumber == other.ItemNumber && WzNumber == other.WzNumber && PartNumberSl == other.PartNumberSl && TransactionNumber == other.TransactionNumber;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((RowMeyleModel)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(ItemNumber, WzNumber, PartNumberSl, TransactionNumber);
|
||||
}
|
||||
}
|
||||
29
OrdersManagement/Models/TransactionModel.cs
Normal file
29
OrdersManagement/Models/TransactionModel.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace OrdersManagement.Models;
|
||||
|
||||
public class TransactionModel : IEquatable<TransactionModel>
|
||||
{
|
||||
public string? PartNumber { get; set; }
|
||||
public string? ItemNumber { get; set; }
|
||||
public decimal? Quantity { get; set; }
|
||||
|
||||
|
||||
public bool Equals(TransactionModel? other)
|
||||
{
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return PartNumber == other.PartNumber;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((TransactionModel)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return PartNumber.GetHashCode();
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ProjectType>Blazor</ProjectType>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
@@ -9,9 +10,11 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BCrypt.Net-Core" Version="1.6.0" />
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
|
||||
<PackageReference Include="FaKrosnoEfDataModel" Version="2.0.1-alpha.0.65" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.6.1" />
|
||||
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.6.1" />
|
||||
<PackageReference Include="OrdersManagementDataModel" Version="2.0.0-alpha.0" />
|
||||
<PackageReference Include="Syncfusion.Blazor.Buttons" Version="28.2.3" />
|
||||
<PackageReference Include="Syncfusion.Blazor.Cards" Version="28.2.3" />
|
||||
<PackageReference Include="Syncfusion.Blazor.Core" Version="28.2.3" />
|
||||
@@ -20,12 +23,7 @@
|
||||
<PackageReference Include="Syncfusion.Blazor.SplitButtons" Version="28.2.3" />
|
||||
<PackageReference Include="Syncfusion.Blazor.Themes" Version="28.2.3" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.6.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FaKrosnoEfDataModel\FaKrosnoEfDataModel.csproj" />
|
||||
<ProjectReference Include="..\OrdersManagementDataModel\OrdersManagementDataModel.csproj" />
|
||||
<ProjectReference Include="..\SytelineSaAppEfDataModel\SytelineSaAppEfDataModel.csproj" />
|
||||
<PackageReference Include="SytelineSaAppEfDataModel" Version="2.0.1-alpha.0.65" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -52,6 +52,7 @@ builder.Services.AddScoped<FunctionService>();
|
||||
builder.Services.AddScoped<UserService>();
|
||||
builder.Services.AddScoped<ErrorLogService>();
|
||||
builder.Services.AddScoped<ProductService>();
|
||||
builder.Services.AddScoped<WarehouseService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
@@ -28,4 +28,10 @@ public class HangfireService(
|
||||
HttpResponseMessage responseMessage = await PostAsJsonAsync("api/HangfireJobs/delete", taskSchedulerDto);
|
||||
return responseMessage.IsSuccessStatusCode ? 1 : 0;
|
||||
}
|
||||
|
||||
public async Task<int> UpdateTaskSchedulerAsync(TaskSchedulerDto taskSchedulerDto)
|
||||
{
|
||||
HttpResponseMessage responseMessage = await PostAsJsonAsync("api/HangfireJobs/update", taskSchedulerDto);
|
||||
return responseMessage.IsSuccessStatusCode ? 1 : 0;
|
||||
}
|
||||
}
|
||||
187
OrdersManagement/Services/WarehouseService.cs
Normal file
187
OrdersManagement/Services/WarehouseService.cs
Normal file
@@ -0,0 +1,187 @@
|
||||
using System.Net;
|
||||
using System.Web;
|
||||
using OrdersManagement.Models;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace OrdersManagement.Services;
|
||||
|
||||
public class WarehouseService(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
private readonly HttpClient _httpClient = httpClientFactory.CreateClient("FaKrosnoApi");
|
||||
|
||||
public async Task<WzHeaderDto> GetWzHeaderByIdAsync(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzHeader/by-id?id={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<WzHeaderDto>();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WzClientDto>> GetAllClientsAsync()
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzClient");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<IEnumerable<WzClientDto>>();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<MaterialTransactionDto>> GetAllClientWzsAsync(string customerNumber, int customerSequence)
|
||||
{
|
||||
var response = await _httpClient.GetAsync(
|
||||
$"api/WzHeader/by-customer-number?customerNumber={customerNumber}&customerSequence={customerSequence}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<IEnumerable<MaterialTransactionDto>>();
|
||||
}
|
||||
|
||||
public async Task<MaterialTransactionDto?> GetMaterialTransactionByPartNumberAsync(string partNumber)
|
||||
{
|
||||
string encodedPartNumber = HttpUtility.UrlEncode(partNumber);
|
||||
var response = await _httpClient.GetAsync(
|
||||
$"api/WzRowMeyle/by-part-number?partNumber={encodedPartNumber}").ConfigureAwait(false);;
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.NoContent)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return await response.Content.ReadFromJsonAsync<MaterialTransactionDto>().ConfigureAwait(false);;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WzHeaderDto>> GetAllClientWzHeadersAsync(string customerNumber, int customerSequence)
|
||||
{
|
||||
var response = await _httpClient.GetAsync(
|
||||
$"api/WzHeader/all-wz-headers?customerNumber={customerNumber}&customerSequence={customerSequence}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<IEnumerable<WzHeaderDto>>();
|
||||
}
|
||||
|
||||
public async Task CreateWzHeaderAsync(WzHeaderDto wzHeader)
|
||||
{
|
||||
var response = await _httpClient.PostAsJsonAsync("api/WzHeader", wzHeader);
|
||||
response.EnsureSuccessStatusCode();
|
||||
if (response.StatusCode != System.Net.HttpStatusCode.Created)
|
||||
{
|
||||
throw new Exception("Failed to create WzHeader");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task CreateWzRowsMeyleAsync(IEnumerable<WzRowMeyleDto> wzRowsMeyle)
|
||||
{
|
||||
if (wzRowsMeyle == null || !wzRowsMeyle.Any())
|
||||
{
|
||||
throw new ArgumentException("No rows provided to create.");
|
||||
}
|
||||
|
||||
var response = await _httpClient.PostAsJsonAsync("api/WzRowMeyle", wzRowsMeyle);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
var errorContent = await response.Content.ReadAsStringAsync();
|
||||
throw new HttpRequestException($"Failed to create WzRowMeyle: {response.StatusCode}, Content: {errorContent}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task CreateWzRowsMarelliAsync(IEnumerable<WzRowMarelliDto> wzRowsMarelli)
|
||||
{
|
||||
if (wzRowsMarelli == null || !wzRowsMarelli.Any())
|
||||
{
|
||||
throw new ArgumentException("No rows provided to create.");
|
||||
}
|
||||
|
||||
var response = await _httpClient.PostAsJsonAsync("api/WzRowMarelli", wzRowsMarelli);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
var errorContent = await response.Content.ReadAsStringAsync();
|
||||
throw new HttpRequestException($"Failed to create WzRowMarelli: {response.StatusCode}, Content: {errorContent}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<CustomerOrderDto> GetCustomerOrder(string customerOrderNumber)
|
||||
{
|
||||
var response = await _httpClient.GetAsync(
|
||||
$"api/CustomerOrders/by-co-number/?customerOrderNumber={customerOrderNumber}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<CustomerOrderDto>();
|
||||
}
|
||||
|
||||
public async Task<ItemCustDto> GetItem(string itemNumber, string customerNumber)
|
||||
{
|
||||
var response = await _httpClient.GetAsync(
|
||||
$"api/ItemCust?itemNumber={itemNumber}&customerNumber={customerNumber}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<ItemCustDto>();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WzRowMeyleDto>> GetWzRowsMeyleByWzHeaderId(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzRowMeyle/by-wz-header-id?wzHeaderId={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<IEnumerable<WzRowMeyleDto>>();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WzRowMarelliDto>> GetWzRowsMarelliByWzHeaderId(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzRowMarelli/by-wz-header-id?wzHeaderId={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadFromJsonAsync<IEnumerable<WzRowMarelliDto>>();
|
||||
}
|
||||
|
||||
public async Task<IDictionary<string, List<TransactionModel>>> GetTransactionsModels()
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/WzRowMeyle/transactions-with-part-number");
|
||||
response.EnsureSuccessStatusCode();
|
||||
IEnumerable<MaterialTransactionDto> materialTransactions =
|
||||
await response.Content.ReadFromJsonAsync<IEnumerable<MaterialTransactionDto>>();
|
||||
|
||||
return materialTransactions.GroupBy(x => x.NR_KARTY_KONTROLNEJ).ToDictionary(x => x.Key ?? "",
|
||||
y => y.Select(z => new TransactionModel() { ItemNumber = z.Item, PartNumber = z.NR_KARTY_KONTROLNEJ, Quantity = z.Qty }).ToList());
|
||||
}
|
||||
|
||||
public async Task UpdateWzRowsMeyleAsync(IEnumerable<WzRowMeyleDto?> wzRowsMeyle)
|
||||
{
|
||||
if (wzRowsMeyle == null || !wzRowsMeyle.Any())
|
||||
{
|
||||
throw new ArgumentException("No rows provided to update.");
|
||||
}
|
||||
|
||||
var response = await _httpClient.PutAsJsonAsync("api/WzRowMeyle", wzRowsMeyle);
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
public async Task UpdateWzRowsMarelliAsync(IEnumerable<WzRowMarelliDto?> wzRowsMarelli)
|
||||
{
|
||||
if (wzRowsMarelli == null || !wzRowsMarelli.Any())
|
||||
{
|
||||
throw new ArgumentException("No rows provided to update.");
|
||||
}
|
||||
|
||||
var response = await _httpClient.PutAsJsonAsync("api/WzRowMarelli", wzRowsMarelli);
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
public async Task GenerateXlsForMeyleAsync(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/ExcelGenerator/generate-meyle?packListId={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
throw new Exception("Failed to generate XLS for Mayle");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task GenerateXlsForMarelliAsync(Guid wzHeaderId)
|
||||
{
|
||||
var response = await _httpClient.GetAsync($"api/ExcelGenerator/generate-marelli?packListId={wzHeaderId}");
|
||||
response.EnsureSuccessStatusCode();
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
throw new Exception("Failed to generate XLS for Marelli");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task AddEmailsToWzHeaderAsync(Guid wzHeaderId, string? emailAddresses)
|
||||
{
|
||||
var response = await _httpClient.PostAsJsonAsync(
|
||||
$"api/WzHeader/add-emails?id={wzHeaderId}",
|
||||
emailAddresses);
|
||||
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,16 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ProjectType>DataModel</ProjectType>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<PackageId>OrdersManagementDataModel</PackageId>
|
||||
<Authors>Piotr Kus</Authors>
|
||||
<Description>OrdersManagement Entity Framework Data Model</Description>
|
||||
<MinVerAutoIncrement>patch</MinVerAutoIncrement>
|
||||
<MinVerMinimumMajorMinor>1.0</MinVerMinimumMajorMinor>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
132
SytelineSaAppEfDataModel/Dtos/CustomerDto.cs
Normal file
132
SytelineSaAppEfDataModel/Dtos/CustomerDto.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class CustomerDto : DtoBase
|
||||
{
|
||||
public string CustNum { get; set; }
|
||||
public int CustSeq { get; set; }
|
||||
public string? Contact1 { get; set; }
|
||||
public string? Contact2 { get; set; }
|
||||
public string? Contact3 { get; set; }
|
||||
public string Phone1 { get; set; }
|
||||
public string Phone2 { get; set; }
|
||||
public string Phone3 { get; set; }
|
||||
public string CustType { get; set; }
|
||||
public string TermsCode { get; set; }
|
||||
public string ShipCode { get; set; }
|
||||
public string Slsman { get; set; }
|
||||
public string StateCycle { get; set; }
|
||||
public bool FinChg { get; set; }
|
||||
public DateTime? LastInv { get; set; }
|
||||
public DateTime? LastPaid { get; set; }
|
||||
public decimal? SalesYtd { get; set; }
|
||||
public decimal? SalesLstYr { get; set; }
|
||||
public decimal? DiscYtd { get; set; }
|
||||
public decimal? DiscLstYr { get; set; }
|
||||
public DateTime? LastFinChg { get; set; }
|
||||
public decimal? SalesPtd { get; set; }
|
||||
public DateTime? CalcDate { get; set; }
|
||||
public short? NumPeriods { get; set; }
|
||||
public short? AvgDaysOs { get; set; }
|
||||
public int? NumInvoices { get; set; }
|
||||
public int? HistDaysOs { get; set; }
|
||||
public int? LargDaysOs { get; set; }
|
||||
public short? LastDaysOs { get; set; }
|
||||
public decimal? AvgBalOs { get; set; }
|
||||
public decimal? LargeBalOs { get; set; }
|
||||
public decimal? LastBalOs { get; set; }
|
||||
public string? Whse { get; set; }
|
||||
public string Charfld1 { get; set; }
|
||||
public string Charfld2 { get; set; }
|
||||
public string Charfld3 { get; set; }
|
||||
public decimal? Decifld1 { get; set; }
|
||||
public decimal? Decifld2 { get; set; }
|
||||
public decimal? Decifld3 { get; set; }
|
||||
public bool Logifld { get; set; }
|
||||
public DateTime? Datefld { get; set; }
|
||||
public string TaxRegNum1 { get; set; }
|
||||
public string BankCode { get; set; }
|
||||
public string TaxRegNum2 { get; set; }
|
||||
public string PayType { get; set; }
|
||||
public bool EdiCust { get; set; }
|
||||
public string BranchId { get; set; }
|
||||
public string TransNat { get; set; }
|
||||
public string Delterm { get; set; }
|
||||
public string ProcessInd { get; set; }
|
||||
public bool UseExchRate { get; set; }
|
||||
public string TaxCode1 { get; set; }
|
||||
public string TaxCode2 { get; set; }
|
||||
public string Pricecode { get; set; }
|
||||
public bool ShipEarly { get; set; }
|
||||
public bool ShipPartial { get; set; }
|
||||
public string LangCode { get; set; }
|
||||
public string EndUserType { get; set; }
|
||||
public string ShipSite { get; set; }
|
||||
public bool LcrReqd { get; set; }
|
||||
public string CustBank { get; set; }
|
||||
public bool DraftPrintFlag { get; set; }
|
||||
public bool RcvInternalEmail { get; set; }
|
||||
public string CustomerEmailAddr { get; set; }
|
||||
public bool SendCustomerEmail { get; set; }
|
||||
public bool ApsPullUp { get; set; }
|
||||
public string DoInvoice { get; set; }
|
||||
public bool Consolidate { get; set; }
|
||||
public string InvFreq { get; set; }
|
||||
public bool Summarize { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public bool Einvoice { get; set; }
|
||||
public decimal? OrderBal { get; set; }
|
||||
public decimal? PostedBal { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public string CrmGuid { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool PrintPackInv { get; set; }
|
||||
public bool OnePackInv { get; set; }
|
||||
public string InvCategory { get; set; }
|
||||
public bool IncludeTaxInPrice { get; set; }
|
||||
public string TransNat2 { get; set; }
|
||||
public bool UseRevisionPayDays { get; set; }
|
||||
public int? RevisionDay { get; set; }
|
||||
public TimeSpan? RevisionDayStartTime1 { get; set; }
|
||||
public TimeSpan? RevisionDayStartTime2 { get; set; }
|
||||
public TimeSpan? RevisionDayEndTime1 { get; set; }
|
||||
public TimeSpan? RevisionDayEndTime2 { get; set; }
|
||||
public int? PayDay { get; set; }
|
||||
public TimeSpan? PayDayStartTime1 { get; set; }
|
||||
public TimeSpan? PayDayStartTime2 { get; set; }
|
||||
public TimeSpan? PayDayEndTime1 { get; set; }
|
||||
public TimeSpan? PayDayEndTime2 { get; set; }
|
||||
public string ExportType { get; set; }
|
||||
public bool ActiveForDataIntegration { get; set; }
|
||||
public bool ShowInShipToDropDownList { get; set; }
|
||||
public bool ShowInDropDownList { get; set; }
|
||||
public string SicCode { get; set; }
|
||||
public int? NumberOfEmployees { get; set; }
|
||||
public decimal? CompanyRevenue { get; set; }
|
||||
public string TerritoryCode { get; set; }
|
||||
public string SalesTeamId { get; set; }
|
||||
public short? DaysShippedBeforeDueDateTolerance { get; set; }
|
||||
public short? DaysShippedAfterDueDateTolerance { get; set; }
|
||||
public decimal? ShippedOverOrderedQtyTolerance { get; set; }
|
||||
public decimal? ShippedUnderOrderedQtyTolerance { get; set; }
|
||||
public int DefaultShipTo { get; set; }
|
||||
public bool IncludeOrdersInTaxRpt { get; set; }
|
||||
public decimal? ConstructiveSalePricePct { get; set; }
|
||||
public string Uf_ZPL_FedId { get; set; }
|
||||
public string Uf_ZPL_VATRegisterCode { get; set; }
|
||||
public int? Uf_INT_CustSeq { get; set; }
|
||||
public bool Uf_INT_Replicate { get; set; }
|
||||
public int? Uf_FKR_FA_SL_SYKOF { get; set; }
|
||||
public bool? Uf_FKR_FA_Eksport_SYKOF { get; set; }
|
||||
public string Uf_FKR_FA_Kod_Dostawcy_u_Klienta { get; set; }
|
||||
public string Uf_FKR_FA_Rampa { get; set; }
|
||||
public string Uf_FKR_FA_Zaklad_Przeznaczenia { get; set; }
|
||||
public char? Uf_FKR_Customer_Status { get; set; }
|
||||
public bool? Uf_bpx_customer_printbatch { get; set; }
|
||||
public string Uf_cust_receiver_line1 { get; set; }
|
||||
public string Uf_cust_receiver_line2 { get; set; }
|
||||
public int? Uf_cust_supplier_no { get; set; }
|
||||
}
|
||||
41
SytelineSaAppEfDataModel/Dtos/CustomerTpDto.cs
Normal file
41
SytelineSaAppEfDataModel/Dtos/CustomerTpDto.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class CustomerTpDto
|
||||
{
|
||||
public string CustNum { get; set; }
|
||||
public int CustSeq { get; set; }
|
||||
public bool UpdCustAddress { get; set; }
|
||||
public string TpCode { get; set; }
|
||||
public string DunsNum { get; set; }
|
||||
public bool GenAck { get; set; }
|
||||
public bool PaperAck { get; set; }
|
||||
public bool GenAsn { get; set; }
|
||||
public bool PaperAsn { get; set; }
|
||||
public bool GenInv { get; set; }
|
||||
public bool PaperInv { get; set; }
|
||||
public string AutoPost { get; set; }
|
||||
public bool PostPlanned { get; set; }
|
||||
public string ReleaseProc { get; set; }
|
||||
public bool PooledAsn { get; set; }
|
||||
public bool ValPrice { get; set; }
|
||||
public string UsePrice { get; set; }
|
||||
public bool ValCredit { get; set; }
|
||||
public string NoteProc { get; set; }
|
||||
public string UseDate { get; set; }
|
||||
public short? DateOffset { get; set; }
|
||||
public string InvCode { get; set; }
|
||||
public string AckCode { get; set; }
|
||||
public string AsnCode { get; set; }
|
||||
public DateTime? LastItemDate { get; set; }
|
||||
public DateTime? LastCustaDate { get; set; }
|
||||
public bool IncludeSerial { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public string Uf_FKR_EDI_RSSBussFolder { get; set; }
|
||||
public string Uf_FKR_EDI_IdentificationCode { get; set; }
|
||||
}
|
||||
@@ -3,13 +3,14 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper.Configuration.Annotations;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Dtos
|
||||
{
|
||||
public class EdiCustomerOrderDto : DtoBase
|
||||
{
|
||||
public string TransactionCode { get; set; }
|
||||
public string TpCode { get; set; }
|
||||
public string? TransactionCode { get; set; }
|
||||
public string? TpCode { get; set; }
|
||||
public DateTime? RecivedDate { get; set; }
|
||||
public byte? Posted { get; set; }
|
||||
public DateTime? PostedDate { get; set; }
|
||||
@@ -17,24 +18,24 @@ namespace SytelineSaAppEfDataModel.Dtos
|
||||
public short? ErrorMessage { get; set; }
|
||||
public byte? Override { get; set; }
|
||||
public byte? Ack { get; set; }
|
||||
public string AckNumber { get; set; }
|
||||
public string? AckNumber { get; set; }
|
||||
public int? AckSequence { get; set; }
|
||||
public string AckType { get; set; }
|
||||
public string? AckType { get; set; }
|
||||
public DateTime? AckDate { get; set; }
|
||||
public string SymbolicCustomerOrderNumber { get; set; }
|
||||
public string? SymbolicCustomerOrderNumber { get; set; }
|
||||
public decimal? BlanketDollar { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string CustomerOrderNumber { get; set; }
|
||||
public string EstimatedNumber { get; set; }
|
||||
public string CustomerNumber { get; set; }
|
||||
public string? Type { get; set; }
|
||||
public string? CustomerOrderNumber { get; set; }
|
||||
public string? EstimatedNumber { get; set; }
|
||||
public string? CustomerNumber { get; set; }
|
||||
public int? CustomerSequence { get; set; }
|
||||
public string Contact { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public string CustomerPoNumber { get; set; }
|
||||
public string? Contact { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? CustomerPoNumber { get; set; }
|
||||
public DateTime? OrderDate { get; set; }
|
||||
public string TakenBy { get; set; }
|
||||
public string TermsCode { get; set; }
|
||||
public string ShipCode { get; set; }
|
||||
public string? TakenBy { get; set; }
|
||||
public string? TermsCode { get; set; }
|
||||
public string? ShipCode { get; set; }
|
||||
public decimal? Price { get; set; }
|
||||
public decimal? Weight { get; set; }
|
||||
public short? QtyPackages { get; set; }
|
||||
@@ -42,69 +43,71 @@ namespace SytelineSaAppEfDataModel.Dtos
|
||||
public decimal? MiscCharges { get; set; }
|
||||
public decimal? PrepaidAmount { get; set; }
|
||||
public decimal? SalesTax { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public decimal? Cost { get; set; }
|
||||
public DateTime? CloseDate { get; set; }
|
||||
public decimal? FreightT { get; set; }
|
||||
public decimal? MchargesT { get; set; }
|
||||
public decimal? PrepaidT { get; set; }
|
||||
public decimal? SalesTaxT { get; set; }
|
||||
public string Salesman { get; set; }
|
||||
public string? Salesman { get; set; }
|
||||
public DateTime? EffectiveDate { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public string Warehouse { get; set; }
|
||||
public string? Warehouse { get; set; }
|
||||
public decimal? SalesTaxTwo { get; set; }
|
||||
public decimal? SalesTaxTwoT { get; set; }
|
||||
public string CharFieldOne { get; set; }
|
||||
public string CharFieldTwo { get; set; }
|
||||
public string CharFieldThree { get; set; }
|
||||
public string? CharFieldOne { get; set; }
|
||||
public string? CharFieldTwo { get; set; }
|
||||
public string? CharFieldThree { get; set; }
|
||||
public DateTime? DateField { get; set; }
|
||||
public decimal? DecimalFieldOne { get; set; }
|
||||
public decimal? DecimalFieldTwo { get; set; }
|
||||
public decimal? DecimalFieldThree { get; set; }
|
||||
public byte? LogiField { get; set; }
|
||||
public byte? EdiOrder { get; set; }
|
||||
public string TransactionNat { get; set; }
|
||||
public string ProcessInd { get; set; }
|
||||
public string DelTerm { get; set; }
|
||||
public string? TransactionNat { get; set; }
|
||||
public string? ProcessInd { get; set; }
|
||||
public string? DelTerm { get; set; }
|
||||
public byte? UseExchangeRate { get; set; }
|
||||
public string TaxCodeOne { get; set; }
|
||||
public string TaxCodeTwo { get; set; }
|
||||
public string FreightTaxCodeOne { get; set; }
|
||||
public string FreightTaxCodeTwo { get; set; }
|
||||
public string MscTaxCodeOne { get; set; }
|
||||
public string MscTaxCodeTwo { get; set; }
|
||||
public string? TaxCodeOne { get; set; }
|
||||
public string? TaxCodeTwo { get; set; }
|
||||
public string? FreightTaxCodeOne { get; set; }
|
||||
public string? FreightTaxCodeTwo { get; set; }
|
||||
public string? MscTaxCodeOne { get; set; }
|
||||
public string? MscTaxCodeTwo { get; set; }
|
||||
public decimal? Discount { get; set; }
|
||||
public string PriceCode { get; set; }
|
||||
public string? PriceCode { get; set; }
|
||||
public byte? ShipPartial { get; set; }
|
||||
public byte? ShipEarly { get; set; }
|
||||
public string NonApplyData { get; set; }
|
||||
public string? NonApplyData { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public string DiscountType { get; set; }
|
||||
public string? DiscountType { get; set; }
|
||||
public decimal? DiscountAmount { get; set; }
|
||||
public string TransNatTwo { get; set; }
|
||||
public string UfFkrEdiMessageRefNum { get; set; }
|
||||
public string UfFkrEdiConsigneeAddress { get; set; }
|
||||
public string UfFkrEdiConsigneeName { get; set; }
|
||||
public string UfFkrEdiFileName { get; set; }
|
||||
public string UfFkrEdiBuyerDunsNumber { get; set; }
|
||||
public string Gate { get; set; }
|
||||
public string CustomerName { get; set; }
|
||||
public string RecipientCode { get; set; }
|
||||
public string SenderCode { get; set; }
|
||||
public string SellerCode { get; set; }
|
||||
public string DocType { get; set; }
|
||||
public string BuyerCode { get; set; }
|
||||
public string? TransNatTwo { get; set; }
|
||||
public string? UfFkrEdiMessageRefNum { get; set; }
|
||||
public string? UfFkrEdiConsigneeAddress { get; set; }
|
||||
public string? UfFkrEdiConsigneeName { get; set; }
|
||||
public string? UfFkrEdiFileName { get; set; }
|
||||
public string? UfFkrEdiBuyerDunsNumber { get; set; }
|
||||
public string? Gate { get; set; }
|
||||
public string? CustomerName { get; set; }
|
||||
public string? RecipientCode { get; set; }
|
||||
public string? SenderCode { get; set; }
|
||||
public string? SellerCode { get; set; }
|
||||
public string? DocType { get; set; }
|
||||
public string? BuyerCode { get; set; }
|
||||
|
||||
public string TranslatedStatus => TranslateStatus(Status);
|
||||
public string TranslatedStatus => TranslateStatus(Status ?? string.Empty);
|
||||
public string? SlOrderNumber => EdiCustomerOrderTranslates.MaxBy(x => x.CreatedDate)?.CoCoNum;
|
||||
public string SentToSl => Posted == 1 ? "TAK" : "NIE";
|
||||
[Ignore] public int ScheduleOrderId { get; set; }
|
||||
[Ignore] public DateTime LastUpdateDate { get; set; }
|
||||
|
||||
public IEnumerable<EdiCustomerOrderLineDto> EdiCustomerOrderLines { get; set; } = new List<EdiCustomerOrderLineDto>();
|
||||
public IEnumerable<EdiCustomerOrderTranslateDto> EdiCustomerOrderTranslates { get; set; } = new List<EdiCustomerOrderTranslateDto>();
|
||||
|
||||
12
SytelineSaAppEfDataModel/Dtos/EdiCustomerOrderImportDto.cs
Normal file
12
SytelineSaAppEfDataModel/Dtos/EdiCustomerOrderImportDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class EdiCustomerOrderImportDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ScheduleOrderId { get; set; }
|
||||
public DateTime LastUpdateDate { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public string? LogData { get; set; }
|
||||
public int ItemsCount { get; set; }
|
||||
}
|
||||
@@ -3,44 +3,47 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper.Configuration.Annotations;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Dtos
|
||||
{
|
||||
public class EdiCustomerOrderLineDto : DtoBase
|
||||
{
|
||||
public string CustomerOrderNumber { get; set; }
|
||||
public string? CustomerOrderNumber { get; set; }
|
||||
public int CustomerOrderLine { get; set; }
|
||||
public string Item { get; set; }
|
||||
public string CustomerItemNumber { get; set; }
|
||||
public string FeatStr { get; set; }
|
||||
public string? Item { get; set; }
|
||||
public string? CustomerItemNumber { get; set; }
|
||||
public string? FeatStr { get; set; }
|
||||
public decimal? BlanketQty { get; set; }
|
||||
public DateTime? EffectiveDate { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public decimal? ContPrice { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public DateTime? PromiseDate { get; set; }
|
||||
public string PriceCode { get; set; }
|
||||
public string Uom { get; set; }
|
||||
public string? PriceCode { get; set; }
|
||||
public string? Uom { get; set; }
|
||||
public decimal? BlanketQtyReleased { get; set; }
|
||||
public decimal? ContPriceReleased { get; set; }
|
||||
public decimal? QtySent { get; set; }
|
||||
public string SentCode { get; set; }
|
||||
public string NonAppliedData { get; set; }
|
||||
public string? SentCode { get; set; }
|
||||
public string? NonAppliedData { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public DateTime? CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public string BoxType { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string FinalDestination { get; set; }
|
||||
public string? BoxType { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? FinalDestination { get; set; }
|
||||
public int? QtyPerBox { get; set; }
|
||||
|
||||
public string TranslatedStatus => TranslateStatus(Status);
|
||||
|
||||
[Ignore] public string VatCode { get; set; }
|
||||
|
||||
public IEnumerable<EdiCustomerOrderLineItemDto> EdiCustomerOrderLineItems { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace SytelineSaAppEfDataModel.Dtos
|
||||
{
|
||||
public class EdiCustomerOrderLineItemDto : DtoBase
|
||||
{
|
||||
public string TransactionCode { get; set; }
|
||||
public string? TransactionCode { get; set; }
|
||||
public DateTime? ReceivedDate { get; set; }
|
||||
public byte? Posted { get; set; }
|
||||
public DateTime? PostedDate { get; set; }
|
||||
@@ -17,17 +17,17 @@ namespace SytelineSaAppEfDataModel.Dtos
|
||||
public byte? Override { get; set; }
|
||||
public byte? Edi { get; set; }
|
||||
public byte? Ack { get; set; }
|
||||
public string AckNumber { get; set; }
|
||||
public string AckType { get; set; }
|
||||
public string? AckNumber { get; set; }
|
||||
public string? AckType { get; set; }
|
||||
public DateTime? AckDate { get; set; }
|
||||
public string SymCustomerOrderNumber { get; set; }
|
||||
public string? SymCustomerOrderNumber { get; set; }
|
||||
public byte? QtyChanged { get; set; }
|
||||
public byte? DateChanged { get; set; }
|
||||
public byte? PriceChanged { get; set; }
|
||||
public string CustomerOrderNumber { get; set; }
|
||||
public string? CustomerOrderNumber { get; set; }
|
||||
public int CustomerOrderLine { get; set; }
|
||||
public int CustomerOrderRelease { get; set; }
|
||||
public string Item { get; set; }
|
||||
public string? Item { get; set; }
|
||||
public decimal? QtyOrdered { get; set; }
|
||||
public decimal? QtyReady { get; set; }
|
||||
public decimal? QtyShipped { get; set; }
|
||||
@@ -35,8 +35,8 @@ namespace SytelineSaAppEfDataModel.Dtos
|
||||
public decimal? Discount { get; set; }
|
||||
public decimal? Cost { get; set; }
|
||||
public decimal? Price { get; set; }
|
||||
public string RefType { get; set; }
|
||||
public string RefNumber { get; set; }
|
||||
public string? RefType { get; set; }
|
||||
public string? RefNumber { get; set; }
|
||||
public short? RefLineSuf { get; set; }
|
||||
public short? RefRelease { get; set; }
|
||||
public DateTime? DueDate { get; set; }
|
||||
@@ -47,68 +47,68 @@ namespace SytelineSaAppEfDataModel.Dtos
|
||||
public decimal? BrkQtyFour { get; set; }
|
||||
public decimal? BrkQtyFive { get; set; }
|
||||
public byte? Reprice { get; set; }
|
||||
public string CustomerItem { get; set; }
|
||||
public string? CustomerItem { get; set; }
|
||||
public decimal? QtyInvoiced { get; set; }
|
||||
public decimal? QtyReturned { get; set; }
|
||||
public decimal? CgsTotal { get; set; }
|
||||
public string FeatStr { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string CustomerNumber { get; set; }
|
||||
public string? FeatStr { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public string? CustomerNumber { get; set; }
|
||||
public int? CustomerSequence { get; set; }
|
||||
public decimal? PrgBillTot { get; set; }
|
||||
public decimal? PrgBillApp { get; set; }
|
||||
public DateTime? ReleaseDate { get; set; }
|
||||
public DateTime? PromiseDate { get; set; }
|
||||
public string Warehouse { get; set; }
|
||||
public string WksBasis { get; set; }
|
||||
public string? Warehouse { get; set; }
|
||||
public string? WksBasis { get; set; }
|
||||
public decimal? WksValue { get; set; }
|
||||
public string CommCode { get; set; }
|
||||
public string TransNat { get; set; }
|
||||
public string ProcessInd { get; set; }
|
||||
public string DelTerm { get; set; }
|
||||
public string? CommCode { get; set; }
|
||||
public string? TransNat { get; set; }
|
||||
public string? ProcessInd { get; set; }
|
||||
public string? DelTerm { get; set; }
|
||||
public decimal? UnitWeight { get; set; }
|
||||
public string Origin { get; set; }
|
||||
public string? Origin { get; set; }
|
||||
public int? ConsNumber { get; set; }
|
||||
public string TaxCodeOne { get; set; }
|
||||
public string TaxCodeTwo { get; set; }
|
||||
public string? TaxCodeOne { get; set; }
|
||||
public string? TaxCodeTwo { get; set; }
|
||||
public decimal? ExportValue { get; set; }
|
||||
public string EcCode { get; set; }
|
||||
public string Transport { get; set; }
|
||||
public string? EcCode { get; set; }
|
||||
public string? Transport { get; set; }
|
||||
public DateTime? PickupDate { get; set; }
|
||||
public string PriceCode { get; set; }
|
||||
public string Uom { get; set; }
|
||||
public string? PriceCode { get; set; }
|
||||
public string? Uom { get; set; }
|
||||
public decimal? QtyOrderedReleased { get; set; }
|
||||
public decimal? PriceReleased { get; set; }
|
||||
public string CustomerOrderCustomerNumber { get; set; }
|
||||
public string? CustomerOrderCustomerNumber { get; set; }
|
||||
public byte? Packed { get; set; }
|
||||
public byte? Bol { get; set; }
|
||||
public decimal? QtyBco { get; set; }
|
||||
public string BcoCode { get; set; }
|
||||
public string ExternalRef { get; set; }
|
||||
public string CustomerPoNumber { get; set; }
|
||||
public string NonApplyData { get; set; }
|
||||
public string? BcoCode { get; set; }
|
||||
public string? ExternalRef { get; set; }
|
||||
public string? CustomerPoNumber { get; set; }
|
||||
public string? NonApplyData { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public string TransNatTwo { get; set; }
|
||||
public string? TransNatTwo { get; set; }
|
||||
public decimal SupplyQtyConvFactor { get; set; }
|
||||
public string UfFkrEdiAddIntDest { get; set; }
|
||||
public string UfFkrEdiCustPoLineNum { get; set; }
|
||||
public string UfFkrEdiPlaceOrPortDischarge { get; set; }
|
||||
public string RoutingCode { get; set; }
|
||||
public string DeliveryCallNumber { get; set; }
|
||||
public string UnloadingPoint { get; set; }
|
||||
public string DestinationPoint { get; set; }
|
||||
public string NewStatus { get; set; }
|
||||
public string PalletCode { get; set; }
|
||||
public string PalletNumber { get; set; }
|
||||
public string? UfFkrEdiAddIntDest { get; set; }
|
||||
public string? UfFkrEdiCustPoLineNum { get; set; }
|
||||
public string? UfFkrEdiPlaceOrPortDischarge { get; set; }
|
||||
public string? RoutingCode { get; set; }
|
||||
public string? DeliveryCallNumber { get; set; }
|
||||
public string? UnloadingPoint { get; set; }
|
||||
public string? DestinationPoint { get; set; }
|
||||
public string? NewStatus { get; set; }
|
||||
public string? PalletCode { get; set; }
|
||||
public string? PalletNumber { get; set; }
|
||||
|
||||
public string DocumentType { get; set; }
|
||||
public string? DocumentType { get; set; }
|
||||
public string TranslatedStatus => TranslateStatus(Status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper.Configuration.Annotations;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Dtos
|
||||
{
|
||||
@@ -11,14 +12,16 @@ namespace SytelineSaAppEfDataModel.Dtos
|
||||
public int Id { get; set; }
|
||||
public byte CoEdiOrder { get; set; }
|
||||
public Guid CoRowPointer { get; set; }
|
||||
public string CoCoNum { get; set; }
|
||||
public string CoType { get; set; }
|
||||
public string CoTakenBy { get; set; }
|
||||
public string EdiCoCoNum { get; set; }
|
||||
public string? CoCoNum { get; set; }
|
||||
public string? CoType { get; set; }
|
||||
public string? CoTakenBy { get; set; }
|
||||
public string? EdiCoCoNum { get; set; }
|
||||
public int OrdersCount { get; set; }
|
||||
public bool OrderFound { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string FoundNumbers { get; set; }
|
||||
public string? FoundNumbers { get; set; }
|
||||
public int ScheduleOrderId { get; set; }
|
||||
|
||||
[Ignore] public string? PoNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
11
SytelineSaAppEfDataModel/Dtos/EdiLogDto.cs
Normal file
11
SytelineSaAppEfDataModel/Dtos/EdiLogDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class EdiLogDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ProcessName { get; set; }
|
||||
public string ConfigurationName { get; set; }
|
||||
public int Status { get; set; }
|
||||
public string LogText { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
}
|
||||
30
SytelineSaAppEfDataModel/Dtos/ItemCustDto.cs
Normal file
30
SytelineSaAppEfDataModel/Dtos/ItemCustDto.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class ItemCustDto
|
||||
{
|
||||
public string Item { get; set; }
|
||||
public string CustNum { get; set; }
|
||||
public int CustItemSeq { get; set; }
|
||||
public string CustItem { get; set; }
|
||||
public int? PurchYtd { get; set; }
|
||||
public decimal? OrderYtd { get; set; }
|
||||
public decimal? ShipYtd { get; set; }
|
||||
public decimal? OrderPtd { get; set; }
|
||||
public string UM { get; set; }
|
||||
public int? DuePeriod { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public int? Rank { get; set; }
|
||||
public string EndUser { get; set; }
|
||||
public string Uf_FKR_CustItem2 { get; set; }
|
||||
public string Uf_KOD_EAN13 { get; set; }
|
||||
public string Uf_Paleta_BROSE { get; set; }
|
||||
public string Uf_Pojemnik_BROSE { get; set; }
|
||||
public string Uf_Paleta_BROSE_Pokrywa { get; set; }
|
||||
public string Uf_RewizjaRysunku { get; set; }
|
||||
}
|
||||
39
SytelineSaAppEfDataModel/Dtos/ItemCustPriceAllDto.cs
Normal file
39
SytelineSaAppEfDataModel/Dtos/ItemCustPriceAllDto.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class ItemCustPriceAllDto : DtoBase
|
||||
{
|
||||
public string SiteRef { get; set; }
|
||||
public string Item { get; set; }
|
||||
public string CustNum { get; set; }
|
||||
public int CustItemSeq { get; set; }
|
||||
public DateTime EffectDate { get; set; }
|
||||
public decimal? ContPrice { get; set; }
|
||||
public decimal? BrkQty1 { get; set; }
|
||||
public decimal? BrkQty2 { get; set; }
|
||||
public decimal? BrkQty3 { get; set; }
|
||||
public decimal? BrkQty4 { get; set; }
|
||||
public decimal? BrkQty5 { get; set; }
|
||||
public decimal? BrkPrice1 { get; set; }
|
||||
public decimal? BrkPrice2 { get; set; }
|
||||
public decimal? BrkPrice3 { get; set; }
|
||||
public decimal? BrkPrice4 { get; set; }
|
||||
public decimal? BrkPrice5 { get; set; }
|
||||
public string BaseCode1 { get; set; }
|
||||
public string BaseCode2 { get; set; }
|
||||
public string BaseCode3 { get; set; }
|
||||
public string BaseCode4 { get; set; }
|
||||
public string BaseCode5 { get; set; }
|
||||
public string DolPercent1 { get; set; }
|
||||
public string DolPercent2 { get; set; }
|
||||
public string DolPercent3 { get; set; }
|
||||
public string DolPercent4 { get; set; }
|
||||
public string DolPercent5 { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool IncludeTaxInPrice { get; set; }
|
||||
}
|
||||
228
SytelineSaAppEfDataModel/Dtos/ItemDto.cs
Normal file
228
SytelineSaAppEfDataModel/Dtos/ItemDto.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class ItemDto : DtoBase
|
||||
{
|
||||
public string ItemCode { get; set; }
|
||||
public string Description { get; set; }
|
||||
public decimal? QtyAllocjob { get; set; }
|
||||
public string UM { get; set; }
|
||||
public short LeadTime { get; set; }
|
||||
public decimal? LotSize { get; set; }
|
||||
public decimal? QtyUsedYtd { get; set; }
|
||||
public decimal? QtyMfgYtd { get; set; }
|
||||
public string AbcCode { get; set; }
|
||||
public string DrawingNbr { get; set; }
|
||||
public string ProductCode { get; set; }
|
||||
public string PMTCode { get; set; }
|
||||
public string CostMethod { get; set; }
|
||||
public decimal? LstLotSize { get; set; }
|
||||
public decimal? UnitCost { get; set; }
|
||||
public decimal? LstUCost { get; set; }
|
||||
public decimal? AvgUCost { get; set; }
|
||||
public string Job { get; set; }
|
||||
public short? Suffix { get; set; }
|
||||
public bool Stocked { get; set; }
|
||||
public string MatlType { get; set; }
|
||||
public string FamilyCode { get; set; }
|
||||
public byte? LowLevel { get; set; }
|
||||
public DateTime? LastInv { get; set; }
|
||||
public short? DaysSupply { get; set; }
|
||||
public decimal? OrderMin { get; set; }
|
||||
public decimal? OrderMult { get; set; }
|
||||
public string PlanCode { get; set; }
|
||||
public bool MpsFlag { get; set; }
|
||||
public bool AcceptReq { get; set; }
|
||||
public DateTime? ChangeDate { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public bool PhantomFlag { get; set; }
|
||||
public bool PlanFlag { get; set; }
|
||||
public short PaperTime { get; set; }
|
||||
public short DockTime { get; set; }
|
||||
public decimal? AsmSetup { get; set; }
|
||||
public decimal? AsmRun { get; set; }
|
||||
public decimal? AsmMatl { get; set; }
|
||||
public decimal? AsmTool { get; set; }
|
||||
public decimal? AsmFixture { get; set; }
|
||||
public decimal? AsmOther { get; set; }
|
||||
public decimal? AsmFixed { get; set; }
|
||||
public decimal? AsmVar { get; set; }
|
||||
public decimal? AsmOutside { get; set; }
|
||||
public decimal? CompSetup { get; set; }
|
||||
public decimal? CompRun { get; set; }
|
||||
public decimal? CompMatl { get; set; }
|
||||
public decimal? CompTool { get; set; }
|
||||
public decimal? CompFixture { get; set; }
|
||||
public decimal? CompOther { get; set; }
|
||||
public decimal? CompFixed { get; set; }
|
||||
public decimal? CompVar { get; set; }
|
||||
public decimal? CompOutside { get; set; }
|
||||
public decimal? SubMatl { get; set; }
|
||||
public decimal? ShrinkFact { get; set; }
|
||||
public string AltItem { get; set; }
|
||||
public decimal? UnitWeight { get; set; }
|
||||
public string WeightUnits { get; set; }
|
||||
public string Charfld4 { get; set; }
|
||||
public decimal? CurUCost { get; set; }
|
||||
public string FeatType { get; set; }
|
||||
public decimal? VarLead { get; set; }
|
||||
public string FeatStr { get; set; }
|
||||
public short? NextConfig { get; set; }
|
||||
public string FeatTempl { get; set; }
|
||||
public bool Backflush { get; set; }
|
||||
public string Charfld1 { get; set; }
|
||||
public string Charfld2 { get; set; }
|
||||
public string Charfld3 { get; set; }
|
||||
public decimal? Decifld1 { get; set; }
|
||||
public decimal? Decifld2 { get; set; }
|
||||
public decimal? Decifld3 { get; set; }
|
||||
public bool Logifld { get; set; }
|
||||
public DateTime? Datefld { get; set; }
|
||||
public bool TrackEcn { get; set; }
|
||||
|
||||
public string CommCode { get; set; }
|
||||
public string Origin { get; set; }
|
||||
public decimal? UnitMatCost { get; set; }
|
||||
public decimal? UnitDutyCost { get; set; }
|
||||
public decimal? UnitFreightCost { get; set; }
|
||||
public decimal? UnitBrokerageCost { get; set; }
|
||||
public decimal? CurMatCost { get; set; }
|
||||
public decimal? CurDutyCost { get; set; }
|
||||
public decimal? CurFreightCost { get; set; }
|
||||
public decimal? CurBrokerageCost { get; set; }
|
||||
public string TaxCode1 { get; set; }
|
||||
public string TaxCode2 { get; set; }
|
||||
public string BflushLoc { get; set; }
|
||||
public bool Reservable { get; set; }
|
||||
public short? ShelfLife { get; set; }
|
||||
public string LotPrefix { get; set; }
|
||||
public string SerialPrefix { get; set; }
|
||||
public byte? SerialLength { get; set; }
|
||||
public string IssueBy { get; set; }
|
||||
public bool SerialTracked { get; set; }
|
||||
public bool LotTracked { get; set; }
|
||||
public string CostType { get; set; }
|
||||
public decimal? MatlCost { get; set; }
|
||||
public decimal? LbrCost { get; set; }
|
||||
public decimal? FovhdCost { get; set; }
|
||||
public decimal? VovhdCost { get; set; }
|
||||
public decimal? OutCost { get; set; }
|
||||
public decimal? CurMatlCost { get; set; }
|
||||
public decimal? CurLbrCost { get; set; }
|
||||
public decimal? CurFovhdCost { get; set; }
|
||||
public decimal? CurVovhdCost { get; set; }
|
||||
public decimal? CurOutCost { get; set; }
|
||||
public decimal? AvgMatlCost { get; set; }
|
||||
public decimal? AvgLbrCost { get; set; }
|
||||
public decimal? AvgFovhdCost { get; set; }
|
||||
public decimal? AvgVovhdCost { get; set; }
|
||||
public decimal? AvgOutCost { get; set; }
|
||||
public string ProdType { get; set; }
|
||||
public decimal? RatePerDay { get; set; }
|
||||
public short? MpsPlanFence { get; set; }
|
||||
public bool PassReq { get; set; }
|
||||
public bool LotGenExp { get; set; }
|
||||
public string SupplySite { get; set; }
|
||||
public string ProdMix { get; set; }
|
||||
public string Stat { get; set; }
|
||||
public string StatusChgUserCode { get; set; }
|
||||
public DateTime? ChgDate { get; set; }
|
||||
public string ReasonCode { get; set; }
|
||||
public string SupplyWhse { get; set; }
|
||||
public short? DuePeriod { get; set; }
|
||||
public decimal? OrderMax { get; set; }
|
||||
public bool MrpPart { get; set; }
|
||||
public bool InfinitePart { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public decimal? SupplyToleranceHrs { get; set; }
|
||||
public short ExpLeadTime { get; set; }
|
||||
public decimal? VarExpLead { get; set; }
|
||||
public string Buyer { get; set; }
|
||||
public bool OrderConfigurable { get; set; }
|
||||
public bool JobConfigurable { get; set; }
|
||||
public string CfgModel { get; set; }
|
||||
public string CoPostConfig { get; set; }
|
||||
public string JobPostConfig { get; set; }
|
||||
public string AutoJob { get; set; }
|
||||
public string AutoPost { get; set; }
|
||||
public string Setupgroup { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool MfgSupplySwitchingActive { get; set; }
|
||||
public short? TimeFenceRule { get; set; }
|
||||
public double? TimeFenceValue { get; set; }
|
||||
public DateTime? EarliestPlannedPoReceipt { get; set; }
|
||||
public bool UseReorderPoint { get; set; }
|
||||
public decimal? ReorderPoint { get; set; }
|
||||
public decimal? FixedOrderQty { get; set; }
|
||||
public decimal? UnitInsuranceCost { get; set; }
|
||||
public decimal? UnitLocFrtCost { get; set; }
|
||||
public decimal? CurInsuranceCost { get; set; }
|
||||
public decimal? CurLocFrtCost { get; set; }
|
||||
public bool TaxFreeMatl { get; set; }
|
||||
public short? TaxFreeDays { get; set; }
|
||||
public decimal? SafetyStockPercent { get; set; }
|
||||
public string TariffClassification { get; set; }
|
||||
public DateTime Lowdate { get; set; }
|
||||
public string RcptRqmt { get; set; }
|
||||
public bool ActiveForDataIntegration { get; set; }
|
||||
public decimal? RcvdOverPoQtyTolerance { get; set; }
|
||||
public decimal? RcvdUnderPoQtyTolerance { get; set; }
|
||||
public bool IncludeInNetChangePlanning { get; set; }
|
||||
public bool Kit { get; set; }
|
||||
public bool PrintKitComponents { get; set; }
|
||||
public short? SafetyStockRule { get; set; }
|
||||
public bool ShowInDropDownList { get; set; }
|
||||
public bool ControlledByExternalIcs { get; set; }
|
||||
public decimal? InventoryUclTolerance { get; set; }
|
||||
public decimal? InventoryLclTolerance { get; set; }
|
||||
public string SeparationAttribute { get; set; }
|
||||
public double? BatchReleaseAttribute1 { get; set; }
|
||||
public double? BatchReleaseAttribute2 { get; set; }
|
||||
public double? BatchReleaseAttribute3 { get; set; }
|
||||
public byte[] Picture { get; set; }
|
||||
public bool ActiveForCustomerPortal { get; set; }
|
||||
public bool Featured { get; set; }
|
||||
public bool TopSeller { get; set; }
|
||||
public string Overview { get; set; }
|
||||
public bool PreassignLots { get; set; }
|
||||
public bool PreassignSerials { get; set; }
|
||||
public string AttrGroup { get; set; }
|
||||
public string DimensionGroup { get; set; }
|
||||
public string LotAttrGroup { get; set; }
|
||||
public bool TrackPieces { get; set; }
|
||||
public DateTime? BomLastImportDate { get; set; }
|
||||
public bool SaveCurrentRevUponBomImport { get; set; }
|
||||
public string NaftaPrefCrit { get; set; }
|
||||
public bool SubjectToNaftaRvc { get; set; }
|
||||
public bool Producer { get; set; }
|
||||
public string NaftaCountryOfOrigin { get; set; }
|
||||
public bool MustUseFutureRcptsBeforePln { get; set; }
|
||||
public bool SubjectToExciseTax { get; set; }
|
||||
public decimal? ExciseTaxPercent { get; set; }
|
||||
public string Uf_PLT_AddItemDesc { get; set; }
|
||||
public string Uf_PLT_Class { get; set; }
|
||||
public string Uf_PLT_CNCode { get; set; }
|
||||
public string Uf_PLT_Norm { get; set; }
|
||||
public string Uf_PLT_OldItemID { get; set; }
|
||||
public decimal? Uf_PLT_Volume { get; set; }
|
||||
public string Uf_PLT_VolumeUnit { get; set; }
|
||||
public bool Uf_INT_Replicate { get; set; }
|
||||
public string BoxId { get; set; }
|
||||
public decimal? ItemLength { get; set; }
|
||||
public decimal? ItemFi { get; set; }
|
||||
public decimal? BoxItemsCnt { get; set; }
|
||||
public string Klient { get; set; }
|
||||
public string Uf_FKR_FA_RodzajPozycji { get; set; }
|
||||
public string Uf_Nr_Klienta { get; set; }
|
||||
public int? Uf_FKR_FA_Items_Nr_Zmiany { get; set; }
|
||||
public string Uf_FKR_FA_item_core { get; set; }
|
||||
public string Uf_FKR_GTU { get; set; }
|
||||
public int? Uf_FKR_FA_Ilosc_Na_Jedn_Pak { get; set; }
|
||||
public int? Uf_Element_Ilosc_W_Palecie { get; set; }
|
||||
public bool? Uf_PUDELKO { get; set; }
|
||||
public string Uf_IMP_OrginalItem { get; set; }
|
||||
}
|
||||
32
SytelineSaAppEfDataModel/Dtos/LotDto.cs
Normal file
32
SytelineSaAppEfDataModel/Dtos/LotDto.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class LotDto
|
||||
{
|
||||
public string Item { get; set; }
|
||||
public string LotNumber { get; set; }
|
||||
public decimal? RcvdQty { get; set; }
|
||||
public DateTime? CreateDate { get; set; }
|
||||
public DateTime? ExpDate { get; set; }
|
||||
public DateTime? PurgeDate { get; set; }
|
||||
public string VendLot { get; set; }
|
||||
public string CertNum { get; set; }
|
||||
public string Charfld1 { get; set; }
|
||||
public string Charfld2 { get; set; }
|
||||
public string Charfld3 { get; set; }
|
||||
public DateTime? Datefld { get; set; }
|
||||
public decimal? Decifld1 { get; set; }
|
||||
public decimal? Decifld2 { get; set; }
|
||||
public decimal? Decifld3 { get; set; }
|
||||
public bool Logifld { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDateField { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool ContainsTaxFreeMatl { get; set; }
|
||||
public string AttrGroup { get; set; }
|
||||
public string ManufacturerId { get; set; }
|
||||
public string ManufacturerItem { get; set; }
|
||||
}
|
||||
66
SytelineSaAppEfDataModel/Dtos/VatCodeAssociationDto.cs
Normal file
66
SytelineSaAppEfDataModel/Dtos/VatCodeAssociationDto.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class VatCodeAssociationDto
|
||||
{
|
||||
public string VATRegisterType { get; set; }
|
||||
public string EndUserType { get; set; }
|
||||
public string Category { get; set; }
|
||||
public string ProdCode { get; set; }
|
||||
public string TaxCode { get; set; }
|
||||
public string VATRegisterCode { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGVarsDescription { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcct { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesOutDescription { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcct { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsDescription { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcct { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesDescription { get; set; }
|
||||
}
|
||||
12
SytelineSaAppEfDataModel/Dtos/WzClientDto.cs
Normal file
12
SytelineSaAppEfDataModel/Dtos/WzClientDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class WzClientDto
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public string CustomerNumber { get; set; }
|
||||
public int? CustomerSequence { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ShortName { get; set; }
|
||||
public string? LogoBase64 { get; set; }
|
||||
}
|
||||
12
SytelineSaAppEfDataModel/Dtos/WzHeaderDto.cs
Normal file
12
SytelineSaAppEfDataModel/Dtos/WzHeaderDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class WzHeaderDto
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public Guid? FK_Client { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string? EmailAddresses { get; set; }
|
||||
public string? WzNumbers { get; set; }
|
||||
public IEnumerable<WzRowMeyleDto> WzRowsMeyle { get; set; } = new List<WzRowMeyleDto>();
|
||||
public IEnumerable<WzRowMarelliDto> WzRowsMarelli { get; set; } = new List<WzRowMarelliDto>();
|
||||
}
|
||||
16
SytelineSaAppEfDataModel/Dtos/WzRowMarelliDto.cs
Normal file
16
SytelineSaAppEfDataModel/Dtos/WzRowMarelliDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class WzRowMarelliDto
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public Guid? FKHeader { get; set; }
|
||||
public string Type { get; set; }
|
||||
public int? PalletNumber { get; set; }
|
||||
public string ItemNumber { get; set; }
|
||||
public string EngineerNumber { get; set; }
|
||||
public int? Quantity { get; set; }
|
||||
public string OrderNumber { get; set; }
|
||||
public string WzNumber { get; set; }
|
||||
public string FaIndex { get; set; }
|
||||
public int? TransactionNumber { get; set; }
|
||||
}
|
||||
16
SytelineSaAppEfDataModel/Dtos/WzRowMeyleDto.cs
Normal file
16
SytelineSaAppEfDataModel/Dtos/WzRowMeyleDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
public class WzRowMeyleDto
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public Guid? FK_Header { get; set; }
|
||||
public string OrderNumber { get; set; }
|
||||
public string ItemNumber { get; set; }
|
||||
public int? Quantity { get; set; }
|
||||
public int? PalletNumber { get; set; }
|
||||
public string WzNumber { get; set; }
|
||||
public string? PartNumber { get; set; }
|
||||
public int? TransactionNumber { get; set; }
|
||||
public string? FaIndex { get; set; }
|
||||
public string? PartNumberSl { get; set; }
|
||||
}
|
||||
132
SytelineSaAppEfDataModel/Entities/Customer.cs
Normal file
132
SytelineSaAppEfDataModel/Entities/Customer.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class Customer
|
||||
{
|
||||
public string CustNum { get; set; }
|
||||
public int CustSeq { get; set; }
|
||||
public string Contact1 { get; set; }
|
||||
public string Contact2 { get; set; }
|
||||
public string Contact3 { get; set; }
|
||||
public string Phone1 { get; set; }
|
||||
public string Phone2 { get; set; }
|
||||
public string Phone3 { get; set; }
|
||||
public string CustType { get; set; }
|
||||
public string TermsCode { get; set; }
|
||||
public string ShipCode { get; set; }
|
||||
public string Slsman { get; set; }
|
||||
public string StateCycle { get; set; }
|
||||
public bool FinChg { get; set; }
|
||||
public DateTime? LastInv { get; set; }
|
||||
public DateTime? LastPaid { get; set; }
|
||||
public decimal? SalesYtd { get; set; }
|
||||
public decimal? SalesLstYr { get; set; }
|
||||
public decimal? DiscYtd { get; set; }
|
||||
public decimal? DiscLstYr { get; set; }
|
||||
public DateTime? LastFinChg { get; set; }
|
||||
public decimal? SalesPtd { get; set; }
|
||||
public DateTime? CalcDate { get; set; }
|
||||
public short? NumPeriods { get; set; }
|
||||
public short? AvgDaysOs { get; set; }
|
||||
public int? NumInvoices { get; set; }
|
||||
public int? HistDaysOs { get; set; }
|
||||
public int? LargDaysOs { get; set; }
|
||||
public short? LastDaysOs { get; set; }
|
||||
public decimal? AvgBalOs { get; set; }
|
||||
public decimal? LargeBalOs { get; set; }
|
||||
public decimal? LastBalOs { get; set; }
|
||||
public string Whse { get; set; }
|
||||
public string Charfld1 { get; set; }
|
||||
public string Charfld2 { get; set; }
|
||||
public string Charfld3 { get; set; }
|
||||
public decimal? Decifld1 { get; set; }
|
||||
public decimal? Decifld2 { get; set; }
|
||||
public decimal? Decifld3 { get; set; }
|
||||
public bool Logifld { get; set; }
|
||||
public DateTime? Datefld { get; set; }
|
||||
public string TaxRegNum1 { get; set; }
|
||||
public string BankCode { get; set; }
|
||||
public string TaxRegNum2 { get; set; }
|
||||
public string PayType { get; set; }
|
||||
public bool EdiCust { get; set; }
|
||||
public string BranchId { get; set; }
|
||||
public string TransNat { get; set; }
|
||||
public string Delterm { get; set; }
|
||||
public string ProcessInd { get; set; }
|
||||
public bool UseExchRate { get; set; }
|
||||
public string TaxCode1 { get; set; }
|
||||
public string TaxCode2 { get; set; }
|
||||
public string Pricecode { get; set; }
|
||||
public bool ShipEarly { get; set; }
|
||||
public bool ShipPartial { get; set; }
|
||||
public string LangCode { get; set; }
|
||||
public string EndUserType { get; set; }
|
||||
public string ShipSite { get; set; }
|
||||
public bool LcrReqd { get; set; }
|
||||
public string CustBank { get; set; }
|
||||
public bool DraftPrintFlag { get; set; }
|
||||
public bool RcvInternalEmail { get; set; }
|
||||
public string CustomerEmailAddr { get; set; }
|
||||
public bool SendCustomerEmail { get; set; }
|
||||
public bool ApsPullUp { get; set; }
|
||||
public string DoInvoice { get; set; }
|
||||
public bool Consolidate { get; set; }
|
||||
public string InvFreq { get; set; }
|
||||
public bool Summarize { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public bool Einvoice { get; set; }
|
||||
public decimal? OrderBal { get; set; }
|
||||
public decimal? PostedBal { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public string CrmGuid { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool PrintPackInv { get; set; }
|
||||
public bool OnePackInv { get; set; }
|
||||
public string InvCategory { get; set; }
|
||||
public bool IncludeTaxInPrice { get; set; }
|
||||
public string TransNat2 { get; set; }
|
||||
public bool UseRevisionPayDays { get; set; }
|
||||
public int? RevisionDay { get; set; }
|
||||
public TimeSpan? RevisionDayStartTime1 { get; set; }
|
||||
public TimeSpan? RevisionDayStartTime2 { get; set; }
|
||||
public TimeSpan? RevisionDayEndTime1 { get; set; }
|
||||
public TimeSpan? RevisionDayEndTime2 { get; set; }
|
||||
public int? PayDay { get; set; }
|
||||
public TimeSpan? PayDayStartTime1 { get; set; }
|
||||
public TimeSpan? PayDayStartTime2 { get; set; }
|
||||
public TimeSpan? PayDayEndTime1 { get; set; }
|
||||
public TimeSpan? PayDayEndTime2 { get; set; }
|
||||
public string ExportType { get; set; }
|
||||
public bool ActiveForDataIntegration { get; set; }
|
||||
public bool ShowInShipToDropDownList { get; set; }
|
||||
public bool ShowInDropDownList { get; set; }
|
||||
public string SicCode { get; set; }
|
||||
public int? NumberOfEmployees { get; set; }
|
||||
public decimal? CompanyRevenue { get; set; }
|
||||
public string TerritoryCode { get; set; }
|
||||
public string SalesTeamId { get; set; }
|
||||
public short? DaysShippedBeforeDueDateTolerance { get; set; }
|
||||
public short? DaysShippedAfterDueDateTolerance { get; set; }
|
||||
public decimal? ShippedOverOrderedQtyTolerance { get; set; }
|
||||
public decimal? ShippedUnderOrderedQtyTolerance { get; set; }
|
||||
public int DefaultShipTo { get; set; }
|
||||
public bool IncludeOrdersInTaxRpt { get; set; }
|
||||
public decimal? ConstructiveSalePricePct { get; set; }
|
||||
public string Uf_ZPL_FedId { get; set; }
|
||||
public string Uf_ZPL_VATRegisterCode { get; set; }
|
||||
public int? Uf_INT_CustSeq { get; set; }
|
||||
public bool Uf_INT_Replicate { get; set; }
|
||||
public int? Uf_FKR_FA_SL_SYKOF { get; set; }
|
||||
public bool? Uf_FKR_FA_Eksport_SYKOF { get; set; }
|
||||
public string Uf_FKR_FA_Kod_Dostawcy_u_Klienta { get; set; }
|
||||
public string Uf_FKR_FA_Rampa { get; set; }
|
||||
public string Uf_FKR_FA_Zaklad_Przeznaczenia { get; set; }
|
||||
public char? Uf_FKR_Customer_Status { get; set; }
|
||||
public bool? Uf_bpx_customer_printbatch { get; set; }
|
||||
public string Uf_cust_receiver_line1 { get; set; }
|
||||
public string Uf_cust_receiver_line2 { get; set; }
|
||||
public int? Uf_cust_supplier_no { get; set; }
|
||||
}
|
||||
41
SytelineSaAppEfDataModel/Entities/CustomerTp.cs
Normal file
41
SytelineSaAppEfDataModel/Entities/CustomerTp.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class CustomerTp
|
||||
{
|
||||
public string CustNum { get; set; }
|
||||
public int CustSeq { get; set; }
|
||||
public bool UpdCustAddress { get; set; }
|
||||
public string TpCode { get; set; }
|
||||
public string DunsNum { get; set; }
|
||||
public bool GenAck { get; set; }
|
||||
public bool PaperAck { get; set; }
|
||||
public bool GenAsn { get; set; }
|
||||
public bool PaperAsn { get; set; }
|
||||
public bool GenInv { get; set; }
|
||||
public bool PaperInv { get; set; }
|
||||
public string AutoPost { get; set; }
|
||||
public bool PostPlanned { get; set; }
|
||||
public string ReleaseProc { get; set; }
|
||||
public bool PooledAsn { get; set; }
|
||||
public bool ValPrice { get; set; }
|
||||
public string UsePrice { get; set; }
|
||||
public bool ValCredit { get; set; }
|
||||
public string NoteProc { get; set; }
|
||||
public string UseDate { get; set; }
|
||||
public short? DateOffset { get; set; }
|
||||
public string InvCode { get; set; }
|
||||
public string AckCode { get; set; }
|
||||
public string AsnCode { get; set; }
|
||||
public DateTime? LastItemDate { get; set; }
|
||||
public DateTime? LastCustaDate { get; set; }
|
||||
public bool IncludeSerial { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public string Uf_FKR_EDI_RSSBussFolder { get; set; }
|
||||
public string Uf_FKR_EDI_IdentificationCode { get; set; }
|
||||
}
|
||||
@@ -8,8 +8,8 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
{
|
||||
public class EdiCustomerOrder : EntityBase
|
||||
{
|
||||
public string TransactionCode { get; set; }
|
||||
public string TpCode { get; set; }
|
||||
public string? TransactionCode { get; set; }
|
||||
public string? TpCode { get; set; }
|
||||
public DateTime? RecivedDate { get; set; }
|
||||
public byte? Posted { get; set; }
|
||||
public DateTime? PostedDate { get; set; }
|
||||
@@ -17,24 +17,24 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
public short? ErrorMessage { get; set; }
|
||||
public byte? Override { get; set; }
|
||||
public byte? Ack { get; set; }
|
||||
public string AckNumber { get; set; }
|
||||
public string? AckNumber { get; set; }
|
||||
public int? AckSequence { get; set; }
|
||||
public string AckType { get; set; }
|
||||
public string? AckType { get; set; }
|
||||
public DateTime? AckDate { get; set; }
|
||||
public string SymbolicCustomerOrderNumber { get; set; }
|
||||
public string? SymbolicCustomerOrderNumber { get; set; }
|
||||
public decimal? BlanketDollar { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string CustomerOrderNumber { get; set; }
|
||||
public string EstimatedNumber { get; set; }
|
||||
public string CustomerNumber { get; set; }
|
||||
public string? Type { get; set; }
|
||||
public string? CustomerOrderNumber { get; set; }
|
||||
public string? EstimatedNumber { get; set; }
|
||||
public string? CustomerNumber { get; set; }
|
||||
public int? CustomerSequence { get; set; }
|
||||
public string Contact { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public string CustomerPoNumber { get; set; }
|
||||
public string? Contact { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? CustomerPoNumber { get; set; }
|
||||
public DateTime? OrderDate { get; set; }
|
||||
public string TakenBy { get; set; }
|
||||
public string TermsCode { get; set; }
|
||||
public string ShipCode { get; set; }
|
||||
public string? TakenBy { get; set; }
|
||||
public string? TermsCode { get; set; }
|
||||
public string? ShipCode { get; set; }
|
||||
public decimal? Price { get; set; }
|
||||
public decimal? Weight { get; set; }
|
||||
public short? QtyPackages { get; set; }
|
||||
@@ -42,64 +42,64 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
public decimal? MiscCharges { get; set; }
|
||||
public decimal? PrepaidAmount { get; set; }
|
||||
public decimal? SalesTax { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public decimal? Cost { get; set; }
|
||||
public DateTime? CloseDate { get; set; }
|
||||
public decimal? FreightT { get; set; }
|
||||
public decimal? MchargesT { get; set; }
|
||||
public decimal? PrepaidT { get; set; }
|
||||
public decimal? SalesTaxT { get; set; }
|
||||
public string Salesman { get; set; }
|
||||
public string? Salesman { get; set; }
|
||||
public DateTime? EffectiveDate { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public string Warehouse { get; set; }
|
||||
public string? Warehouse { get; set; }
|
||||
public decimal? SalesTaxTwo { get; set; }
|
||||
public decimal? SalesTaxTwoT { get; set; }
|
||||
public string CharFieldOne { get; set; }
|
||||
public string CharFieldTwo { get; set; }
|
||||
public string CharFieldThree { get; set; }
|
||||
public string? CharFieldOne { get; set; }
|
||||
public string? CharFieldTwo { get; set; }
|
||||
public string? CharFieldThree { get; set; }
|
||||
public DateTime? DateField { get; set; }
|
||||
public decimal? DecimalFieldOne { get; set; }
|
||||
public decimal? DecimalFieldTwo { get; set; }
|
||||
public decimal? DecimalFieldThree { get; set; }
|
||||
public byte? LogiField { get; set; }
|
||||
public byte? EdiOrder { get; set; }
|
||||
public string TransactionNat { get; set; }
|
||||
public string ProcessInd { get; set; }
|
||||
public string DelTerm { get; set; }
|
||||
public string? TransactionNat { get; set; }
|
||||
public string? ProcessInd { get; set; }
|
||||
public string? DelTerm { get; set; }
|
||||
public byte? UseExchangeRate { get; set; }
|
||||
public string TaxCodeOne { get; set; }
|
||||
public string TaxCodeTwo { get; set; }
|
||||
public string FreightTaxCodeOne { get; set; }
|
||||
public string FreightTaxCodeTwo { get; set; }
|
||||
public string MscTaxCodeOne { get; set; }
|
||||
public string MscTaxCodeTwo { get; set; }
|
||||
public string? TaxCodeOne { get; set; }
|
||||
public string? TaxCodeTwo { get; set; }
|
||||
public string? FreightTaxCodeOne { get; set; }
|
||||
public string? FreightTaxCodeTwo { get; set; }
|
||||
public string? MscTaxCodeOne { get; set; }
|
||||
public string? MscTaxCodeTwo { get; set; }
|
||||
public decimal? Discount { get; set; }
|
||||
public string PriceCode { get; set; }
|
||||
public string? PriceCode { get; set; }
|
||||
public byte? ShipPartial { get; set; }
|
||||
public byte? ShipEarly { get; set; }
|
||||
public string NonApplyData { get; set; }
|
||||
public string? NonApplyData { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public string DiscountType { get; set; }
|
||||
public string? DiscountType { get; set; }
|
||||
public decimal? DiscountAmount { get; set; }
|
||||
public string TransNatTwo { get; set; }
|
||||
public string UfFkrEdiMessageRefNum { get; set; }
|
||||
public string UfFkrEdiConsigneeAddress { get; set; }
|
||||
public string UfFkrEdiConsigneeName { get; set; }
|
||||
public string UfFkrEdiFileName { get; set; }
|
||||
public string UfFkrEdiBuyerDunsNumber { get; set; }
|
||||
public string Gate { get; set; }
|
||||
public string CustomerName { get; set; }
|
||||
public string RecipientCode { get; set; }
|
||||
public string SenderCode { get; set; }
|
||||
public string SellerCode { get; set; }
|
||||
public string DocType { get; set; }
|
||||
public string BuyerCode { get; set; }
|
||||
public string? TransNatTwo { get; set; }
|
||||
public string? UfFkrEdiMessageRefNum { get; set; }
|
||||
public string? UfFkrEdiConsigneeAddress { get; set; }
|
||||
public string? UfFkrEdiConsigneeName { get; set; }
|
||||
public string? UfFkrEdiFileName { get; set; }
|
||||
public string? UfFkrEdiBuyerDunsNumber { get; set; }
|
||||
public string? Gate { get; set; }
|
||||
public string? CustomerName { get; set; }
|
||||
public string? RecipientCode { get; set; }
|
||||
public string? SenderCode { get; set; }
|
||||
public string? SellerCode { get; set; }
|
||||
public string? DocType { get; set; }
|
||||
public string? BuyerCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
12
SytelineSaAppEfDataModel/Entities/EdiCustomerOrderImport.cs
Normal file
12
SytelineSaAppEfDataModel/Entities/EdiCustomerOrderImport.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class EdiCustomerOrderImport
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ScheduleOrderId { get; set; }
|
||||
public DateTime LastUpdateDate { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string LogData { get; set; }
|
||||
public int ItemsCount { get; set; }
|
||||
}
|
||||
@@ -8,35 +8,35 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
{
|
||||
public class EdiCustomerOrderLine
|
||||
{
|
||||
public string CustomerOrderNumber { get; set; }
|
||||
public string? CustomerOrderNumber { get; set; }
|
||||
public int CustomerOrderLine { get; set; }
|
||||
public string Item { get; set; }
|
||||
public string CustomerItemNumber { get; set; }
|
||||
public string FeatStr { get; set; }
|
||||
public string? Item { get; set; }
|
||||
public string? CustomerItemNumber { get; set; }
|
||||
public string? FeatStr { get; set; }
|
||||
public decimal? BlanketQty { get; set; }
|
||||
public DateTime? EffectiveDate { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public decimal? ContPrice { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public DateTime? PromiseDate { get; set; }
|
||||
public string PriceCode { get; set; }
|
||||
public string Uom { get; set; }
|
||||
public string? PriceCode { get; set; }
|
||||
public string? Uom { get; set; }
|
||||
public decimal? BlanketQtyReleased { get; set; }
|
||||
public decimal? ContPriceReleased { get; set; }
|
||||
public decimal? QtySent { get; set; }
|
||||
public string SentCode { get; set; }
|
||||
public string NonAppliedData { get; set; }
|
||||
public string? SentCode { get; set; }
|
||||
public string? NonAppliedData { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public DateTime? CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public string BoxType { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string FinalDestination { get; set; }
|
||||
public string? BoxType { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? FinalDestination { get; set; }
|
||||
public int? QtyPerBox { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
{
|
||||
public class EdiCustomerOrderLineItem
|
||||
{
|
||||
public string TransactionCode { get; set; }
|
||||
public string? TransactionCode { get; set; }
|
||||
public DateTime? ReceivedDate { get; set; }
|
||||
public byte? Posted { get; set; }
|
||||
public DateTime? PostedDate { get; set; }
|
||||
@@ -17,17 +17,17 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
public byte? Override { get; set; }
|
||||
public byte? Edi { get; set; }
|
||||
public byte? Ack { get; set; }
|
||||
public string AckNumber { get; set; }
|
||||
public string AckType { get; set; }
|
||||
public string? AckNumber { get; set; }
|
||||
public string? AckType { get; set; }
|
||||
public DateTime? AckDate { get; set; }
|
||||
public string SymCustomerOrderNumber { get; set; }
|
||||
public string? SymCustomerOrderNumber { get; set; }
|
||||
public byte? QtyChanged { get; set; }
|
||||
public byte? DateChanged { get; set; }
|
||||
public byte? PriceChanged { get; set; }
|
||||
public string CustomerOrderNumber { get; set; }
|
||||
public string? CustomerOrderNumber { get; set; }
|
||||
public int CustomerOrderLine { get; set; }
|
||||
public int CustomerOrderRelease { get; set; }
|
||||
public string Item { get; set; }
|
||||
public string? Item { get; set; }
|
||||
public decimal? QtyOrdered { get; set; }
|
||||
public decimal? QtyReady { get; set; }
|
||||
public decimal? QtyShipped { get; set; }
|
||||
@@ -35,8 +35,8 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
public decimal? Discount { get; set; }
|
||||
public decimal? Cost { get; set; }
|
||||
public decimal? Price { get; set; }
|
||||
public string RefType { get; set; }
|
||||
public string RefNumber { get; set; }
|
||||
public string? RefType { get; set; }
|
||||
public string? RefNumber { get; set; }
|
||||
public short? RefLineSuf { get; set; }
|
||||
public short? RefRelease { get; set; }
|
||||
public DateTime? DueDate { get; set; }
|
||||
@@ -47,67 +47,67 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
public decimal? BrkQtyFour { get; set; }
|
||||
public decimal? BrkQtyFive { get; set; }
|
||||
public byte? Reprice { get; set; }
|
||||
public string CustomerItem { get; set; }
|
||||
public string? CustomerItem { get; set; }
|
||||
public decimal? QtyInvoiced { get; set; }
|
||||
public decimal? QtyReturned { get; set; }
|
||||
public decimal? CgsTotal { get; set; }
|
||||
public string FeatStr { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string CustomerNumber { get; set; }
|
||||
public string? FeatStr { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public string? CustomerNumber { get; set; }
|
||||
public int? CustomerSequence { get; set; }
|
||||
public decimal? PrgBillTot { get; set; }
|
||||
public decimal? PrgBillApp { get; set; }
|
||||
public DateTime? ReleaseDate { get; set; }
|
||||
public DateTime? PromiseDate { get; set; }
|
||||
public string Warehouse { get; set; }
|
||||
public string WksBasis { get; set; }
|
||||
public string? Warehouse { get; set; }
|
||||
public string? WksBasis { get; set; }
|
||||
public decimal? WksValue { get; set; }
|
||||
public string CommCode { get; set; }
|
||||
public string TransNat { get; set; }
|
||||
public string ProcessInd { get; set; }
|
||||
public string DelTerm { get; set; }
|
||||
public string? CommCode { get; set; }
|
||||
public string? TransNat { get; set; }
|
||||
public string? ProcessInd { get; set; }
|
||||
public string? DelTerm { get; set; }
|
||||
public decimal? UnitWeight { get; set; }
|
||||
public string Origin { get; set; }
|
||||
public string? Origin { get; set; }
|
||||
public int? ConsNumber { get; set; }
|
||||
public string TaxCodeOne { get; set; }
|
||||
public string TaxCodeTwo { get; set; }
|
||||
public string? TaxCodeOne { get; set; }
|
||||
public string? TaxCodeTwo { get; set; }
|
||||
public decimal? ExportValue { get; set; }
|
||||
public string EcCode { get; set; }
|
||||
public string Transport { get; set; }
|
||||
public string? EcCode { get; set; }
|
||||
public string? Transport { get; set; }
|
||||
public DateTime? PickupDate { get; set; }
|
||||
public string PriceCode { get; set; }
|
||||
public string Uom { get; set; }
|
||||
public string? PriceCode { get; set; }
|
||||
public string? Uom { get; set; }
|
||||
public decimal? QtyOrderedReleased { get; set; }
|
||||
public decimal? PriceReleased { get; set; }
|
||||
public string CustomerOrderCustomerNumber { get; set; }
|
||||
public string? CustomerOrderCustomerNumber { get; set; }
|
||||
public byte? Packed { get; set; }
|
||||
public byte? Bol { get; set; }
|
||||
public decimal? QtyBco { get; set; }
|
||||
public string BcoCode { get; set; }
|
||||
public string ExternalRef { get; set; }
|
||||
public string CustomerPoNumber { get; set; }
|
||||
public string NonApplyData { get; set; }
|
||||
public string? BcoCode { get; set; }
|
||||
public string? ExternalRef { get; set; }
|
||||
public string? CustomerPoNumber { get; set; }
|
||||
public string? NonApplyData { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? CreatedBy { get; set; }
|
||||
public string? UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public string TransNatTwo { get; set; }
|
||||
public string? TransNatTwo { get; set; }
|
||||
public decimal SupplyQtyConvFactor { get; set; }
|
||||
public string UfFkrEdiAddIntDest { get; set; }
|
||||
public string UfFkrEdiCustPoLineNum { get; set; }
|
||||
public string UfFkrEdiPlaceOrPortDischarge { get; set; }
|
||||
public string RoutingCode { get; set; }
|
||||
public string DeliveryCallNumber { get; set; }
|
||||
public string UnloadingPoint { get; set; }
|
||||
public string DestinationPoint { get; set; }
|
||||
public string NewStatus { get; set; }
|
||||
public string PalletCode { get; set; }
|
||||
public string PalletNumber { get; set; }
|
||||
public string? UfFkrEdiAddIntDest { get; set; }
|
||||
public string? UfFkrEdiCustPoLineNum { get; set; }
|
||||
public string? UfFkrEdiPlaceOrPortDischarge { get; set; }
|
||||
public string? RoutingCode { get; set; }
|
||||
public string? DeliveryCallNumber { get; set; }
|
||||
public string? UnloadingPoint { get; set; }
|
||||
public string? DestinationPoint { get; set; }
|
||||
public string? NewStatus { get; set; }
|
||||
public string? PalletCode { get; set; }
|
||||
public string? PalletNumber { get; set; }
|
||||
|
||||
public string DocumentType { get; set; }
|
||||
public string? DocumentType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ namespace SytelineSaAppEfDataModel.Entities
|
||||
public int Id { get; set; }
|
||||
public byte CoEdiOrder { get; set; }
|
||||
public Guid CoRowPointer { get; set; }
|
||||
public string CoCoNum { get; set; }
|
||||
public string CoType { get; set; }
|
||||
public string CoTakenBy { get; set; }
|
||||
public string EdiCoCoNum { get; set; }
|
||||
public string? CoCoNum { get; set; }
|
||||
public string? CoType { get; set; }
|
||||
public string? CoTakenBy { get; set; }
|
||||
public string? EdiCoCoNum { get; set; }
|
||||
public int OrdersCount { get; set; }
|
||||
public bool OrderFound { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string FoundNumbers { get; set; }
|
||||
public string? FoundNumbers { get; set; }
|
||||
public int ScheduleOrderId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
11
SytelineSaAppEfDataModel/Entities/EdiLog.cs
Normal file
11
SytelineSaAppEfDataModel/Entities/EdiLog.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class EdiLog
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ProcessName { get; set; }
|
||||
public string ConfigurationName { get; set; }
|
||||
public int Status { get; set; }
|
||||
public string LogText { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
}
|
||||
228
SytelineSaAppEfDataModel/Entities/Item.cs
Normal file
228
SytelineSaAppEfDataModel/Entities/Item.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class Item
|
||||
{
|
||||
public string ItemCode { get; set; }
|
||||
public string Description { get; set; }
|
||||
public decimal? QtyAllocjob { get; set; }
|
||||
public string UM { get; set; }
|
||||
public short LeadTime { get; set; }
|
||||
public decimal? LotSize { get; set; }
|
||||
public decimal? QtyUsedYtd { get; set; }
|
||||
public decimal? QtyMfgYtd { get; set; }
|
||||
public string AbcCode { get; set; }
|
||||
public string DrawingNbr { get; set; }
|
||||
public string ProductCode { get; set; }
|
||||
public string PMTCode { get; set; }
|
||||
public string CostMethod { get; set; }
|
||||
public decimal? LstLotSize { get; set; }
|
||||
public decimal? UnitCost { get; set; }
|
||||
public decimal? LstUCost { get; set; }
|
||||
public decimal? AvgUCost { get; set; }
|
||||
public string Job { get; set; }
|
||||
public short? Suffix { get; set; }
|
||||
public bool Stocked { get; set; }
|
||||
public string MatlType { get; set; }
|
||||
public string FamilyCode { get; set; }
|
||||
public byte? LowLevel { get; set; }
|
||||
public DateTime? LastInv { get; set; }
|
||||
public short? DaysSupply { get; set; }
|
||||
public decimal? OrderMin { get; set; }
|
||||
public decimal? OrderMult { get; set; }
|
||||
public string PlanCode { get; set; }
|
||||
public bool MpsFlag { get; set; }
|
||||
public bool AcceptReq { get; set; }
|
||||
public DateTime? ChangeDate { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public bool PhantomFlag { get; set; }
|
||||
public bool PlanFlag { get; set; }
|
||||
public short PaperTime { get; set; }
|
||||
public short DockTime { get; set; }
|
||||
public decimal? AsmSetup { get; set; }
|
||||
public decimal? AsmRun { get; set; }
|
||||
public decimal? AsmMatl { get; set; }
|
||||
public decimal? AsmTool { get; set; }
|
||||
public decimal? AsmFixture { get; set; }
|
||||
public decimal? AsmOther { get; set; }
|
||||
public decimal? AsmFixed { get; set; }
|
||||
public decimal? AsmVar { get; set; }
|
||||
public decimal? AsmOutside { get; set; }
|
||||
public decimal? CompSetup { get; set; }
|
||||
public decimal? CompRun { get; set; }
|
||||
public decimal? CompMatl { get; set; }
|
||||
public decimal? CompTool { get; set; }
|
||||
public decimal? CompFixture { get; set; }
|
||||
public decimal? CompOther { get; set; }
|
||||
public decimal? CompFixed { get; set; }
|
||||
public decimal? CompVar { get; set; }
|
||||
public decimal? CompOutside { get; set; }
|
||||
public decimal? SubMatl { get; set; }
|
||||
public decimal? ShrinkFact { get; set; }
|
||||
public string AltItem { get; set; }
|
||||
public decimal? UnitWeight { get; set; }
|
||||
public string WeightUnits { get; set; }
|
||||
public string Charfld4 { get; set; }
|
||||
public decimal? CurUCost { get; set; }
|
||||
public string FeatType { get; set; }
|
||||
public decimal? VarLead { get; set; }
|
||||
public string FeatStr { get; set; }
|
||||
public short? NextConfig { get; set; }
|
||||
public string FeatTempl { get; set; }
|
||||
public bool Backflush { get; set; }
|
||||
public string Charfld1 { get; set; }
|
||||
public string Charfld2 { get; set; }
|
||||
public string Charfld3 { get; set; }
|
||||
public decimal? Decifld1 { get; set; }
|
||||
public decimal? Decifld2 { get; set; }
|
||||
public decimal? Decifld3 { get; set; }
|
||||
public bool Logifld { get; set; }
|
||||
public DateTime? Datefld { get; set; }
|
||||
public bool TrackEcn { get; set; }
|
||||
|
||||
public string CommCode { get; set; }
|
||||
public string Origin { get; set; }
|
||||
public decimal? UnitMatCost { get; set; }
|
||||
public decimal? UnitDutyCost { get; set; }
|
||||
public decimal? UnitFreightCost { get; set; }
|
||||
public decimal? UnitBrokerageCost { get; set; }
|
||||
public decimal? CurMatCost { get; set; }
|
||||
public decimal? CurDutyCost { get; set; }
|
||||
public decimal? CurFreightCost { get; set; }
|
||||
public decimal? CurBrokerageCost { get; set; }
|
||||
public string TaxCode1 { get; set; }
|
||||
public string TaxCode2 { get; set; }
|
||||
public string BflushLoc { get; set; }
|
||||
public bool Reservable { get; set; }
|
||||
public short? ShelfLife { get; set; }
|
||||
public string LotPrefix { get; set; }
|
||||
public string SerialPrefix { get; set; }
|
||||
public byte? SerialLength { get; set; }
|
||||
public string IssueBy { get; set; }
|
||||
public bool SerialTracked { get; set; }
|
||||
public bool LotTracked { get; set; }
|
||||
public string CostType { get; set; }
|
||||
public decimal? MatlCost { get; set; }
|
||||
public decimal? LbrCost { get; set; }
|
||||
public decimal? FovhdCost { get; set; }
|
||||
public decimal? VovhdCost { get; set; }
|
||||
public decimal? OutCost { get; set; }
|
||||
public decimal? CurMatlCost { get; set; }
|
||||
public decimal? CurLbrCost { get; set; }
|
||||
public decimal? CurFovhdCost { get; set; }
|
||||
public decimal? CurVovhdCost { get; set; }
|
||||
public decimal? CurOutCost { get; set; }
|
||||
public decimal? AvgMatlCost { get; set; }
|
||||
public decimal? AvgLbrCost { get; set; }
|
||||
public decimal? AvgFovhdCost { get; set; }
|
||||
public decimal? AvgVovhdCost { get; set; }
|
||||
public decimal? AvgOutCost { get; set; }
|
||||
public string ProdType { get; set; }
|
||||
public decimal? RatePerDay { get; set; }
|
||||
public short? MpsPlanFence { get; set; }
|
||||
public bool PassReq { get; set; }
|
||||
public bool LotGenExp { get; set; }
|
||||
public string SupplySite { get; set; }
|
||||
public string ProdMix { get; set; }
|
||||
public string Stat { get; set; }
|
||||
public string StatusChgUserCode { get; set; }
|
||||
public DateTime? ChgDate { get; set; }
|
||||
public string ReasonCode { get; set; }
|
||||
public string SupplyWhse { get; set; }
|
||||
public short? DuePeriod { get; set; }
|
||||
public decimal? OrderMax { get; set; }
|
||||
public bool MrpPart { get; set; }
|
||||
public bool InfinitePart { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public decimal? SupplyToleranceHrs { get; set; }
|
||||
public short ExpLeadTime { get; set; }
|
||||
public decimal? VarExpLead { get; set; }
|
||||
public string Buyer { get; set; }
|
||||
public bool OrderConfigurable { get; set; }
|
||||
public bool JobConfigurable { get; set; }
|
||||
public string CfgModel { get; set; }
|
||||
public string CoPostConfig { get; set; }
|
||||
public string JobPostConfig { get; set; }
|
||||
public string AutoJob { get; set; }
|
||||
public string AutoPost { get; set; }
|
||||
public string Setupgroup { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool MfgSupplySwitchingActive { get; set; }
|
||||
public short? TimeFenceRule { get; set; }
|
||||
public double? TimeFenceValue { get; set; }
|
||||
public DateTime? EarliestPlannedPoReceipt { get; set; }
|
||||
public bool UseReorderPoint { get; set; }
|
||||
public decimal? ReorderPoint { get; set; }
|
||||
public decimal? FixedOrderQty { get; set; }
|
||||
public decimal? UnitInsuranceCost { get; set; }
|
||||
public decimal? UnitLocFrtCost { get; set; }
|
||||
public decimal? CurInsuranceCost { get; set; }
|
||||
public decimal? CurLocFrtCost { get; set; }
|
||||
public bool TaxFreeMatl { get; set; }
|
||||
public short? TaxFreeDays { get; set; }
|
||||
public decimal? SafetyStockPercent { get; set; }
|
||||
public string TariffClassification { get; set; }
|
||||
public DateTime Lowdate { get; set; }
|
||||
public string RcptRqmt { get; set; }
|
||||
public bool ActiveForDataIntegration { get; set; }
|
||||
public decimal? RcvdOverPoQtyTolerance { get; set; }
|
||||
public decimal? RcvdUnderPoQtyTolerance { get; set; }
|
||||
public bool IncludeInNetChangePlanning { get; set; }
|
||||
public bool Kit { get; set; }
|
||||
public bool PrintKitComponents { get; set; }
|
||||
public short? SafetyStockRule { get; set; }
|
||||
public bool ShowInDropDownList { get; set; }
|
||||
public bool ControlledByExternalIcs { get; set; }
|
||||
public decimal? InventoryUclTolerance { get; set; }
|
||||
public decimal? InventoryLclTolerance { get; set; }
|
||||
public string SeparationAttribute { get; set; }
|
||||
public double? BatchReleaseAttribute1 { get; set; }
|
||||
public double? BatchReleaseAttribute2 { get; set; }
|
||||
public double? BatchReleaseAttribute3 { get; set; }
|
||||
public byte[] Picture { get; set; }
|
||||
public bool ActiveForCustomerPortal { get; set; }
|
||||
public bool Featured { get; set; }
|
||||
public bool TopSeller { get; set; }
|
||||
public string Overview { get; set; }
|
||||
public bool PreassignLots { get; set; }
|
||||
public bool PreassignSerials { get; set; }
|
||||
public string AttrGroup { get; set; }
|
||||
public string DimensionGroup { get; set; }
|
||||
public string LotAttrGroup { get; set; }
|
||||
public bool TrackPieces { get; set; }
|
||||
public DateTime? BomLastImportDate { get; set; }
|
||||
public bool SaveCurrentRevUponBomImport { get; set; }
|
||||
public string NaftaPrefCrit { get; set; }
|
||||
public bool SubjectToNaftaRvc { get; set; }
|
||||
public bool Producer { get; set; }
|
||||
public string NaftaCountryOfOrigin { get; set; }
|
||||
public bool MustUseFutureRcptsBeforePln { get; set; }
|
||||
public bool SubjectToExciseTax { get; set; }
|
||||
public decimal? ExciseTaxPercent { get; set; }
|
||||
public string Uf_PLT_AddItemDesc { get; set; }
|
||||
public string Uf_PLT_Class { get; set; }
|
||||
public string Uf_PLT_CNCode { get; set; }
|
||||
public string Uf_PLT_Norm { get; set; }
|
||||
public string Uf_PLT_OldItemID { get; set; }
|
||||
public decimal? Uf_PLT_Volume { get; set; }
|
||||
public string Uf_PLT_VolumeUnit { get; set; }
|
||||
public bool Uf_INT_Replicate { get; set; }
|
||||
public string BoxId { get; set; }
|
||||
public decimal? ItemLength { get; set; }
|
||||
public decimal? ItemFi { get; set; }
|
||||
public decimal? BoxItemsCnt { get; set; }
|
||||
public string Klient { get; set; }
|
||||
public string Uf_FKR_FA_RodzajPozycji { get; set; }
|
||||
public string Uf_Nr_Klienta { get; set; }
|
||||
public int? Uf_FKR_FA_Items_Nr_Zmiany { get; set; }
|
||||
public string Uf_FKR_FA_item_core { get; set; }
|
||||
public string Uf_FKR_GTU { get; set; }
|
||||
public int? Uf_FKR_FA_Ilosc_Na_Jedn_Pak { get; set; }
|
||||
public int? Uf_Element_Ilosc_W_Palecie { get; set; }
|
||||
public bool? Uf_PUDELKO { get; set; }
|
||||
public string Uf_IMP_OrginalItem { get; set; }
|
||||
}
|
||||
30
SytelineSaAppEfDataModel/Entities/ItemCust.cs
Normal file
30
SytelineSaAppEfDataModel/Entities/ItemCust.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class ItemCust
|
||||
{
|
||||
public string Item { get; set; }
|
||||
public string CustNum { get; set; }
|
||||
public int CustItemSeq { get; set; }
|
||||
public string CustItem { get; set; }
|
||||
public int? PurchYtd { get; set; }
|
||||
public decimal? OrderYtd { get; set; }
|
||||
public decimal? ShipYtd { get; set; }
|
||||
public decimal? OrderPtd { get; set; }
|
||||
public string UM { get; set; }
|
||||
public int? DuePeriod { get; set; }
|
||||
public byte NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public byte InWorkflow { get; set; }
|
||||
public int? Rank { get; set; }
|
||||
public string EndUser { get; set; }
|
||||
public string Uf_FKR_CustItem2 { get; set; }
|
||||
public string Uf_KOD_EAN13 { get; set; }
|
||||
public string Uf_Paleta_BROSE { get; set; }
|
||||
public string Uf_Pojemnik_BROSE { get; set; }
|
||||
public string Uf_Paleta_BROSE_Pokrywa { get; set; }
|
||||
public string Uf_RewizjaRysunku { get; set; }
|
||||
}
|
||||
39
SytelineSaAppEfDataModel/Entities/ItemCustPriceAll.cs
Normal file
39
SytelineSaAppEfDataModel/Entities/ItemCustPriceAll.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class ItemCustPriceAll
|
||||
{
|
||||
public string SiteRef { get; set; }
|
||||
public string Item { get; set; }
|
||||
public string CustNum { get; set; }
|
||||
public int CustItemSeq { get; set; }
|
||||
public DateTime EffectDate { get; set; }
|
||||
public decimal? ContPrice { get; set; }
|
||||
public decimal? BrkQty1 { get; set; }
|
||||
public decimal? BrkQty2 { get; set; }
|
||||
public decimal? BrkQty3 { get; set; }
|
||||
public decimal? BrkQty4 { get; set; }
|
||||
public decimal? BrkQty5 { get; set; }
|
||||
public decimal? BrkPrice1 { get; set; }
|
||||
public decimal? BrkPrice2 { get; set; }
|
||||
public decimal? BrkPrice3 { get; set; }
|
||||
public decimal? BrkPrice4 { get; set; }
|
||||
public decimal? BrkPrice5 { get; set; }
|
||||
public string BaseCode1 { get; set; }
|
||||
public string BaseCode2 { get; set; }
|
||||
public string BaseCode3 { get; set; }
|
||||
public string BaseCode4 { get; set; }
|
||||
public string BaseCode5 { get; set; }
|
||||
public string DolPercent1 { get; set; }
|
||||
public string DolPercent2 { get; set; }
|
||||
public string DolPercent3 { get; set; }
|
||||
public string DolPercent4 { get; set; }
|
||||
public string DolPercent5 { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool IncludeTaxInPrice { get; set; }
|
||||
}
|
||||
32
SytelineSaAppEfDataModel/Entities/Lot.cs
Normal file
32
SytelineSaAppEfDataModel/Entities/Lot.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class Lot
|
||||
{
|
||||
public string Item { get; set; }
|
||||
public string LotNumber { get; set; }
|
||||
public decimal? RcvdQty { get; set; }
|
||||
public DateTime? CreateDate { get; set; }
|
||||
public DateTime? ExpDate { get; set; }
|
||||
public DateTime? PurgeDate { get; set; }
|
||||
public string VendLot { get; set; }
|
||||
public string CertNum { get; set; }
|
||||
public string Charfld1 { get; set; }
|
||||
public string Charfld2 { get; set; }
|
||||
public string Charfld3 { get; set; }
|
||||
public DateTime? Datefld { get; set; }
|
||||
public decimal? Decifld1 { get; set; }
|
||||
public decimal? Decifld2 { get; set; }
|
||||
public decimal? Decifld3 { get; set; }
|
||||
public bool Logifld { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDateField { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool ContainsTaxFreeMatl { get; set; }
|
||||
public string AttrGroup { get; set; }
|
||||
public string ManufacturerId { get; set; }
|
||||
public string ManufacturerItem { get; set; }
|
||||
}
|
||||
66
SytelineSaAppEfDataModel/Entities/VatCodeAssociation.cs
Normal file
66
SytelineSaAppEfDataModel/Entities/VatCodeAssociation.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class VatCodeAssociation
|
||||
{
|
||||
public string VATRegisterType { get; set; }
|
||||
public string EndUserType { get; set; }
|
||||
public string Category { get; set; }
|
||||
public string ProdCode { get; set; }
|
||||
public string TaxCode { get; set; }
|
||||
public string VATRegisterCode { get; set; }
|
||||
public bool InWorkflow { get; set; }
|
||||
public bool NoteExistsFlag { get; set; }
|
||||
public DateTime RecordDate { get; set; }
|
||||
public Guid RowPointer { get; set; }
|
||||
public string CreatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime CreateDate { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsFovhdDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsLbrDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCgsVovhdDescription { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcct { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGSVarsAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesCOGVarsDescription { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcct { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesOutAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesOutDescription { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcct { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesSaleDsDescription { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcct { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit1 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit2 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit3 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesAcctUnit4 { get; set; }
|
||||
public string Uf_ZPL_CodesSalesDescription { get; set; }
|
||||
}
|
||||
12
SytelineSaAppEfDataModel/Entities/WzClient.cs
Normal file
12
SytelineSaAppEfDataModel/Entities/WzClient.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class WzClient
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public string CustomerNumber { get; set; }
|
||||
public int? CustomerSequence { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ShortName { get; set; }
|
||||
public byte[]? Logo { get; set; }
|
||||
}
|
||||
13
SytelineSaAppEfDataModel/Entities/WzHeader.cs
Normal file
13
SytelineSaAppEfDataModel/Entities/WzHeader.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class WzHeader
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public Guid? FK_Client { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public string? EmailAddresses { get; set; }
|
||||
public string? WzNumbers { get; set; }
|
||||
|
||||
// Navigation property
|
||||
public WzClient Client { get; set; }
|
||||
}
|
||||
19
SytelineSaAppEfDataModel/Entities/WzRowMarelli.cs
Normal file
19
SytelineSaAppEfDataModel/Entities/WzRowMarelli.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class WzRowMarelli
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public Guid? FKHeader { get; set; }
|
||||
public string Type { get; set; }
|
||||
public int? PalletNumber { get; set; }
|
||||
public string ItemNumber { get; set; }
|
||||
public string EngineerNumber { get; set; }
|
||||
public int? Quantity { get; set; }
|
||||
public string OrderNumber { get; set; }
|
||||
public string WzNumber { get; set; }
|
||||
public string FaIndex { get; set; }
|
||||
public int? TransactionNumber { get; set; }
|
||||
|
||||
// Navigation property
|
||||
public WzHeader Header { get; set; }
|
||||
}
|
||||
19
SytelineSaAppEfDataModel/Entities/WzRowMeyle.cs
Normal file
19
SytelineSaAppEfDataModel/Entities/WzRowMeyle.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
public class WzRowMeyle
|
||||
{
|
||||
public Guid ID { get; set; }
|
||||
public Guid? FK_Header { get; set; }
|
||||
public string OrderNumber { get; set; }
|
||||
public string ItemNumber { get; set; }
|
||||
public int? Quantity { get; set; }
|
||||
public int? PalletNumber { get; set; }
|
||||
public string WzNumber { get; set; }
|
||||
public string? PartNumber { get; set; }
|
||||
public int? TransactionNumber { get; set; }
|
||||
public string? FaIndex { get; set; }
|
||||
public string? PartNumberSl { get; set; }
|
||||
|
||||
// Navigation property
|
||||
public WzHeader Header { get; set; }
|
||||
}
|
||||
@@ -20,6 +20,20 @@ namespace SytelineSaAppEfDataModel
|
||||
CreateMap<UserName, UserNameDto>().ReverseMap();
|
||||
CreateMap<EdiUser, EdiUserDto>().ReverseMap();
|
||||
CreateMap<MaterialTransaction, MaterialTransactionDto>().ReverseMap();
|
||||
CreateMap<WzClient, WzClientDto>().ForMember(dest => dest.LogoBase64,
|
||||
opt => opt.MapFrom(src => src.Logo != null ? Convert.ToBase64String(src.Logo) : null)).ReverseMap();
|
||||
CreateMap<WzHeader, WzHeaderDto>().ReverseMap();
|
||||
CreateMap<WzRowMeyle, WzRowMeyleDto>().ReverseMap();
|
||||
CreateMap<ItemCust, ItemCustDto>().ReverseMap();
|
||||
CreateMap<Lot, LotDto>().ReverseMap();
|
||||
CreateMap<EdiCustomerOrderImport, EdiCustomerOrderImportDto>().ReverseMap();
|
||||
CreateMap<Customer, CustomerDto>().ReverseMap();
|
||||
CreateMap<CustomerTp, CustomerTpDto>().ReverseMap();
|
||||
CreateMap<Item, ItemDto>().ReverseMap();
|
||||
CreateMap<VatCodeAssociation, VatCodeAssociationDto>().ReverseMap();
|
||||
CreateMap<ItemCustPriceAll, ItemCustPriceAllDto>().ReverseMap();
|
||||
CreateMap<EdiLog, EdiLogDto>().ReverseMap();
|
||||
CreateMap<WzRowMarelli, WzRowMarelliDto>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
@@ -42,5 +37,79 @@ namespace SytelineSaAppEfDataModel.Services
|
||||
|
||||
return customerOrder;
|
||||
}
|
||||
|
||||
public async Task<CustomerOrderDto?> GetByCoNumber(string orderNumber)
|
||||
{
|
||||
CustomerOrderDto? customerOrder = await context.CustomerOrders
|
||||
.Where(x => x.CoNum == orderNumber)
|
||||
.Select(x => mapper.Map<CustomerOrderDto>(x)).FirstOrDefaultAsync();
|
||||
if (customerOrder == null) return null;
|
||||
|
||||
customerOrder.CustomerOrderLines = await context.CustomerOrderLines
|
||||
.Where(x => x.CoNum == customerOrder.CoNum)
|
||||
.Select(x => mapper.Map<CustomerOrderLineDto>(x)).ToListAsync();
|
||||
|
||||
foreach (CustomerOrderLineDto customerOrderLine in customerOrder.CustomerOrderLines)
|
||||
{
|
||||
customerOrderLine.CustomerOrderLineItems = await context.CustomerOrderLineItems
|
||||
.Where(x => x.CoNum == customerOrder.CoNum && x.CoLine == customerOrderLine.CoLine)
|
||||
.Select(x => mapper.Map<CustomerOrderLineItemDto>(x)).ToListAsync();
|
||||
}
|
||||
|
||||
IList<EdiCustomerOrderTranslateDto> ediCustomerOrderTranslates = await context.EdiCustomerOrderTranslates
|
||||
.Where(x => x.CoCoNum == customerOrder.CoNum)
|
||||
.Select(x => mapper.Map<EdiCustomerOrderTranslateDto>(x)).ToListAsync();
|
||||
|
||||
customerOrder.EdiCustomerOrderTranslates = ediCustomerOrderTranslates;
|
||||
|
||||
return customerOrder;
|
||||
}
|
||||
|
||||
public async Task<CustomerOrderDto?> GetByCustomerAndPo(string customerNumber, int customerSequence,
|
||||
string poNumber)
|
||||
{
|
||||
return await context.CustomerOrders
|
||||
.Where(x => x.CustNum == customerNumber && x.CustSeq == customerSequence && x.CustPo == poNumber)
|
||||
.Select(x => mapper.Map<CustomerOrderDto>(x)).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<CustomerOrderDto?> GetByPo(string poNumber)
|
||||
{
|
||||
return await context.CustomerOrders.Where(x => x.CustPo == poNumber && x.Stat == "O")
|
||||
.OrderByDescending(x => x.CreateDate).Select(x => mapper.Map<CustomerOrderDto>(x))
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<IList<CustomerOrderDto>> GetListByCustomerAndPo(string customerNumber, int customerSequence,
|
||||
string poNumber)
|
||||
{
|
||||
return await context.CustomerOrders
|
||||
.Where(x => x.CustNum == customerNumber && x.CustSeq == customerSequence && x.CustPo == poNumber)
|
||||
.Select(x => mapper.Map<CustomerOrderDto>(x)).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<CustomerOrderDto>> GetListByCustomer(string customerNumber, int customerSequence)
|
||||
{
|
||||
return await context.CustomerOrders.Where(x => x.CustNum == customerNumber && x.CustSeq == customerSequence)
|
||||
.Select(x => mapper.Map<CustomerOrderDto>(x)).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<CustomerOrderLineDto>?> GetLinesByCoNumber(string customerOrderNumber)
|
||||
{
|
||||
List<CustomerOrderLineDto> customerOrderLines = await context.CustomerOrderLines
|
||||
.Where(x => x.CoNum == customerOrderNumber).Select(x => mapper.Map<CustomerOrderLineDto>(x))
|
||||
.ToListAsync();
|
||||
|
||||
return customerOrderLines;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<CustomerOrderLineItemDto>?> GetItemsByCoNumber(string customerOrderNumber)
|
||||
{
|
||||
List<CustomerOrderLineItemDto> customerOrderLineItems = await context.CustomerOrderLineItems
|
||||
.Where(x => x.CoNum == customerOrderNumber)
|
||||
.Select(x => mapper.Map<CustomerOrderLineItemDto>(x)).ToListAsync();
|
||||
|
||||
return customerOrderLineItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
SytelineSaAppEfDataModel/Services/CustomerService.cs
Normal file
13
SytelineSaAppEfDataModel/Services/CustomerService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class CustomerService(SytelineSaAppDbContext context, IMapper mapper) : ICustomerService
|
||||
{
|
||||
public async Task<IList<CustomerDto>> GetAllCustomers()
|
||||
{
|
||||
return await context.Customers.Select(x => mapper.Map<CustomerDto>(x)).ToListAsync();
|
||||
}
|
||||
}
|
||||
13
SytelineSaAppEfDataModel/Services/CustomerTpService.cs
Normal file
13
SytelineSaAppEfDataModel/Services/CustomerTpService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class CustomerTpService(SytelineSaAppDbContext context, IMapper mapper) : ICustomerTpService
|
||||
{
|
||||
public async Task<IList<CustomerTpDto>> GetAllCustomersTp()
|
||||
{
|
||||
return await context.CustomerTps.Select(x => mapper.Map<CustomerTpDto>(x)).ToListAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class EdiCustomerOrderImportService(SytelineSaAppDbContext context, IMapper mapper) : IEdiCustomerOrderImportService
|
||||
{
|
||||
public async Task<DateTime> GetLastUpdateDate()
|
||||
{
|
||||
return (await context.EdiCustomerOrderImports.OrderByDescending(x => x.LastUpdateDate)
|
||||
.FirstOrDefaultAsync())?.LastUpdateDate ?? DateTime.Now.Date;
|
||||
}
|
||||
|
||||
public async Task<bool> AddEdiCustomerOrderImport(EdiCustomerOrderImportDto ediCustomerOrderImport)
|
||||
{
|
||||
var entity = mapper.Map<EdiCustomerOrderImport>(ediCustomerOrderImport);
|
||||
await context.EdiCustomerOrderImports.AddAsync(entity);
|
||||
return await context.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<bool> AddEdiCustomerOrderImports(IList<EdiCustomerOrderImportDto> ediCustomerOrderImports)
|
||||
{
|
||||
var entities = mapper.Map<List<EdiCustomerOrderImport>>(ediCustomerOrderImports);
|
||||
context.EdiCustomerOrderImports.AddRange(entities);
|
||||
return await context.SaveChangesAsync() > 0;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,15 @@ namespace SytelineSaAppEfDataModel.Services
|
||||
{
|
||||
public class EdiCustomerOrderService(SytelineSaAppDbContext context, IMapper mapper) : IEdiCustomerOrderService
|
||||
{
|
||||
public async Task<int> GetLastOrderNumber()
|
||||
{
|
||||
var lastOrderNumber =
|
||||
(await context.EdiCustomerOrders.OrderByDescending(x => x.CustomerOrderNumber).FirstOrDefaultAsync())
|
||||
?.CustomerOrderNumber[3..] ?? "0";
|
||||
|
||||
return int.Parse(lastOrderNumber);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<EdiCustomerOrderDto>> GetAll()
|
||||
{
|
||||
IList<EdiCustomerOrderTranslateDto> ediCustomerOrderTranslates = await context.EdiCustomerOrderTranslates
|
||||
@@ -100,14 +109,19 @@ namespace SytelineSaAppEfDataModel.Services
|
||||
|
||||
public async Task<int> SendOrderToSyteline(Guid customerOrderNumber)
|
||||
{
|
||||
EdiCustomerOrder? ediCustomerOrder = await context.EdiCustomerOrders.FirstOrDefaultAsync(x => x.RowPointer == customerOrderNumber);
|
||||
EdiCustomerOrder? ediCustomerOrder =
|
||||
await context.EdiCustomerOrders.FirstOrDefaultAsync(x => x.RowPointer == customerOrderNumber);
|
||||
|
||||
if (ediCustomerOrder == null) return 0;
|
||||
|
||||
var ediCoNum = new SqlParameter("@PEdiCoNum", SqlDbType.NVarChar, 50) { Value = ediCustomerOrder.CustomerOrderNumber };
|
||||
var ediCoCount = new SqlParameter("@PEdiCoCount", SqlDbType.Int) { Value = 0, Direction = ParameterDirection.Output };
|
||||
var postedCount = new SqlParameter("@PPostedCount", SqlDbType.Int) { Value = 0, Direction = ParameterDirection.Output };
|
||||
var infoBar = new SqlParameter("@Infobar", SqlDbType.NVarChar, 2800) { Value = "", Direction = ParameterDirection.Output };
|
||||
var ediCoNum = new SqlParameter("@PEdiCoNum", SqlDbType.NVarChar, 50)
|
||||
{ Value = ediCustomerOrder.CustomerOrderNumber };
|
||||
var ediCoCount = new SqlParameter("@PEdiCoCount", SqlDbType.Int)
|
||||
{ Value = 0, Direction = ParameterDirection.Output };
|
||||
var postedCount = new SqlParameter("@PPostedCount", SqlDbType.Int)
|
||||
{ Value = 0, Direction = ParameterDirection.Output };
|
||||
var infoBar = new SqlParameter("@Infobar", SqlDbType.NVarChar, 2800)
|
||||
{ Value = "", Direction = ParameterDirection.Output };
|
||||
var autoPost = new SqlParameter("@AutoPost", SqlDbType.Int) { Value = 0 };
|
||||
var processId = new SqlParameter("@ProcessId", SqlDbType.Int) { Value = 423456 };
|
||||
|
||||
@@ -125,5 +139,36 @@ namespace SytelineSaAppEfDataModel.Services
|
||||
|
||||
return postedCountResult;
|
||||
}
|
||||
|
||||
public async Task<(bool, string)> SaveOrdersWithDetails(List<EdiCustomerOrderDto> ediCustomerOrders)
|
||||
{
|
||||
if (ediCustomerOrders.Count == 0)
|
||||
{
|
||||
return (false, string.Empty);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IList<EdiCustomerOrder> customerOrders = ediCustomerOrders.Select(mapper.Map<EdiCustomerOrder>).ToList();
|
||||
IList<EdiCustomerOrderLine> ediCustomerOrderLines = ediCustomerOrders
|
||||
.SelectMany(x => x.EdiCustomerOrderLines).Select(mapper.Map<EdiCustomerOrderLine>).ToList();
|
||||
IList<EdiCustomerOrderLineItem> ediCustomerOrderLineItems = ediCustomerOrders
|
||||
.SelectMany(x => x.EdiCustomerOrderLines).SelectMany(y => y.EdiCustomerOrderLineItems)
|
||||
.Select(mapper.Map<EdiCustomerOrderLineItem>).ToList();
|
||||
|
||||
await context.EdiCustomerOrders.AddRangeAsync(customerOrders);
|
||||
await context.EdiCustomerOrderLines.AddRangeAsync(ediCustomerOrderLines);
|
||||
await context.EdiCustomerOrderLineItems.AddRangeAsync(ediCustomerOrderLineItems);
|
||||
await context.EdiCustomerOrderTranslates.AddRangeAsync(ediCustomerOrders
|
||||
.SelectMany(x => x.EdiCustomerOrderTranslates)
|
||||
.Select(mapper.Map<EdiCustomerOrderTranslate>));
|
||||
await context.SaveChangesAsync();
|
||||
return (true, string.Empty);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (false, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
SytelineSaAppEfDataModel/Services/EdiLogService.cs
Normal file
15
SytelineSaAppEfDataModel/Services/EdiLogService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using AutoMapper;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Entities;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class EdiLogService(SytelineSaAppDbContext context, IMapper mapper) : IEdiLogService
|
||||
{
|
||||
public async Task<bool> AddEdiLog(EdiLogDto ediLog)
|
||||
{
|
||||
var entity = mapper.Map<EdiLog>(ediLog);
|
||||
await context.EdiLogs.AddAsync(entity);
|
||||
return await context.SaveChangesAsync() > 0;
|
||||
}
|
||||
}
|
||||
@@ -11,5 +11,15 @@ namespace SytelineSaAppEfDataModel.Services
|
||||
{
|
||||
Task<IEnumerable<CustomerOrderDto>> GetAll();
|
||||
Task<CustomerOrderDto?> GetByOrderNumber(Guid orderNumber);
|
||||
Task<CustomerOrderDto?> GetByCoNumber(string orderNumber);
|
||||
Task<CustomerOrderDto?> GetByCustomerAndPo(string customerNumber, int customerSequence, string poNumber);
|
||||
|
||||
Task<IList<CustomerOrderDto>> GetListByCustomerAndPo(string customerNumber, int customerSequence,
|
||||
string poNumber);
|
||||
|
||||
Task<CustomerOrderDto?> GetByPo(string poNumber);
|
||||
Task<List<CustomerOrderDto>> GetListByCustomer(string customerNumber, int customerSequence);
|
||||
Task<IEnumerable<CustomerOrderLineDto>?> GetLinesByCoNumber(string customerOrderNumber);
|
||||
Task<IEnumerable<CustomerOrderLineItemDto>?> GetItemsByCoNumber(string customerOrderNumber);
|
||||
}
|
||||
}
|
||||
|
||||
8
SytelineSaAppEfDataModel/Services/ICustomerService.cs
Normal file
8
SytelineSaAppEfDataModel/Services/ICustomerService.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface ICustomerService
|
||||
{
|
||||
Task<IList<CustomerDto>> GetAllCustomers();
|
||||
}
|
||||
8
SytelineSaAppEfDataModel/Services/ICustomerTpService.cs
Normal file
8
SytelineSaAppEfDataModel/Services/ICustomerTpService.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface ICustomerTpService
|
||||
{
|
||||
Task<IList<CustomerTpDto>> GetAllCustomersTp();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IEdiCustomerOrderImportService
|
||||
{
|
||||
Task<DateTime> GetLastUpdateDate();
|
||||
Task<bool> AddEdiCustomerOrderImport(EdiCustomerOrderImportDto ediCustomerOrderImport);
|
||||
Task<bool> AddEdiCustomerOrderImports(IList<EdiCustomerOrderImportDto> ediCustomerOrderImports);
|
||||
}
|
||||
@@ -9,10 +9,12 @@ namespace SytelineSaAppEfDataModel.Services
|
||||
{
|
||||
public interface IEdiCustomerOrderService
|
||||
{
|
||||
Task<int> GetLastOrderNumber();
|
||||
Task<IEnumerable<EdiCustomerOrderDto>> GetAll();
|
||||
Task<IEnumerable<EdiCustomerOrderDto?>> GetByDate(DateTime date);
|
||||
Task<EdiCustomerOrderDto?> GetByOrderNumber(Guid orderNumber);
|
||||
Task<IEnumerable<EdiCustomerOrderTranslateDto>> FindMissingOrders(DateTime startDate);
|
||||
Task<(bool, string)> SaveOrdersWithDetails(List<EdiCustomerOrderDto> ediCustomerOrders);
|
||||
Task<int> SendOrderToSyteline(Guid customerOrderNumber);
|
||||
}
|
||||
}
|
||||
|
||||
8
SytelineSaAppEfDataModel/Services/IEdiLogService.cs
Normal file
8
SytelineSaAppEfDataModel/Services/IEdiLogService.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IEdiLogService
|
||||
{
|
||||
Task<bool> AddEdiLog(EdiLogDto ediLog);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IItemCustPriceAllService
|
||||
{
|
||||
Task<ItemCustPriceAllDto?> GetItemCustPriceAllAsync(string itemNumber, string customerNumber);
|
||||
}
|
||||
8
SytelineSaAppEfDataModel/Services/IItemCustService.cs
Normal file
8
SytelineSaAppEfDataModel/Services/IItemCustService.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IItemCustService
|
||||
{
|
||||
Task<ItemCustDto> GetItem(string itemNumber, string customerNumber);
|
||||
}
|
||||
8
SytelineSaAppEfDataModel/Services/IItemService.cs
Normal file
8
SytelineSaAppEfDataModel/Services/IItemService.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IItemService
|
||||
{
|
||||
Task<ItemDto> GetItem(string itemNumber);
|
||||
}
|
||||
10
SytelineSaAppEfDataModel/Services/ILotService.cs
Normal file
10
SytelineSaAppEfDataModel/Services/ILotService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface ILotService
|
||||
{
|
||||
Task<IEnumerable<LotDto>> GetAll();
|
||||
Task<LotDto?> GetByItemNumber(string itemNumber);
|
||||
Task<LotDto?> GetByLotNumber(string lotNumber);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user