Browse Source

修复bug

master
前端-胡立永 3 months ago
parent
commit
52f45cbaf4
35 changed files with 2099 additions and 293 deletions
  1. +1
    -1
      admin-pc/src/utils/request.js
  2. +253
    -0
      admin-pc/src/views/applet/shop/CommonShopList.vue
  3. +495
    -0
      admin-pc/src/views/applet/shop/modules/BrandSelectModal.vue
  4. +286
    -0
      admin-pc/src/views/applet/shop/modules/CommonShopForm.vue
  5. +84
    -0
      admin-pc/src/views/applet/shop/modules/CommonShopModal.Style#Drawer.vue
  6. +60
    -0
      admin-pc/src/views/applet/shop/modules/CommonShopModal.vue
  7. +21
    -3
      module-common/src/main/java/org/jeecg/api/service/impl/AppletClassServiceImpl.java
  8. +9
    -1
      module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java
  9. +14
    -1
      module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderTeamServiceImpl.java
  10. +119
    -29
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/controller/CommonBrandProductController.java
  11. +13
    -18
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/entity/CommonBrandProduct.java
  12. +62
    -0
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/entity/CommonBrandProductPrice.java
  13. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/mapper/CommonBrandProductMapper.java
  14. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/mapper/CommonBrandProductPriceMapper.java
  15. +16
    -0
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/mapper/xml/CommonBrandProductPriceMapper.xml
  16. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/ICommonBrandProductPriceService.java
  17. +27
    -1
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/ICommonBrandProductService.java
  18. +60
    -0
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/impl/CommonBrandProductPriceServiceImpl.java
  19. +60
    -2
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/impl/CommonBrandProductServiceImpl.java
  20. +76
    -0
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vo/CommonBrandProductPage.java
  21. +16
    -42
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue/CommonBrandProductList.vue
  22. +134
    -66
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue/modules/CommonBrandProductForm.vue
  23. +12
    -8
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue/modules/CommonBrandProductModal.vue
  24. +7
    -0
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/CommonBrandProduct.api.ts
  25. +39
    -37
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/CommonBrandProduct.data.ts
  26. +15
    -15
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/CommonBrandProductList.vue
  27. +54
    -9
      module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/components/CommonBrandProductModal.vue
  28. +17
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/controller/CommonShopController.java
  29. +38
    -17
      module-common/src/main/java/org/jeecg/modules/commonShop/entity/CommonShop.java
  30. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/mapper/CommonShopMapper.java
  31. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java
  32. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java
  33. +17
    -16
      module-common/src/main/java/org/jeecg/modules/commonShop/vue/CommonShopList.vue
  34. +17
    -2
      module-common/src/main/java/org/jeecg/modules/commonShop/vue/modules/CommonShopForm.vue
  35. +35
    -20
      module-common/src/main/java/org/jeecg/modules/commonShop/vue3/CommonShop.data.ts

+ 1
- 1
admin-pc/src/utils/request.js View File

@ -17,7 +17,7 @@ let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
const service = axios.create({
//baseURL: '/jeecg-boot',
baseURL: apiBaseUrl, // api base_url
timeout: 9000 // 请求超时时间
timeout: 9000000 // 请求超时时间
})
const err = (error) => {


+ 253
- 0
admin-pc/src/views/applet/shop/CommonShopList.vue View File

@ -0,0 +1,253 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="商品分类">
<j-multi-select-tag placeholder="请选择商品分类" dictCode="common_shop_class,title,id" v-model="queryParam.shopClass"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('商品信息表')">导出</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<common-shop-modal ref="modalForm" @ok="modalFormOk"></common-shop-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonShopModal from './modules/CommonShopModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'CommonShopList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonShopModal
},
data () {
return {
description: '商品信息表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'创建日期',
align:"center",
dataIndex: 'createTime'
},
{
title:'商品分类',
align:"center",
dataIndex: 'shopClass_dictText'
},
{
title:'商品标题',
align:"center",
dataIndex: 'name'
},
{
title:'商品图片',
align:"center",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'是否上架',
align:"center",
dataIndex: 'status_dictText'
},
{
title:'商品说明',
align:"center",
dataIndex: 'service'
},
{
title:'最低价格',
align:"center",
dataIndex: 'price'
},
{
title:'最高价格',
align:"center",
dataIndex: 'maxPrice'
},
{
title:'单位',
align:"center",
dataIndex: 'unit'
},
{
title:'是否品牌',
align:"center",
dataIndex: 'isPin',
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isPin'], text) : ''),
},
{
title:'显示回收规则',
align:"center",
dataIndex: 'isRecycleRules',
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isRecycleRules'], text) : ''),
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonShop/commonShop/list",
delete: "/commonShop/commonShop/delete",
deleteBatch: "/commonShop/commonShop/deleteBatch",
exportXlsUrl: "/commonShop/commonShop/exportXls",
importExcelUrl: "commonShop/commonShop/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.$set(this.dictOptions, 'isPin', [{text:'是',value:'Y'},{text:'否',value:'N'}])
this.$set(this.dictOptions, 'isRecycleRules', [{text:'是',value:'Y'},{text:'否',value:'N'}])
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
fieldList.push({type:'Text',value:'shopCion',text:'关联品牌',dictCode:"common_vip,name,id"})
fieldList.push({type:'list_multi',value:'shopClass',text:'商品分类',dictTable:"common_shop_class", dictText:'title', dictCode:'id'})
fieldList.push({type:'string',value:'name',text:'商品标题',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'商品图片',dictCode:''})
fieldList.push({type:'int',value:'status',text:'是否上架',dictCode:'book_my_status'})
fieldList.push({type:'string',value:'service',text:'商品说明',dictCode:''})
fieldList.push({type:'Text',value:'details',text:'回收规则',dictCode:''})
fieldList.push({type:'BigDecimal',value:'price',text:'最低价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'maxPrice',text:'最高价格',dictCode:''})
fieldList.push({type:'string',value:'unit',text:'单位',dictCode:''})
fieldList.push({type:'switch',value:'isPin',text:'是否品牌'})
fieldList.push({type:'switch',value:'isRecycleRules',text:'显示回收规则'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 495
- 0
admin-pc/src/views/applet/shop/modules/BrandSelectModal.vue View File

@ -0,0 +1,495 @@
<template>
<a-modal
:title="title"
:width="'80%'"
:height="'80%'"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="取消"
okText="确定"
:bodyStyle="{ height: '80vh', overflow: 'hidden' }"
>
<div class="brand-select-container">
<!-- 操作按钮区域 -->
<div class="operation-bar">
<a-space>
<a-button type="primary" size="small" @click="selectAll">全选</a-button>
<a-button size="small" @click="unselectAll">全不选</a-button>
<a-button size="small" @click="reverseSelect">反选</a-button>
<span class="selected-count">已选择: {{ selectedBrands.length }} 个品牌</span>
</a-space>
</div>
<!-- 品牌分类和品牌列表 -->
<a-spin :spinning="loading">
<div class="brand-categories">
<div
v-for="category in brandCategories"
:key="category.id"
class="category-section"
>
<div class="category-header" @click="toggleCategoryExpand(category.id)">
<div class="category-left">
<a-icon
:type="isCategoryExpanded(category.id) ? 'down' : 'right'"
class="expand-icon"
/>
<a-checkbox
:checked="isCategoryAllSelected(category.id)"
:indeterminate="isCategoryIndeterminate(category.id)"
@change="onCategorySelectChange(category.id, $event)"
@click.stop
>
<span class="category-name">{{ category.name }}</span>
<span class="category-count">({{ getCategoryBrandCount(category.id) }})</span>
</a-checkbox>
</div>
<a-space size="small" @click.stop>
<a-button
type="link"
size="small"
@click="selectCategoryAll(category.id)"
>
全选
</a-button>
<a-button
type="link"
size="small"
@click="unselectCategoryAll(category.id)"
>
全不选
</a-button>
<a-button
type="link"
size="small"
@click="reverseCategorySelect(category.id)"
>
反选
</a-button>
</a-space>
</div>
<div v-if="isCategoryExpanded(category.id)" class="brands-grid">
<div
v-for="brand in getCategoryBrands(category.id)"
:key="brand.id"
class="brand-item"
:class="{ 'selected': selectedBrands.includes(String(brand.id)) }"
@click="toggleBrandSelect(brand.id)"
>
<a-checkbox
:checked="selectedBrands.includes(String(brand.id))"
@click.stop
@change="onBrandSelectChange(brand.id, $event)"
>
</a-checkbox>
<div class="brand-content">
<img
v-if="brand.image"
:src="getImageUrl(brand.image)"
:alt="brand.name"
class="brand-image"
@error="onImageError"
/>
<div v-else class="brand-image-placeholder">
<a-icon type="picture" />
</div>
<div class="brand-name" :title="brand.name">{{ brand.name }}</div>
<div v-if="brand.hot === '1'" class="hot-tag">热门</div>
</div>
</div>
</div>
</div>
</div>
<!-- 空状态 -->
<div v-if="!loading && brandCategories.length === 0" class="empty-state">
<a-empty description="暂无品牌数据" />
</div>
</a-spin>
</div>
</a-modal>
</template>
<script>
import { getAction } from '@/api/manage'
export default {
name: 'BrandSelectModal',
components: {
},
props: {
visible: {
type: Boolean,
default: false
},
value: {
type: [String, Array],
default: () => []
},
title: {
type: String,
default: '选择品牌'
}
},
data() {
return {
confirmLoading: false,
loading: false,
brandCategories: [],
allBrands: [],
selectedBrands: [],
expandedCategories: [] // ID
}
},
watch: {
visible(val) {
if (val) {
this.initData()
}
}
},
methods: {
// watch
initSelectedBrands() {
if (Array.isArray(this.value)) {
// ID
this.selectedBrands = this.value.map(id => String(id))
} else if (typeof this.value === 'string' && this.value) {
this.selectedBrands = this.value.split(',').map(id => id.trim())
} else {
this.selectedBrands = []
}
},
async initData() {
this.loading = true
try {
//
const [categoryRes, brandRes] = await Promise.all([
getAction('/commonBrandCategory/commonBrandCategory/list', { pageNo: 1, pageSize: 99999 }),
getAction('/commonVip/commonVip/list', { pageNo: 1, pageSize: 99999 })
])
if (categoryRes.success) {
this.brandCategories = categoryRes.result.records || []
}
if (brandRes.success) {
this.allBrands = brandRes.result.records || []
}
// value
this.initSelectedBrands()
} catch (error) {
console.error('获取品牌数据失败:', error)
this.$message.error('获取品牌数据失败')
} finally {
this.loading = false
}
},
//
getCategoryBrands(categoryId) {
return this.allBrands.filter(brand => brand.brandCategory === categoryId)
},
//
getCategoryBrandCount(categoryId) {
return this.getCategoryBrands(categoryId).length
},
//
isCategoryExpanded(categoryId) {
return this.expandedCategories.includes(categoryId)
},
//
toggleCategoryExpand(categoryId) {
const index = this.expandedCategories.indexOf(categoryId)
if (index > -1) {
this.expandedCategories.splice(index, 1)
} else {
this.expandedCategories.push(categoryId)
}
},
//
isCategoryAllSelected(categoryId) {
const categoryBrands = this.getCategoryBrands(categoryId)
return categoryBrands.length > 0 && categoryBrands.every(brand => this.selectedBrands.includes(String(brand.id)))
},
//
isCategoryIndeterminate(categoryId) {
const categoryBrands = this.getCategoryBrands(categoryId)
const selectedCount = categoryBrands.filter(brand => this.selectedBrands.includes(String(brand.id))).length
return selectedCount > 0 && selectedCount < categoryBrands.length
},
//
onCategorySelectChange(categoryId, event) {
const checked = event.target.checked
if (checked) {
this.selectCategoryAll(categoryId)
} else {
this.unselectCategoryAll(categoryId)
}
},
//
onBrandSelectChange(brandId, event) {
const checked = event.target.checked
const brandIdStr = String(brandId)
if (checked) {
if (!this.selectedBrands.includes(brandIdStr)) {
this.selectedBrands.push(brandIdStr)
}
} else {
const index = this.selectedBrands.indexOf(brandIdStr)
if (index > -1) {
this.selectedBrands.splice(index, 1)
}
}
},
//
toggleBrandSelect(brandId) {
const brandIdStr = String(brandId)
const index = this.selectedBrands.indexOf(brandIdStr)
if (index > -1) {
this.selectedBrands.splice(index, 1)
} else {
this.selectedBrands.push(brandIdStr)
}
},
//
selectAll() {
this.selectedBrands = this.allBrands.map(brand => String(brand.id))
},
//
unselectAll() {
this.selectedBrands = []
},
//
reverseSelect() {
const allBrandIds = this.allBrands.map(brand => String(brand.id))
this.selectedBrands = allBrandIds.filter(id => !this.selectedBrands.includes(id))
},
//
selectCategoryAll(categoryId) {
const categoryBrands = this.getCategoryBrands(categoryId)
categoryBrands.forEach(brand => {
const brandIdStr = String(brand.id)
if (!this.selectedBrands.includes(brandIdStr)) {
this.selectedBrands.push(brandIdStr)
}
})
},
//
unselectCategoryAll(categoryId) {
const categoryBrands = this.getCategoryBrands(categoryId)
categoryBrands.forEach(brand => {
const brandIdStr = String(brand.id)
const index = this.selectedBrands.indexOf(brandIdStr)
if (index > -1) {
this.selectedBrands.splice(index, 1)
}
})
},
//
reverseCategorySelect(categoryId) {
const categoryBrands = this.getCategoryBrands(categoryId)
categoryBrands.forEach(brand => {
const brandIdStr = String(brand.id)
const index = this.selectedBrands.indexOf(brandIdStr)
if (index > -1) {
this.selectedBrands.splice(index, 1)
} else {
this.selectedBrands.push(brandIdStr)
}
})
},
// URL
getImageUrl(image) {
if (!image) return ''
if (image.startsWith('http')) return image
return `${process.env.VUE_APP_API_BASE_URL}/sys/common/static/${image}`
},
//
onImageError(event) {
event.target.style.display = 'none'
event.target.nextElementSibling.style.display = 'flex'
},
//
handleOk() {
this.$emit('input', this.selectedBrands)
this.$emit('ok', this.selectedBrands)
this.handleCancel()
},
//
handleCancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="less" scoped>
.brand-select-container {
height: 100%;
display: flex;
flex-direction: column;
.operation-bar {
padding: 16px 0;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 16px;
flex-shrink: 0;
.selected-count {
color: #666;
font-size: 14px;
}
}
.brand-categories {
flex: 1;
overflow-y: auto;
max-height: calc(80vh - 120px); /* 减去操作栏和弹窗头部的高度 */
.category-section {
margin-bottom: 24px;
.category-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: #fafafa;
border-radius: 6px;
margin-bottom: 12px;
cursor: pointer;
transition: background-color 0.3s;
&:hover {
background: #f0f0f0;
}
.category-left {
display: flex;
align-items: center;
.expand-icon {
margin-right: 8px;
color: #666;
transition: transform 0.3s;
}
}
.category-name {
font-weight: 500;
font-size: 16px;
}
.category-count {
color: #999;
font-size: 14px;
}
}
.brands-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 12px;
padding: 0 8px;
.brand-item {
display: flex;
align-items: center;
padding: 12px;
border: 1px solid #e8e8e8;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s;
&:hover {
border-color: #1890ff;
box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}
&.selected {
border-color: #1890ff;
background: #f6ffed;
}
.brand-content {
display: flex;
align-items: center;
flex: 1;
margin-left: 8px;
position: relative;
.brand-image {
width: 32px;
height: 32px;
border-radius: 4px;
object-fit: cover;
margin-right: 8px;
}
.brand-image-placeholder {
width: 32px;
height: 32px;
border-radius: 4px;
background: #f5f5f5;
display: flex;
align-items: center;
justify-content: center;
margin-right: 8px;
color: #ccc;
}
.brand-name {
flex: 1;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.hot-tag {
position: absolute;
top: -6px;
right: -6px;
background: #ff4d4f;
color: white;
font-size: 10px;
padding: 2px 4px;
border-radius: 2px;
transform: scale(0.8);
}
}
}
}
}
}
.empty-state {
text-align: center;
padding: 40px 0;
}
}
</style>

+ 286
- 0
admin-pc/src/views/applet/shop/modules/CommonShopForm.vue View File

@ -0,0 +1,286 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="关联品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopCion">
<div class="brand-select-wrapper">
<a-input
v-model="brandDisplayText"
placeholder="请选择关联品牌"
readonly
@click="showBrandSelectModal"
style="cursor: pointer;"
>
<a-icon slot="suffix" type="down" />
</a-input>
<a-button
type="link"
size="small"
@click="showBrandSelectModal"
style="margin-left: 8px;"
>
选择品牌
</a-button>
</div>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="商品分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopClass">
<j-multi-select-tag type="list_multi" v-model="model.shopClass" dictCode="common_shop_class,title,id" placeholder="请选择商品分类" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="商品标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入商品标题" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="商品图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="是否上架" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag type="list" v-model="model.status" dictCode="book_my_status" placeholder="请选择是否上架" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="商品说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="service">
<a-input v-model="model.service" placeholder="请输入商品说明" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="回收规则" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details">
<j-editor v-model="model.details" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="最低价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input-number v-model="model.price" placeholder="请输入最低价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="最高价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maxPrice">
<a-input-number v-model="model.maxPrice" placeholder="请输入最高价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit">
<a-input v-model="model.unit" placeholder="请输入单位" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="是否品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isPin">
<j-switch v-model="model.isPin" ></j-switch>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="显示回收规则" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isRecycleRules">
<j-switch v-model="model.isRecycleRules" ></j-switch>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
<!-- 品牌选择弹窗 -->
<BrandSelectModal
:visible="brandSelectVisible"
v-model="selectedBrandIds"
@ok="onBrandSelectOk"
@cancel="onBrandSelectCancel"
/>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import BrandSelectModal from './BrandSelectModal.vue'
export default {
name: 'CommonShopForm',
components: {
BrandSelectModal
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/commonShop/commonShop/add",
edit: "/commonShop/commonShop/edit",
queryById: "/commonShop/commonShop/queryById"
},
//
brandSelectVisible: false,
selectedBrandIds: [],
brandDisplayText: '',
allBrands: [] //
}
},
computed: {
formDisabled(){
return this.disabled
},
},
watch: {
// model.shopCion
'model.shopCion': {
handler(val) {
if (val) {
this.selectedBrandIds = val.split(',').map(id => id.trim())
this.updateBrandDisplayText()
} else {
this.selectedBrandIds = []
this.brandDisplayText = ''
}
},
immediate: true
},
// ID
selectedBrandIds: {
handler(val) {
this.model.shopCion = val.join(',')
this.updateBrandDisplayText()
},
deep: true
}
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
//
this.loadBrandData();
},
methods: {
add () {
this.edit(this.modelDefault);
},
async edit (record) {
if (record.id) {
//
try {
this.confirmLoading = true;
const res = await getAction(this.url.queryById, { id: record.id });
if (res.success) {
this.model = Object.assign({}, res.result);
} else {
this.$message.error('获取商品详情失败');
this.model = Object.assign({}, record);
}
} catch (error) {
console.error('查询商品详情失败:', error);
this.$message.error('获取商品详情失败');
this.model = Object.assign({}, record);
} finally {
this.confirmLoading = false;
}
} else {
this.model = Object.assign({}, record);
}
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
//
async loadBrandData() {
try {
const res = await getAction('/commonVip/commonVip/list', { pageNo: 1, pageSize: 999 })
if (res.success) {
this.allBrands = res.result.records || []
}
} catch (error) {
console.error('加载品牌数据失败:', error)
}
},
//
showBrandSelectModal() {
this.brandSelectVisible = true
},
//
onBrandSelectOk(selectedIds) {
this.selectedBrandIds = [...selectedIds]
this.brandSelectVisible = false
},
//
onBrandSelectCancel() {
this.brandSelectVisible = false
},
//
updateBrandDisplayText() {
if (this.selectedBrandIds.length === 0) {
this.brandDisplayText = ''
return
}
const selectedBrands = this.allBrands.filter(brand =>
this.selectedBrandIds.includes(brand.id)
)
if (selectedBrands.length === 0) {
this.brandDisplayText = `已选择 ${this.selectedBrandIds.length} 个品牌`
} else if (selectedBrands.length <= 3) {
this.brandDisplayText = selectedBrands.map(brand => brand.name).join('、')
} else {
const firstThree = selectedBrands.slice(0, 3).map(brand => brand.name).join('、')
this.brandDisplayText = `${firstThree}${selectedBrands.length}个品牌`
}
}
}
}
</script>

+ 84
- 0
admin-pc/src/views/applet/shop/modules/CommonShopModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<common-shop-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-shop-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import CommonShopForm from './CommonShopForm'
export default {
name: 'CommonShopModal',
components: {
CommonShopForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 60
- 0
admin-pc/src/views/applet/shop/modules/CommonShopModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<common-shop-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-shop-form>
</j-modal>
</template>
<script>
import CommonShopForm from './CommonShopForm'
export default {
name: 'CommonShopModal',
components: {
CommonShopForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 21
- 3
module-common/src/main/java/org/jeecg/api/service/impl/AppletClassServiceImpl.java View File

@ -9,6 +9,8 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.commonAddress.service.ICommonAddressService;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductPriceService;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductService;
import org.jeecg.modules.commonShop.entity.CommonShop;
import org.jeecg.modules.commonShop.service.ICommonShopService;
@ -19,6 +21,7 @@ import org.jeecg.modules.commonVip.service.ICommonVipService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
@ -37,6 +40,8 @@ public class AppletClassServiceImpl implements AppletClassService {
private ICommonVipService commonVipService;
@Resource
private ICommonBrandProductService commonBrandProductService;
@Resource
private ICommonBrandProductPriceService commonBrandProductPriceService;
//获取价格预览分类列表
@Override
@ -99,11 +104,24 @@ public class AppletClassServiceImpl implements AppletClassService {
@Override
public Result<?> getGoodsBrandProduct(String productId, String brandId) {
return Result.ok(commonBrandProductService.lambdaQuery()
.eq(CommonBrandProduct::getBrandId, brandId)
CommonVip byId = commonVipService.getById(brandId);
if (byId == null || StringUtils.isBlank(byId.getBrandCategory())){
return Result.ok(new ArrayList<>());
}
List<CommonBrandProduct> list = commonBrandProductService.lambdaQuery()
.eq(CommonBrandProduct::getShopId, productId)
.list());
.list();
for (CommonBrandProduct brandProduct : list) {
commonBrandProductPriceService.buildBrandProductPrice(brandProduct, byId.getBrandCategory());
}
return Result.ok(list);
}
}

+ 9
- 1
module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java View File

@ -16,6 +16,7 @@ import org.jeecg.modules.commonAddress.entity.CommonAddress;
import org.jeecg.modules.commonAddress.service.ICommonAddressService;
import org.jeecg.modules.commonAdminOrderBrowseRecord.entity.CommonAdminOrderBrowseRecord;
import org.jeecg.modules.commonAdminOrderBrowseRecord.service.ICommonAdminOrderBrowseRecordService;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductPriceService;
import org.jeecg.modules.commonConfig.service.ICommonConfigService;
import org.jeecg.modules.commonMoneyLog.service.ICommonMoneyLogService;
import org.jeecg.modules.commonOrder.entity.CommonOrder;
@ -80,6 +81,8 @@ public class AppletOrderServiceImpl implements AppletOrderService {
private ILogisticsTrajectoryService logisticsTrajectoryService;
@Autowired
private ICommonBrandProductService commonBrandProductService;
@Resource
private ICommonBrandProductPriceService commonBrandProductPriceService;
@Resource
@ -314,9 +317,14 @@ public class AppletOrderServiceImpl implements AppletOrderService {
if (StringUtils.isNotBlank(sku.getStyleId())) {
// 查询款式信息
CommonBrandProduct brandProduct = commonBrandProductService.getById(sku.getStyleId());
CommonVip vip = commonVipService.getById(sku.getPinId());
if (vip != null && StringUtils.isNotBlank(vip.getBrandCategory())){
commonBrandProductPriceService.buildBrandProductPrice(brandProduct, vip.getBrandCategory());
}
if (brandProduct != null) {
unitMinPrice = brandProduct.getMinPrice();
unitMaxPrice = brandProduct.getMaxPrice();
sku.setImage(brandProduct.getImage());
log.info("使用款式价格计算,款式ID: {}, 最低价格: {}, 最高价格: {}",
sku.getStyleId(), unitMinPrice, unitMaxPrice);
} else {
@ -325,6 +333,7 @@ public class AppletOrderServiceImpl implements AppletOrderService {
unitMaxPrice = commonShop.getMaxPrice();
}
} else {
sku.setImage(commonShop.getImage());
// 使用商品价格
unitMinPrice = commonShop.getPrice();
unitMaxPrice = commonShop.getMaxPrice();
@ -365,7 +374,6 @@ public class AppletOrderServiceImpl implements AppletOrderService {
sku.setHasChild("1");
sku.setShopId(commonShop.getId());
sku.setTitle(commonShop.getName());
sku.setImage(commonShop.getImage());
sku.setDetails(commonShop.getService());
sku.setShopClass(commonShop.getShopClass());
sku.setCreateTime(new Date());


+ 14
- 1
module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderTeamServiceImpl.java View File

@ -566,8 +566,21 @@ public class AppletOrderTeamServiceImpl implements AppletOrderTeamService {
if (StringUtils.isNotBlank(orderReq.getShopId())){
CommonShop shop = commonShopService.getById(orderReq.getShopId());
if (shop != null) {
if (StringUtils.isNotBlank(orderReq.getStyleId())) {
// 查询款式信息
CommonBrandProduct brandProduct = commonBrandProductService.getById(orderReq.getStyleId());
if (brandProduct != null) {
orderReq.setImage(brandProduct.getImage());
} else {
orderReq.setImage(shop.getImage());
}
}else {
orderReq.setImage(shop.getImage());
}
orderReq.setUnit(shop.getUnit());
orderReq.setImage(shop.getImage());
//orderReq.setImage(shop.getImage());
orderReq.setTitle(shop.getName());
orderReq.setDetails(shop.getService());
orderReq.setShopClass(shop.getShopClass());


+ 119
- 29
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/controller/CommonBrandProductController.java View File

@ -1,36 +1,42 @@
package org.jeecg.modules.commonBrandProduct.controller;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import org.jeecg.modules.commonBrandProduct.vo.CommonBrandProductPage;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductService;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductPriceService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -39,16 +45,18 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 品牌款式
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Date: 2025-08-28
* @Version: V1.0
*/
@Api(tags="品牌款式")
@RestController
@RequestMapping("/commonBrandProduct/commonBrandProduct")
@Slf4j
public class CommonBrandProductController extends JeecgController<CommonBrandProduct, ICommonBrandProductService> {
public class CommonBrandProductController {
@Autowired
private ICommonBrandProductService commonBrandProductService;
@Autowired
private ICommonBrandProductPriceService commonBrandProductPriceService;
/**
* 分页列表查询
@ -75,28 +83,36 @@ public class CommonBrandProductController extends JeecgController<CommonBrandPro
/**
* 添加
*
* @param commonBrandProduct
* @param commonBrandProductPage
* @return
*/
@AutoLog(value = "品牌款式-添加")
@ApiOperation(value="品牌款式-添加", notes="品牌款式-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonBrandProduct commonBrandProduct) {
commonBrandProductService.save(commonBrandProduct);
public Result<String> add(@RequestBody CommonBrandProductPage commonBrandProductPage) {
CommonBrandProduct commonBrandProduct = new CommonBrandProduct();
BeanUtils.copyProperties(commonBrandProductPage, commonBrandProduct);
commonBrandProductService.saveMain(commonBrandProduct, commonBrandProductPage.getCommonBrandProductPriceList());
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonBrandProduct
* @param commonBrandProductPage
* @return
*/
@AutoLog(value = "品牌款式-编辑")
@ApiOperation(value="品牌款式-编辑", notes="品牌款式-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonBrandProduct commonBrandProduct) {
commonBrandProductService.updateById(commonBrandProduct);
public Result<String> edit(@RequestBody CommonBrandProductPage commonBrandProductPage) {
CommonBrandProduct commonBrandProduct = new CommonBrandProduct();
BeanUtils.copyProperties(commonBrandProductPage, commonBrandProduct);
CommonBrandProduct commonBrandProductEntity = commonBrandProductService.getById(commonBrandProduct.getId());
if(commonBrandProductEntity==null) {
return Result.error("未找到对应数据");
}
commonBrandProductService.updateMain(commonBrandProduct, commonBrandProductPage.getCommonBrandProductPriceList());
return Result.OK("编辑成功!");
}
@ -110,7 +126,7 @@ public class CommonBrandProductController extends JeecgController<CommonBrandPro
@ApiOperation(value="品牌款式-通过id删除", notes="品牌款式-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
commonBrandProductService.removeById(id);
commonBrandProductService.delMain(id);
return Result.OK("删除成功!");
}
@ -124,8 +140,8 @@ public class CommonBrandProductController extends JeecgController<CommonBrandPro
@ApiOperation(value="品牌款式-批量删除", notes="品牌款式-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.commonBrandProductService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
this.commonBrandProductService.delBatchMain(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功");
}
/**
@ -143,6 +159,21 @@ public class CommonBrandProductController extends JeecgController<CommonBrandPro
return Result.error("未找到对应数据");
}
return Result.OK(commonBrandProduct);
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "款式价格配置通过主表ID查询")
@ApiOperation(value="款式价格配置主表ID查询", notes="款式价格配置-通主表ID查询")
@GetMapping(value = "/queryCommonBrandProductPriceByMainId")
public Result<List<CommonBrandProductPrice>> queryCommonBrandProductPriceListByMainId(@RequestParam(name="id",required=true) String id) {
List<CommonBrandProductPrice> commonBrandProductPriceList = commonBrandProductPriceService.selectByMainId(id);
return Result.OK(commonBrandProductPriceList);
}
/**
@ -153,11 +184,43 @@ public class CommonBrandProductController extends JeecgController<CommonBrandPro
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonBrandProduct commonBrandProduct) {
return super.exportXls(request, commonBrandProduct, CommonBrandProduct.class, "品牌款式");
// Step.1 组装查询条件查询数据
QueryWrapper<CommonBrandProduct> queryWrapper = QueryGenerator.initQueryWrapper(commonBrandProduct, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//Step.2 获取导出数据
List<CommonBrandProduct> queryList = commonBrandProductService.list(queryWrapper);
// 过滤选中数据
String selections = request.getParameter("selections");
List<CommonBrandProduct> commonBrandProductList = new ArrayList<CommonBrandProduct>();
if(oConvertUtils.isEmpty(selections)) {
commonBrandProductList = queryList;
}else {
List<String> selectionList = Arrays.asList(selections.split(","));
commonBrandProductList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
}
// Step.3 组装pageList
List<CommonBrandProductPage> pageList = new ArrayList<CommonBrandProductPage>();
for (CommonBrandProduct main : commonBrandProductList) {
CommonBrandProductPage vo = new CommonBrandProductPage();
BeanUtils.copyProperties(main, vo);
List<CommonBrandProductPrice> commonBrandProductPriceList = commonBrandProductPriceService.selectByMainId(main.getId());
vo.setCommonBrandProductPriceList(commonBrandProductPriceList);
pageList.add(vo);
}
// Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "品牌款式列表");
mv.addObject(NormalExcelConstants.CLASS, CommonBrandProductPage.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("品牌款式数据", "导出人:"+sysUser.getRealname(), "品牌款式"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
* 通过excel导入数据
*
* @param request
* @param response
@ -165,7 +228,34 @@ public class CommonBrandProductController extends JeecgController<CommonBrandPro
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommonBrandProduct.class);
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<CommonBrandProductPage> list = ExcelImportUtil.importExcel(file.getInputStream(), CommonBrandProductPage.class, params);
for (CommonBrandProductPage page : list) {
CommonBrandProduct po = new CommonBrandProduct();
BeanUtils.copyProperties(page, po);
commonBrandProductService.saveMain(po, page.getCommonBrandProductPriceList());
}
return Result.OK("文件导入成功!数据行数:" + list.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.OK("文件导入失败!");
}
}

+ 13
- 18
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/entity/CommonBrandProduct.java View File

@ -3,7 +3,6 @@ package org.jeecg.modules.commonBrandProduct.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@ -14,20 +13,16 @@ import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 品牌款式
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Date: 2025-08-28
* @Version: V1.0
*/
@ApiModel(value="common_brand_product对象", description="品牌款式")
@Data
@TableName("common_brand_product")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_brand_product对象", description="品牌款式")
public class CommonBrandProduct implements Serializable {
private static final long serialVersionUID = 1L;
@ -58,22 +53,22 @@ public class CommonBrandProduct implements Serializable {
@Excel(name = "款式图片", width = 15)
@ApiModelProperty(value = "款式图片")
private java.lang.String image;
/**最低价格*/
@Excel(name = "最低价格", width = 15)
@ApiModelProperty(value = "最低价格")
/**默认最低价格*/
@Excel(name = "默认最低价格", width = 15)
@ApiModelProperty(value = "默认最低价格")
private java.math.BigDecimal minPrice;
/**最高价格*/
@Excel(name = "最高价格", width = 15)
@ApiModelProperty(value = "最高价格")
/**默认最高价格*/
@Excel(name = "默认最高价格", width = 15)
@ApiModelProperty(value = "默认最高价格")
private java.math.BigDecimal maxPrice;
/**品牌*/
@Excel(name = "品牌", width = 15, dictTable = "common_vip", dicText = "name", dicCode = "id")
@Dict(dictTable = "common_vip", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "品牌")
/**品牌分类*/
@Excel(name = "品牌分类", width = 15, dictTable = "common_brand_category", dicText = "name", dicCode = "id")
@Dict(dictTable = "common_brand_category", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "品牌分类")
private java.lang.String brandId;
/**商品*/
@Excel(name = "商品", width = 15, dictTable = "common_shop", dicText = "name", dicCode = "id")
@Dict(dictTable = "common_shop", dicText = "name", dicCode = "id")
@Dict(dictTable = "common_shop", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "商品")
private java.lang.String shopId;
}

+ 62
- 0
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/entity/CommonBrandProductPrice.java View File

@ -0,0 +1,62 @@
package org.jeecg.modules.commonBrandProduct.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.UnsupportedEncodingException;
/**
* @Description: 款式价格配置
* @Author: jeecg-boot
* @Date: 2025-08-28
* @Version: V1.0
*/
@ApiModel(value="common_brand_product_price对象", description="款式价格配置")
@Data
@TableName("common_brand_product_price")
public class CommonBrandProductPrice implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**最低价格*/
@Excel(name = "最低价格", width = 15)
@ApiModelProperty(value = "最低价格")
private java.math.BigDecimal minPrice;
/**最高价格*/
@Excel(name = "最高价格", width = 15)
@ApiModelProperty(value = "最高价格")
private java.math.BigDecimal maxPrice;
/**款式*/
@ApiModelProperty(value = "款式")
private java.lang.String styleId;
/**品牌分类*/
@Excel(name = "品牌分类", width = 15, dictTable = "common_brand_category", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "品牌分类")
private java.lang.String brandCategoryId;
}

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/mapper/CommonBrandProductMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 品牌款式
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Date: 2025-08-28
* @Version: V1.0
*/
public interface CommonBrandProductMapper extends BaseMapper<CommonBrandProduct> {


+ 19
- 0
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/mapper/CommonBrandProductPriceMapper.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.commonBrandProduct.mapper;
import java.util.List;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: 款式价格配置
* @Author: jeecg-boot
* @Date: 2025-08-28
* @Version: V1.0
*/
public interface CommonBrandProductPriceMapper extends BaseMapper<CommonBrandProductPrice> {
public boolean deleteByMainId(@Param("mainId") String mainId);
public List<CommonBrandProductPrice> selectByMainId(@Param("mainId") String mainId);
}

+ 16
- 0
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/mapper/xml/CommonBrandProductPriceMapper.xml View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.commonBrandProduct.mapper.CommonBrandProductPriceMapper">
<delete id="deleteByMainId" parameterType="java.lang.String">
DELETE
FROM common_brand_product_price
WHERE
style_id = #{mainId} </delete>
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice">
SELECT *
FROM common_brand_product_price
WHERE
style_id = #{mainId} </select>
</mapper>

+ 19
- 0
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/ICommonBrandProductPriceService.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.commonBrandProduct.service;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 款式价格配置
* @Author: jeecg-boot
* @Date: 2025-08-28
* @Version: V1.0
*/
public interface ICommonBrandProductPriceService extends IService<CommonBrandProductPrice> {
public List<CommonBrandProductPrice> selectByMainId(String mainId);
public void buildBrandProductPrice(CommonBrandProduct brandProduct, String brandCategory);
}

+ 27
- 1
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/ICommonBrandProductService.java View File

@ -1,14 +1,40 @@
package org.jeecg.modules.commonBrandProduct.service;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import com.baomidou.mybatisplus.extension.service.IService;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
/**
* @Description: 品牌款式
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Date: 2025-08-28
* @Version: V1.0
*/
public interface ICommonBrandProductService extends IService<CommonBrandProduct> {
/**
* 添加一对多
*
*/
public void saveMain(CommonBrandProduct commonBrandProduct,List<CommonBrandProductPrice> commonBrandProductPriceList) ;
/**
* 修改一对多
*
*/
public void updateMain(CommonBrandProduct commonBrandProduct,List<CommonBrandProductPrice> commonBrandProductPriceList);
/**
* 删除一对多
*/
public void delMain (String id);
/**
* 批量删除一对多
*/
public void delBatchMain (Collection<? extends Serializable> idList);
}

+ 60
- 0
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/impl/CommonBrandProductPriceServiceImpl.java View File

@ -0,0 +1,60 @@
package org.jeecg.modules.commonBrandProduct.service.impl;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import org.jeecg.modules.commonBrandProduct.mapper.CommonBrandProductPriceMapper;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductPriceService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description: 款式价格配置
* @Author: jeecg-boot
* @Date: 2025-08-28
* @Version: V1.0
*/
@Log4j2
@Service
public class CommonBrandProductPriceServiceImpl extends ServiceImpl<CommonBrandProductPriceMapper, CommonBrandProductPrice> implements ICommonBrandProductPriceService {
@Autowired
private CommonBrandProductPriceMapper commonBrandProductPriceMapper;
@Override
public List<CommonBrandProductPrice> selectByMainId(String mainId) {
return commonBrandProductPriceMapper.selectByMainId(mainId);
}
@Override
public void buildBrandProductPrice(CommonBrandProduct brandProduct, String brandCategory){
if (brandProduct == null || StringUtils.isBlank(brandCategory)){
log.warn("品牌款式的价格配置失败 款式:{} 品牌分类: {}", brandProduct, brandCategory);
return;
}
log.info("使用品牌款式下的价格配置 款式ID:{} 品牌分类: {}", brandProduct.getId(), brandCategory);
List<CommonBrandProductPrice> prices = lambdaQuery()
.eq(CommonBrandProductPrice::getBrandCategoryId, brandCategory)
.eq(CommonBrandProductPrice::getStyleId, brandProduct.getId())
.list();
brandProduct.setBrandId(brandCategory);
if (prices.size() > 0){
CommonBrandProductPrice price = prices.get(0);
if (price.getMinPrice() != null){
log.info("设置最低价格: {}", price.getMinPrice());
brandProduct.setMinPrice(price.getMinPrice());
}
if (price.getMaxPrice() != null){
log.info("设置最高价格: {}", price.getMaxPrice());
brandProduct.setMaxPrice(price.getMaxPrice());
}
}
}
}

+ 60
- 2
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/service/impl/CommonBrandProductServiceImpl.java View File

@ -1,19 +1,77 @@
package org.jeecg.modules.commonBrandProduct.service.impl;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import org.jeecg.modules.commonBrandProduct.mapper.CommonBrandProductPriceMapper;
import org.jeecg.modules.commonBrandProduct.mapper.CommonBrandProductMapper;
import org.jeecg.modules.commonBrandProduct.service.ICommonBrandProductService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;
/**
* @Description: 品牌款式
* @Author: jeecg-boot
* @Date: 2025-08-25
* @Date: 2025-08-28
* @Version: V1.0
*/
@Service
public class CommonBrandProductServiceImpl extends ServiceImpl<CommonBrandProductMapper, CommonBrandProduct> implements ICommonBrandProductService {
@Autowired
private CommonBrandProductMapper commonBrandProductMapper;
@Autowired
private CommonBrandProductPriceMapper commonBrandProductPriceMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(CommonBrandProduct commonBrandProduct, List<CommonBrandProductPrice> commonBrandProductPriceList) {
commonBrandProductMapper.insert(commonBrandProduct);
if(commonBrandProductPriceList!=null && commonBrandProductPriceList.size()>0) {
for(CommonBrandProductPrice entity:commonBrandProductPriceList) {
//外键设置
entity.setStyleId(commonBrandProduct.getId());
commonBrandProductPriceMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(CommonBrandProduct commonBrandProduct,List<CommonBrandProductPrice> commonBrandProductPriceList) {
commonBrandProductMapper.updateById(commonBrandProduct);
//1.先删除子表数据
commonBrandProductPriceMapper.deleteByMainId(commonBrandProduct.getId());
//2.子表数据重新插入
if(commonBrandProductPriceList!=null && commonBrandProductPriceList.size()>0) {
for(CommonBrandProductPrice entity:commonBrandProductPriceList) {
//外键设置
entity.setStyleId(commonBrandProduct.getId());
commonBrandProductPriceMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
commonBrandProductPriceMapper.deleteByMainId(id);
commonBrandProductMapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
commonBrandProductPriceMapper.deleteByMainId(id.toString());
commonBrandProductMapper.deleteById(id);
}
}
}

+ 76
- 0
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vo/CommonBrandProductPage.java View File

@ -0,0 +1,76 @@
package org.jeecg.modules.commonBrandProduct.vo;
import java.util.List;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProduct;
import org.jeecg.modules.commonBrandProduct.entity.CommonBrandProductPrice;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 品牌款式
* @Author: jeecg-boot
* @Date: 2025-08-28
* @Version: V1.0
*/
@Data
@ApiModel(value="common_brand_productPage对象", description="品牌款式")
public class CommonBrandProductPage {
/**主键*/
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**款式名称*/
@Excel(name = "款式名称", width = 15)
@ApiModelProperty(value = "款式名称")
private java.lang.String name;
/**款式图片*/
@Excel(name = "款式图片", width = 15)
@ApiModelProperty(value = "款式图片")
private java.lang.String image;
/**默认最低价格*/
@Excel(name = "默认最低价格", width = 15)
@ApiModelProperty(value = "默认最低价格")
private java.math.BigDecimal minPrice;
/**默认最高价格*/
@Excel(name = "默认最高价格", width = 15)
@ApiModelProperty(value = "默认最高价格")
private java.math.BigDecimal maxPrice;
/**品牌分类*/
@Excel(name = "品牌分类", width = 15, dictTable = "common_brand_category", dicText = "name", dicCode = "id")
@Dict(dictTable = "common_brand_category", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "品牌分类")
private java.lang.String brandId;
/**商品*/
@Excel(name = "商品", width = 15, dictTable = "common_shop", dicText = "name", dicCode = "id")
@Dict(dictTable = "common_shop", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "商品")
private java.lang.String shopId;
@ExcelCollection(name="款式价格配置")
@ApiModelProperty(value = "款式价格配置")
private List<CommonBrandProductPrice> commonBrandProductPriceList;
}

+ 16
- 42
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue/CommonBrandProductList.vue View File

@ -4,31 +4,11 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="品牌">
<j-search-select-tag placeholder="请选择品牌" v-model="queryParam.brandId" dict="common_vip,name,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="商品">
<j-search-select-tag placeholder="请选择商品" v-model="queryParam.shopId" dict="common_shop,name,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
@ -56,15 +36,15 @@
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
@ -109,21 +89,20 @@
</a-table>
</div>
<common-brand-product-modal ref="modalForm" @ok="modalFormOk"></common-brand-product-modal>
<common-brand-product-modal ref="modalForm" @ok="modalFormOk"/>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonBrandProductModal from './modules/CommonBrandProductModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import '@/assets/less/TableExpand.less'
export default {
name: 'CommonBrandProductList',
mixins:[JeecgListMixin, mixinDevice],
name: "CommonBrandProductList",
mixins:[JeecgListMixin],
components: {
CommonBrandProductModal
},
@ -150,23 +129,19 @@
{
title:'款式图片',
align:"center",
dataIndex: 'image'
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'最低价格',
title:'默认最低价格',
align:"center",
dataIndex: 'minPrice'
},
{
title:'最高价格',
title:'默认最高价格',
align:"center",
dataIndex: 'maxPrice'
},
{
title:'品牌',
align:"center",
dataIndex: 'brandId_dictText'
},
{
title:'商品',
align:"center",
@ -178,7 +153,7 @@
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
scopedSlots: { customRender: 'action' },
}
],
url: {
@ -194,12 +169,12 @@
}
},
created() {
this.getSuperFieldList();
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
}
},
methods: {
initDictConfig(){
@ -208,9 +183,8 @@
let fieldList=[];
fieldList.push({type:'string',value:'name',text:'款式名称',dictCode:''})
fieldList.push({type:'string',value:'image',text:'款式图片',dictCode:''})
fieldList.push({type:'BigDecimal',value:'minPrice',text:'最低价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'maxPrice',text:'最高价格',dictCode:''})
fieldList.push({type:'sel_search',value:'brandId',text:'品牌',dictTable:"common_vip", dictText:'name', dictCode:'id'})
fieldList.push({type:'BigDecimal',value:'minPrice',text:'默认最低价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'maxPrice',text:'默认最高价格',dictCode:''})
fieldList.push({type:'sel_search',value:'shopId',text:'商品',dictTable:"common_shop", dictText:'name', dictCode:'id'})
this.superFieldList = fieldList
}


+ 134
- 66
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue/modules/CommonBrandProductForm.vue View File

@ -1,65 +1,74 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<!-- 主表单区域 -->
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-col :span="24" >
<a-form-model-item label="款式名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入款式名称" ></a-input>
<a-input v-model="model.name" placeholder="请输入款式名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-model-item label="款式图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<a-input v-model="model.image" placeholder="请输入款式图片" ></a-input>
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="最低价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="minPrice">
<a-input-number v-model="model.minPrice" placeholder="请输入最低价格" style="width: 100%" />
<a-col :span="24" >
<a-form-model-item label="默认最低价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="minPrice">
<a-input-number v-model="model.minPrice" placeholder="请输入默认最低价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="最高价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maxPrice">
<a-input-number v-model="model.maxPrice" placeholder="请输入最高价格" style="width: 100%" />
<a-col :span="24" >
<a-form-model-item label="默认最高价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maxPrice">
<a-input-number v-model="model.maxPrice" placeholder="请输入默认最高价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brandId">
<j-search-select-tag v-model="model.brandId" dict="common_vip,name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-model-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopId">
<j-search-select-tag v-model="model.shopId" dict="common_shop,name,id" />
<j-search-select-tag v-model="model.shopId" dict="common_shop,name,id" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
<!-- 子表单区域 -->
<a-tabs v-model="activeKey" @change="handleChangeTabs">
<a-tab-pane tab="款式价格配置" :key="refKeys[0]" :forceRender="true">
<j-vxe-table
keep-source
:ref="refKeys[0]"
:loading="commonBrandProductPriceTable.loading"
:columns="commonBrandProductPriceTable.columns"
:dataSource="commonBrandProductPriceTable.dataSource"
:maxHeight="300"
:disabled="formDisabled"
:rowNumber="true"
:rowSelection="true"
:toolbar="true"
/>
</a-tab-pane>
</a-tabs>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { getAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jeecg/JFormContainer'
export default {
name: 'CommonBrandProductForm',
mixins: [JVxeTableModelMixin],
components: {
JFormContainer,
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
data() {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
@ -68,62 +77,121 @@
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
model:{
},
//
addDefaultRowNum: 1,
validatorRules: {
},
refKeys: ['commonBrandProductPrice', ],
tableKeys:['commonBrandProductPrice', ],
activeKey: 'commonBrandProductPrice',
//
commonBrandProductPriceTable: {
loading: false,
dataSource: [],
columns: [
{
title: '最低价格',
key: 'minPrice',
type: JVXETypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '最高价格',
key: 'maxPrice',
type: JVXETypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '品牌分类',
key: 'brandCategoryId',
type: JVXETypes.selectSearch,
dictCode:"common_brand_category,name,id",
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
]
},
url: {
add: "/commonBrandProduct/commonBrandProduct/add",
edit: "/commonBrandProduct/commonBrandProduct/edit",
queryById: "/commonBrandProduct/commonBrandProduct/queryById"
queryById: "/commonBrandProduct/commonBrandProduct/queryById",
commonBrandProductPrice: {
list: '/commonBrandProduct/commonBrandProduct/queryCommonBrandProductPriceByMainId'
},
}
}
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
addBefore(){
this.commonBrandProductPriceTable.dataSource=[]
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
getAllTable() {
let values = this.tableKeys.map(key => getRefPromise(this, key))
return Promise.all(values)
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
/** 调用完edit()方法之后会自动调用此方法 */
editAfter() {
this.$nextTick(() => {
})
//
if (this.model.id) {
let params = { id: this.model.id }
this.requestSubTableData(this.url.commonBrandProductPrice.list, params, this.commonBrandProductPriceTable)
}
},
//
validateSubForm(allValues){
return new Promise((resolve,reject)=>{
Promise.all([
]).then(() => {
resolve(allValues)
}).catch(e => {
if (e.error === VALIDATE_FAILED) {
// tab
this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
} else {
console.error(e)
}
})
})
},
/** 整理成formData */
classifyIntoFormData(allValues) {
let main = Object.assign(this.model, allValues.formValue)
return {
...main, //
commonBrandProductPriceList: allValues.tablesValue[0].tableData,
}
},
validateError(msg){
this.$message.error(msg)
},
}
}
</script>
</script>
<style scoped>
</style>

+ 12
- 8
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue/modules/CommonBrandProductModal.vue View File

@ -1,26 +1,27 @@
<template>
<j-modal
:title="title"
:width="width"
:width="1200"
:visible="visible"
:maskClosable="false"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<common-brand-product-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-brand-product-form>
@cancel="handleCancel">
<common-brand-product-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
</j-modal>
</template>
<script>
import CommonBrandProductForm from './CommonBrandProductForm'
export default {
name: 'CommonBrandProductModal',
components: {
CommonBrandProductForm
},
data () {
data() {
return {
title:'',
width:800,
@ -28,7 +29,7 @@
disableSubmit: false
}
},
methods: {
methods:{
add () {
this.visible=true
this.$nextTick(()=>{
@ -46,7 +47,7 @@
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
this.$refs.realForm.handleOk();
},
submitCallback(){
this.$emit('ok');
@ -57,4 +58,7 @@
}
}
}
</script>
</script>
<style scoped>
</style>

+ 7
- 0
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/CommonBrandProduct.api.ts View File

@ -9,16 +9,23 @@ enum Api {
deleteBatch = '/commonBrandProduct/commonBrandProduct/deleteBatch',
importExcel = '/commonBrandProduct/commonBrandProduct/importExcel',
exportXls = '/commonBrandProduct/commonBrandProduct/exportXls',
commonBrandProductPriceList = '/commonBrandProduct/commonBrandProduct/queryCommonBrandProductPriceByMainId',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const commonBrandProductPriceList = Api.commonBrandProductPriceList;
/**
*
* @param params


+ 39
- 37
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/CommonBrandProduct.data.ts View File

@ -2,6 +2,7 @@ import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
{
@ -12,23 +13,19 @@ export const columns: BasicColumn[] = [
{
title: '款式图片',
align:"center",
dataIndex: 'image'
dataIndex: 'image',
customRender:render.renderAvatar,
},
{
title: '最低价格',
title: '默认最低价格',
align:"center",
dataIndex: 'minPrice'
},
{
title: '最高价格',
title: '默认最高价格',
align:"center",
dataIndex: 'maxPrice'
},
{
title: '品牌',
align:"center",
dataIndex: 'brandId_dictText'
},
{
title: '商品',
align:"center",
@ -37,24 +34,6 @@ export const columns: BasicColumn[] = [
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "品牌",
field: "brandId",
component: 'JSearchSelect',
componentProps:{
dict:"common_vip,name,id"
},
colProps: {span: 6},
},
{
label: "商品",
field: "shopId",
component: 'JSearchSelect',
componentProps:{
dict:"common_shop,name,id"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -66,26 +45,20 @@ export const formSchema: FormSchema[] = [
{
label: '款式图片',
field: 'image',
component: 'Input',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '最低价格',
label: '默认最低价格',
field: 'minPrice',
component: 'InputNumber',
},
{
label: '最高价格',
label: '默认最高价格',
field: 'maxPrice',
component: 'InputNumber',
},
{
label: '品牌',
field: 'brandId',
component: 'JSearchSelect',
componentProps:{
dict:"common_vip,name,id"
},
},
{
label: '商品',
field: 'shopId',
@ -95,3 +68,32 @@ export const formSchema: FormSchema[] = [
},
},
];
//子表单数据
//子表表格配置
export const commonBrandProductPriceColumns: JVxeColumn[] = [
{
title: '最低价格',
key: 'minPrice',
type: JVxeTypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '最高价格',
key: 'maxPrice',
type: JVxeTypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '品牌分类',
key: 'brandCategoryId',
type: JVxeTypes.selectSearch,
dictCode:"common_brand_category,name,id",
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
]

+ 15
- 15
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/CommonBrandProductList.vue View File

@ -42,15 +42,15 @@
<script lang="ts" name="commonBrandProduct-commonBrandProduct" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import {useModal} from '/@/components/Modal';
import CommonBrandProductModal from './components/CommonBrandProductModal.vue'
import {columns, searchFormSchema} from './commonBrandProduct.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonBrandProduct.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '品牌款式',
@ -58,25 +58,25 @@
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
actionColumn: {
width: 120,
},
},
exportConfig: {
},
exportConfig: {
name:"品牌款式",
url: getExportUrl,
},
importConfig: {
},
importConfig: {
url: getImportUrl
},
})
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext


+ 54
- 9
module-common/src/main/java/org/jeecg/modules/commonBrandProduct/vue3/components/CommonBrandProductModal.vue View File

@ -1,45 +1,90 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
<BasicForm @register="registerForm" ref="formRef"/>
<!-- 子表单区域 -->
<a-tabs v-model:activeKey="activeKey" @change="handleChangeTabs">
<a-tab-pane tab="款式价格配置" :key="refKeys[0]" :forceRender="true">
<JVxeTable
keep-source
resizable
:ref="refKeys[0]"
:loading="commonBrandProductPriceTable.loading"
:columns="commonBrandProductPriceTable.columns"
:dataSource="commonBrandProductPriceTable.dataSource"
:maxHeight="300"
:rowNumber="true"
:rowSelection="true"
:toolbar="true"
/>
</a-tab-pane>
</a-tabs>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {ref, computed, unref,reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../commonBrandProduct.data';
import {saveOrUpdate} from '../commonBrandProduct.api';
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
import {formSchema,commonBrandProductPriceColumns} from '../commonBrandProduct.data';
import {saveOrUpdate,commonBrandProductPriceList} from '../commonBrandProduct.api';
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const refKeys = ref(['commonBrandProductPrice', ]);
const activeKey = ref('commonBrandProductPrice');
const commonBrandProductPrice = ref();
const tableRefs = {commonBrandProductPrice, };
const commonBrandProductPriceTable = reactive({
loading: false,
dataSource: [],
columns:commonBrandProductPriceColumns
})
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
await reset();
setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
requestSubTableData(commonBrandProductPriceList, {id:data?.record?.id}, commonBrandProductPriceTable)
}
//
setProps({ disabled: !data?.showFooter })
});
//
const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys);
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
async function reset(){
await resetFields();
activeKey.value = 'commonBrandProductPrice';
commonBrandProductPriceTable.dataSource = [];
}
function classifyIntoFormData(allValues) {
let main = Object.assign({}, allValues.formValue)
return {
...main, //
commonBrandProductPriceList: allValues.tablesValue[0].tableData,
}
}
//
async function handleSubmit(v) {
async function requestAddOrEdit(values) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);


+ 17
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/controller/CommonShopController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 商品信息表
* @Author: jeecg-boot
* @Date: 2025-06-23
* @Date: 2025-08-28
* @Version: V1.0
*/
@Api(tags="商品信息表")
@ -68,6 +68,22 @@ public class CommonShopController extends JeecgController<CommonShop, ICommonSho
HttpServletRequest req) {
QueryWrapper<CommonShop> queryWrapper = QueryGenerator.initQueryWrapper(commonShop, req.getParameterMap());
Page<CommonShop> page = new Page<CommonShop>(pageNo, pageSize);
queryWrapper.lambda()
.select(CommonShop::getId,
CommonShop::getShopClass,
CommonShop::getName,
CommonShop::getService,
CommonShop::getStatus,
CommonShop::getIsPin,
CommonShop::getPrice,
CommonShop::getMaxPrice,
CommonShop::getUnit,
CommonShop::getCreateTime,
CommonShop::getIsRecycleRules,
CommonShop::getImage
);
IPage<CommonShop> pageList = commonShopService.page(page, queryWrapper);
return Result.OK(pageList);
}


+ 38
- 17
module-common/src/main/java/org/jeecg/modules/commonShop/entity/CommonShop.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 商品信息表
* @Author: jeecg-boot
* @Date: 2025-06-23
* @Date: 2025-08-28
* @Version: V1.0
*/
@Data
@ -61,10 +61,10 @@ public class CommonShop implements Serializable {
@Excel(name = "商品标题", width = 15)
@ApiModelProperty(value = "商品标题")
private java.lang.String name;
// /**小说作者*/
// @Excel(name = "小说作者", width = 15)
// @ApiModelProperty(value = "小说作者")
// private java.lang.String author;
/**小说作者*/
@Excel(name = "小说作者", width = 15)
@ApiModelProperty(value = "小说作者")
private java.lang.String author;
/**商品图片*/
@Excel(name = "商品图片", width = 15)
@ApiModelProperty(value = "商品图片")
@ -78,30 +78,51 @@ public class CommonShop implements Serializable {
@Excel(name = "商品说明", width = 15)
@ApiModelProperty(value = "商品说明")
private java.lang.String service;
/**推荐票数*/
@Excel(name = "推荐票数", width = 15)
@ApiModelProperty(value = "推荐票数")
private java.lang.Integer tuiNum;
/**作者累积亲密值*/
@Excel(name = "作者累积亲密值", width = 15)
@ApiModelProperty(value = "作者累积亲密值")
private java.lang.Integer qmNum;
/**回收规则*/
@Excel(name = "回收规则", width = 15)
@ApiModelProperty(value = "回收规则")
private java.lang.String details;
/**价格*/
@Excel(name = "价格", width = 15)
@ApiModelProperty(value = "价格")
/**作者账户*/
@Excel(name = "作者账户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@ApiModelProperty(value = "作者账户")
private java.lang.String userId;
/**设置状态*/
@Excel(name = "设置状态", width = 15, dicCode = "book_tool_status")
@Dict(dicCode = "book_tool_status")
@ApiModelProperty(value = "设置状态")
private java.lang.Integer toolStatus;
/**作品状态*/
@Excel(name = "作品状态", width = 15, dicCode = "book_my_status")
@Dict(dicCode = "book_my_status")
@ApiModelProperty(value = "作品状态")
private java.lang.Integer bookStatus;
/**最低价格*/
@Excel(name = "最低价格", width = 15)
@ApiModelProperty(value = "最低价格")
private java.math.BigDecimal price;
/**最高价格*/
@Excel(name = "最高价格", width = 15)
@ApiModelProperty(value = "最高价格")
private java.math.BigDecimal maxPrice;
/**单位*/
@Excel(name = "单位", width = 15)
@ApiModelProperty(value = "单位")
private java.lang.String unit;
// /**是否品牌*/
/**是否品牌*/
@Excel(name = "是否品牌", width = 15)
@ApiModelProperty(value = "是否品牌")
private java.lang.String isPin;
/**最高价格*/
@Excel(name = "最高价格", width = 15)
@ApiModelProperty(value = "最高价格")
private java.math.BigDecimal maxPrice;
/**显示回收规则*/
@Excel(name = "显示回收规则", width = 15)
@ApiModelProperty(value = "显示回收规则")
private String isRecycleRules;
@ApiModelProperty(value = "显示回收规则")
private java.lang.String isRecycleRules;
}

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/mapper/CommonShopMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 商品信息表
* @Author: jeecg-boot
* @Date: 2025-06-23
* @Date: 2025-08-28
* @Version: V1.0
*/
public interface CommonShopMapper extends BaseMapper<CommonShop> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 商品信息表
* @Author: jeecg-boot
* @Date: 2025-06-23
* @Date: 2025-08-28
* @Version: V1.0
*/
public interface ICommonShopService extends IService<CommonShop> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 商品信息表
* @Author: jeecg-boot
* @Date: 2025-06-23
* @Date: 2025-08-28
* @Version: V1.0
*/
@Service


+ 17
- 16
module-common/src/main/java/org/jeecg/modules/commonShop/vue/CommonShopList.vue View File

@ -9,18 +9,6 @@
<j-multi-select-tag placeholder="请选择商品分类" dictCode="common_shop_class,title,id" v-model="queryParam.shopClass"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="设置状态">
<j-dict-select-tag placeholder="请选择设置状态" v-model="queryParam.toolStatus" dictCode="book_tool_status"/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="作品状态">
<j-dict-select-tag placeholder="请选择作品状态" v-model="queryParam.bookStatus" dictCode="book_my_status"/>
</a-form-item>
</a-col>
</template>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@ -181,10 +169,15 @@
dataIndex: 'service'
},
{
title:'价格',
title:'最低价格',
align:"center",
dataIndex: 'price'
},
{
title:'最高价格',
align:"center",
dataIndex: 'maxPrice'
},
{
title:'单位',
align:"center",
@ -196,6 +189,12 @@
dataIndex: 'isPin',
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isPin'], text) : ''),
},
{
title:'显示回收规则',
align:"center",
dataIndex: 'isRecycleRules',
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isRecycleRules'], text) : ''),
},
{
title: '操作',
dataIndex: 'action',
@ -219,6 +218,7 @@
},
created() {
this.$set(this.dictOptions, 'isPin', [{text:'是',value:'Y'},{text:'否',value:'N'}])
this.$set(this.dictOptions, 'isRecycleRules', [{text:'是',value:'Y'},{text:'否',value:'N'}])
this.getSuperFieldList();
},
computed: {
@ -232,17 +232,18 @@
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
fieldList.push({type:'Text',value:'shopCion',text:'关联品牌',dictCode:"common_vip,name,id"})
fieldList.push({type:'list_multi',value:'shopClass',text:'商品分类',dictTable:"common_shop_class", dictText:'title', dictCode:'id'})
fieldList.push({type:'string',value:'name',text:'商品标题',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'商品图片',dictCode:''})
fieldList.push({type:'int',value:'status',text:'是否上架',dictCode:'book_my_status'})
fieldList.push({type:'string',value:'service',text:'商品说明',dictCode:''})
fieldList.push({type:'Text',value:'details',text:'回收规则',dictCode:''})
fieldList.push({type:'int',value:'toolStatus',text:'设置状态',dictCode:'book_tool_status'})
fieldList.push({type:'int',value:'bookStatus',text:'作品状态',dictCode:'book_my_status'})
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'price',text:'最低价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'maxPrice',text:'最高价格',dictCode:''})
fieldList.push({type:'string',value:'unit',text:'单位',dictCode:''})
fieldList.push({type:'switch',value:'isPin',text:'是否品牌'})
fieldList.push({type:'switch',value:'isRecycleRules',text:'显示回收规则'})
this.superFieldList = fieldList
}
}


+ 17
- 2
module-common/src/main/java/org/jeecg/modules/commonShop/vue/modules/CommonShopForm.vue View File

@ -3,6 +3,11 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="关联品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopCion">
<j-multi-select-tag type="checkbox" v-model="model.shopCion" dictCode="common_vip,name,id" placeholder="请选择关联品牌" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="商品分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopClass">
<j-multi-select-tag type="list_multi" v-model="model.shopClass" dictCode="common_shop_class,title,id" placeholder="请选择商品分类" />
@ -34,8 +39,13 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input-number v-model="model.price" placeholder="请输入价格" style="width: 100%" />
<a-form-model-item label="最低价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input-number v-model="model.price" placeholder="请输入最低价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="最高价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maxPrice">
<a-input-number v-model="model.maxPrice" placeholder="请输入最高价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -48,6 +58,11 @@
<j-switch v-model="model.isPin" ></j-switch>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="显示回收规则" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isRecycleRules">
<j-switch v-model="model.isRecycleRules" ></j-switch>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>


+ 35
- 20
module-common/src/main/java/org/jeecg/modules/commonShop/vue3/CommonShop.data.ts View File

@ -36,10 +36,15 @@ export const columns: BasicColumn[] = [
dataIndex: 'service'
},
{
title: '价格',
title: '最低价格',
align:"center",
dataIndex: 'price'
},
{
title: '最高价格',
align:"center",
dataIndex: 'maxPrice'
},
{
title: '单位',
align:"center",
@ -53,6 +58,14 @@ export const columns: BasicColumn[] = [
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '显示回收规则',
align:"center",
dataIndex: 'isRecycleRules',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -65,27 +78,17 @@ export const searchFormSchema: FormSchema[] = [
},
colProps: {span: 6},
},
{
label: "设置状态",
field: "toolStatus",
component: 'JDictSelectTag',
componentProps:{
dictCode:"book_tool_status"
},
colProps: {span: 6},
},
{
label: "作品状态",
field: "bookStatus",
component: 'JDictSelectTag',
componentProps:{
dictCode:"book_my_status"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '关联品牌',
field: 'shopCion',
component: 'JMultiSelectTag',//TODO 暂无该组件
componentProps:{
dictCode:"common_vip,name,id"
},
},
{
label: '商品分类',
field: 'shopClass',
@ -125,10 +128,15 @@ export const formSchema: FormSchema[] = [
component: 'JCodeEditor', //TODO String后缀暂未添加
},
{
label: '价格',
label: '最低价格',
field: 'price',
component: 'InputNumber',
},
{
label: '最高价格',
field: 'maxPrice',
component: 'InputNumber',
},
{
label: '单位',
field: 'unit',
@ -141,4 +149,11 @@ export const formSchema: FormSchema[] = [
componentProps:{
},
},
{
label: '显示回收规则',
field: 'isRecycleRules',
component: 'JSwitch',
componentProps:{
},
},
];

Loading…
Cancel
Save