首次提交

master
unknown 6 months ago
commit 9380a8e330

3
.idea/.gitignore vendored

@ -0,0 +1,3 @@
# 默认忽略的文件
/shelf/
/workspace.xml

@ -0,0 +1,629 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DDLFileAttachmentManager">
<mappings />
<preferences />
</component>
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="true" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.DatabaseConsoleManager">
<connection id="a43a2568-3221-484a-ad31-c092b4b73a08">
<console name="Connection" type="STANDARD" schema="" session="Main" />
</connection>
<connection id="a29edc96-0d87-48b5-a98c-90d7b0399103">
<console name="Connection 1" type="STANDARD" schema="" session="Main" />
</connection>
</component>
<component name="DBNavigator.Project.DatabaseEditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.DatabaseSessionManager">
<connection id="a43a2568-3221-484a-ad31-c092b4b73a08" />
<connection id="a29edc96-0d87-48b5-a98c-90d7b0399103" />
</component>
<component name="DBNavigator.Project.DatasetFilterManager">
<filter-actions connection-id="a43a2568-3221-484a-ad31-c092b4b73a08" dataset="db_shop_info.commodity" active-filter-id="001d5c81-d9c7-4512-87de-69a45bc75e69">
<filter id="001d5c81-d9c7-4512-87de-69a45bc75e69" name="Filter 1" temporary="false" custom-name="false" type="basic" join-type="AND">
<condition column="com_code" operator="=" value="" active="true" />
</filter>
</filter-actions>
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.Settings">
<connections>
<connection id="a43a2568-3221-484a-ad31-c092b4b73a08" active="true" signed="true">
<database>
<name value="Connection" />
<description value="localhost" />
<database-type value="MYSQL" />
<config-type value="BASIC" />
<database-version value="8.0" />
<driver-source value="BUNDLED" />
<driver-library value="" />
<driver value="" />
<url-type value="DATABASE" />
<host value="localhost" />
<port value="3306" />
<database value="mysql" />
<tns-folder value="" />
<tns-profile value="" />
<type value="USER_PASSWORD" />
<user value="root" />
<deprecated-pwd value="MTIzNDU2" />
</database>
<properties>
<auto-commit value="true" />
</properties>
<ssh-settings>
<active value="false" />
<proxy-host value="" />
<proxy-port value="22" />
<proxy-user value="" />
<deprecated-proxy-pwd value="" />
<auth-type value="PASSWORD" />
<key-file value="" />
<key-passphrase value="" />
</ssh-settings>
<ssl-settings>
<active value="false" />
<certificate-authority-file value="" />
<client-certificate-file value="" />
<client-key-file value="" />
</ssl-settings>
<details>
<charset value="UTF-8" />
<session-management value="true" />
<ddl-file-binding value="true" />
<database-logging value="true" />
<connect-automatically value="true" />
<restore-workspace value="true" />
<restore-workspace-deep value="false" />
<environment-type value="default" />
<connectivity-timeout value="30" />
<idle-time-to-disconnect value="30" />
<idle-time-to-disconnect-pool value="5" />
<credential-expiry-time value="10" />
<max-connection-pool-size value="7" />
<alternative-statement-delimiter value="" />
</details>
<debugger>
<compile-dependencies value="true" />
<tcp-driver-tunneling value="false" />
<tcp-host-address value="" />
<tcp-port-from value="4000" />
<tcp-port-to value="4999" />
<debugger-type value="JDBC" />
</debugger>
<object-filters hide-empty-schemas="false" hide-pseudo-columns="false" hide-audit-columns="false">
<object-filters />
<object-type-filter use-master-settings="true">
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</object-filters>
</connection>
<connection id="a29edc96-0d87-48b5-a98c-90d7b0399103" active="true" signed="true">
<database>
<name value="Connection 1" />
<description value="localhost_3306" />
<database-type value="MYSQL" />
<config-type value="BASIC" />
<database-version value="8.0" />
<driver-source value="BUNDLED" />
<driver-library value="" />
<driver value="" />
<url-type value="DATABASE" />
<host value="localhost" />
<port value="3306" />
<database value="mysql" />
<tns-folder value="" />
<tns-profile value="" />
<type value="USER_PASSWORD" />
<user value="root" />
<deprecated-pwd value="MTIzNDU2" />
</database>
<properties>
<auto-commit value="false" />
</properties>
<ssh-settings>
<active value="false" />
<proxy-host value="" />
<proxy-port value="22" />
<proxy-user value="" />
<deprecated-proxy-pwd value="" />
<auth-type value="PASSWORD" />
<key-file value="" />
<key-passphrase value="" />
</ssh-settings>
<ssl-settings>
<active value="false" />
<certificate-authority-file value="" />
<client-certificate-file value="" />
<client-key-file value="" />
</ssl-settings>
<details>
<charset value="UTF-8" />
<session-management value="true" />
<ddl-file-binding value="true" />
<database-logging value="true" />
<connect-automatically value="true" />
<restore-workspace value="true" />
<restore-workspace-deep value="false" />
<environment-type value="default" />
<connectivity-timeout value="30" />
<idle-time-to-disconnect value="30" />
<idle-time-to-disconnect-pool value="5" />
<credential-expiry-time value="10" />
<max-connection-pool-size value="7" />
<alternative-statement-delimiter value="" />
</details>
<debugger>
<compile-dependencies value="true" />
<tcp-driver-tunneling value="false" />
<tcp-host-address value="" />
<tcp-port-from value="4000" />
<tcp-port-to value="4999" />
<debugger-type value="JDBC" />
</debugger>
<object-filters hide-empty-schemas="false" hide-pseudo-columns="false" hide-audit-columns="false">
<object-filters />
<object-type-filter use-master-settings="true">
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</object-filters>
</connection>
</connections>
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
<object-type name="TYPE ATTRIBUTE" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<audit-columns>
<column-names value="" />
<visible value="true" />
<editable value="false" />
</audit-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-actions-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-actions-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="SQL" enabled="true" />
<content-type name="PL/SQL" enabled="true" />
<content-type name="JSON" enabled="true" />
<content-type name="JSON5" enabled="true" />
<content-type name="YAML" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
<exit-on-changes value="ASK" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
</project>

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.11 (shopxm)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/shopxm.iml" filepath="$PROJECT_DIR$/.idea/shopxm.iml" />
</modules>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.11" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,16 @@
#商品实体类
class commodity:
def __init__(self, com_code, com_name, com_price, com_stock):
self.com_code = com_code #编号
self.com_name = com_name #名称
self.com_price = com_price #价格
self.com_stock = com_stock #库存
def get_commodity(self):
com_dict = {
'com_code':self.com_code,
'com_name':self.com_name,
'com_price':self.com_price,
'com_stock':self.com_stock,
}
return com_dict

@ -0,0 +1,464 @@
from tkinter import *
import tkinter as tk
import numpy as np
import openpyxl #操作excel表格
import pymssql #链接数据库
import tkinter.font as tkFont#字体
from tkinter import ttk #界面样式
from tkinter.filedialog import askopenfilename,askdirectory#系统文件操作
from tkinter import messagebox#信息提示框
from pandas import DataFrame#写数据表
from commodity import commodity # 商品实体类
import matplotlib.pyplot as plt #数据图包
from PIL import Image, ImageTk
# 创建主页面UI
class Application(Frame):
# 初始化
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.createWidget()
# 连接数据库
server = "LAPTOP-7PS55P1C"
user = "sa"
pwd = "123456"
db = "fruit"
self.conn = pymssql.connect(server, user, pwd, db, tds_version="7.0")
self.cursor = self.conn.cursor()
# 创建主页元素
def createWidget(self):
# 左侧背景图片
global photo_bg
photo_bg=PhotoImage(file='./s/center.gif')
lable_bg=Label(self,image=photo_bg)
lable_bg.pack()
self.frame_left = Frame(self,bg='#68b8be',width=200,height=540).place(x=0, y=0)
# logo图
global photo_Avatar
photo_Avatar=PhotoImage(file='./s/4.gif')
lable_Avatar=Label(self.frame_left,bg='#68b8be',image=photo_Avatar)
lable_Avatar.place(x=23,y=25)
# 功能按钮
menu_font=tkFont.Font(family='宋体',size=10)
Button(self.frame_left,text='数据图信息',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_drawing,).place(x=30,y=143,width=140,height=30)
Button(self.frame_left,text='商品信息',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_info,).place(x=30,y=193,width=140,height=30)
Button(self.frame_left,text='查询商品',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_inquire,).place(x=30,y=243,width=140,height=30)
Button(self.frame_left,text='添加商品',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_add,).place(x=30,y=293,width=140,height=30)
Button(self.frame_left,text='修改商品',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_modify,).place(x=30,y=343,width=140,height=30)
Button(self.frame_left,text='删除商品',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_delete,).place(x=30,y=393,width=140,height=30)
Button(self.frame_left,text='关于',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_about,).place(x=30,y=443,width=140,height=30)
Button(self.frame_left,text='退出',font=menu_font,fg='#000000',bg='#ffffff',command=self.index_quit,).place(x=30,y=493,width=140,height=30)
# 右侧背景图
self.frame_right=Frame(self,width=600,height=540).place(x=200,y=0)
global photo_index
photo_index=PhotoImage(file='./s/center.gif')
Label(self.frame_right,image=photo_index).place(x=200,y=0)
# 图纸
def index_drawing(self):
plt.rcParams["font.sans-serif"] = ["SimHei"]
y_pos = np.arange(len(self.DataList(1)))
# 创建条形图
plt.bar(y_pos, self.DataList(0))
# x轴标签
x = [1, 2, 3, 4, 5]
plt.xticks(y_pos, self.DataList(1))
# 显示
plt.show()
def DataList(self, number):
sql = "select top 5 com_stock,com_name from commodity order by cast(com_stock as int) desc"
self.cursor.execute(sql)
results = self.cursor.fetchall()
print(results)
data = []
for i in results:
data.append(str(i[number]).strip())
data = data[::-1]
# 将 'col_name' 列转换为数组
print(data)
return data
# 01查看商品信息
def index_info(self):
info=tk.Toplevel()
w=600
h=400
x=(info.winfo_screenwidth()-w)/2
y=(info.winfo_screenheight()-h)/2
info.geometry('%dx%d+%d+%d'%(w,h,x,y))
info.title('商品信息')
info.resizable(width=False,height=False)
info_frame=Frame(info,bg='#68b8be',width=600,height=55)
info_frame.place(x=0,y=0)
inquire_font_1=tkFont.Font(family='宋体',size=25,weight=tkFont.BOLD)
Label(info_frame,text='商品信息',font=inquire_font_1,bg='#68b8be').place(x=230,y=10)
entries=[]
sql="select *from commodity"
self.cursor.execute(sql)
results=self.cursor.fetchall()
com_list=[]
for result in results:
com_li=commodity(result[0],result[1],result[2],result[3])
com_list.append(com_li)
for i in com_list:
args=(i.get_commodity()['com_code'],i.get_commodity()['com_name'],i.get_commodity()['com_code'],i.get_commodity()['com_stock'])
entries.append(args)
table_frame=Frame(info)
table_frame.place(x=0,y=55,width=600,height=345)
yscroll=Scrollbar(table_frame,orient=VERTICAL)
style=ttk.Style()
style.configure('Treeview.Heading',font=(None,14))
style.configure('Treeview',rowheight=30,font=(None,12))
tree=ttk.Treeview(
master=table_frame,
columns=('商品编号','商品名称','商品价格','商品库存'),
yscrollcommand=yscroll.set,
)
yscroll.config(command=tree.yview)
yscroll.pack(side=RIGHT,fill=Y)
tree['show']='headings'
tree.heading('#1',text='商品编号')
tree.heading('#2',text='商品名称')
tree.heading('#3',text='商品价格')
tree.heading('#4',text='商品库存')
tree.column('#1',stretch=YES,width=150,minwidth=150,anchor='center')
tree.column('#2',stretch=YES,width=150,minwidth=150,anchor='center')
tree.column('#3',stretch=YES,width=150,minwidth=150,anchor='center')
tree.column('#4',stretch=YES,width=150,minwidth=150,anchor='center')
tree.pack(fill=BOTH,expand=1)
for entry in entries:
tree.insert('','end',values=(entry[0],entry[1],entry[2],entry[3]))
info.mainloop()
# 查询商品
#02查询商品
def index_inquire(self):
inquire=tk.Toplevel()
w=600
h=400
x=(inquire.winfo_screenwidth()-w)/2
y=(inquire.winfo_screenheight()-h)/2
global com_code
global com_price
global com_stock
global com_name_label
global com_price_label
global com_stock_label
com_code='查询中'
com_price='查询中'
com_stock='查询中'
inquire.geometry('%dx%d+%d+%d'%(w,h,x,y))
inquire.title('查询商品')
inquire.resizable(width=False,height=False)
inquire_frame=Frame(inquire,bg='#68b8be',width=600,height=400)
inquire_frame.pack()
inquire_font_1=tkFont.Font(family='宋体',size=25,weight=tkFont.BOLD)
Label(inquire_frame,text='查询商品信息',font=inquire_font_1,bg='#68b8be').place(x=200,y=20)
inquire_font_2=tkFont.Font(family='宋体',size=15)
# 说明图片位置,并导入图片到画布上
Label(inquire_frame, text='商品编号', font=inquire_font_2, bg='#68b8be').place(x=200, y=90)
Label(inquire_frame, text='商品名称', font=inquire_font_2, bg='#68b8be').place(x=200, y=150)
Label(inquire_frame, text='商品价格', font=inquire_font_2, bg='#68b8be').place(x=200, y=210)
Label(inquire_frame, text='商品库存', font=inquire_font_2, bg='#68b8be').place(x=200, y=270)
com_name_label=Label(inquire_frame,text=com_code,font=inquire_font_2,bg='#68b8be')
com_name_label.place(x=300,y=90)
com_name = tk.StringVar()
Entry(inquire_frame,highlightthickness=1,font=('宋体',15),bg='#F3F3F4',textvariable=com_name).place(x=300,y=150,width=200,height=30)
com_price_label = Label(inquire_frame, text=com_price, font=inquire_font_2, bg='#68b8be')
com_price_label.place(x=300, y=210)
com_stock_label = Label(inquire_frame, text=com_stock, font=inquire_font_2, bg='#68b8be')
com_stock_label.place(x=300, y=270)
Button(inquire_frame,text='立即查询',font=('宋体',15,'bold'),fg="#000000",bg="#ffffff",
command=lambda: self.inquire_com(com_name)).place(x=180,y=325,width=240,height=40)
inquire.mainloop()
#02-1数据库中查询商品返回结果
def inquire_com(self,com_name):
sql="select *from commodity where com_name like '%"+str(com_name.get())+"%'"
self.cursor.execute(sql)
result=self.cursor.fetchall()
self.conn.commit()
print(sql)
if len(result) ==0:
com_name_label.config(text='未查询到商品')
com_price_label.config(text='未查询到商品')
com_stock_label.config(text='未查询到商品')
else:
com=commodity(result[0][0],result[0][1],result[0][2],result[0][3])
if com is False:
com_name_label.config(text='未查询到商品')
com_price_label.config(text='未查询到商品')
com_stock_label.config(text='未查询到商品')
else:
com_name_label.config(text=com.get_commodity()['com_code'])
com_price_label.config(text=com.get_commodity()['com_price'])
com_stock_label.config(text=com.get_commodity()['com_stock'])
#03添加商品界面
def index_add(self):
add=tk.Toplevel()
w = 600
h = 400
x = (add.winfo_screenwidth() - w) / 2
y = (add.winfo_screenheight()-h) / 2
self.com_code=tk.StringVar()
self.com_name=tk.StringVar()
self.com_price=tk.StringVar()
self.com_stock=tk.StringVar()
add.geometry('%dx%d+%d+%d' % (w, h, x, y))
add.title('修改商品')
add.resizable(width=False, height=False)
add_frame = Frame(add, bg='#68b8be', width=600, height=400)
add_frame.pack()
add_font_1 = tkFont.Font(family='宋体', size=25, weight=tkFont.BOLD)
Label(add_frame, text='添加商品信息', font=add_font_1, bg='#68b8be').place(x=200, y=20)
add_font_2 = tkFont.Font(family='宋体', size=15)
# Label(add_frame, text='商品编号', font=add_font_2, bg='#68b8be').place(x=100, y=90)
modify_font_3=tkFont.Font(family='宋体',size=9)
# Label(add_frame, text='注意:商品编号不可重复', font=modify_font_3, bg='#68b8be').place(x=235, y=125)
Label(add_frame, text='商品名称', font=add_font_2, bg='#68b8be').place(x=100, y=100)
Label(add_frame, text='商品价格', font=add_font_2, bg='#68b8be').place(x=100, y=160)
Label(add_frame, text='商品库存', font=add_font_2, bg='#68b8be').place(x=100, y=210)
# Entry(add_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=self.com_code).place(x=300,y=90,width=200,height=30)
Entry(add_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=self.com_name).place(x=300,y=100,width=200,height=30)
Entry(add_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=self.com_price).place(x=300,y=160,width=200,height=30)
Entry(add_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=self.com_stock).place(x=300,y=210,width=200,height=30)
Button(add_frame,text='批量添加',font=('宋体',15,'bold'),fg='#000000',bg='#ffffff',command=self.add_com_up).place(x=50,y=325,width=120,height=40)
Button(add_frame,text='立即添加',font=('宋体',15,'bold'),fg='#000000',bg='#ffffff',command=self.add_com).place(x=250,y=325,width=120,height=40)
Button(add_frame,text='下载模板',font=('宋体',15,'bold'),fg='#000000',bg='#ffffff',command=self.add_com_download).place(x=450,y=325,width=120,height=40)
add.mainloop()
#03-1数据库中添加商品上传文件方式
def add_com_up(self):
path=askopenfilename(title='上传文件',initialdir='D:',filetypes=[("Excel表格",".xlsx")])
file=openpyxl.load_workbook(path)
ws=file[file.sheetnames[0]]#第一个表
excel_max_row=ws.max_row#最大行
list_com=[]
for row in range(2,excel_max_row+1):
com_code=ws.cell(row,1).value,
com_name=ws.cell(row,2).value,
com_price=ws.cell(row,3).value,
com_stock=ws.cell(row,4).value,
com=commodity(com_code,com_name,com_price,com_stock)
com_dict=com.get_commodity()
list_com.append(com_dict)
results=[]
for com in list_com:
com_code=com['com_code'][0]
com_name=com['com_name'][0]
com_price=com['com_price'][0]
com_stock=com['com_stock'][0]
sql="insert into commodity(com_name,com_price,com_stock) values('%s','%s','%s')" %(com_name,com_price,com_stock)
self.cursor.execute(sql)
# result=self.cursor.fetchall()
self.conn.commit()
results.append(com)
if len(results)==excel_max_row-1:
messagebox.showinfo('提示','商品批量导入成功!')
elif len(results)!=0 and len(results)!=excel_max_row-1:
messagebox.showinfo('提示','导入成功%s条商品数据,共%s条商品数据!'%(len(results),excel_max_row-1))
else:
messagebox.showinfo('提示','商品批量导入失败')
#03-2数据库中添加商品直接输入的方式
def add_com(self):
sql = "insert into commodity(com_name,com_price,com_stock) values('%s','%s','%s')" %(
self.com_name.get(),self.com_price.get(),self.com_stock.get())
try:
print(sql)
self.cursor.execute(sql)
self.conn.commit()
messagebox.showinfo('提示','添加商品成功')
except:
messagebox.showinfo('提示','添加商品失败')
#03-3数据库中添加商品下载模板)
def add_com_download(self):
path=askdirectory(title='下载到')
com=commodity('使用前请删除本行', 'tip:商品编号不允许重复', '保留两位小数', '整数')
dict_com=com.get_commodity()
list_com=[dict_com]
print(list_com)
com_code=[]
com_name=[]
com_price=[]
com_stock=[]
for li_com in list_com:
com_code.append(li_com['com_code'])
com_name.append(li_com['com_name'])
com_price.append(li_com['com_price'])
com_stock.append(li_com['com_stock'])
testDate=[com_code,com_name,com_price,com_stock]
name="/商品批量导入模板.xlsx"
filepath=path+name
dfData = {
"商品编号":testDate[0],
"商品名称":testDate[1],
"商品价格":testDate[2],
"商品库存":testDate[3],
}
print(dfData)
df= DataFrame(dfData)#创建DataFrame
df.to_excel(filepath,index=False)
if len(df) !=0:
messagebox.showinfo('提示','模板下载成功')
else:
messagebox.showinfo('提示','模板下载失败')
#04修改商品界面
def index_modify(self):
modify = tk.Toplevel()
w = 600
h = 400
x = (modify.winfo_screenwidth() - w) / 2
y = (modify.winfo_screenheight()-h) / 2
global com_code
global com_name
global com_price
global com_stock
global com_name_label
global com_price_label
global com_stock_label
com_code=tk.StringVar()
com_name = tk.StringVar()
com_price = tk.StringVar()
com_stock = tk.StringVar()
modify.geometry('%dx%d+%d+%d' % (w, h, x, y))
modify.title('修改商品')
modify.resizable(width=False, height=False)
modify_frame = Frame(modify, bg='#68b8be', width=600, height=400)
modify_frame.pack()
modify_font_1 = tkFont.Font(family='宋体', size=25, weight=tkFont.BOLD)
Label(modify_frame, text='修改商品信息', font=modify_font_1, bg='#68b8be').place(x=200, y=30)
modify_font_2 = tkFont.Font(family='宋体', size=15)
modify_font_3 = tkFont.Font(family='宋体', size=9)
Label(modify_frame, text='商品编号', font=modify_font_2, bg='#68b8be').place(x=100, y=90)
##################################################
Label(modify_frame, text='注意:商品编号不可修改', font=modify_font_3, bg='#68b8be').place(x=100, y=110)
Label(modify_frame, text='商品名称', font=modify_font_2, bg='#68b8be').place(x=100, y=150)
Label(modify_frame, text='商品价格', font=modify_font_2, bg='#68b8be').place(x=100, y=210)
Label(modify_frame, text='商品库存', font=modify_font_2, bg='#68b8be').place(x=100, y=270)
#输入框
Entry(modify_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=com_code).place(x=300,y=90,width=200,height=30)
Entry(modify_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=com_name).place(x=300,y=150,width=200,height=30)
Entry(modify_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=com_price).place(x=300,y=210,width=200,height=30)
Entry(modify_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=com_stock).place(x=300,y=270,width=200,height=30)
#按钮
Button(modify_frame, text='立即查询', font=('宋体', 15, 'bold'), fg="#000000", bg="#ffffff",
command=self.modify_inquire_com).place(x=100, y=325, width=120, height=40)
Button(modify_frame, text='立即修改', font=('宋体', 15, 'bold'), fg="#000000", bg="#ffffff",
command=self.modify_com).place(x=340, y=325, width=120, height=40)
modify.mainloop()
#04-1立即查询商品
def modify_inquire_com(self):
sql='select *from commodity where com_code=%s'% com_code.get()
self.cursor.execute(sql)
result=self.cursor.fetchall()
self.conn.commit()
if len(result) ==0:
com_name.set('未找到相关商品')
com_price.set('未找到相关商品')
com_stock.set('未找到相关商品')
else:
com=commodity(result[0][0],result[0][1],result[0][2],result[0][3],)
com_name.set(com.get_commodity()['com_name'])
com_price.set(com.get_commodity()['com_price'])
com_stock.set(com.get_commodity()['com_stock'])
#04-2修改商品
def modify_com(self):
###############################################
sql="update commodity set com_name='%s',com_price='%s',com_stock='%s' where com_code=%s" %(
com_name.get().strip(),com_price.get().strip(),com_stock.get().strip(),com_code.get().strip())
self.cursor.execute(sql)
self.conn.commit()
messagebox.showinfo('提示','修改成功')
#05删除商品界面
def index_delete(self):
delete=tk.Toplevel()
w = 600
h = 400
x = (delete.winfo_screenwidth() - w) / 2
y = (delete.winfo_screenheight() - h) / 2
global com_name
global com_price
global com_stock
global com_name_label
global com_price_label
global com_stock_label
com_name = '查询中'
com_price = '查询中'
com_stock = '查询中'
delete.geometry('%dx%d+%d+%d' %(w,h,x,y))
delete.title('删除商品')
delete.resizable(width=False,height=False)
delete_frame = Frame(delete, bg='#68b8be', width=600, height=400)
delete_frame.pack()
delete_font_1 = tkFont.Font(family='宋体', size=25, weight=tkFont.BOLD)
###############################
Label(delete_frame, text='删除商品信息', font=delete_font_1, bg='#68b8be').place(x=200, y=30)
delete_font_2 = tkFont.Font(family='宋体', size=15)
###############################
Label(delete_frame, text='商品编号', font=delete_font_2, bg='#68b8be').place(x=200, y=90)
Label(delete_frame, text='商品名称', font=delete_font_2, bg='#68b8be').place(x=200, y=150)
Label(delete_frame, text='商品价格', font=delete_font_2, bg='#68b8be').place(x=200, y=210)
Label(delete_frame, text='商品库存', font=delete_font_2, bg='#68b8be').place(x=200, y=270)
delete_com_code = tk.StringVar()
Entry(delete_frame, highlightthickness=1, font=('宋体', 15), bg='#F3F3F4', textvariable=delete_com_code).place(x=300,y=90,width=200,height=30)
com_name_label = Label(delete_frame, text=com_name, font=delete_font_2, bg='#68b8be')
com_name_label.place(x=300, y=150)
com_price_label = Label(delete_frame, text=com_price, font=delete_font_2, bg='#68b8be')
com_price_label.place(x=300, y=210)
com_stock_label = Label(delete_frame, text=com_stock, font=delete_font_2, bg='#68b8be')
com_stock_label.place(x=300, y=270)
Button(delete_frame, text='立即查询', font=('宋体', 15, 'bold'), fg="#000000", bg="#ffffff",
command=lambda: self.delete_inquire_com(delete_com_code)).place(x=100, y=325, width=120, height=40)
Button(delete_frame, text='立即删除', font=('宋体', 15, 'bold'), fg="#000000", bg="#ffffff",
command=lambda: self.delete_com(delete_com_code)).place(x=340, y=325, width=120, height=40)
delete.mainloop()
#05-1删除查询商品
def delete_inquire_com(self,delete_com_code):
sql="select *from commodity where com_code=%s" % delete_com_code.get()
self.cursor.execute(sql)
result=self.cursor.fetchall()
self.conn.commit()
if len(result) !=0:
com = commodity(result[0][0], result[0][1], result[0][2], result[0][3], )
com_name_label.config(text=com.get_commodity()['com_name'])
com_price_label.config(text=com.get_commodity()['com_price'])
com_stock_label.config(text=com.get_commodity()['com_stock'])
else:
com_name_label.config(text='为未查询到相关的商品')
com_price_label.config(text='为未查询到相关的商品')
com_stock_label.config(text='为未查询到相关的商品')
#05-2删除商品
def delete_com(self,delete_com_code):
sql='delete from commodity where com_code=%s' % delete_com_code.get()
self.cursor.execute(sql)
# result=self.cursor.fetchall()
self.conn.commit()
messagebox.showinfo('提示', '删除成功')
# if len(result)==0:
# messagebox.showinfo('提示','删除成功')
# else:
# messagebox.showinfo('提示','删除失败')
#06关于界面
def index_about(self):
about = Tk()
w = 600
h = 400
x = (about.winfo_screenwidth() - w) / 2
y = (about.winfo_screenheight() - h) / 2
about.geometry('%dx%d+%d+%d' % (w, h, x, y))
about.title('关于')
about.resizable(width=False, height=False)
about_frame = Frame(about, bg='#68b8be', width=600, height=400)
about_frame.pack()
about_font_1 = tkFont.Font(family='宋体', size=16, weight=tkFont.BOLD)
Label(about_frame, text='python超市管理系统', font=about_font_1, bg='#68b8be').place(x=200, y=90)
Label(about_frame, text='2024年', font=about_font_1, bg='#68b8be').place(x=200, y=130)
Label(about_frame, text='xiaoxiaojing', font=about_font_1, bg='#68b8be').place(x=200, y=160)
about.mainloop()
#07退出
def index_quit(self):
self.conn.close()
self.master.destroy()

@ -0,0 +1,102 @@
import tkinter
import pymssql
import tkinter.font as tkFont
from tkinter import *
from tkinter import messagebox
from index import Application as index_ui#登录成功进入主页
# 登陆界面UI设计与功能实现
class Application(Frame):
# 初始参数
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.username = tkinter.StringVar()
self.password = tkinter.StringVar()
self.createWidget()
# 界面设计
def createWidget(self):
# 设置背景图片
global photo_login
photo_login = PhotoImage(file='./s/bg.gif')
self.lable_bg = Label(self,image=photo_login)
self.lable_bg.pack()
# 欢迎语区域设计
global photo_login_center
photo_login_center = PhotoImage(file='./s/bg.gif')
label_login_center = Label(self, image=photo_login_center, width='600', height='340')
label_login_center.place(x=100, y=100)
welcome_font_1 = tkFont.Font(family='宋体', size=30, weight=tkFont.BOLD)
label_welcome_1 = Label(self, text="Welcome", font=welcome_font_1,bg='#56cdff')
label_welcome_1.place(x=175, y=170)
welcome_font_2 = tkFont.Font(family='宋体', size=20, weight=tkFont.BOLD)
label_welcome_2 = Label(self, text="欢迎登陆python", font=welcome_font_2, bg='#6BF0B9')
label_welcome_2.place(x=160, y=250)
label_welcome_3 = Label(self, text="超市管理系统", font=welcome_font_2, bg='#56cdff')
label_welcome_3.place(x=170, y=320)
# 数据输入区
login_font = tkFont.Font(family='宋体', size=15)
login_user = Label(self, text='账号', font=login_font, bg='#ffffff')
login_user.place(x=430, y=160)
Entry(self, highlightthickness=1, font=("宋体", 15), bg="#f3f3f4", textvariable=self.username).place(x=430,y=193,width=240,height=40)
login_pass = Label(self, text='密码:', font=login_font, bg='#ffffff')
login_pass.place(x=430, y=240)
Entry(self, highlightthickness=1, font=("宋体", 15), bg="#f3f3f4", show='*', textvariable=self.password).place(x=430, y=270, width=240, height=40)
Button(self, text='立即登录', font=('宋体', 15, 'bold'), fg='#000000', bg='#56cdff', command=self.login).place(x=430, y=340, width=240, height=40)
# 登陆方法
def login(self):
errMessage = ""
username = self.username.get()
password = self.password.get()
new_errMessage = self.login_verity(username, password)
errMessage = str(errMessage) + str(new_errMessage)
if errMessage != "":
messagebox.showinfo("提示", errMessage)
self.password.set('')
if new_errMessage == "登陆成功":
self.login_destroy()
# 加载index界面
index_ui(self.master)
# 登录校验
def login_verity(self, username, paassword):
errMessage = ""
result = False
if len(username) == 0:
errMessage = errMessage + "用户名不能为空!!"
elif len(paassword) == 0:
errMessage = errMessage + "密码不能为空!!"
else:
result = self.login_db(username, paassword)
if result is True:
errMessage = errMessage + "登陆成功"
else:
errMessage = errMessage + "用户名或密码错误"
return errMessage
# 登陆处理
def login_db(self, username, password):
print(username, password)
server = "LAPTOP-7PS55P1C"
user = "sa"
pwd = "123456"
db = "fruit"
conn = pymssql.connect(server, user, pwd, db, tds_version="7.0")
# 创建游标对象
cursor = conn.cursor()
sql = 'select * from userInfo where username=' + username + ' and password=' + password + ''
cursor.execute(sql)
result = cursor.fetchall()
conn.commit()
conn.close()
if len(result) == 0:
return False
else:
return True
# 销毁界面
def login_destroy(self):
self.destroy()

@ -0,0 +1,16 @@
from tkinter import *
from login import Application as login
if __name__ == '__main__':
win = Tk()
win.title('超市')
w=800
h=540
sw=win.winfo_screenwidth()
sh=win.winfo_screenheight()
x=(sw-w)/2
y=(sh-h)/2
win.geometry('%dx%d+%d+%d' % (w,h,x,y))
win.resizable(width=False, height=False)
login(master=win)
win.mainloop()

@ -0,0 +1 @@
8522

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

@ -0,0 +1,16 @@
import matplotlib.pyplot as plt
# 示例数据
x = [1, 2, 3, 4, 5]
y = [2, 4, 1, 5, 3]
# 绘制折线图
plt.plot(x, y)
# 添加标题和轴标签
plt.title("Example Plot")
plt.xlabel("X Axis")
plt.ylabel("Y Axis")
# 显示图形
plt.show()

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Loading…
Cancel
Save