From 2d675170d274b25cdafe3fe12975e78cc2168ff0 Mon Sep 17 00:00:00 2001 From: kala888 Date: Fri, 10 May 2024 13:15:17 +0800 Subject: [PATCH] add a demo store --- models/demo-store/account_book.xml | 36 +++++++++++++++ models/demo-store/course.xml | 31 +++++++++++++ models/demo-store/data.xml | 73 ++++++++++++++++++++++++++++++ models/demo-store/index.xml | 18 ++++++++ models/demo-store/merchant.xml | 53 ++++++++++++++++++++++ models/demo-store/product.xml | 63 ++++++++++++++++++++++++++ models/demo-store/screen.xml | 8 ++++ 7 files changed, 282 insertions(+) create mode 100644 models/demo-store/account_book.xml create mode 100644 models/demo-store/course.xml create mode 100644 models/demo-store/data.xml create mode 100644 models/demo-store/index.xml create mode 100644 models/demo-store/merchant.xml create mode 100644 models/demo-store/product.xml create mode 100644 models/demo-store/screen.xml diff --git a/models/demo-store/account_book.xml b/models/demo-store/account_book.xml new file mode 100644 index 0000000..6e6e7ba --- /dev/null +++ b/models/demo-store/account_book.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/models/demo-store/course.xml b/models/demo-store/course.xml new file mode 100644 index 0000000..8951f61 --- /dev/null +++ b/models/demo-store/course.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + <file_attachment label="文档附件" type="fileList" hideInTable="true"/> + </course_record> + + <!-- 3. 子对象 --> + <create_record label="创建历程" extends="course_record.create" menu="false" disableController="true"> + <title label="申请原因" type="long-text" length="500"/> + </create_record> + + <update_record label="改进记录" extends="course_record.update" menu="false" disableController="true"> + <approve_pass label="是否通过" type="boolean"/> + <title label="改进基建" type="long-text" length="500"/> + </update_record> + + <other_record label="其他记录" extends="course_record.other" menu="false" disableController="true"> + <title label="自定义类型" type="long-text" length="500" group="自定义信息"/> + <brief label="补充说明" type="long-text" length="500" group="自定义信息"/> + </other_record> +</root> + diff --git a/models/demo-store/data.xml b/models/demo-store/data.xml new file mode 100644 index 0000000..2d47059 --- /dev/null +++ b/models/demo-store/data.xml @@ -0,0 +1,73 @@ +<!-- 定义说明参照 ./README.md --> +<root brief="基础数据"> + + <base type="data" bref="基础数据"> + <!-- 创建平台和平台账户--> + <account_book id="1" balance="10000"/> + <merchant id="1" + name="如是嘉木" + top_brand="true" + work_time="周一 ~ 周五;早10点 ~ 晚6点" + brief="如是嘉木是一家专业的茶叶店铺,主要经营茶叶、茶具、茶器等茶叶相关产品。" + contact_mobile="13880964614" + contact_email="kalaliu@aliyun.com" + account_book="1" + store_status="OPEN" + /> + + <!-- 产品单位 --> + <product_unit id="1" name="两" code="liang"/> + <product_unit id="2" name="克" code="g"/> + <product_unit id="3" name="千克" code="kg"/> + <product_unit id="4" name="片" code="piece"/> + <product_unit id="5" name="罐" code="can"/> + <product_unit id="6" name="套" code="set"/> + <product_unit id="7" name="盒" code="box"/> + <product_unit id="8" name="袋" code="bag"/> + <product_unit id="9" name="个" code="item"/> + + </base> + + <base type="data" bref="测试数据"> + <!-- 测试店铺 --> + <product_tag id="1" name="礼品茶"/> + <product_tag id="2" name="产地茶"/> + <product_tag id="3" name="自营"/> + + <product_category id="1" name="品鉴"/> + <product_category id="2" name="口粮"/> + + <product id="1" + name="黄金芽" + list_price="100.00" + sale_price="88.88" + instock="10" + unit="1" + product_type="GREENTEA" + category="1" + total_view="200" + /> + <product id="2" + name="黄金甘露" + list_price="299.00" + sale_price="166.00" + instock="1000" + unit="1" + product_type="GREENTEA" + category="1" + total_view="128" + /> + <product id="3" + name="祁门红茶" + list_price="29.00" + sale_price="20.00" + instock="1000" + unit="2" + product_type="BLACKTEA" + category="2" + total_view="10" + /> + + </base> + +</root> diff --git a/models/demo-store/index.xml b/models/demo-store/index.xml new file mode 100644 index 0000000..00500eb --- /dev/null +++ b/models/demo-store/index.xml @@ -0,0 +1,18 @@ +<!-- 定义说明参照 ./README.md --> +<root name="teastore" + org="tiandtech" + label="小茶铺" + brief="Tea World" + logo="logo.svg" + slogan="Get your tea" +> + <import file="account_book.xml"/> + <import file="course.xml"/> + <import file="data.xml"/> + <import file="merchant.xml"/> + <import file="product.xml"/> + <import file="screen.xml"/> + + <!--这里为了简单,假设平台就是商店,非SAAS,所以只有一个merchant就行--> + +</root> diff --git a/models/demo-store/merchant.xml b/models/demo-store/merchant.xml new file mode 100644 index 0000000..0c6de91 --- /dev/null +++ b/models/demo-store/merchant.xml @@ -0,0 +1,53 @@ +<root brief="客户管理"> + <!--entity level enum 测试--> + <customer_type label="客户类型" type="enum"> + <Direct label="直客"/> + <Sales label="渠道"/> + <Chanel label="渠道客户"/> + </customer_type> + + <store_status label="店铺状态" type="enum" values="open(营业)|closed(打烊)"/> + + <!--建立一个平台对象,一般只有一条数据,用来记录平台相关数据,例如平台账本--> + <merchant label="茶铺" lineActions="开门|打烊" insertable="false"> + + <name label="店铺名称" required="true" brief="小茶铺"/> + <logo label="Logo" type="image"/> + <top_brand label="金牌店铺" type="boolean" searchable="true"/> + <work_time label="营业时间"/> + + <!--测试: group--> + <contact_mobile label="联系电话" type="mobile" group="联系方式" rule="required"/> + <contact_email label="Email" type="email" group="联系方式"/> + + <!--测试: rich-text--> + <brief label="店铺介绍" type="long-text" lenght="200" searchable="true" queryType="like"/> + <!--测试: 测试日期--> + <available_date label="开业日期" type="date"/> + + <store_status label="店铺状态" ref="store_status"/> + + <account_book label="账本" ref="account_book"/> + + </merchant> + + + <!-- 拓展系统用户 --> + <customer_user label="客户" actions="充值|调账|对账单"> + <!-- 测试: 拓展系统对象--> + <sys_user label="系统用户" + type="com.tiandtech.system.domain.SysUser" + customQuery="com.tiandtech.system.mapper.SysUserMapper.selectById" + /> + <!-- 测试: length--> + <user_type label="客户类型" ref="customer_type" required="true"/> + <name label="客户名称" lenght="20"/> + <uid label="身份证" type="uid"/> + <!-- 测试: int,min, max --> + <age label="年龄" type="int" min="18"/> + <!-- 测试: 修改OOTB属性 --> + <create_time type="date-time" searchable="true" queryType="between" hideInDescriptions="false"/> + <!-- 测试: 关系1:1--> + <account_book label="账本" ref="account_book"/> + </customer_user> +</root> diff --git a/models/demo-store/product.xml b/models/demo-store/product.xml new file mode 100644 index 0000000..9c33e09 --- /dev/null +++ b/models/demo-store/product.xml @@ -0,0 +1,63 @@ +<root brief="产品"> + + <product_type label="产品分类" type="enum"> + <green_tea label="绿茶"/> + <black_tea label="红茶"/> + <dark_tea label="黑茶"/> + <white_tea label="白茶"/> + <oolong_tea label="乌龙茶"/> + <puer_tea label="普洱茶"/> + <fflower_tea label="花茶"/> + <container label="器皿"/> + <package label="包装"/> + <accessories label="配件"/> + <service label="服务"/> + <other label="其他"/> + </product_type> + + <product_unit label="单位"> + <name label="单位名称"/> + <code label="编码"/> + <brief label="描述"/> + </product_unit> + + <product_category label="产品目录" menu="产品管理"> + <name label="分类名称"/> + <!-- 测试: date-time和dateTime--> + <start_time label="开始时间" type="date-time"/> + <end_time label="开始时间" type="dateTime"/> + </product_category> + + <product_tag label="产品标签" menu="产品管理"> + <name label="产品标签"/> + <brief label="标签描述"/> + </product_tag> + + <product label="产品" feature="+IE" menu="产品管理"> + <name label="产品名称" required="true" index="true"/> + <brief label="产品简介" type="rich-text"/> + <product_type label="产品分类" ref="product_type" index="true"/> + <image_list label="产品图册" type="image-list" lenght="9" brief="9图"/> + <approve_video label="宣传视频" type="video"/> + + <!--测试: 最大,最小,required,between--> + <list_price label="市场价" type="number" min="1" required="true" searchable="true" queryType="between" group="价格"/> + <sale_price label="销售价" type="number" min="1" max="999999" group="价格"/> + + <instock label="库存数量" type="number" group="库存"/> + <unit label="单位" ref="product_unit" group="库存"/> + + <display_order label="排序" type="number"/> + <category label="目录" ref="product_category"/> + + <total_view label="浏览量" type="int" editable="false"/> + <total_hot_point label="热度" type="int" dynamic="true"/> + </product> + + <!--测试: 多对多,忽略中间对象--> + + <product_tag_relationship label="产品和产品标签" type="ManyToMany"> + <product_entities label="产品ID" ref="product.tagList(标签)"/> + <tag_entities label="标签" ref="product_tag.productList(产品列表)"/> + </product_tag_relationship> +</root> diff --git a/models/demo-store/screen.xml b/models/demo-store/screen.xml new file mode 100644 index 0000000..feba070 --- /dev/null +++ b/models/demo-store/screen.xml @@ -0,0 +1,8 @@ +<root brief="screen 工作台和数据大屏定义"> + <dashboard type="screen" label="工作台" > + <slot1 label="店铺数量" condition="count from merchant as card"/> + <slot2 label="产品数量" condition="count from product as card"/> + <slot3 label="店铺状态" condition="count from merchant group by store_status as pie"/> + <slot4 label="产品统计" condition="count from product group by product_type as bar"/> + </dashboard> +</root>