Browse Source

修改bug

v1
前端-胡立永 4 months ago
parent
commit
32e16cd8c4
65 changed files with 4296 additions and 100 deletions
  1. +193
    -0
      admin-pc/src/views/commonDistributionRatio/CommonDistributionRatioList.vue
  2. +133
    -0
      admin-pc/src/views/commonDistributionRatio/modules/CommonDistributionRatioForm.vue
  3. +84
    -0
      admin-pc/src/views/commonDistributionRatio/modules/CommonDistributionRatioModal.Style#Drawer.vue
  4. +60
    -0
      admin-pc/src/views/commonDistributionRatio/modules/CommonDistributionRatioModal.vue
  5. +1
    -1
      module-base/base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java
  6. +1
    -1
      module-base/base-core/src/main/java/org/jeecg/modules/hanHaiMember/entity/HanHaiMember.java
  7. +2
    -2
      module-common/src/main/java/org/jeecg/api/controller/AppletClassController.java
  8. +8
    -0
      module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java
  9. +14
    -0
      module-common/src/main/java/org/jeecg/api/controller/AppletOrderController.java
  10. +22
    -0
      module-common/src/main/java/org/jeecg/api/req/s.js
  11. +1
    -1
      module-common/src/main/java/org/jeecg/api/service/AppletClassService.java
  12. +1
    -1
      module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java
  13. +4
    -0
      module-common/src/main/java/org/jeecg/api/service/AppletOrderService.java
  14. +13
    -10
      module-common/src/main/java/org/jeecg/api/service/impl/AppletClassServiceImpl.java
  15. +9
    -12
      module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java
  16. +178
    -26
      module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java
  17. +29
    -12
      module-common/src/main/java/org/jeecg/api/service/impl/AppletPromotionServiceImpl.java
  18. +171
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/controller/CommonRecyclingDestinationController.java
  19. +69
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/entity/CommonRecyclingDestination.java
  20. +17
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/mapper/CommonRecyclingDestinationMapper.java
  21. +5
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/mapper/xml/CommonRecyclingDestinationMapper.xml
  22. +14
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/service/ICommonRecyclingDestinationService.java
  23. +19
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/service/impl/CommonRecyclingDestinationServiceImpl.java
  24. +191
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/CommonRecyclingDestinationList.vue
  25. +119
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/modules/CommonRecyclingDestinationForm.vue
  26. +84
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/modules/CommonRecyclingDestinationModal.Style#Drawer.vue
  27. +60
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/modules/CommonRecyclingDestinationModal.vue
  28. +61
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/CommonRecyclingDestination.api.ts
  29. +57
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/CommonRecyclingDestination.data.ts
  30. +162
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/CommonRecyclingDestinationList.vue
  31. +58
    -0
      module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/components/CommonRecyclingDestinationModal.vue
  32. +10
    -0
      module-common/src/main/java/org/jeecg/modules/commonAddress/service/ICommonAddressService.java
  33. +120
    -1
      module-common/src/main/java/org/jeecg/modules/commonAddress/service/impl/CommonAddressServiceImpl.java
  34. +3
    -0
      module-common/src/main/java/org/jeecg/modules/commonCity/service/ICommonCityService.java
  35. +34
    -0
      module-common/src/main/java/org/jeecg/modules/commonCity/service/impl/CommonCityServiceImpl.java
  36. +171
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/controller/CommonDistributionRatioController.java
  37. +69
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/entity/CommonDistributionRatio.java
  38. +17
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/mapper/CommonDistributionRatioMapper.java
  39. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/mapper/xml/CommonDistributionRatioMapper.xml
  40. +14
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/service/ICommonDistributionRatioService.java
  41. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/service/impl/CommonDistributionRatioServiceImpl.java
  42. +189
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/CommonDistributionRatioList.vue
  43. +133
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/modules/CommonDistributionRatioForm.vue
  44. +84
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/modules/CommonDistributionRatioModal.Style#Drawer.vue
  45. +60
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/modules/CommonDistributionRatioModal.vue
  46. +61
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/CommonDistributionRatio.api.ts
  47. +75
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/CommonDistributionRatio.data.ts
  48. +162
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/CommonDistributionRatioList.vue
  49. +58
    -0
      module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/components/CommonDistributionRatioModal.vue
  50. +35
    -4
      module-common/src/main/java/org/jeecg/modules/commonOrder/entity/CommonOrder.java
  51. +34
    -29
      module-common/src/main/java/org/jeecg/modules/commonShop/entity/CommonShop.java
  52. +171
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/controller/CommonReasonsController.java
  53. +67
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/entity/CommonReasons.java
  54. +17
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/mapper/CommonReasonsMapper.java
  55. +5
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/mapper/xml/CommonReasonsMapper.xml
  56. +14
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/service/ICommonReasonsService.java
  57. +19
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/service/impl/CommonReasonsServiceImpl.java
  58. +204
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue/CommonReasonsList.vue
  59. +114
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue/modules/CommonReasonsForm.vue
  60. +84
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue/modules/CommonReasonsModal.Style#Drawer.vue
  61. +60
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue/modules/CommonReasonsModal.vue
  62. +61
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/CommonReasons.api.ts
  63. +67
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/CommonReasons.data.ts
  64. +162
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/CommonReasonsList.vue
  65. +58
    -0
      module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/components/CommonReasonsModal.vue

+ 193
- 0
admin-pc/src/views/commonDistributionRatio/CommonDistributionRatioList.vue View File

@ -0,0 +1,193 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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-distribution-ratio-modal ref="modalForm" @ok="modalFormOk"></common-distribution-ratio-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonDistributionRatioModal from './modules/CommonDistributionRatioModal'
export default {
name: 'CommonDistributionRatioList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonDistributionRatioModal
},
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: 'title'
},
{
title:'直推百分比',
align:"center",
dataIndex: 'direct'
},
{
title:'间推百分比',
align:"center",
dataIndex: 'indirect'
},
{
title:'排序',
align:"center",
dataIndex: 'sort'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonDistributionRatio/commonDistributionRatio/list",
delete: "/commonDistributionRatio/commonDistributionRatio/delete",
deleteBatch: "/commonDistributionRatio/commonDistributionRatio/deleteBatch",
exportXlsUrl: "/commonDistributionRatio/commonDistributionRatio/exportXls",
importExcelUrl: "commonDistributionRatio/commonDistributionRatio/importExcel",
},
dictOptions:{},
superFieldList:[],
isorter:{
column: 'sort',
order: 'asc',
},
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'title',text:'名称',dictCode:''})
fieldList.push({type:'BigDecimal',value:'direct',text:'直推百分比',dictCode:''})
fieldList.push({type:'BigDecimal',value:'indirect',text:'间推百分比',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 133
- 0
admin-pc/src/views/commonDistributionRatio/modules/CommonDistributionRatioForm.vue View File

@ -0,0 +1,133 @@
<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="title">
<a-input v-model="model.title" placeholder="请输入名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="直推百分比" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="direct">
<a-input-number v-model="model.direct" placeholder="请输入直推百分比" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="间推百分比" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="indirect">
<a-input-number v-model="model.indirect" placeholder="请输入间推百分比" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
<a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'CommonDistributionRatioForm',
components: {
},
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: {
title: [
{ required: true, message: '请输入名称!'},
],
direct: [
{ required: true, message: '请输入直推百分比!'},
{ pattern: '/^([0-9][0-9]{0,1}|100)$/', message: '不符合校验规则!'},
],
indirect: [
{ required: true, message: '请输入间推百分比!'},
],
sort: [
{ required: true, message: '请输入排序!'},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
],
},
url: {
add: "/commonDistributionRatio/commonDistributionRatio/add",
edit: "/commonDistributionRatio/commonDistributionRatio/edit",
queryById: "/commonDistributionRatio/commonDistributionRatio/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
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;
})
}
})
},
}
}
</script>

+ 84
- 0
admin-pc/src/views/commonDistributionRatio/modules/CommonDistributionRatioModal.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-distribution-ratio-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-distribution-ratio-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 CommonDistributionRatioForm from './CommonDistributionRatioForm'
export default {
name: 'CommonDistributionRatioModal',
components: {
CommonDistributionRatioForm
},
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/commonDistributionRatio/modules/CommonDistributionRatioModal.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-distribution-ratio-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-distribution-ratio-form>
</j-modal>
</template>
<script>
import CommonDistributionRatioForm from './CommonDistributionRatioForm'
export default {
name: 'CommonDistributionRatioModal',
components: {
CommonDistributionRatioForm
},
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>

+ 1
- 1
module-base/base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java View File

@ -36,7 +36,7 @@ import org.jeecg.common.util.oConvertUtils;
public class JwtUtil {
/**Token有效期为1小时(Token在reids中缓存时间为两倍)*/
public static final long EXPIRE_TIME = 600 * 600 * 1000;
public static final long EXPIRE_TIME = 3000 * 600 * 600 * 1000;
static final String WELL_NUMBER = SymbolConstant.WELL_NUMBER + SymbolConstant.LEFT_CURLY_BRACKET;
/**


+ 1
- 1
module-base/base-core/src/main/java/org/jeecg/modules/hanHaiMember/entity/HanHaiMember.java View File

@ -272,6 +272,6 @@ public class HanHaiMember implements Serializable {
@Excel(name = "推广官类型", width = 15)
@ApiModelProperty(value = "推广官类型")
@Dict(dicCode = "tui_type")
@Dict(dictTable = "common_distribution_ratio", dicCode = "id", dicText = "title")
private java.lang.String isTuiType;
}

+ 2
- 2
module-common/src/main/java/org/jeecg/api/controller/AppletClassController.java View File

@ -59,8 +59,8 @@ public class AppletClassController {
//根据商品标识查询商品可回品牌
@ApiOperation(value="根据商品标识查询商品可回品牌", notes="根据商品标识查询商品可回品牌")
@GetMapping(value = "/getGoodsBrandList")
public Result<?> getGoodsBrandList(String name,String iconId,PageBean pageBean){
return appletClassService.getGoodsBrandList(name,iconId,pageBean);
public Result<?> getGoodsBrandList(String name,String productId,PageBean pageBean){
return appletClassService.getGoodsBrandList(name,productId,pageBean);
}


+ 8
- 0
module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java View File

@ -58,6 +58,14 @@ public class AppletIndexController {
}
//查询回收去向
@ApiOperation(value="查询回收去向", notes="查询回收去向")
@GetMapping(value = "/getRecyclingDestination")
public Result<?> getRecyclingDestination(){
return appletIndexService.getRecyclingDestination();
}
//查询最近回收商品
@ApiOperation(value="查询最近回收商品", notes="查询最近回收商品")
@GetMapping(value = "/getRecentGoodsList")


+ 14
- 0
module-common/src/main/java/org/jeecg/api/controller/AppletOrderController.java View File

@ -78,4 +78,18 @@ public class AppletOrderController {
return appletOrderService.getCumulativeRecoveryCount(token);
}
//检验订单通过
@ApiOperation(value="检验订单通过", notes="检验订单通过")
@GetMapping(value = "/checkoutOrder")
public Result<?> checkoutOrder(@RequestHeader("X-Access-Token") String token, String id, String list) {
return appletOrderService.checkoutOrder(token, id, list);
}
//获取检验理由列表
@ApiOperation(value="获取检验理由列表", notes="获取检验理由列表")
@GetMapping(value = "/getcheckoutReasons")
public Result<?> getcheckoutReasons(@RequestHeader("X-Access-Token") String token, String classId, String type) {
return appletOrderService.getCeckoutReasons(token, classId, type);
}
}

+ 22
- 0
module-common/src/main/java/org/jeecg/api/req/s.js View File

@ -0,0 +1,22 @@
let a = {
id : 1565465498,//一级订单id
list : [
{
id : 1565465452,//二级订单id
price : 44.1,//价格
qualifiedNum : 2,//合格数量
noQualifiedNum : 1,//不合格数量
unrecyclable : 1,//不可回收数量
commonOrderList : [
{
id : 354616854,//三级订单id
testingInstructions : '199168761,654651745,61541684',//检测说明,多个id用逗号分割
testingImages : 'https://xxxx,https://xxxx',//检测报告图片
testingStatus : 0,//【质检合格:0】【质量问题:1】【不可回收:2】
}
]
}
]
}

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

@ -23,7 +23,7 @@ public interface AppletClassService {
//根据商品标识查询商品可回品牌
Result<?> getGoodsBrandList(String name,String iconId,PageBean pageBean);
Result<?> getGoodsBrandList(String name,String productId,PageBean pageBean);


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

@ -27,5 +27,5 @@ public interface AppletIndexService {
Result<?> getQualityReport(String goodsId);
Result<?> getRecyclingDestination();
}

+ 4
- 0
module-common/src/main/java/org/jeecg/api/service/AppletOrderService.java View File

@ -22,4 +22,8 @@ public interface AppletOrderService {
Result<?> createOrder(String token, String list, String addressId, String strTime);
Result<?> getCumulativeRecoveryCount(String token);
Result<?> checkoutOrder(String token, String id, String list);
Result<?> getCeckoutReasons(String token, String classId, String type);
}

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

@ -2,6 +2,7 @@ package org.jeecg.api.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang.StringUtils;
import org.jeecg.api.bean.PageBean;
import org.jeecg.api.service.AppletClassService;
import org.jeecg.common.api.vo.Result;
@ -71,20 +72,22 @@ public class AppletClassServiceImpl implements AppletClassService {
//根据商品标识查询商品可回品牌
@Override
public Result<?> getGoodsBrandList(String name,String iconId,PageBean pageBean){
public Result<?> getGoodsBrandList(String name,String productId,PageBean pageBean){
CommonShop byId = commonShopService.getById(productId);
if (byId == null){
Result.error("商品不存在");
}
String[] vids = byId.getShopCion() == null ? null : byId.getShopCion().split(",");
Page<CommonVip> page = new Page<>(pageBean.getPageNo(),pageBean.getPageSize());
IPage<CommonVip> pageList = commonVipService
.lambdaQuery()
// .eq(CommonVip::getPid, iconId)
.in(vids != null, CommonVip::getId, vids)
.like(StringUtils.isNotBlank(name), CommonVip::getName, name)
.page(page);
//如果名称不为空
if(name != null){
pageList = commonVipService
.lambdaQuery()
// .eq(CommonVip::getPid, iconId)
.like(CommonVip::getName, name)
.page(page);
}
return Result.OK("商品品牌",pageList);
}


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

@ -8,6 +8,7 @@ import org.jeecg.api.bean.PageBean;
import org.jeecg.api.service.AppletIndexService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.CommonRecyclingDestination.service.ICommonRecyclingDestinationService;
import org.jeecg.modules.commonBanner.entity.CommonBanner;
import org.jeecg.modules.commonBanner.service.ICommonBannerService;
import org.jeecg.modules.commonBook.entity.CommonBook;
@ -71,6 +72,8 @@ public class AppletIndexServiceImpl implements AppletIndexService {
private ICommonGetService commonGetService;
@Autowired
private ICommonOrderService commonOrderService;
@Autowired
private ICommonRecyclingDestinationService commonRecyclingDestinationService;
// 获取首页banner
@Override
@ -97,18 +100,7 @@ public class AppletIndexServiceImpl implements AppletIndexService {
@Override
public Result<?> getFreeCityList(){
List<CommonCity> list = commonCityService
.lambdaQuery()
.eq(CommonCity::getPid,"0")
.list();
//循环数据得到子集
for (CommonCity commonCity : list) {
List<CommonCity> children = commonCityService
.lambdaQuery()
.eq(CommonCity::getPid,commonCity.getId())
.list();
commonCity.setChildren(children);
}
List<CommonCity> list = commonCityService.buildOpenCityTree();
return Result.OK("已开通包邮城市",list);
}
@ -132,4 +124,9 @@ public class AppletIndexServiceImpl implements AppletIndexService {
return Result.OK("质量检测报告",one);
}
@Override
public Result<?> getRecyclingDestination() {
return Result.OK(commonRecyclingDestinationService.list());
}
}

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

@ -25,9 +25,14 @@ import org.jeecg.modules.commonShop.entity.CommonShop;
import org.jeecg.modules.commonShop.service.ICommonShopService;
import org.jeecg.modules.commonText.entity.CommonText;
import org.jeecg.modules.commonText.service.ICommonTextService;
import org.jeecg.modules.common_reasons.entity.CommonReasons;
import org.jeecg.modules.common_reasons.service.ICommonReasonsService;
import org.jeecg.modules.commonCity.entity.CommonCity;
import org.jeecg.modules.commonCity.service.ICommonCityService;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
@ -50,6 +55,10 @@ public class AppletOrderServiceImpl implements AppletOrderService {
private ICommonTextService commonTextService;
@Autowired
private ICommonAddressService commonAddressService;
@Autowired
private ICommonReasonsService commonReasonsService;
@Autowired
private ICommonCityService commonCityService;
// 联系客服问题相关列表数据带分页
@Override
@ -68,6 +77,7 @@ public class AppletOrderServiceImpl implements AppletOrderService {
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(status != null,CommonOrder::getStatus,status)
.eq(CommonOrder::getPid,"0")
.orderByDesc(CommonOrder::getCreateTime)
.page(page);
//得到集合数据
@ -97,8 +107,20 @@ public class AppletOrderServiceImpl implements AppletOrderService {
.lambdaQuery()
.eq(CommonOrder::getPid,commonOrder.getId())
.list();
commonOrder.setCommonOrderList(children);
//得到第三级集合数据
for (CommonOrder order1 : children) {
//查询下级
List<CommonOrder> order2 = commonOrderService
.lambdaQuery()
.eq(CommonOrder::getPid,commonOrder.getId())
.list();
order1.setCommonOrderList(order2);
}
return Result.OK("订单详情",commonOrder);
}
@ -121,7 +143,8 @@ public class AppletOrderServiceImpl implements AppletOrderService {
//创建预约订单//把list转为对象 list = [{"shopId":"1","num":1},{"shopId":"2","num":2}]
@Override
public Result<?> createOrder(String token, String list, String addressId, String strTime) {
@Transactional
public Result<?> createOrder(String token, String listJson, String addressId, String strTime) {
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//用户地址不能为空
if(StringUtils.isBlank(addressId)){
@ -133,51 +156,68 @@ public class AppletOrderServiceImpl implements AppletOrderService {
return Result.error("地址不存在");
}
//把list转为对象 list = [{"shopId":"1","num":1,"pinId":1},{"shopId":"2","num":2,"pinId":1}]
List<CommonOrder> list1 = JSON.parseArray(list, CommonOrder.class);
List<CommonOrder> list = JSON.parseArray(listJson, CommonOrder.class);
//创建订单标识
String orderId = IdWorker.getIdStr();
if(null!=list1 && list1.size()>0) {
//订单总额
BigDecimal totalPrice = new BigDecimal(0);
//总直推金额
BigDecimal totalOneMoney = new BigDecimal(0);
//总二级代理金额
BigDecimal totalTwoMoney = new BigDecimal(0);
if(null!=list && list.size()>0) {
//订单商品数量
Integer totalNum = 0;
BigDecimal minEstimatedPriceSum = BigDecimal.ZERO;//预估价格
BigDecimal maxEstimatedPriceSum = BigDecimal.ZERO;//预估价格
//创建订单详情
for (CommonOrder sku : list1) {
for (CommonOrder sku : list) {
BigDecimal minEstimatedPrice = BigDecimal.ZERO;//预估价格
BigDecimal maxEstimatedPrice = BigDecimal.ZERO;//预估价格
//查询商品信息
CommonShop commonShop = commonShopService.getById(sku.getShopId());
//商品不能为空
if (commonShop == null) {
return Result.error("商品不存在");
}
if (commonShop.getPrice() != null){
maxEstimatedPrice = commonShop.getMaxPrice().multiply(new BigDecimal(sku.getNum()));
}
if (commonShop.getMaxPrice() != null){
maxEstimatedPrice = commonShop.getMaxPrice().multiply(new BigDecimal(sku.getNum()));
}
minEstimatedPriceSum.add(commonShop.getPrice().multiply(new BigDecimal(sku.getNum())));
maxEstimatedPriceSum.add(commonShop.getMaxPrice().multiply(new BigDecimal(sku.getNum())));
//创建订单
BigDecimal price = commonShop.getPrice().multiply(new BigDecimal(sku.getNum()));
sku.setPid(orderId);
sku.setHasChild("0");
sku.setHasChild("1");
sku.setShopId(commonShop.getId());
sku.setTitle(commonShop.getName());
sku.setImage(commonShop.getImage());
sku.setPrice(price);
sku.setNum(sku.getNum());
sku.setCreateTime(new Date());
sku.setPrice(price);
sku.setImage(commonShop.getImage());
sku.setShopClass(commonShop.getShopClass());
sku.setCreateTime(new Date());
sku.setPinId(sku.getPinId());
sku.setEstimatedPrice("" + minEstimatedPrice+ "-" + maxEstimatedPrice);
commonOrderService.save(sku);
//计算总价格
totalPrice = totalPrice.add(price);
for (Integer i = 0; i < sku.getNum(); i++) {
//创建第三级的订单
CommonOrder order3 = new CommonOrder();
order3.setPid(sku.getId());
order3.setHasChild("0");
order3.setShopId(commonShop.getId());
order3.setCreateTime(new Date());
order3.setPinId(sku.getPinId());
order3.setNum(1);
commonOrderService.save(order3);
}
totalNum = totalNum + sku.getNum();
}
// 计算是否包邮
boolean isFreeShipping = calculateFreeShipping(commonAddress);
//创建主订单
CommonOrder cityOrder = new CommonOrder();
@ -189,19 +229,17 @@ public class AppletOrderServiceImpl implements AppletOrderService {
cityOrder.setName(commonAddress.getName());
cityOrder.setPhone(commonAddress.getPhone());
cityOrder.setAddressDetail(commonAddress.getAddressDetails());
cityOrder.setName(commonAddress.getName());
cityOrder.setTitle("组合订单");
cityOrder.setPrice(totalPrice);
cityOrder.setOneMoney(totalOneMoney);
cityOrder.setTwoMoney(totalTwoMoney);
cityOrder.setTitle("组合订单" + (isFreeShipping ? "(包邮)" : "(需付邮费)"));
cityOrder.setPid("0");
cityOrder.setHasChild("1");
cityOrder.setImage(null);
cityOrder.setStatus(0);
cityOrder.setGoTime(strTime);
cityOrder.setAddressId(addressId);
cityOrder.setTestingStatus(0);
cityOrder.setCreateTime(new Date());
cityOrder.setEstimatedPrice("" + minEstimatedPriceSum + "-" + maxEstimatedPriceSum);
// 可以考虑在订单表中添加一个字段来记录是否包邮
// cityOrder.setFreeShipping(isFreeShipping ? "Y" : "N");
commonOrderService.save(cityOrder);
return Result.OK("创建预约订单成功",cityOrder);
@ -226,4 +264,118 @@ public class AppletOrderServiceImpl implements AppletOrderService {
return Result.ok(count);
}
@Override
@Transactional
public Result<?> checkoutOrder(String token, String id, String listJson) {
List<CommonOrder> list = JSON.parseArray(listJson, CommonOrder.class);
CommonOrder order = commonOrderService.getById(id);
if (order == null){
Result.error("订单无效");
}
BigDecimal priceSum = new BigDecimal(0);//总价格
Integer qualifiedNumSum = 0;//合格数量
Integer noQualifiedNumSum = 0;//不合格数量
Integer unrecyclableSum = 0;//不可回收数量
for (CommonOrder orderReq : list) {
priceSum.add(orderReq.getPrice());
qualifiedNumSum += orderReq.getQualifiedNum();
noQualifiedNumSum += orderReq.getNoQualifiedNum();
unrecyclableSum += orderReq.getUnrecyclable();
commonOrderService.updateById(orderReq);
if (orderReq.getCommonOrderList() == null) {
continue;
}
for (CommonOrder orderReq2 : orderReq.getCommonOrderList()) {
commonOrderService.updateById(orderReq2);
}
}
order.setPrice(priceSum);
order.setQualifiedNum(qualifiedNumSum);
order.setNoQualifiedNum(noQualifiedNumSum);
order.setUnrecyclable(unrecyclableSum);
order.setState(2);//已完成
order.setState(3);//现金打款
commonOrderService.updateById(order);
return null;
}
@Override
public Result<?> getCeckoutReasons(String token, String classId, String type) {
if (StringUtils.isBlank(classId)){
return Result.error("classId分类ID不能为空");
}
if (StringUtils.isBlank(type)){
return Result.error("type类型不能为空");
}
return Result.ok(commonReasonsService.lambdaQuery()
.eq(CommonReasons::getClassId, classId)
.eq(CommonReasons::getType, type)
);
}
/**
* 计算地址是否包邮
* @param address 收货地址对象
* @return true表示包邮false表示不包邮
*/
private boolean calculateFreeShipping(CommonAddress address) {
// 参数校验
if (address == null || StringUtils.isBlank(address.getAddress())) {
return false;
}
try {
// 获取开通包邮城市列表含完整三级结构
List<CommonCity> openCityList = commonCityService.buildOpenCityTree();
// 使用 CommonAddress 服务检查地址是否在开放城市中
return commonAddressService.isAddressInOpenCities(address.getAddress(), openCityList);
} catch (Exception e) {
// 如果包邮计算出错默认不包邮
System.err.println("计算包邮状态出错: " + e.getMessage());
return false;
}
}
/**
* 根据地址字符串计算是否包邮重载方法
* @param addressString 地址字符串
* @return true表示包邮false表示不包邮
*/
public boolean calculateFreeShippingByAddress(String addressString) {
// 参数校验
if (StringUtils.isBlank(addressString)) {
return false;
}
try {
// 获取开通包邮城市列表
List<CommonCity> openCityList = commonCityService.buildOpenCityTree();
// 使用 CommonAddress 服务检查地址是否在开放城市中
return commonAddressService.isAddressInOpenCities(addressString, openCityList);
} catch (Exception e) {
// 如果包邮计算出错默认不包邮
System.err.println("计算包邮状态出错: " + e.getMessage());
return false;
}
}
}

+ 29
- 12
module-common/src/main/java/org/jeecg/api/service/impl/AppletPromotionServiceImpl.java View File

@ -15,6 +15,8 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.commonConfig.entity.CommonConfig;
import org.jeecg.modules.commonConfig.service.ICommonConfigService;
import org.jeecg.modules.commonDistributionRatio.entity.CommonDistributionRatio;
import org.jeecg.modules.commonDistributionRatio.service.ICommonDistributionRatioService;
import org.jeecg.modules.commonOrder.entity.CommonOrder;
import org.jeecg.modules.commonOrder.service.ICommonOrderService;
import org.jeecg.modules.commonPromotion.entity.CommonPromotion;
@ -56,6 +58,8 @@ public class AppletPromotionServiceImpl implements AppletPromotionService {
private ICommonConfigService commonConfigService;
@Resource
private ICommonOrderService commonOrderService;
@Resource
private ICommonDistributionRatioService commonDistributionRatioService;
@Autowired
private WxHttpUtils wxHttpUtils;
@ -252,22 +256,23 @@ public class AppletPromotionServiceImpl implements AppletPromotionService {
Page<HanHaiMember> page = new Page<HanHaiMember>(pageBean.getPageNo(), pageBean.getPageSize());
Page<HanHaiMember> pageList = hanHaiMemberService.lambdaQuery()
.eq(HanHaiMember::getShareId,hanHaiMember.getId())
.eq(state == 0, HanHaiMember::getShareId,hanHaiMember.getId())
.eq(state != 0, HanHaiMember::getVid,hanHaiMember.getId())
.page(page);
if(state == 0){
pageList = hanHaiMemberService.lambdaQuery()
.eq(HanHaiMember::getShareId,hanHaiMember.getId())
.page(page);
}else{
pageList = hanHaiMemberService.lambdaQuery()
.eq(HanHaiMember::getVid,hanHaiMember.getId())
.page(page);
}
// if(state == 0){
// pageList = hanHaiMemberService.lambdaQuery()
// .eq(HanHaiMember::getShareId,hanHaiMember.getId())
// .page(page);
// }else{
// pageList = hanHaiMemberService.lambdaQuery()
// .eq(HanHaiMember::getVid,hanHaiMember.getId())
// .page(page);
// }
//创建一个新的集合
Page<FansPageBean> pageListFans = new Page<>();
List<FansPageBean> fansPageBean = new ArrayList<>();
pageList.getRecords().forEach(item->{
//创建一个新的对象
FansPageBean fansPageBean1 = new FansPageBean();
@ -287,9 +292,7 @@ public class AppletPromotionServiceImpl implements AppletPromotionService {
fansPageBean1.setCommission(commission);
fansPageBean1.setCreateTime(item.getCreateTime());
fansPageBean.add(fansPageBean1);
});
pageListFans.setRecords(fansPageBean);
return Result.OK(pageListFans);
}
@ -312,6 +315,20 @@ public class AppletPromotionServiceImpl implements AppletPromotionService {
CommonPromotion commonPromotion = commonPromotionService.getById(id);
commonPromotion.setStatus(1);
commonPromotionService.updateById(commonPromotion);
HanHaiMember byId = hanHaiMemberService.getById(commonPromotion.getUserId());
if (byId != null){
List<CommonDistributionRatio> list = commonDistributionRatioService.
lambdaQuery()
.orderByAsc(CommonDistributionRatio::getSort)
.list();
if (list.size() > 0){
String tid = list.get(0).getId();
byId.setIsTuiType(tid);
byId.setIsTuiRole("Y");
}
}
return Result.OK("通过推广表单申请成功");
}


+ 171
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/controller/CommonRecyclingDestinationController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.CommonRecyclingDestination.controller;
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.CommonRecyclingDestination.entity.CommonRecyclingDestination;
import org.jeecg.modules.CommonRecyclingDestination.service.ICommonRecyclingDestinationService;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 回收去向
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
@Api(tags="回收去向")
@RestController
@RequestMapping("/CommonRecyclingDestination/commonRecyclingDestination")
@Slf4j
public class CommonRecyclingDestinationController extends JeecgController<CommonRecyclingDestination, ICommonRecyclingDestinationService> {
@Autowired
private ICommonRecyclingDestinationService commonRecyclingDestinationService;
/**
* 分页列表查询
*
* @param commonRecyclingDestination
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "回收去向-分页列表查询")
@ApiOperation(value="回收去向-分页列表查询", notes="回收去向-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonRecyclingDestination>> queryPageList(CommonRecyclingDestination commonRecyclingDestination,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonRecyclingDestination> queryWrapper = QueryGenerator.initQueryWrapper(commonRecyclingDestination, req.getParameterMap());
Page<CommonRecyclingDestination> page = new Page<CommonRecyclingDestination>(pageNo, pageSize);
IPage<CommonRecyclingDestination> pageList = commonRecyclingDestinationService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonRecyclingDestination
* @return
*/
@AutoLog(value = "回收去向-添加")
@ApiOperation(value="回收去向-添加", notes="回收去向-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonRecyclingDestination commonRecyclingDestination) {
commonRecyclingDestinationService.save(commonRecyclingDestination);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonRecyclingDestination
* @return
*/
@AutoLog(value = "回收去向-编辑")
@ApiOperation(value="回收去向-编辑", notes="回收去向-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonRecyclingDestination commonRecyclingDestination) {
commonRecyclingDestinationService.updateById(commonRecyclingDestination);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "回收去向-通过id删除")
@ApiOperation(value="回收去向-通过id删除", notes="回收去向-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
commonRecyclingDestinationService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "回收去向-批量删除")
@ApiOperation(value="回收去向-批量删除", notes="回收去向-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.commonRecyclingDestinationService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "回收去向-通过id查询")
@ApiOperation(value="回收去向-通过id查询", notes="回收去向-通过id查询")
@GetMapping(value = "/queryById")
public Result<CommonRecyclingDestination> queryById(@RequestParam(name="id",required=true) String id) {
CommonRecyclingDestination commonRecyclingDestination = commonRecyclingDestinationService.getById(id);
if(commonRecyclingDestination==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonRecyclingDestination);
}
/**
* 导出excel
*
* @param request
* @param commonRecyclingDestination
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonRecyclingDestination commonRecyclingDestination) {
return super.exportXls(request, commonRecyclingDestination, CommonRecyclingDestination.class, "回收去向");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommonRecyclingDestination.class);
}
}

+ 69
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/entity/CommonRecyclingDestination.java View File

@ -0,0 +1,69 @@
package org.jeecg.modules.CommonRecyclingDestination.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;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
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-06-26
* @Version: V1.0
*/
@Data
@TableName("common_recycling_destination")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_recycling_destination对象", description="回收去向")
public class CommonRecyclingDestination 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.lang.String icon;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private java.lang.String title;
/**描述*/
@Excel(name = "描述", width = 15)
@ApiModelProperty(value = "描述")
private java.lang.String description;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String content;
}

+ 17
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/mapper/CommonRecyclingDestinationMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.CommonRecyclingDestination.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.CommonRecyclingDestination.entity.CommonRecyclingDestination;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 回收去向
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
public interface CommonRecyclingDestinationMapper extends BaseMapper<CommonRecyclingDestination> {
}

+ 5
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/mapper/xml/CommonRecyclingDestinationMapper.xml View File

@ -0,0 +1,5 @@
<?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.CommonRecyclingDestination.mapper.CommonRecyclingDestinationMapper">
</mapper>

+ 14
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/service/ICommonRecyclingDestinationService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.CommonRecyclingDestination.service;
import org.jeecg.modules.CommonRecyclingDestination.entity.CommonRecyclingDestination;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 回收去向
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
public interface ICommonRecyclingDestinationService extends IService<CommonRecyclingDestination> {
}

+ 19
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/service/impl/CommonRecyclingDestinationServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.CommonRecyclingDestination.service.impl;
import org.jeecg.modules.CommonRecyclingDestination.entity.CommonRecyclingDestination;
import org.jeecg.modules.CommonRecyclingDestination.mapper.CommonRecyclingDestinationMapper;
import org.jeecg.modules.CommonRecyclingDestination.service.ICommonRecyclingDestinationService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 回收去向
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
@Service
public class CommonRecyclingDestinationServiceImpl extends ServiceImpl<CommonRecyclingDestinationMapper, CommonRecyclingDestination> implements ICommonRecyclingDestinationService {
}

+ 191
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/CommonRecyclingDestinationList.vue View File

@ -0,0 +1,191 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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-recycling-destination-modal ref="modalForm" @ok="modalFormOk"></common-recycling-destination-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonRecyclingDestinationModal from './modules/CommonRecyclingDestinationModal'
export default {
name: 'CommonRecyclingDestinationList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonRecyclingDestinationModal
},
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: 'icon'
},
{
title:'标题',
align:"center",
dataIndex: 'title',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'描述',
align:"center",
dataIndex: 'description'
},
{
title:'内容',
align:"center",
dataIndex: 'content',
scopedSlots: {customRender: 'htmlSlot'}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/CommonRecyclingDestination/commonRecyclingDestination/list",
delete: "/CommonRecyclingDestination/commonRecyclingDestination/delete",
deleteBatch: "/CommonRecyclingDestination/commonRecyclingDestination/deleteBatch",
exportXlsUrl: "/CommonRecyclingDestination/commonRecyclingDestination/exportXls",
importExcelUrl: "CommonRecyclingDestination/commonRecyclingDestination/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'icon',text:'图片',dictCode:''})
fieldList.push({type:'string',value:'title',text:'标题',dictCode:''})
fieldList.push({type:'string',value:'description',text:'描述',dictCode:''})
fieldList.push({type:'Text',value:'content',text:'内容',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 119
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/modules/CommonRecyclingDestinationForm.vue View File

@ -0,0 +1,119 @@
<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="icon">
<a-input v-model="model.icon" placeholder="请输入图片" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<j-image-upload isMultiple v-model="model.title" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description">
<a-input v-model="model.description" placeholder="请输入描述" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="content">
<j-editor v-model="model.content" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'CommonRecyclingDestinationForm',
components: {
},
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: "/CommonRecyclingDestination/commonRecyclingDestination/add",
edit: "/CommonRecyclingDestination/commonRecyclingDestination/edit",
queryById: "/CommonRecyclingDestination/commonRecyclingDestination/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
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;
})
}
})
},
}
}
</script>

+ 84
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/modules/CommonRecyclingDestinationModal.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-recycling-destination-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-recycling-destination-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 CommonRecyclingDestinationForm from './CommonRecyclingDestinationForm'
export default {
name: 'CommonRecyclingDestinationModal',
components: {
CommonRecyclingDestinationForm
},
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
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue/modules/CommonRecyclingDestinationModal.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-recycling-destination-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-recycling-destination-form>
</j-modal>
</template>
<script>
import CommonRecyclingDestinationForm from './CommonRecyclingDestinationForm'
export default {
name: 'CommonRecyclingDestinationModal',
components: {
CommonRecyclingDestinationForm
},
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>

+ 61
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/CommonRecyclingDestination.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/CommonRecyclingDestination/commonRecyclingDestination/list',
save='/CommonRecyclingDestination/commonRecyclingDestination/add',
edit='/CommonRecyclingDestination/commonRecyclingDestination/edit',
deleteOne = '/CommonRecyclingDestination/commonRecyclingDestination/delete',
deleteBatch = '/CommonRecyclingDestination/commonRecyclingDestination/deleteBatch',
importExcel = '/CommonRecyclingDestination/commonRecyclingDestination/importExcel',
exportXls = '/CommonRecyclingDestination/commonRecyclingDestination/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 57
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/CommonRecyclingDestination.data.ts View File

@ -0,0 +1,57 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '图片',
align:"center",
dataIndex: 'icon'
},
{
title: '标题',
align:"center",
dataIndex: 'title',
customRender:render.renderAvatar,
},
{
title: '描述',
align:"center",
dataIndex: 'description'
},
{
title: '内容',
align:"center",
dataIndex: 'content',
slots: { customRender: 'htmlSlot' },
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '图片',
field: 'icon',
component: 'Input',
},
{
label: '标题',
field: 'title',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '描述',
field: 'description',
component: 'Input',
},
{
label: '内容',
field: 'content',
component: 'JCodeEditor', //TODO String后缀暂未添加
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/CommonRecyclingDestinationList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<CommonRecyclingDestinationModal @register="registerModal" @success="handleSuccess"></CommonRecyclingDestinationModal>
</div>
</template>
<script lang="ts" name="CommonRecyclingDestination-commonRecyclingDestination" 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 CommonRecyclingDestinationModal from './components/CommonRecyclingDestinationModal.vue'
import {columns, searchFormSchema} from './commonRecyclingDestination.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonRecyclingDestination.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '回收去向',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"回收去向",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
module-common/src/main/java/org/jeecg/modules/CommonRecyclingDestination/vue3/components/CommonRecyclingDestinationModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../commonRecyclingDestination.data';
import {saveOrUpdate} from '../commonRecyclingDestination.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
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});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 10
- 0
module-common/src/main/java/org/jeecg/modules/commonAddress/service/ICommonAddressService.java View File

@ -2,6 +2,8 @@ package org.jeecg.modules.commonAddress.service;
import org.jeecg.modules.commonAddress.entity.CommonAddress;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.commonCity.entity.CommonCity;
import java.util.List;
/**
* @Description: 地址信息表
@ -11,4 +13,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ICommonAddressService extends IService<CommonAddress> {
/**
* 检查地址是否在开放城市列表中
* @param address 地址字符串
* @param openCityList 开放城市树形结构列表
* @return true表示在开放城市中false表示不在
*/
boolean isAddressInOpenCities(String address, List<CommonCity> openCityList);
}

+ 120
- 1
module-common/src/main/java/org/jeecg/modules/commonAddress/service/impl/CommonAddressServiceImpl.java View File

@ -3,9 +3,11 @@ package org.jeecg.modules.commonAddress.service.impl;
import org.jeecg.modules.commonAddress.entity.CommonAddress;
import org.jeecg.modules.commonAddress.mapper.CommonAddressMapper;
import org.jeecg.modules.commonAddress.service.ICommonAddressService;
import org.jeecg.modules.commonCity.entity.CommonCity;
import org.springframework.stereotype.Service;
import org.apache.commons.lang.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 地址信息表
@ -16,4 +18,121 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class CommonAddressServiceImpl extends ServiceImpl<CommonAddressMapper, CommonAddress> implements ICommonAddressService {
/**
* 检查地址是否在开放城市列表中
* @param address 地址字符串
* @param openCityList 开放城市树形结构列表
* @return true表示在开放城市中false表示不在
*/
@Override
public boolean isAddressInOpenCities(String address, List<CommonCity> openCityList) {
// 参数校验
if (StringUtils.isBlank(address) || openCityList == null || openCityList.isEmpty()) {
return false;
}
// 从地址中提取省市区信息
String[] addressInfo = extractProvinceAndCityAndDistrict(address);
if (addressInfo == null || addressInfo.length < 3 ||
StringUtils.isBlank(addressInfo[0]) || StringUtils.isBlank(addressInfo[1]) || StringUtils.isBlank(addressInfo[2])) {
return false;
}
String province = addressInfo[0];
String city = addressInfo[1];
String district = addressInfo[2];
// 在开放城市列表中查找匹配的省市区
return findMatchingCityInOpenList(province, city, district, openCityList);
}
/**
* 从地址字符串中提取省市区信息
* @param address 地址字符串
* @return 返回长度为3的数组[省份, 城市, 区县]如果提取失败返回null
*/
private String[] extractProvinceAndCityAndDistrict(String address) {
if (StringUtils.isBlank(address)) {
return null;
}
String province = "";
String city = "";
String district = "";
// 匹配省份
java.util.regex.Pattern provincePattern = java.util.regex.Pattern.compile("^(.*?省|.*?自治区|北京市|天津市|上海市|重庆市)");
java.util.regex.Matcher provinceMatcher = provincePattern.matcher(address);
if (provinceMatcher.find()) {
province = provinceMatcher.group(1);
// 匹配城市
java.util.regex.Pattern cityPattern = java.util.regex.Pattern.compile(province + "(.*?市|.*?地区|.*?盟|.*?自治州)");
java.util.regex.Matcher cityMatcher = cityPattern.matcher(address);
if (cityMatcher.find()) {
city = cityMatcher.group(1);
// 匹配区县
java.util.regex.Pattern districtPattern = java.util.regex.Pattern.compile(province + city + "(.*?区|.*?县|.*?市|.*?旗)");
java.util.regex.Matcher districtMatcher = districtPattern.matcher(address);
if (districtMatcher.find()) {
district = districtMatcher.group(1);
}
}
}
// 检查是否成功提取了三级结构
if (StringUtils.isNotBlank(province) && StringUtils.isNotBlank(city) && StringUtils.isNotBlank(district)) {
return new String[]{province, city, district};
}
return null;
}
/**
* 在开放城市列表中查找匹配的省市区
* @param province 省份名称
* @param city 城市名称
* @param district 区县名称
* @param openCityList 开放城市列表
* @return true表示找到匹配false表示未找到
*/
private boolean findMatchingCityInOpenList(String province, String city, String district,
List<CommonCity> openCityList) {
// 遍历省级节点
for (CommonCity provinceNode : openCityList) {
// 检查省份是否匹配且必须有子节点
if (StringUtils.isNotBlank(provinceNode.getName()) &&
provinceNode.getName().equals(province) &&
"1".equals(provinceNode.getHasChild()) &&
"Y".equals(provinceNode.getOpen()) &&
provinceNode.getChildren() != null && !provinceNode.getChildren().isEmpty()) {
// 遍历市级节点
for (CommonCity cityNode : provinceNode.getChildren()) {
// 检查城市是否匹配且必须有子节点
if (StringUtils.isNotBlank(cityNode.getName()) &&
cityNode.getName().equals(city) &&
"1".equals(cityNode.getHasChild()) &&
"Y".equals(cityNode.getOpen()) &&
cityNode.getChildren() != null && !cityNode.getChildren().isEmpty()) {
// 遍历区县级节点
for (CommonCity districtNode : cityNode.getChildren()) {
// 检查区县是否匹配且开通
if (StringUtils.isNotBlank(districtNode.getName()) &&
districtNode.getName().equals(district) &&
"Y".equals(districtNode.getOpen())) {
return true;
}
}
}
}
}
}
return false;
}
}

+ 3
- 0
module-common/src/main/java/org/jeecg/modules/commonCity/service/ICommonCityService.java View File

@ -35,4 +35,7 @@ public interface ICommonCityService extends IService<CommonCity> {
/**查询所有数据,无分页*/
List<CommonCity> queryTreeListNoPage(QueryWrapper<CommonCity> queryWrapper);
/**构建开通包邮城市的完整树形结构*/
List<CommonCity> buildOpenCityTree();
}

+ 34
- 0
module-common/src/main/java/org/jeecg/modules/commonCity/service/impl/CommonCityServiceImpl.java View File

@ -188,4 +188,38 @@ public class CommonCityServiceImpl extends ServiceImpl<CommonCityMapper, CommonC
return sb;
}
/**
* 构建开通包邮城市的完整树形结构
* @return 包含完整三级结构的开放城市列表
*/
@Override
public List<CommonCity> buildOpenCityTree() {
// 获取省级开通城市列表
List<CommonCity> openCityList = this.lambdaQuery()
.eq(CommonCity::getPid, "0")
.eq(CommonCity::getOpen, "Y")
.list();
// 构建完整的树形结构
for (CommonCity provinceCity : openCityList) {
// 加载市级子节点
List<CommonCity> cityChildren = this.lambdaQuery()
.eq(CommonCity::getPid, provinceCity.getId())
.eq(CommonCity::getOpen, "Y")
.list();
// 为每个市级城市加载区县级数据
for (CommonCity cityNode : cityChildren) {
List<CommonCity> districtChildren = this.lambdaQuery()
.eq(CommonCity::getPid, cityNode.getId())
.eq(CommonCity::getOpen, "Y")
.list();
cityNode.setChildren(districtChildren);
}
provinceCity.setChildren(cityChildren);
}
return openCityList;
}
}

+ 171
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/controller/CommonDistributionRatioController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.commonDistributionRatio.controller;
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.commonDistributionRatio.entity.CommonDistributionRatio;
import org.jeecg.modules.commonDistributionRatio.service.ICommonDistributionRatioService;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 分销比例
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
@Api(tags="分销比例")
@RestController
@RequestMapping("/commonDistributionRatio/commonDistributionRatio")
@Slf4j
public class CommonDistributionRatioController extends JeecgController<CommonDistributionRatio, ICommonDistributionRatioService> {
@Autowired
private ICommonDistributionRatioService commonDistributionRatioService;
/**
* 分页列表查询
*
* @param commonDistributionRatio
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "分销比例-分页列表查询")
@ApiOperation(value="分销比例-分页列表查询", notes="分销比例-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonDistributionRatio>> queryPageList(CommonDistributionRatio commonDistributionRatio,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonDistributionRatio> queryWrapper = QueryGenerator.initQueryWrapper(commonDistributionRatio, req.getParameterMap());
Page<CommonDistributionRatio> page = new Page<CommonDistributionRatio>(pageNo, pageSize);
IPage<CommonDistributionRatio> pageList = commonDistributionRatioService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonDistributionRatio
* @return
*/
@AutoLog(value = "分销比例-添加")
@ApiOperation(value="分销比例-添加", notes="分销比例-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonDistributionRatio commonDistributionRatio) {
commonDistributionRatioService.save(commonDistributionRatio);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonDistributionRatio
* @return
*/
@AutoLog(value = "分销比例-编辑")
@ApiOperation(value="分销比例-编辑", notes="分销比例-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonDistributionRatio commonDistributionRatio) {
commonDistributionRatioService.updateById(commonDistributionRatio);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "分销比例-通过id删除")
@ApiOperation(value="分销比例-通过id删除", notes="分销比例-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
commonDistributionRatioService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "分销比例-批量删除")
@ApiOperation(value="分销比例-批量删除", notes="分销比例-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.commonDistributionRatioService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "分销比例-通过id查询")
@ApiOperation(value="分销比例-通过id查询", notes="分销比例-通过id查询")
@GetMapping(value = "/queryById")
public Result<CommonDistributionRatio> queryById(@RequestParam(name="id",required=true) String id) {
CommonDistributionRatio commonDistributionRatio = commonDistributionRatioService.getById(id);
if(commonDistributionRatio==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonDistributionRatio);
}
/**
* 导出excel
*
* @param request
* @param commonDistributionRatio
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonDistributionRatio commonDistributionRatio) {
return super.exportXls(request, commonDistributionRatio, CommonDistributionRatio.class, "分销比例");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommonDistributionRatio.class);
}
}

+ 69
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/entity/CommonDistributionRatio.java View File

@ -0,0 +1,69 @@
package org.jeecg.modules.commonDistributionRatio.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;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
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-06-26
* @Version: V1.0
*/
@Data
@TableName("common_distribution_ratio")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_distribution_ratio对象", description="分销比例")
public class CommonDistributionRatio 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.lang.String title;
/**直推百分比*/
@Excel(name = "直推百分比", width = 15)
@ApiModelProperty(value = "直推百分比")
private java.math.BigDecimal direct;
/**间推百分比*/
@Excel(name = "间推百分比", width = 15)
@ApiModelProperty(value = "间推百分比")
private java.math.BigDecimal indirect;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
}

+ 17
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/mapper/CommonDistributionRatioMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.commonDistributionRatio.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.commonDistributionRatio.entity.CommonDistributionRatio;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 分销比例
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
public interface CommonDistributionRatioMapper extends BaseMapper<CommonDistributionRatio> {
}

+ 5
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/mapper/xml/CommonDistributionRatioMapper.xml View File

@ -0,0 +1,5 @@
<?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.commonDistributionRatio.mapper.CommonDistributionRatioMapper">
</mapper>

+ 14
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/service/ICommonDistributionRatioService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.commonDistributionRatio.service;
import org.jeecg.modules.commonDistributionRatio.entity.CommonDistributionRatio;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 分销比例
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
public interface ICommonDistributionRatioService extends IService<CommonDistributionRatio> {
}

+ 19
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/service/impl/CommonDistributionRatioServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.commonDistributionRatio.service.impl;
import org.jeecg.modules.commonDistributionRatio.entity.CommonDistributionRatio;
import org.jeecg.modules.commonDistributionRatio.mapper.CommonDistributionRatioMapper;
import org.jeecg.modules.commonDistributionRatio.service.ICommonDistributionRatioService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 分销比例
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
@Service
public class CommonDistributionRatioServiceImpl extends ServiceImpl<CommonDistributionRatioMapper, CommonDistributionRatio> implements ICommonDistributionRatioService {
}

+ 189
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/CommonDistributionRatioList.vue View File

@ -0,0 +1,189 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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-distribution-ratio-modal ref="modalForm" @ok="modalFormOk"></common-distribution-ratio-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonDistributionRatioModal from './modules/CommonDistributionRatioModal'
export default {
name: 'CommonDistributionRatioList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonDistributionRatioModal
},
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: 'title'
},
{
title:'直推百分比',
align:"center",
dataIndex: 'direct'
},
{
title:'间推百分比',
align:"center",
dataIndex: 'indirect'
},
{
title:'排序',
align:"center",
dataIndex: 'sort'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonDistributionRatio/commonDistributionRatio/list",
delete: "/commonDistributionRatio/commonDistributionRatio/delete",
deleteBatch: "/commonDistributionRatio/commonDistributionRatio/deleteBatch",
exportXlsUrl: "/commonDistributionRatio/commonDistributionRatio/exportXls",
importExcelUrl: "commonDistributionRatio/commonDistributionRatio/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'title',text:'名称',dictCode:''})
fieldList.push({type:'BigDecimal',value:'direct',text:'直推百分比',dictCode:''})
fieldList.push({type:'BigDecimal',value:'indirect',text:'间推百分比',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 133
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/modules/CommonDistributionRatioForm.vue View File

@ -0,0 +1,133 @@
<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="title">
<a-input v-model="model.title" placeholder="请输入名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="直推百分比" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="direct">
<a-input-number v-model="model.direct" placeholder="请输入直推百分比" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="间推百分比" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="indirect">
<a-input-number v-model="model.indirect" placeholder="请输入间推百分比" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
<a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'CommonDistributionRatioForm',
components: {
},
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: {
title: [
{ required: true, message: '请输入名称!'},
],
direct: [
{ required: true, message: '请输入直推百分比!'},
{ pattern: '/^([0-9][0-9]{0,1}|100)$/', message: '不符合校验规则!'},
],
indirect: [
{ required: true, message: '请输入间推百分比!'},
],
sort: [
{ required: true, message: '请输入排序!'},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
],
},
url: {
add: "/commonDistributionRatio/commonDistributionRatio/add",
edit: "/commonDistributionRatio/commonDistributionRatio/edit",
queryById: "/commonDistributionRatio/commonDistributionRatio/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
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;
})
}
})
},
}
}
</script>

+ 84
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/modules/CommonDistributionRatioModal.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-distribution-ratio-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-distribution-ratio-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 CommonDistributionRatioForm from './CommonDistributionRatioForm'
export default {
name: 'CommonDistributionRatioModal',
components: {
CommonDistributionRatioForm
},
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
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue/modules/CommonDistributionRatioModal.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-distribution-ratio-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-distribution-ratio-form>
</j-modal>
</template>
<script>
import CommonDistributionRatioForm from './CommonDistributionRatioForm'
export default {
name: 'CommonDistributionRatioModal',
components: {
CommonDistributionRatioForm
},
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>

+ 61
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/CommonDistributionRatio.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/commonDistributionRatio/commonDistributionRatio/list',
save='/commonDistributionRatio/commonDistributionRatio/add',
edit='/commonDistributionRatio/commonDistributionRatio/edit',
deleteOne = '/commonDistributionRatio/commonDistributionRatio/delete',
deleteBatch = '/commonDistributionRatio/commonDistributionRatio/deleteBatch',
importExcel = '/commonDistributionRatio/commonDistributionRatio/importExcel',
exportXls = '/commonDistributionRatio/commonDistributionRatio/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 75
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/CommonDistributionRatio.data.ts View File

@ -0,0 +1,75 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '名称',
align:"center",
dataIndex: 'title'
},
{
title: '直推百分比',
align:"center",
dataIndex: 'direct'
},
{
title: '间推百分比',
align:"center",
dataIndex: 'indirect'
},
{
title: '排序',
align:"center",
dataIndex: 'sort'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '名称',
field: 'title',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入名称!'},
];
},
},
{
label: '直推百分比',
field: 'direct',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入直推百分比!'},
{ pattern: '/^([0-9][0-9]{0,1}|100)$/', message: '不符合校验规则!'},
];
},
},
{
label: '间推百分比',
field: 'indirect',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入间推百分比!'},
];
},
},
{
label: '排序',
field: 'sort',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入排序!'},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
];
},
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/CommonDistributionRatioList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<CommonDistributionRatioModal @register="registerModal" @success="handleSuccess"></CommonDistributionRatioModal>
</div>
</template>
<script lang="ts" name="commonDistributionRatio-commonDistributionRatio" 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 CommonDistributionRatioModal from './components/CommonDistributionRatioModal.vue'
import {columns, searchFormSchema} from './commonDistributionRatio.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonDistributionRatio.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '分销比例',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"分销比例",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
module-common/src/main/java/org/jeecg/modules/commonDistributionRatio/vue3/components/CommonDistributionRatioModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../commonDistributionRatio.data';
import {saveOrUpdate} from '../commonDistributionRatio.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
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});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 35
- 4
module-common/src/main/java/org/jeecg/modules/commonOrder/entity/CommonOrder.java View File

@ -49,11 +49,23 @@ public class CommonOrder implements Serializable {
@Excel(name = "订单状态", width = 15, dicCode = "order_type")
@Dict(dicCode = "order_type")
@ApiModelProperty(value = "订单状态")
/*
待取件 0
已取件 1
已完成 2
已取消 3
*/
private java.lang.Integer state;
/**流程状态*/
@Excel(name = "流程状态", width = 15, dicCode = "order_state")
@Dict(dicCode = "order_state")
@ApiModelProperty(value = "流程状态")
/*
在线预约 0
快递上门 1
透明质检 2
现金打款 3
*/
private java.lang.Integer status;
/**下单用户*/
@Excel(name = "下单用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@ -64,6 +76,10 @@ public class CommonOrder implements Serializable {
@Excel(name = "订单图片", width = 15)
@ApiModelProperty(value = "订单图片")
private java.lang.String image;
/**商品分类*/
@Excel(name = "商品分类", width = 15)
@ApiModelProperty(value = "商品分类")
private java.lang.String shopClass;
/**订单标题*/
@Excel(name = "订单标题", width = 15)
@ApiModelProperty(value = "订单标题")
@ -160,7 +176,7 @@ public class CommonOrder implements Serializable {
private java.util.Date testingTime;
/**检测报告*/
@Excel(name = "检测报告", width = 15)
@ApiModelProperty(value = "检测报告")
@ApiModelProperty(value = "检测图片")
private java.lang.String testingImages;
/**是否包邮*/
@Excel(name = "是否包邮", width = 15)
@ -176,10 +192,25 @@ public class CommonOrder implements Serializable {
@ApiModelProperty(value = "品牌标识")
private java.lang.String pinId;
@Excel(name = "快递员电话", width = 15)
@ApiModelProperty(value = "快递员电话")
private String deliveryPhone;
// @Excel(name = "快递员电话", width = 15)
// @ApiModelProperty(value = "快递员电话")
// private String deliveryPhone;
@Excel(name = "合格数量", width = 15)
@ApiModelProperty(value = "合格数量")
private Integer qualifiedNum;
@Excel(name = "不合格数量", width = 15)
@ApiModelProperty(value = "不合格数量")
private Integer noQualifiedNum;
@Excel(name = "不可回收数量", width = 15)
@ApiModelProperty(value = "不可回收数量")
private Integer unrecyclable;
@Excel(name = "不可回收数量", width = 15)
@ApiModelProperty(value = "不可回收数量")
private String estimatedPrice;//预估价格
@TableField (exist=false)
private List<CommonOrder> commonOrderList;


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

@ -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,33 +78,33 @@ 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.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, 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, 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_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, dicCode = "book_my_status")
// @Dict(dicCode = "book_my_status")
// @ApiModelProperty(value = "作品状态")
// private java.lang.Integer bookStatus;
/**价格*/
@Excel(name = "价格", width = 15)
@ApiModelProperty(value = "价格")
@ -113,8 +113,13 @@ public class CommonShop implements Serializable {
@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.lang.String isPin;
/**最高价格*/
@Excel(name = "最高价格", width = 15)
@ApiModelProperty(value = "最高价格")
private java.math.BigDecimal maxPrice;
}

+ 171
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/controller/CommonReasonsController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.common_reasons.controller;
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.common_reasons.entity.CommonReasons;
import org.jeecg.modules.common_reasons.service.ICommonReasonsService;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 检验理由
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
@Api(tags="检验理由")
@RestController
@RequestMapping("/common_reasons/commonReasons")
@Slf4j
public class CommonReasonsController extends JeecgController<CommonReasons, ICommonReasonsService> {
@Autowired
private ICommonReasonsService commonReasonsService;
/**
* 分页列表查询
*
* @param commonReasons
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "检验理由-分页列表查询")
@ApiOperation(value="检验理由-分页列表查询", notes="检验理由-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonReasons>> queryPageList(CommonReasons commonReasons,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonReasons> queryWrapper = QueryGenerator.initQueryWrapper(commonReasons, req.getParameterMap());
Page<CommonReasons> page = new Page<CommonReasons>(pageNo, pageSize);
IPage<CommonReasons> pageList = commonReasonsService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonReasons
* @return
*/
@AutoLog(value = "检验理由-添加")
@ApiOperation(value="检验理由-添加", notes="检验理由-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonReasons commonReasons) {
commonReasonsService.save(commonReasons);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonReasons
* @return
*/
@AutoLog(value = "检验理由-编辑")
@ApiOperation(value="检验理由-编辑", notes="检验理由-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonReasons commonReasons) {
commonReasonsService.updateById(commonReasons);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "检验理由-通过id删除")
@ApiOperation(value="检验理由-通过id删除", notes="检验理由-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
commonReasonsService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "检验理由-批量删除")
@ApiOperation(value="检验理由-批量删除", notes="检验理由-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.commonReasonsService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "检验理由-通过id查询")
@ApiOperation(value="检验理由-通过id查询", notes="检验理由-通过id查询")
@GetMapping(value = "/queryById")
public Result<CommonReasons> queryById(@RequestParam(name="id",required=true) String id) {
CommonReasons commonReasons = commonReasonsService.getById(id);
if(commonReasons==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonReasons);
}
/**
* 导出excel
*
* @param request
* @param commonReasons
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonReasons commonReasons) {
return super.exportXls(request, commonReasons, CommonReasons.class, "检验理由");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommonReasons.class);
}
}

+ 67
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/entity/CommonReasons.java View File

@ -0,0 +1,67 @@
package org.jeecg.modules.common_reasons.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;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
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-06-26
* @Version: V1.0
*/
@Data
@TableName("common_reasons")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_reasons对象", description="检验理由")
public class CommonReasons 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.lang.String reason;
/**类型*/
@Excel(name = "类型", width = 15, dicCode = "test_status")
@Dict(dicCode = "test_status")
@ApiModelProperty(value = "类型")
private java.lang.String type;
/**所属分类*/
@Excel(name = "所属分类", width = 15, dictTable = "common_shop_class", dicText = "title", dicCode = "id")
@Dict(dictTable = "common_shop_class", dicText = "title", dicCode = "id")
@ApiModelProperty(value = "所属分类")
private java.lang.String classId;
}

+ 17
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/mapper/CommonReasonsMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.common_reasons.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.common_reasons.entity.CommonReasons;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 检验理由
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
public interface CommonReasonsMapper extends BaseMapper<CommonReasons> {
}

+ 5
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/mapper/xml/CommonReasonsMapper.xml View File

@ -0,0 +1,5 @@
<?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.common_reasons.mapper.CommonReasonsMapper">
</mapper>

+ 14
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/service/ICommonReasonsService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.common_reasons.service;
import org.jeecg.modules.common_reasons.entity.CommonReasons;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 检验理由
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
public interface ICommonReasonsService extends IService<CommonReasons> {
}

+ 19
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/service/impl/CommonReasonsServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.common_reasons.service.impl;
import org.jeecg.modules.common_reasons.entity.CommonReasons;
import org.jeecg.modules.common_reasons.mapper.CommonReasonsMapper;
import org.jeecg.modules.common_reasons.service.ICommonReasonsService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 检验理由
* @Author: jeecg-boot
* @Date: 2025-06-26
* @Version: V1.0
*/
@Service
public class CommonReasonsServiceImpl extends ServiceImpl<CommonReasonsMapper, CommonReasons> implements ICommonReasonsService {
}

+ 204
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/vue/CommonReasonsList.vue View File

@ -0,0 +1,204 @@
<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-dict-select-tag placeholder="请选择类型" v-model="queryParam.type" dictCode="test_status"/>
</a-form-item>
</a-col>
<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.classId"/>
</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-reasons-modal ref="modalForm" @ok="modalFormOk"></common-reasons-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonReasonsModal from './modules/CommonReasonsModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'CommonReasonsList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonReasonsModal
},
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: 'reason'
},
{
title:'类型',
align:"center",
dataIndex: 'type_dictText'
},
{
title:'所属分类',
align:"center",
dataIndex: 'classId_dictText'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/common_reasons/commonReasons/list",
delete: "/common_reasons/commonReasons/delete",
deleteBatch: "/common_reasons/commonReasons/deleteBatch",
exportXlsUrl: "/common_reasons/commonReasons/exportXls",
importExcelUrl: "common_reasons/commonReasons/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'reason',text:'理由',dictCode:''})
fieldList.push({type:'string',value:'type',text:'类型',dictCode:'test_status'})
fieldList.push({type:'list_multi',value:'classId',text:'所属分类',dictTable:"common_shop_class", dictText:'title', dictCode:'id'})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 114
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/vue/modules/CommonReasonsForm.vue View File

@ -0,0 +1,114 @@
<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="reason">
<a-input v-model="model.reason" placeholder="请输入理由" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<j-dict-select-tag type="list" v-model="model.type" dictCode="test_status" placeholder="请选择类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="所属分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="classId">
<j-multi-select-tag type="list_multi" v-model="model.classId" dictCode="common_shop_class,title,id" placeholder="请选择所属分类" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'CommonReasonsForm',
components: {
},
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: "/common_reasons/commonReasons/add",
edit: "/common_reasons/commonReasons/edit",
queryById: "/common_reasons/commonReasons/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
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;
})
}
})
},
}
}
</script>

+ 84
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/vue/modules/CommonReasonsModal.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-reasons-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-reasons-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 CommonReasonsForm from './CommonReasonsForm'
export default {
name: 'CommonReasonsModal',
components: {
CommonReasonsForm
},
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
module-common/src/main/java/org/jeecg/modules/common_reasons/vue/modules/CommonReasonsModal.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-reasons-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-reasons-form>
</j-modal>
</template>
<script>
import CommonReasonsForm from './CommonReasonsForm'
export default {
name: 'CommonReasonsModal',
components: {
CommonReasonsForm
},
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>

+ 61
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/CommonReasons.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/common_reasons/commonReasons/list',
save='/common_reasons/commonReasons/add',
edit='/common_reasons/commonReasons/edit',
deleteOne = '/common_reasons/commonReasons/delete',
deleteBatch = '/common_reasons/commonReasons/deleteBatch',
importExcel = '/common_reasons/commonReasons/importExcel',
exportXls = '/common_reasons/commonReasons/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 67
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/CommonReasons.data.ts View File

@ -0,0 +1,67 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '理由',
align:"center",
dataIndex: 'reason'
},
{
title: '类型',
align:"center",
dataIndex: 'type_dictText'
},
{
title: '所属分类',
align:"center",
dataIndex: 'classId_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "类型",
field: "type",
component: 'JDictSelectTag',
componentProps:{
dictCode:"test_status"
},
colProps: {span: 6},
},
{
label: "所属分类",
field: "classId",
component: 'JMultiSelectTag',//暂无该组件
componentProps:{
dictCode:"query_field_dictCode?default("")"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '理由',
field: 'reason',
component: 'Input',
},
{
label: '类型',
field: 'type',
component: 'JDictSelectTag',
componentProps:{
dictCode:"test_status"
},
},
{
label: '所属分类',
field: 'classId',
component: 'JMultiSelectTag',//TODO 暂无该组件
componentProps:{
dictCode:"common_shop_class,title,id"
},
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/CommonReasonsList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<CommonReasonsModal @register="registerModal" @success="handleSuccess"></CommonReasonsModal>
</div>
</template>
<script lang="ts" name="common_reasons-commonReasons" 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 CommonReasonsModal from './components/CommonReasonsModal.vue'
import {columns, searchFormSchema} from './commonReasons.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonReasons.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '检验理由',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"检验理由",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
module-common/src/main/java/org/jeecg/modules/common_reasons/vue3/components/CommonReasonsModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../commonReasons.data';
import {saveOrUpdate} from '../commonReasons.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
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});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

Loading…
Cancel
Save