From efbb4ce442b49a57c915663b40ac3d17b23dccb9 Mon Sep 17 00:00:00 2001 From: yangtengze Date: Sun, 21 May 2023 10:31:19 +0800 Subject: [PATCH 1/5] CODE --- data/data1.csv | 0 data/data2.csv | 0 images/Show.drawio.svg | 66 +++ images/delete_from_list.drawio.svg | 103 ++++ images/exit.drawio.svg | 48 ++ images/find_goods.drawio.svg | 102 ++++ images/increase_count.drawio.svg | 120 ++++ images/insert.drawio.svg | 102 ++++ images/main.drawio.svg | 848 +++++++++++++++++++++++++++++ images/readData.drawio.svg | 102 ++++ images/saveData.drawio.svg | 152 ++++++ images/save_data.drawio.svg | 0 images/show_goods.drawio.svg | 102 ++++ images/sort.drawio.svg | 66 +++ src/system.c | 45 ++ src/system.cpp | 418 ++++++++++++++ src/void.c | 413 ++++++++++++++ 17 files changed, 2687 insertions(+) create mode 100644 data/data1.csv create mode 100644 data/data2.csv create mode 100644 images/Show.drawio.svg create mode 100644 images/delete_from_list.drawio.svg create mode 100644 images/exit.drawio.svg create mode 100644 images/find_goods.drawio.svg create mode 100644 images/increase_count.drawio.svg create mode 100644 images/insert.drawio.svg create mode 100644 images/main.drawio.svg create mode 100644 images/readData.drawio.svg create mode 100644 images/saveData.drawio.svg create mode 100644 images/save_data.drawio.svg create mode 100644 images/show_goods.drawio.svg create mode 100644 images/sort.drawio.svg create mode 100644 src/system.c create mode 100644 src/system.cpp create mode 100644 src/void.c diff --git a/data/data1.csv b/data/data1.csv new file mode 100644 index 0000000..e69de29 diff --git a/data/data2.csv b/data/data2.csv new file mode 100644 index 0000000..e69de29 diff --git a/images/Show.drawio.svg b/images/Show.drawio.svg new file mode 100644 index 0000000..512a24f --- /dev/null +++ b/images/Show.drawio.svg @@ -0,0 +1,66 @@ + + + + + + + +
+
+
+ 图表模块 +
+
+
+
+ + 图表模块 + +
+
+ + + + + +
+
+
+ 打印一个图表格式 +
+
+
+
+ + 打印一个图表格式 + +
+
+ + + + + +
+
+
+ 调用打印函数 +
+
+
+
+ + 调用打印函数 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/delete_from_list.drawio.svg b/images/delete_from_list.drawio.svg new file mode 100644 index 0000000..a9ec896 --- /dev/null +++ b/images/delete_from_list.drawio.svg @@ -0,0 +1,103 @@ + + + + + + + +
+
+
+ 删除模块 +
+
+
+
+ + 删除模块 + +
+
+ + + + + +
+
+
+ 判断链表并返回信息 +
+
+
+
+ + 判断链表并返回信息 + +
+
+ + + + + +
+
+
+ 定义数组进行id比对 +
+
+
+
+ + 定义数组进行id比对 + +
+
+ + + + + + + +
+
+
+ 不存在则返回错误信息 +
+
+
+
+ + 不存在则返回错误信息 + +
+
+ + + + +
+
+
+ 存在则释放对应结点并更新结点 +
+
+
+
+ + 存在则释放对应结点并更新结点 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/exit.drawio.svg b/images/exit.drawio.svg new file mode 100644 index 0000000..c0b7c6f --- /dev/null +++ b/images/exit.drawio.svg @@ -0,0 +1,48 @@ + + + + + + + +
+
+
+ 退出模块 +
+
+
+
+ + 退出模块 + +
+
+ + + + + +
+
+
+ 调用保存函数并打印退出信息 +
+
+
+
+ + 调用保存函数并打印退出信息 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/find_goods.drawio.svg b/images/find_goods.drawio.svg new file mode 100644 index 0000000..d15a582 --- /dev/null +++ b/images/find_goods.drawio.svg @@ -0,0 +1,102 @@ + + + + + + + +
+
+
+ 查找模块 +
+
+
+
+ + 查找模块 + +
+
+ + + + + +
+
+
+ 判断链表是否存在并返回信息 +
+
+
+
+ + 判断链表是否存在并返回信息 + +
+
+ + + + + +
+
+
+ 创建数组进行id比对 +
+
+
+
+ + 创建数组进行id比对 + +
+
+ + + + + + +
+
+
+ 若不存在则返回错误信息 +
+
+
+
+ + 若不存在则返回错误信息 + +
+
+ + + + +
+
+
+ 存在则链表返回物品信息 +
+
+
+
+ + 存在则链表返回物品信息 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/increase_count.drawio.svg b/images/increase_count.drawio.svg new file mode 100644 index 0000000..2b61434 --- /dev/null +++ b/images/increase_count.drawio.svg @@ -0,0 +1,120 @@ + + + + + + + +
+
+
+ 修改模块 +
+
+
+
+ + 修改模块 + +
+
+ + + + + +
+
+
+ 判断指针并返回信息 +
+
+
+
+ + 判断指针并返回信息 + +
+
+ + + + + +
+
+
+ 定义数组用于id比对 +
+
+
+
+ + 定义数组用于id比对 + +
+
+ + + + + +
+
+
+ 输入id进行比对 +
+
+
+
+ + 输入id进行比对 + +
+
+ + + + + + +
+
+
+ 若没有则返回信息 +
+
+
+
+ + 若没有则返回信息 + +
+
+ + + + +
+
+
+ 若有则通过链表修改信息 +
+
+
+
+ + 若有则通过链表修改信息 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/insert.drawio.svg b/images/insert.drawio.svg new file mode 100644 index 0000000..3648733 --- /dev/null +++ b/images/insert.drawio.svg @@ -0,0 +1,102 @@ + + + + + + + +
+
+
+ 添加模块 +
+
+
+
+ + 添加模块 + +
+
+ + + + +
+
+
+ 判断链表是否存在 +
+
+
+
+ + 判断链表是否存在 + +
+
+ + + + + + +
+
+
+ 不存在返回error +
+
+
+
+ + 不存在返回error + +
+
+ + + + + +
+
+
+ 存在则头插法输入数据 +
+
+
+
+ + 存在则头插法输入数据 + +
+
+ + + + + +
+
+
+ 输入结束返回ok +
+
+
+
+ + 输入结束返回ok + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/main.drawio.svg b/images/main.drawio.svg new file mode 100644 index 0000000..511f7f2 --- /dev/null +++ b/images/main.drawio.svg @@ -0,0 +1,848 @@ + + + + + + + + + +
+
+
+ main +
+
+
+
+ + main + +
+
+ + + + + + + + +
+
+
+ init +
+
+
+
+ + init + +
+
+ + + + + + + +
+
+
+ display_menu +
+
+
+
+ + display_menu + +
+
+ + + + + + + +
+
+
+ c = make_choice +
+
+
+
+ + c = make_choice + +
+
+ + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 1 +
+
+
+
+ + c == 1 + +
+
+ + + + + + + +
+
+
+ read_data +
+
+
+
+ + read_data + +
+
+ + + + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 2 +
+
+
+
+ + c == 2 + +
+
+ + + + + + + +
+
+
+ savedata +
+
+
+
+ + savedata + +
+
+ + + + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 3 +
+
+
+
+ + c == 3 + +
+
+ + + + + + + +
+
+
+
+ show_goods +
+
+
+
+
+ + show_goods + +
+
+ + + + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 4 +
+
+
+
+ + c == 4 + +
+
+ + + + + + + +
+
+
+
+ + find_goods + +
+
+
+
+
+ + find_goods + +
+
+ + + + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 5 +
+
+
+
+ + c == 5 + +
+
+ + + + + + + +
+
+
+
+ insert +
+
+
+
+
+ + insert + +
+
+ + + + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 6 +
+
+
+
+ + c == 6 + +
+
+ + + + + + + +
+
+
+
+ increase_count +
+
+
+
+
+ + increase_count + +
+
+ + + + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 7 +
+
+
+
+ + c == 7 + +
+
+ + + + + + + +
+
+
+
+ delete_from_list +
+
+
+
+
+ + delete_from_list + +
+
+ + + + + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ c == 8 +
+
+
+
+ + c == 8 + +
+
+ + + + + + + +
+
+
+
+ sort +
+
+
+
+
+ + sort + +
+
+ + + + + + + + + + +
+
+
+ c == CMD_QUIT +
+
+
+
+ + c == CMD_QUIT + +
+
+ + + + + + + +
+
+
+ quit +
+
+
+
+ + quit + +
+
+ + + + + + + + +
+
+
+ 确定退出 +
+
+
+
+ + 确定退出 + +
+
+ + + + + + +
+
+
+ 命令错误,请重新选择 +
+
+
+
+ + 命令错误,请重新选择 + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+ + + + +
+
+
+ Y +
+
+
+
+ + Y + +
+
+ + + + +
+
+
+ N +
+
+
+
+ + N + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/readData.drawio.svg b/images/readData.drawio.svg new file mode 100644 index 0000000..b6de3dd --- /dev/null +++ b/images/readData.drawio.svg @@ -0,0 +1,102 @@ + + + + + + + +
+
+
+ 读取文件 +
+
+
+
+ + 读取文件 + +
+
+ + + + + +
+
+
+ 判断头指针 +
+
+
+
+ + 判断头指针 + +
+
+ + + + + +
+
+
+ 为空返回error +
+
+
+
+ + 为空返回error + +
+
+ + + + + +
+
+
+ 不为空文件指针指向文件 并打开 +
+
+
+
+ + 不为空文件指针指向文件 并打开 + +
+
+ + + + + +
+
+
+ 若文件内没有数据返回无信息 +
+
+
+
+ + 若文件内没有数据返回无信息 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/saveData.drawio.svg b/images/saveData.drawio.svg new file mode 100644 index 0000000..0af3f30 --- /dev/null +++ b/images/saveData.drawio.svg @@ -0,0 +1,152 @@ + + + + + + + + + +
+
+
+ save_data +
+
+
+
+ + save_data + +
+
+ + + + + + +
+
+
+ 输入文件名 +
+
+
+
+ + 输入文件名 + +
+
+ + + + + + +
+
+
+ 打开文件 +
+
+
+
+ + 打开文件 + +
+
+ + + + + + + + +
+
+
+ 打开文件成功? +
+
+
+
+ + 打开文件成功? + +
+
+ + + + + + +
+
+
+ 把所有库存记录 +
+ 写入文件 +
+
+
+
+ + 把所有库存记录 +写入文件 + +
+
+ + + + + + +
+
+
+ 关闭文件 +
+
+
+
+ + 关闭文件 + +
+
+ + + + + + + +
+
+
+ 提示打开文件失败 +
+
+
+
+ + 提示打开文件失败 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/save_data.drawio.svg b/images/save_data.drawio.svg new file mode 100644 index 0000000..e69de29 diff --git a/images/show_goods.drawio.svg b/images/show_goods.drawio.svg new file mode 100644 index 0000000..47b0ea3 --- /dev/null +++ b/images/show_goods.drawio.svg @@ -0,0 +1,102 @@ + + + + + + + +
+
+
+ 打印模块 +
+
+
+
+ + 打印模块 + +
+
+ + + + + +
+
+
+ 判断头指针 +
+
+
+
+ + 判断头指针 + +
+
+ + + + + +
+
+
+ 为空返回错误信息 +
+
+
+
+ + 为空返回错误信息 + +
+
+ + + + + +
+
+
+ 不为空定义指针变量 +
+
+
+
+ + 不为空定义指针变量 + +
+
+ + + + + +
+
+
+ 打印商品信息 +
+
+
+
+ + 打印商品信息 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/images/sort.drawio.svg b/images/sort.drawio.svg new file mode 100644 index 0000000..6370643 --- /dev/null +++ b/images/sort.drawio.svg @@ -0,0 +1,66 @@ + + + + + + + +
+
+
+ 排序模块 +
+
+
+
+ + 排序模块 + +
+
+ + + + + +
+
+
+ 链表的冒泡排序 +
+
+
+
+ + 链表的冒泡排序 + +
+
+ + + + + +
+
+
+ 定义前后指针对物品id进行从小到大的排序 +
+
+
+
+ + 定义前后指针对物品id进行从小到大的排序 + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/src/system.c b/src/system.c new file mode 100644 index 0000000..4c8d49b --- /dev/null +++ b/src/system.c @@ -0,0 +1,45 @@ + +#include +#include +#include +#include +#include "void.c" + +int main () +{ + LIST *pList = NULL; + pList = creation ( ); + readData2 ( pList ); + + while ( 1 ) + { + int choice = menu ( ); + int c1; + getchar(); + switch ( choice ) + { + case 1: + c1= menu1(); + if(c1==1) readData1 ( pList ); + if(c1==2) saveData(pList); + if(c1==3) show_goods(pList); + if(c1==4) find_goods(pList); + if(c1==5) insert(pList); + if(c1==6) increase_count(pList); + if(c1==7) delete_from_list(pList); + if(c1==8) sort(pList); + if(c1==9) Show(pList); + if(c1==0) {saveData(pList); printf("感谢使用");} + break; + case 2: + saveData ( pList ); + printf("感谢使用"); + return 0; + break; + default: + printf ("输入的信息有误,请重新输入!!!\r\n"); + break; + } + } + return 0; +} diff --git a/src/system.cpp b/src/system.cpp new file mode 100644 index 0000000..e780dd1 --- /dev/null +++ b/src/system.cpp @@ -0,0 +1,418 @@ +//sjandy sjandsy sjandsy +#include +#define Rl 1000 +using namespace std; + +#include +#include +#include +#include + +//常量定义 +#define SIZE 20 + +enum judge +{ + ERROR = -1, + OK, +}; + + +//类型定义 +struct goods +{ int id; + char name [SIZE]; + int count; +}; + +typedef struct goods dataType; + +typedef struct list +{ + dataType data; + struct list *pNext; +}LIST; + +LIST lis; + + +LIST * creation ( ) +{ + LIST *pList = NULL; + pList = ( LIST * ) malloc ( sizeof ( LIST ) ); + if ( NULL == pList ) + { + return NULL; + } + memset ( pList, 0, sizeof ( LIST ) ); + + return pList; +} + +bool add_goods(int id,char name[],int count,LIST *p){ + if ( NULL == p ) + { + return false; + } + //赋值 + strcpy(p->data.name,name); + p->data.count = count; + p->data.id=id; + return true; +} + +int insert ( LIST * pList ) +{ + //判断链表是否存在 + if ( NULL == pList ) + { + return ERROR; + } + LIST *p = creation ( ); + char name[20]; + int count=0; + int id=0; + printf("请输入id:\n"); + scanf("%d",&id); + printf("请输入商品名:\n"); + scanf("%s",&name); + printf("请输入商品数量:\n"); + scanf("%d",&count); + if(add_goods(id,name,count,p)){ + //头插法插入节点 + p->pNext = pList->pNext; + pList->pNext = p; + printf ( "商品 %s 已经添加成功\r\n", p->data.name ); + return OK; + } +} + + + + +int delete_from_list ( LIST * pList ) +{ + //判断链表是否存在,是否为空 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "数据库数据为空,请先添加商品信息\r\n" ); + return ERROR; + } + int s[SIZE] = {0}; + printf( "请输入需要删除的商品id\r\n" ); + scanf ( "%d", s ); + + LIST *p = pList->pNext; + LIST *q = pList; + + while ( NULL != p ) + { + if ( p->data.id == s[0] ) + { + q->pNext = p->pNext; + free ( p ); + p = NULL; + printf ( "商品 %s 信息已被删除!!\r\n", s ); + return OK; + } + p = p->pNext; + q = q->pNext; + + } + printf ( "您输入的商品名称没有找到!!\r\n" ); + return ERROR; +} + + + +int find_goods ( LIST *pList ) +{ + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "数据库数据为空,请先添加商品信息\r\n" ); + return ERROR; + } + int s[SIZE] = {0}; + printf( "请输入需要查找的商品id\r\n" ); + scanf ( "%d", s ); + + //定义指针变量 + LIST *p = pList->pNext; + while ( NULL != p ) + { + if ( p->data.id==s[0] ) + { printf ("商品的id:%d\r\n ",p->data.id); + printf ( "商品的名称:%s\r\n", p->data.name ); + printf ( "商品的数量:%d\r\n", p->data.count ); + return OK; + } + p = p->pNext; + } + printf ( "输入的商品信息无效!!!\r\n" ); + return ERROR; +} + + +int increase_count ( LIST *pList ) +{ + //判断链表是否存在,是否为空 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "数据库数据为空,请先添加商品信息\r\n" ); + return ERROR; + } + + int s[SIZE] = {0}; + printf( "请输入需修改的商品id\r\n" ); + scanf ( "%d", s ); + + + LIST *p = pList->pNext; + while ( NULL != p ) + { + + if ( p->data.id==s[0] ) + { + + printf ( "原商品的数量:%d\r\n", p->data.count ); + printf ( "请输入修改的商品数量\r\n" ); + int xiugai; + scanf ( "%d", &xiugai ); + p->data.count+=xiugai; + printf ( "商品数量修改成功 *_* \r\n" ); + return OK; + } + p = p->pNext; + } + printf ( "您输入的商品名称没有找到!!\r\n"); + return ERROR; +} + + +int menu ( ) +{ + + printf ( " ==欢迎来到商品管理系统===\r\n" ); + printf("1.功能菜单 | 2.退出 \n"); + + printf ( "请输入想要操作的选项*-*\r\n" ); + int choice = 0; + + scanf ( "%d", &choice ); + + return choice; +} + +int menu1 ( ) +{ + + printf ( " ==欢迎来到商品管理系统===\r\n" ); + printf ( "1.读取 | 2. 保存 | 3. 打印 | 4. 查询 | 5. 添加\n" + "6.修改 | 7.删除 | 8.排序 | 9.图表 | 0.退出\n\n"); + + //输入选项 + printf ( "请输入想要操作的选项*-*\r\n" ); + int choice = 0; + + scanf ( "%d", &choice ); + return choice; +} + + +int show_goods ( LIST *pList ) +{ + //判断 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "您的数据库内没有商品!\r\n" ); + return ERROR; + } + + int count = 0; + LIST *p = pList->pNext; + while ( NULL != p ) + { + count++; + printf ( "商品的id: %d\r\n",p->data.id); + printf ( "商品的名称:%s\r\n", p->data.name ); + printf ( "商品的数量:%d\r\n", p->data.count ); + //printf ( "商品的价格:%f\r\n", p->data.price ); + printf ( "\r\n" ); + p = p->pNext; + } + printf ( "商品的种类为 %d \r\n", count ); + return count; +} + + + +void saveData ( LIST *pList ) +{ + //判断 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "您没有商品信息不用保存\r\n" ); + return ; + } + + FILE *fp =NULL; + fp = fopen ( "ck.csv", "w+" ); + if ( NULL == fp ) + { + printf( "文件打开失败\r\n" ); + return ; + } + LIST *p = NULL; + int count = 0; + + while ( NULL != pList->pNext ) + { + p = pList->pNext; + pList->pNext = p->pNext; + fwrite(&p->data,sizeof(p->data),1,fp); + free (p); + p = NULL; + count++; + } + free ( pList ); + pList = NULL; + + fclose ( fp ); + printf ( "已经保存 %d 种商品信息\r\n" , count ); + + return; +} + +void readData ( LIST *pList ) +{ + //判断 + if ( NULL == pList ) + { + printf ( "读取数据失败!\r\n" ); + return ; + } + FILE *fp = fopen ( "ck.csv", "rb" ); + if ( NULL == fp ) + { + printf( "注意:您的数据库内没有商品信息\r\n" ); + return ; + } + + int count = 0; + int tmp = 1; + LIST *p = NULL; + + p = creation ( ); + fread(&p->data,sizeof(p->data),1,fp); + + while ( !feof(fp) ) + { + //头插法插入节点 + p->pNext = pList->pNext; + pList->pNext = p; + count++; + p = creation ( ); + fread(&p->data,sizeof(p->data),1,fp); + } + printf ( "数据库中有 %d 种商品信息\r\n", count ); + fclose ( fp ); + + return; +} + +int Show( LIST *pList ) +{printf("ID | NAME Amount\n"); + //判断 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "您的数据库内没有商品!\r\n" ); + return ERROR; + } + + int count = 0; + LIST *p = pList->pNext; + while ( NULL != p ) + { + count++; + printf ( "%d ",p->data.id); + printf ( " %s ", p->data.name ); + printf ( " %d ", p->data.count ); + printf ( "\r\n" ); + p = p->pNext; + } +} +void sort(LIST *pList) +{ + int i ,count = 0, num; + LIST *p, *q, *tail; + p = pList; + while(p->pNext != NULL) + { + count++; + p = p->pNext; + } + for(i = 0; i < count - 1; i++) + { + num = count - i - 1; + q = pList->pNext; + p = q->pNext; + tail = pList; + while(num--) + { + if(q->data.id > p->data.id) + { + q->pNext = p->pNext; + p->pNext = q; + tail->pNext = p; + } + tail = tail->pNext; + q = tail->pNext; + p = q->pNext; + } + } +} + +int main ( ) +{ + LIST *pList = NULL; + pList = creation ( ); + readData ( pList ); + + while ( 1 ) + { + int choice = menu ( ); + int c1; + getchar(); + switch ( choice ) + { + case 1: + c1= menu1(); + if(c1==1) readData ( pList ); + if(c1==2) saveData(pList); + if(c1==3) show_goods(pList); + if(c1==4) find_goods(pList); + if(c1==5) insert(pList); + if(c1==6) increase_count(pList); + if(c1==7) delete_from_list(pList); + if(c1==8) sort(pList); + if(c1==9) Show(pList); + if(c1==0) {saveData(pList); printf("感谢使用");} + break; + case 2: + saveData ( pList ); + printf("感谢使用"); + return 0; + break; + default: + printf ("输入的信息有误,请重新输入!!!\r\n"); + break; + } + } + return 0; +} diff --git a/src/void.c b/src/void.c new file mode 100644 index 0000000..3e17bbe --- /dev/null +++ b/src/void.c @@ -0,0 +1,413 @@ +#include +#include +#include +#include +//常量定义 +#define SIZE 20 + +enum judge +{ + ERROR = -1, + OK, +}; + + +//类型定义 +struct goods +{ int id; + char name [SIZE]; + int count; +}; + +typedef struct goods dataType; + +typedef struct list +{ + dataType data; + struct list *pNext; +}LIST; + +LIST lis; + + +LIST * creation ( ) +{ + LIST *pList = NULL; + pList = ( LIST * ) malloc ( sizeof ( LIST ) ); + if ( NULL == pList ) + { + return NULL; + } + memset ( pList, 0, sizeof ( LIST ) ); + + return pList; +} + +bool add_goods(int id,char name[],int count,LIST *p){ + if ( NULL == p ) + { + return false; + } + //赋值 + strcpy(p->data.name,name); + p->data.count = count; + p->data.id=id; + return true; +} + +int insert ( LIST * pList ) +{ + //判断链表是否存在 + if ( NULL == pList ) + { + return ERROR; + } + LIST *p = creation ( ); + char name[20]; + int count=0; + int id=0; + printf("请输入id:\n"); + scanf("%d",&id); + printf("请输入商品名:\n"); + scanf("%s",&name); + printf("请输入商品数量:\n"); + scanf("%d",&count); + if(add_goods(id,name,count,p)){ + //头插法插入节点 + p->pNext = pList->pNext; + pList->pNext = p; + printf ( "商品 %s 已经添加成功\r\n", p->data.name ); + return OK; + } +} + + + + +int delete_from_list ( LIST * pList ) +{ + //判断链表是否存在,是否为空 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "数据库数据为空,请先添加商品信息\r\n" ); + return ERROR; + } + int s[SIZE] = {0}; + printf( "请输入需要删除的商品id\r\n" ); + scanf ( "%d", s ); + + LIST *p = pList->pNext; + LIST *q = pList; + + while ( NULL != p ) + { + if ( p->data.id == s[0] ) + { + q->pNext = p->pNext; + free ( p ); + p = NULL; + printf ( "商品 %s 信息已被删除!!\r\n", s ); + return OK; + } + p = p->pNext; + q = q->pNext; + + } + printf ( "您输入的商品名称没有找到!!\r\n" ); + return ERROR; +} + + + +int find_goods ( LIST *pList ) +{ + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "数据库数据为空,请先添加商品信息\r\n" ); + return ERROR; + } + int s[SIZE] = {0}; + printf( "请输入需要查找的商品id\r\n" ); + scanf ( "%d", s ); + + //定义指针变量 + LIST *p = pList->pNext; + while ( NULL != p ) + { + if ( p->data.id==s[0] ) + { printf ("商品的id:%d\r\n ",p->data.id); + printf ( "商品的名称:%s\r\n", p->data.name ); + printf ( "商品的数量:%d\r\n", p->data.count ); + return OK; + } + p = p->pNext; + } + printf ( "输入的商品信息无效!!!\r\n" ); + return ERROR; +} + + +int increase_count ( LIST *pList ) +{ + //判断链表是否存在,是否为空 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "数据库数据为空,请先添加商品信息\r\n" ); + return ERROR; + } + + int s[SIZE] = {0}; + printf( "请输入需修改的商品id\r\n" ); + scanf ( "%d", s ); + + + LIST *p = pList->pNext; + while ( NULL != p ) + { + + if ( p->data.id==s[0] ) + { + + printf ( "原商品的数量:%d\r\n", p->data.count ); + printf ( "请输入修改的商品数量\r\n" ); + int xiugai; + scanf ( "%d", &xiugai ); + p->data.count+=xiugai; + printf ( "商品数量修改成功 *_* \r\n" ); + return OK; + } + p = p->pNext; + } + printf ( "您输入的商品名称没有找到!!\r\n"); + return ERROR; +} + + +int menu ( ) +{ + + printf ( " ==欢迎来到商品管理系统===\r\n" ); + printf("1.功能菜单 | 2.退出 \n"); + + printf ( "请输入想要操作的选项*-*\r\n" ); + int choice = 0; + + scanf ( "%d", &choice ); + + return choice; +} + +int menu1 ( ) +{ + + printf ( " ==欢迎来到商品管理系统===\r\n" ); + printf ( "1.读取 | 2. 保存 | 3. 打印 | 4. 查询 | 5. 添加\n" + "6.修改 | 7.删除 | 8.排序 | 9.图表 | 0.退出\n\n"); + + //输入选项 + printf ( "请输入想要操作的选项*-*\r\n" ); + int choice = 0; + + scanf ( "%d", &choice ); + return choice; +} + + +int show_goods ( LIST *pList ) +{ + //判断 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "您的数据库内没有商品!\r\n" ); + return ERROR; + } + + int count = 0; + LIST *p = pList->pNext; + while ( NULL != p ) + { + count++; + printf ( "商品的id: %d\r\n",p->data.id); + printf ( "商品的名称:%s\r\n", p->data.name ); + printf ( "商品的数量:%d\r\n", p->data.count ); + //printf ( "商品的价格:%f\r\n", p->data.price ); + printf ( "\r\n" ); + p = p->pNext; + } + printf ( "商品的种类为 %d \r\n", count ); + return count; +} + + + +void saveData ( LIST *pList ) +{ + //判断 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "您没有商品信息不用保存\r\n" ); + return ; + } + printf("输入文件名称: "); + char str=getchar(); + FILE *fp =NULL; + fp = fopen ( "data2.csv", "w+" ); + if ( NULL == fp ) + { + printf( "文件打开失败\r\n" ); + return ; + } + LIST *p = NULL; + int count = 0; + + while ( NULL != pList->pNext ) + { + p = pList->pNext; + pList->pNext = p->pNext; + fwrite(&p->data,sizeof(p->data),1,fp); + free (p); + p = NULL; + count++; + } + free ( pList ); + pList = NULL; + + fclose ( fp ); + printf ( "已经保存 %d 种商品信息\r\n" , count ); + + return; +} + +void readData1 ( LIST *pList ) +{ + //判断 + if ( NULL == pList ) + { + printf ( "读取数据失败!\r\n" ); + return ; + } + FILE *fp = fopen ( "data1.csv", "rb" ); + if ( NULL == fp ) + { + printf( "注意:您的数据库内没有商品信息\r\n" ); + return ; + } + + int count = 0; + int tmp = 1; + LIST *p = NULL; + + p = creation ( ); + fread(&p->data,sizeof(p->data),1,fp); + + while ( !feof(fp) ) + { + //头插法插入节点 + p->pNext = pList->pNext; + pList->pNext = p; + count++; + p = creation ( ); + fread(&p->data,sizeof(p->data),1,fp); + } + printf ( "数据库中有 %d 种商品信息\r\n", count ); + fclose ( fp ); + + return; +} +void readData2 ( LIST *pList ) +{ + //判断 + if ( NULL == pList ) + { + printf ( "读取数据失败!\r\n" ); + return ; + } + + printf("输入文件名称: "); + char str=getchar(); + FILE *fp = fopen ( "data2.csv", "rb" ); + if ( NULL == fp ) + { + printf( "注意:您的数据库内没有商品信息\r\n" ); + return ; + } + + int count = 0; + int tmp = 1; + LIST *p = NULL; + + p = creation ( ); + fread(&p->data,sizeof(p->data),1,fp); + + while ( !feof(fp) ) + { + //头插法插入节点 + p->pNext = pList->pNext; + pList->pNext = p; + count++; + p = creation ( ); + fread(&p->data,sizeof(p->data),1,fp); + } + printf ( "数据库中有 %d 种商品信息\r\n", count ); + fclose ( fp ); + + return; +} + +int Show( LIST *pList ) +{printf("ID | NAME Amount\n"); + //判断 + if ( NULL == pList + || NULL == pList->pNext ) + { + printf ( "您的数据库内没有商品!\r\n" ); + return ERROR; + } + + int count = 0; + LIST *p = pList->pNext; + while ( NULL != p ) + { + count++; + printf ( "%d ",p->data.id); + printf ( " %s ", p->data.name ); + printf ( " %d ", p->data.count ); + printf ( "\r\n" ); + p = p->pNext; + } +} +void sort(LIST *pList) +{ + int i ,count = 0, num; + LIST *p, *q, *tail; + p = pList; + while(p->pNext != NULL) + { + count++; + p = p->pNext; + } + for(i = 0; i < count - 1; i++) + { + num = count - i - 1; + q = pList->pNext; + p = q->pNext; + tail = pList; + while(num--) + { + if(q->data.id > p->data.id) + { + q->pNext = p->pNext; + p->pNext = q; + tail->pNext = p; + } + tail = tail->pNext; + q = tail->pNext; + p = q->pNext; + } + } +} From c215514261e726f31059a5c3de0d812345ccbb89 Mon Sep 17 00:00:00 2001 From: yangtengze Date: Sun, 21 May 2023 10:35:59 +0800 Subject: [PATCH 2/5] KANBAN --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 094f521..37c0619 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,50 @@ -# a +# 零件库存管理系统 + +2022年6月9日 + +胡顺奇,岳楠,姚祥格,楚佳杰 + +## 项目简介 + +本系统是程序设计与问题求解课程设计项目,实现了库存零件 CSV 格式数据文件的读取和保存,以及数据的增删改查(CRUD)、排序和图表显示等功能。项目采用 C 语言编程实现,在 VS Code 集成开发环境(IDE)中用 GCC 进行编译。系统采用模块化设计,程序结构清晰,采用菜单驱动的命令行界面,操作便捷,能够用 CSV 格式读取和保存数据,通用性强,能够用图表展示数据,直观清楚。 + +下载地址:https://gitee.com/sjandsy/parts-management.git + +项目开发过程中采用 Kanban(看板)进行任务管理和分工协作,并使用 Git 对程序代码和文档进行版本管理。任务分工情况如下: + +| 任务 | 设计 | 开发 | 测试 | 文档 | +| ---- | ---- | ---- | ---- | ---- | +| C1-C3 菜单驱动的用户界面 | 胡顺奇 | 胡顺奇 | 胡顺奇 | 岳楠,姚祥格,楚佳杰 | +|C4 添加库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +|C5 查询库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +|C6 打印库存列表 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +|C7 修改库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +|C8 删除库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +|C9 库存记录排序 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +|C10 读取库存文件 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +|C11 将库存保存到文件 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | + +每个成员的工作量(百分比): +| 胡顺奇 | 岳楠 | 姚祥格 | 楚佳杰 | +|--------|-------|---------|-------| +| 90 | 4 | 3 | 3 | + + + +## 关于零件库存管理系统 + +设计一个库存零件管理系统,要求采用命令行菜单界面进行交互,具备读取、保存、打印、查询、修改、插入、删除和排序等基本功能,能够以表格和图表形式展示数据,采用 CSV 格式保存数据。 + +系统的功能性需求: +- 数据的读取、保存、打印、查询、修改、插入、删除、排序和图表展示。 + +系统的非功能性需求: +- 菜单驱动的命令行交互界面。 + + +## 需求分析 + +分析系统的功能需求和界面需求,编制用户手册如下。 #### C1: 启动程序 From d5e049ff3ebe7b7ab2011082d35f1269a8377ec3 Mon Sep 17 00:00:00 2001 From: yangtengze Date: Sun, 21 May 2023 10:39:03 +0800 Subject: [PATCH 3/5] kanban --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 37c0619..baae73e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # 零件库存管理系统 -2022年6月9日 +2023/5/21 -胡顺奇,岳楠,姚祥格,楚佳杰 +杨腾泽,孙英皓,刘彩月,李聪颖 ## 项目简介 @@ -14,21 +14,20 @@ | 任务 | 设计 | 开发 | 测试 | 文档 | | ---- | ---- | ---- | ---- | ---- | -| C1-C3 菜单驱动的用户界面 | 胡顺奇 | 胡顺奇 | 胡顺奇 | 岳楠,姚祥格,楚佳杰 | -|C4 添加库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | -|C5 查询库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | -|C6 打印库存列表 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | -|C7 修改库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | -|C8 删除库存记录 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | -|C9 库存记录排序 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | -|C10 读取库存文件 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | -|C11 将库存保存到文件 | 胡顺奇 | 胡顺奇 | 岳楠 姚祥格 楚佳杰 | 岳楠 姚祥格 楚佳杰 | +| C1-C3 菜单驱动的用户界面 | | | | | +|C4 添加库存记录 | | | | | +|C5 查询库存记录 | | | | | +|C6 打印库存列表 | | | | | +|C7 修改库存记录 | | | | | +|C8 删除库存记录 | | | | | +|C9 库存记录排序 | | | | | +|C10 读取库存文件 | | | | | +|C11 将库存保存到文件 | | | | | 每个成员的工作量(百分比): -| 胡顺奇 | 岳楠 | 姚祥格 | 楚佳杰 | +| | | | | |--------|-------|---------|-------| -| 90 | 4 | 3 | 3 | - +| | | | | ## 关于零件库存管理系统 From fb640956c8c1477a83bee2d80a9aec0c691a12d6 Mon Sep 17 00:00:00 2001 From: yangtengze Date: Sun, 21 May 2023 10:41:57 +0800 Subject: [PATCH 4/5] tubiao --- images/Show.drawio.svg | 66 --- images/delete_from_list.drawio.svg | 103 ---- images/exit.drawio.svg | 48 -- images/find_goods.drawio.svg | 102 ---- images/increase_count.drawio.svg | 120 ---- images/insert.drawio.svg | 102 ---- images/main.drawio.svg | 848 ----------------------------- images/readData.drawio.svg | 102 ---- images/saveData.drawio.svg | 152 ------ images/save_data.drawio.svg | 0 images/show_goods.drawio.svg | 102 ---- images/sort.drawio.svg | 66 --- 12 files changed, 1811 deletions(-) delete mode 100644 images/Show.drawio.svg delete mode 100644 images/delete_from_list.drawio.svg delete mode 100644 images/exit.drawio.svg delete mode 100644 images/find_goods.drawio.svg delete mode 100644 images/increase_count.drawio.svg delete mode 100644 images/insert.drawio.svg delete mode 100644 images/main.drawio.svg delete mode 100644 images/readData.drawio.svg delete mode 100644 images/saveData.drawio.svg delete mode 100644 images/save_data.drawio.svg delete mode 100644 images/show_goods.drawio.svg delete mode 100644 images/sort.drawio.svg diff --git a/images/Show.drawio.svg b/images/Show.drawio.svg deleted file mode 100644 index 512a24f..0000000 --- a/images/Show.drawio.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - -
-
-
- 图表模块 -
-
-
-
- - 图表模块 - -
-
- - - - - -
-
-
- 打印一个图表格式 -
-
-
-
- - 打印一个图表格式 - -
-
- - - - - -
-
-
- 调用打印函数 -
-
-
-
- - 调用打印函数 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/delete_from_list.drawio.svg b/images/delete_from_list.drawio.svg deleted file mode 100644 index a9ec896..0000000 --- a/images/delete_from_list.drawio.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - -
-
-
- 删除模块 -
-
-
-
- - 删除模块 - -
-
- - - - - -
-
-
- 判断链表并返回信息 -
-
-
-
- - 判断链表并返回信息 - -
-
- - - - - -
-
-
- 定义数组进行id比对 -
-
-
-
- - 定义数组进行id比对 - -
-
- - - - - - - -
-
-
- 不存在则返回错误信息 -
-
-
-
- - 不存在则返回错误信息 - -
-
- - - - -
-
-
- 存在则释放对应结点并更新结点 -
-
-
-
- - 存在则释放对应结点并更新结点 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/exit.drawio.svg b/images/exit.drawio.svg deleted file mode 100644 index c0b7c6f..0000000 --- a/images/exit.drawio.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - -
-
-
- 退出模块 -
-
-
-
- - 退出模块 - -
-
- - - - - -
-
-
- 调用保存函数并打印退出信息 -
-
-
-
- - 调用保存函数并打印退出信息 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/find_goods.drawio.svg b/images/find_goods.drawio.svg deleted file mode 100644 index d15a582..0000000 --- a/images/find_goods.drawio.svg +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - -
-
-
- 查找模块 -
-
-
-
- - 查找模块 - -
-
- - - - - -
-
-
- 判断链表是否存在并返回信息 -
-
-
-
- - 判断链表是否存在并返回信息 - -
-
- - - - - -
-
-
- 创建数组进行id比对 -
-
-
-
- - 创建数组进行id比对 - -
-
- - - - - - -
-
-
- 若不存在则返回错误信息 -
-
-
-
- - 若不存在则返回错误信息 - -
-
- - - - -
-
-
- 存在则链表返回物品信息 -
-
-
-
- - 存在则链表返回物品信息 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/increase_count.drawio.svg b/images/increase_count.drawio.svg deleted file mode 100644 index 2b61434..0000000 --- a/images/increase_count.drawio.svg +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - -
-
-
- 修改模块 -
-
-
-
- - 修改模块 - -
-
- - - - - -
-
-
- 判断指针并返回信息 -
-
-
-
- - 判断指针并返回信息 - -
-
- - - - - -
-
-
- 定义数组用于id比对 -
-
-
-
- - 定义数组用于id比对 - -
-
- - - - - -
-
-
- 输入id进行比对 -
-
-
-
- - 输入id进行比对 - -
-
- - - - - - -
-
-
- 若没有则返回信息 -
-
-
-
- - 若没有则返回信息 - -
-
- - - - -
-
-
- 若有则通过链表修改信息 -
-
-
-
- - 若有则通过链表修改信息 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/insert.drawio.svg b/images/insert.drawio.svg deleted file mode 100644 index 3648733..0000000 --- a/images/insert.drawio.svg +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - -
-
-
- 添加模块 -
-
-
-
- - 添加模块 - -
-
- - - - -
-
-
- 判断链表是否存在 -
-
-
-
- - 判断链表是否存在 - -
-
- - - - - - -
-
-
- 不存在返回error -
-
-
-
- - 不存在返回error - -
-
- - - - - -
-
-
- 存在则头插法输入数据 -
-
-
-
- - 存在则头插法输入数据 - -
-
- - - - - -
-
-
- 输入结束返回ok -
-
-
-
- - 输入结束返回ok - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/main.drawio.svg b/images/main.drawio.svg deleted file mode 100644 index 511f7f2..0000000 --- a/images/main.drawio.svg +++ /dev/null @@ -1,848 +0,0 @@ - - - - - - - - - -
-
-
- main -
-
-
-
- - main - -
-
- - - - - - - - -
-
-
- init -
-
-
-
- - init - -
-
- - - - - - - -
-
-
- display_menu -
-
-
-
- - display_menu - -
-
- - - - - - - -
-
-
- c = make_choice -
-
-
-
- - c = make_choice - -
-
- - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 1 -
-
-
-
- - c == 1 - -
-
- - - - - - - -
-
-
- read_data -
-
-
-
- - read_data - -
-
- - - - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 2 -
-
-
-
- - c == 2 - -
-
- - - - - - - -
-
-
- savedata -
-
-
-
- - savedata - -
-
- - - - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 3 -
-
-
-
- - c == 3 - -
-
- - - - - - - -
-
-
-
- show_goods -
-
-
-
-
- - show_goods - -
-
- - - - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 4 -
-
-
-
- - c == 4 - -
-
- - - - - - - -
-
-
-
- - find_goods - -
-
-
-
-
- - find_goods - -
-
- - - - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 5 -
-
-
-
- - c == 5 - -
-
- - - - - - - -
-
-
-
- insert -
-
-
-
-
- - insert - -
-
- - - - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 6 -
-
-
-
- - c == 6 - -
-
- - - - - - - -
-
-
-
- increase_count -
-
-
-
-
- - increase_count - -
-
- - - - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 7 -
-
-
-
- - c == 7 - -
-
- - - - - - - -
-
-
-
- delete_from_list -
-
-
-
-
- - delete_from_list - -
-
- - - - - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- c == 8 -
-
-
-
- - c == 8 - -
-
- - - - - - - -
-
-
-
- sort -
-
-
-
-
- - sort - -
-
- - - - - - - - - - -
-
-
- c == CMD_QUIT -
-
-
-
- - c == CMD_QUIT - -
-
- - - - - - - -
-
-
- quit -
-
-
-
- - quit - -
-
- - - - - - - - -
-
-
- 确定退出 -
-
-
-
- - 确定退出 - -
-
- - - - - - -
-
-
- 命令错误,请重新选择 -
-
-
-
- - 命令错误,请重新选择 - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
- - - - -
-
-
- Y -
-
-
-
- - Y - -
-
- - - - -
-
-
- N -
-
-
-
- - N - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/readData.drawio.svg b/images/readData.drawio.svg deleted file mode 100644 index b6de3dd..0000000 --- a/images/readData.drawio.svg +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - -
-
-
- 读取文件 -
-
-
-
- - 读取文件 - -
-
- - - - - -
-
-
- 判断头指针 -
-
-
-
- - 判断头指针 - -
-
- - - - - -
-
-
- 为空返回error -
-
-
-
- - 为空返回error - -
-
- - - - - -
-
-
- 不为空文件指针指向文件 并打开 -
-
-
-
- - 不为空文件指针指向文件 并打开 - -
-
- - - - - -
-
-
- 若文件内没有数据返回无信息 -
-
-
-
- - 若文件内没有数据返回无信息 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/saveData.drawio.svg b/images/saveData.drawio.svg deleted file mode 100644 index 0af3f30..0000000 --- a/images/saveData.drawio.svg +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - -
-
-
- save_data -
-
-
-
- - save_data - -
-
- - - - - - -
-
-
- 输入文件名 -
-
-
-
- - 输入文件名 - -
-
- - - - - - -
-
-
- 打开文件 -
-
-
-
- - 打开文件 - -
-
- - - - - - - - -
-
-
- 打开文件成功? -
-
-
-
- - 打开文件成功? - -
-
- - - - - - -
-
-
- 把所有库存记录 -
- 写入文件 -
-
-
-
- - 把所有库存记录 -写入文件 - -
-
- - - - - - -
-
-
- 关闭文件 -
-
-
-
- - 关闭文件 - -
-
- - - - - - - -
-
-
- 提示打开文件失败 -
-
-
-
- - 提示打开文件失败 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/save_data.drawio.svg b/images/save_data.drawio.svg deleted file mode 100644 index e69de29..0000000 diff --git a/images/show_goods.drawio.svg b/images/show_goods.drawio.svg deleted file mode 100644 index 47b0ea3..0000000 --- a/images/show_goods.drawio.svg +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - -
-
-
- 打印模块 -
-
-
-
- - 打印模块 - -
-
- - - - - -
-
-
- 判断头指针 -
-
-
-
- - 判断头指针 - -
-
- - - - - -
-
-
- 为空返回错误信息 -
-
-
-
- - 为空返回错误信息 - -
-
- - - - - -
-
-
- 不为空定义指针变量 -
-
-
-
- - 不为空定义指针变量 - -
-
- - - - - -
-
-
- 打印商品信息 -
-
-
-
- - 打印商品信息 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file diff --git a/images/sort.drawio.svg b/images/sort.drawio.svg deleted file mode 100644 index 6370643..0000000 --- a/images/sort.drawio.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - -
-
-
- 排序模块 -
-
-
-
- - 排序模块 - -
-
- - - - - -
-
-
- 链表的冒泡排序 -
-
-
-
- - 链表的冒泡排序 - -
-
- - - - - -
-
-
- 定义前后指针对物品id进行从小到大的排序 -
-
-
-
- - 定义前后指针对物品id进行从小到大的排序 - -
-
-
- - - - - Viewer does not support full SVG 1.1 - - - -
\ No newline at end of file From 3d91c0210f46edead7c42232a4c1758bd22e5f99 Mon Sep 17 00:00:00 2001 From: yangtengze Date: Sun, 21 May 2023 10:42:32 +0800 Subject: [PATCH 5/5] code --- {src => code}/system.c | 0 {src => code}/system.cpp | 0 {src => code}/void.c | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {src => code}/system.c (100%) rename {src => code}/system.cpp (100%) rename {src => code}/void.c (100%) diff --git a/src/system.c b/code/system.c similarity index 100% rename from src/system.c rename to code/system.c diff --git a/src/system.cpp b/code/system.cpp similarity index 100% rename from src/system.cpp rename to code/system.cpp diff --git a/src/void.c b/code/void.c similarity index 100% rename from src/void.c rename to code/void.c