暫無描述

tum 612497b3ce readme 2 小時之前
app bf7012e325 en template 21 小時之前
db-init 53c83a80ce fix else 3 天之前
.gitignore 631f4cee30 template xlsx 1 年之前
.node-version bada0a1500 coi 1 年之前
Dockerfile a01e843d91 add jap name 3 天之前
README.md 612497b3ce readme 2 小時之前
checkbox_checked.jpg 631f4cee30 template xlsx 1 年之前
checkbox_unchecked.jpg 631f4cee30 template xlsx 1 年之前
data_ms.csv 49a52fb769 fix coi 2 天之前
docker-compose.yml a01e843d91 add jap name 3 天之前
e_master_view.csv 49a52fb769 fix coi 2 天之前
entrypoint.sh db1ef2c3ec first commit 1 年之前
hardness.xlsx 4c91f0c519 genreport 1 年之前
install.ps1 bada0a1500 coi 1 年之前
myuses.dot a01e843d91 add jap name 3 天之前
myuses.html a01e843d91 add jap name 3 天之前
requirements.txt bada0a1500 coi 1 年之前
test_xls.py 631f4cee30 template xlsx 1 年之前
test_xlsx2.py 4c91f0c519 genreport 1 年之前
testpd_xlsx.py 631f4cee30 template xlsx 1 年之前

README.md

COI Project

This project runs Django and SQL Server with Docker Compose.

Start The Stack

docker compose build
docker compose up -d
docker compose ps

Web app:

http://localhost:8039

Import Customer Template Data

The project includes a tab-separated import file:

app/customer_template_mapping_import.tsv

Import it into CustomerTemplateMapping:

docker exec coi-web-1 python manage.py import_customer_templates /app/customer_template_mapping_import.tsv

Set created_by:

docker exec coi-web-1 python manage.py import_customer_templates /app/customer_template_mapping_import.tsv --created_by 1

Override export template:

docker exec coi-web-1 python manage.py import_customer_templates /app/customer_template_mapping_import.tsv --export-template japanese

Import Command Behavior

  • Merges duplicate rows by customer_name
  • Uses the numeric template column from the TSV as the sheet selector
  • Maps template indexes to SHEET_NAMES using 1-based order
  • Skips hardness_out_in_4 from the numeric index mapping
  • Defaults imported export_template to asean

Adjusted numeric mapping:

1  -> hardness_out
2  -> hardness_out_in
3  -> hardness_both_size
4  -> dimension
5  -> dimension_weight_warp
6  -> dimension_app
7  -> dimension_app_drawing
8  -> dimension_bal_weight
9  -> dim_bal_app_hard
10 -> dim_bal_app_hard_stamp
11 -> dim_bal_app_rot_hard
12 -> thickness_8_point
13 -> centering

The command also still supports the older CSV format with customer_name and JSON template_names.

Other Management Commands

Seed or top up project data models:

docker exec coi-web-1 python manage.py seed_all_mock_models
docker exec coi-web-1 python manage.py seed_all_mock_models --target-count 100

Create missing user profiles:

docker exec coi-web-1 python manage.py create_profile

Run migrations:

docker exec coi-web-1 python manage.py migrate

Open a Django shell:

docker exec -it coi-web-1 python manage.py shell

Useful Docker Commands

Show running containers:

docker compose ps

View web logs:

docker compose logs web --tail 200

View database logs:

docker compose logs db --tail 200

Restart services:

docker compose restart web
docker compose restart db

Stop the stack:

docker compose down

COI Test Lots

Lots for /report/coi/:

  • 260218548-019 -> customer NOGUCHI SEIKI -> auto-selects asean
  • 260218549-022 -> customer NOGUCHI SEIKI -> auto-selects asean
  • CEN-TEST-008 -> customer CENTERING TEST -> auto-selects asean
  • CEN-TEST-012 -> customer CENTERING TEST -> auto-selects asean
  • CEN-JP-001 -> customer CENTERING JAPAN TEST -> auto-selects japanese

Notes

  • The web container name in Compose is coi-web-1
  • The database container name in Compose is coi-db-1
  • SQL Server credentials are defined in docker-compose.yml
  • The app code is mounted into the container from ./app