Browse Source

1、分类调整-改成二级联动形式

master
Aug 4 months ago
parent
commit
f3aff06eed
33 changed files with 1176 additions and 169 deletions
  1. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/controller/CarrentApplyController.java
  2. +3
    -5
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/entity/CarrentApply.java
  3. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/mapper/CarrentApplyMapper.java
  4. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/ICarrentApplyService.java
  5. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/impl/CarrentApplyServiceImpl.java
  6. +3
    -23
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/CarrentApplyList.vue
  7. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/modules/CarrentApplyForm.vue
  8. +3
    -24
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue3/CarrentApply.data.ts
  9. +171
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/controller/CarrentCategoryController.java
  10. +67
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/entity/CarrentCategory.java
  11. +17
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/CarrentCategoryMapper.java
  12. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/xml/CarrentCategoryMapper.xml
  13. +14
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/ICarrentCategoryService.java
  14. +19
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/impl/CarrentCategoryServiceImpl.java
  15. +178
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/CarrentCategoryList.vue
  16. +109
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryForm.vue
  17. +84
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.Style#Drawer.vue
  18. +60
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.vue
  19. +61
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.api.ts
  20. +36
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.data.ts
  21. +162
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategoryList.vue
  22. +58
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/components/CarrentCategoryModal.vue
  23. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/controller/CarrentGoodsController.java
  24. +3
    -5
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/entity/CarrentGoods.java
  25. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/mapper/CarrentGoodsMapper.java
  26. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/ICarrentGoodsService.java
  27. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/impl/CarrentGoodsServiceImpl.java
  28. +3
    -8
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/CarrentGoodsList.vue
  29. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/modules/CarrentGoodsForm.vue
  30. +3
    -15
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue3/CarrentGoods.data.ts
  31. +16
    -16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/carrentController/ConfigController.java
  32. +59
    -44
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ConfigServiceImpl.java
  33. +30
    -17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/GoodsServiceImpl.java

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/controller/CarrentApplyController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 寻车申请表
* @Author: jeecg-boot
* @Date: 2025-01-12
* @Date: 2025-01-13
* @Version: V1.0
*/
@Api(tags="寻车申请表")


+ 3
- 5
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/entity/CarrentApply.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 寻车申请表
* @Author: jeecg-boot
* @Date: 2025-01-12
* @Date: 2025-01-13
* @Version: V1.0
*/
@Data
@ -72,13 +72,11 @@ public class CarrentApply implements Serializable {
@ApiModelProperty(value = "备注")
private java.lang.String remark;
/**关联一级分类id*/
@Excel(name = "关联一级分类id", width = 15, dictTable = "carrent_categoryone", dicText = "name", dicCode = "id")
@Dict(dictTable = "carrent_categoryone", dicText = "name", dicCode = "id")
@Excel(name = "关联一级分类id", width = 15)
@ApiModelProperty(value = "关联一级分类id")
private java.lang.String categoryoneId;
/**关联二级分类id*/
@Excel(name = "关联二级分类id", width = 15, dictTable = "carrent_categorytwo", dicText = "name", dicCode = "id")
@Dict(dictTable = "carrent_categorytwo", dicText = "name", dicCode = "id")
@Excel(name = "关联二级分类id", width = 15)
@ApiModelProperty(value = "关联二级分类id")
private java.lang.String categorytwoId;
/**关联用户*/


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/mapper/CarrentApplyMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 寻车申请表
* @Author: jeecg-boot
* @Date: 2025-01-12
* @Date: 2025-01-13
* @Version: V1.0
*/
public interface CarrentApplyMapper extends BaseMapper<CarrentApply> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/ICarrentApplyService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 寻车申请表
* @Author: jeecg-boot
* @Date: 2025-01-12
* @Date: 2025-01-13
* @Version: V1.0
*/
public interface ICarrentApplyService extends IService<CarrentApply> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/impl/CarrentApplyServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 寻车申请表
* @Author: jeecg-boot
* @Date: 2025-01-12
* @Date: 2025-01-13
* @Version: V1.0
*/
@Service


+ 3
- 23
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/CarrentApplyList.vue View File

@ -4,26 +4,6 @@
<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="关联一级分类id">
<j-dict-select-tag placeholder="请选择关联一级分类id" v-model="queryParam.categoryoneId" dictCode="carrent_categoryone,name,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="关联二级分类id">
<j-dict-select-tag placeholder="请选择关联二级分类id" v-model="queryParam.categorytwoId" dictCode="carrent_categorytwo,name,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
@ -175,7 +155,7 @@
{
title:'关联一级分类id',
align:"center",
dataIndex: 'categoryoneId_dictText'
dataIndex: 'categoryoneId'
},
{
title:'关联二级分类id',
@ -227,8 +207,8 @@
fieldList.push({type:'string',value:'name',text:'联系人',dictCode:''})
fieldList.push({type:'string',value:'phone',text:'联系电话',dictCode:''})
fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
fieldList.push({type:'string',value:'categoryoneId',text:'关联一级分类id',dictCode:"carrent_categoryone,name,id"})
fieldList.push({type:'string',value:'categorytwoId',text:'关联二级分类id',dictCode:"carrent_categorytwo,name,id"})
fieldList.push({type:'string',value:'categoryoneId',text:'关联一级分类id'})
fieldList.push({type:'string',value:'categorytwoId',text:'关联二级分类id',dictCode:''})
fieldList.push({type:'string',value:'userId',text:'关联用户',dictCode:"han_hai_member,nick_name,id"})
this.superFieldList = fieldList
}


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/modules/CarrentApplyForm.vue View File

@ -35,12 +35,12 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="关联一级分类id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryoneId">
<j-dict-select-tag type="list" v-model="model.categoryoneId" dictCode="carrent_categoryone,name,id" placeholder="请选择关联一级分类id" />
<a-input v-model="model.categoryoneId" placeholder="请输入关联一级分类id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="关联二级分类id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categorytwoId">
<j-dict-select-tag type="list" v-model="model.categorytwoId" dictCode="carrent_categorytwo,name,id" placeholder="请选择关联二级分类id" />
<j-dict-select-tag type="list" v-model="model.categorytwoId" dictCode="" placeholder="请选择关联二级分类id" />
</a-form-model-item>
</a-col>
<a-col :span="24">


+ 3
- 24
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue3/CarrentApply.data.ts View File

@ -37,7 +37,7 @@ export const columns: BasicColumn[] = [
{
title: '关联一级分类id',
align:"center",
dataIndex: 'categoryoneId_dictText'
dataIndex: 'categoryoneId'
},
{
title: '关联二级分类id',
@ -52,24 +52,6 @@ export const columns: BasicColumn[] = [
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "关联一级分类id",
field: "categoryoneId",
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_categoryone,name,id"
},
colProps: {span: 6},
},
{
label: "关联二级分类id",
field: "categorytwoId",
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_categorytwo,name,id"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -106,17 +88,14 @@ export const formSchema: FormSchema[] = [
{
label: '关联一级分类id',
field: 'categoryoneId',
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_categoryone,name,id"
},
component: 'Input',
},
{
label: '关联二级分类id',
field: 'categorytwoId',
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_categorytwo,name,id"
dictCode:""
},
},
{


+ 171
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/controller/CarrentCategoryController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.carrentCategory.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.carrentCategory.entity.CarrentCategory;
import org.jeecg.modules.carrentCategory.service.ICarrentCategoryService;
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-01-13
* @Version: V1.0
*/
@Api(tags="二级联动菜单表")
@RestController
@RequestMapping("/carrentCategory/carrentCategory")
@Slf4j
public class CarrentCategoryController extends JeecgController<CarrentCategory, ICarrentCategoryService> {
@Autowired
private ICarrentCategoryService carrentCategoryService;
/**
* 分页列表查询
*
* @param carrentCategory
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "二级联动菜单表-分页列表查询")
@ApiOperation(value="二级联动菜单表-分页列表查询", notes="二级联动菜单表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CarrentCategory>> queryPageList(CarrentCategory carrentCategory,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CarrentCategory> queryWrapper = QueryGenerator.initQueryWrapper(carrentCategory, req.getParameterMap());
Page<CarrentCategory> page = new Page<CarrentCategory>(pageNo, pageSize);
IPage<CarrentCategory> pageList = carrentCategoryService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param carrentCategory
* @return
*/
@AutoLog(value = "二级联动菜单表-添加")
@ApiOperation(value="二级联动菜单表-添加", notes="二级联动菜单表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CarrentCategory carrentCategory) {
carrentCategoryService.save(carrentCategory);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param carrentCategory
* @return
*/
@AutoLog(value = "二级联动菜单表-编辑")
@ApiOperation(value="二级联动菜单表-编辑", notes="二级联动菜单表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CarrentCategory carrentCategory) {
carrentCategoryService.updateById(carrentCategory);
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) {
carrentCategoryService.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.carrentCategoryService.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<CarrentCategory> queryById(@RequestParam(name="id",required=true) String id) {
CarrentCategory carrentCategory = carrentCategoryService.getById(id);
if(carrentCategory==null) {
return Result.error("未找到对应数据");
}
return Result.OK(carrentCategory);
}
/**
* 导出excel
*
* @param request
* @param carrentCategory
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CarrentCategory carrentCategory) {
return super.exportXls(request, carrentCategory, CarrentCategory.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, CarrentCategory.class);
}
}

+ 67
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/entity/CarrentCategory.java View File

@ -0,0 +1,67 @@
package org.jeecg.modules.carrentCategory.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.carrentCategorytwo.entity.CarrentCategorytwo;
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-01-13
* @Version: V1.0
*/
@Data
@TableName("carrent_category")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="carrent_category对象", description="二级联动菜单表")
public class CarrentCategory 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;
/**pid*/
@Excel(name = "pid", width = 15, dictTable = "carrent_category", dicText = "name", dicCode = "id")
@Dict(dictTable = "carrent_category", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "pid")
private java.lang.String pid;
/**分类名称*/
@Excel(name = "分类名称", width = 15)
@ApiModelProperty(value = "分类名称")
private java.lang.String name;
//二级分类列表
@TableField(exist = false)
private List<CarrentCategory> carrentCategorytwoList;
}

+ 17
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/CarrentCategoryMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.carrentCategory.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.carrentCategory.entity.CarrentCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 二级联动菜单表
* @Author: jeecg-boot
* @Date: 2025-01-13
* @Version: V1.0
*/
public interface CarrentCategoryMapper extends BaseMapper<CarrentCategory> {
}

+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/xml/CarrentCategoryMapper.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.carrentCategory.mapper.CarrentCategoryMapper">
</mapper>

+ 14
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/ICarrentCategoryService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.carrentCategory.service;
import org.jeecg.modules.carrentCategory.entity.CarrentCategory;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 二级联动菜单表
* @Author: jeecg-boot
* @Date: 2025-01-13
* @Version: V1.0
*/
public interface ICarrentCategoryService extends IService<CarrentCategory> {
}

+ 19
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/impl/CarrentCategoryServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.carrentCategory.service.impl;
import org.jeecg.modules.carrentCategory.entity.CarrentCategory;
import org.jeecg.modules.carrentCategory.mapper.CarrentCategoryMapper;
import org.jeecg.modules.carrentCategory.service.ICarrentCategoryService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 二级联动菜单表
* @Author: jeecg-boot
* @Date: 2025-01-13
* @Version: V1.0
*/
@Service
public class CarrentCategoryServiceImpl extends ServiceImpl<CarrentCategoryMapper, CarrentCategory> implements ICarrentCategoryService {
}

+ 178
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/CarrentCategoryList.vue View File

@ -0,0 +1,178 @@
<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>
<carrent-category-modal ref="modalForm" @ok="modalFormOk"></carrent-category-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CarrentCategoryModal from './modules/CarrentCategoryModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'CarrentCategoryList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CarrentCategoryModal
},
data () {
return {
description: '二级联动菜单表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'pid',
align:"center",
dataIndex: 'pid_dictText'
},
{
title:'分类名称',
align:"center",
dataIndex: 'name'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/carrentCategory/carrentCategory/list",
delete: "/carrentCategory/carrentCategory/delete",
deleteBatch: "/carrentCategory/carrentCategory/deleteBatch",
exportXlsUrl: "/carrentCategory/carrentCategory/exportXls",
importExcelUrl: "carrentCategory/carrentCategory/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:'pid',text:'pid',dictCode:"carrent_category,name,id"})
fieldList.push({type:'string',value:'name',text:'分类名称',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 109
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryForm.vue View File

@ -0,0 +1,109 @@
<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="pid" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
<j-dict-select-tag type="list" v-model="model.pid" dictCode="carrent_category,name,id" placeholder="请选择pid" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入分类名称" ></a-input>
</a-form-model-item>
</a-col>
</a-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: 'CarrentCategoryForm',
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: "/carrentCategory/carrentCategory/add",
edit: "/carrentCategory/carrentCategory/edit",
queryById: "/carrentCategory/carrentCategory/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
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.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">
<carrent-category-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></carrent-category-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 CarrentCategoryForm from './CarrentCategoryForm'
export default {
name: 'CarrentCategoryModal',
components: {
CarrentCategoryForm
},
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
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.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="关闭">
<carrent-category-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></carrent-category-form>
</j-modal>
</template>
<script>
import CarrentCategoryForm from './CarrentCategoryForm'
export default {
name: 'CarrentCategoryModal',
components: {
CarrentCategoryForm
},
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
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/carrentCategory/carrentCategory/list',
save='/carrentCategory/carrentCategory/add',
edit='/carrentCategory/carrentCategory/edit',
deleteOne = '/carrentCategory/carrentCategory/delete',
deleteBatch = '/carrentCategory/carrentCategory/deleteBatch',
importExcel = '/carrentCategory/carrentCategory/importExcel',
exportXls = '/carrentCategory/carrentCategory/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});
}

+ 36
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.data.ts View File

@ -0,0 +1,36 @@
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: 'pid',
align:"center",
dataIndex: 'pid_dictText'
},
{
title: '分类名称',
align:"center",
dataIndex: 'name'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: 'pid',
field: 'pid',
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_category,name,id"
},
},
{
label: '分类名称',
field: 'name',
component: 'Input',
},
];

+ 162
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategoryList.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>
<!-- 表单区域 -->
<CarrentCategoryModal @register="registerModal" @success="handleSuccess"></CarrentCategoryModal>
</div>
</template>
<script lang="ts" name="carrentCategory-carrentCategory" 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 CarrentCategoryModal from './components/CarrentCategoryModal.vue'
import {columns, searchFormSchema} from './carrentCategory.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './carrentCategory.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
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/components/CarrentCategoryModal.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 '../carrentCategory.data';
import {saveOrUpdate} from '../carrentCategory.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>

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/controller/CarrentGoodsController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 商品信息表
* @Author: jeecg-boot
* @Date: 2025-01-08
* @Date: 2025-01-13
* @Version: V1.0
*/
@Api(tags="商品信息表")


+ 3
- 5
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/entity/CarrentGoods.java View File

@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 商品信息表
* @Author: jeecg-boot
* @Date: 2025-01-08
* @Date: 2025-01-13
* @Version: V1.0
*/
@Data
@ -126,13 +126,11 @@ public class CarrentGoods implements Serializable {
@ApiModelProperty(value = "审核状态")
private java.lang.String status;
/**关联一级分类id*/
@Excel(name = "关联一级分类id", width = 15, dictTable = "carrent_categoryone", dicText = "name", dicCode = "id")
@Dict(dictTable = "carrent_categoryone", dicText = "name", dicCode = "id")
@Excel(name = "关联一级分类id", width = 15)
@ApiModelProperty(value = "关联一级分类id")
private java.lang.String cartypeId;
/**关联二级分类id*/
@Excel(name = "关联二级分类id", width = 15, dictTable = "carrent_categorytwo", dicText = "name", dicCode = "id")
@Dict(dictTable = "carrent_categorytwo", dicText = "name", dicCode = "id")
@Excel(name = "关联二级分类id", width = 15)
@ApiModelProperty(value = "关联二级分类id")
private java.lang.String categorytwoId;
/**关联用户id*/


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/mapper/CarrentGoodsMapper.java View File

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


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/ICarrentGoodsService.java View File

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


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/impl/CarrentGoodsServiceImpl.java View File

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


+ 3
- 8
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/CarrentGoodsList.vue View File

@ -9,11 +9,6 @@
<j-dict-select-tag placeholder="请选择审核状态" v-model="queryParam.status" dictCode="authentic_status"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="关联一级分类id">
<j-dict-select-tag placeholder="请选择关联一级分类id" v-model="queryParam.cartypeId" dictCode="carrent_categoryone,name,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@ -246,7 +241,7 @@
{
title:'关联一级分类id',
align:"center",
dataIndex: 'cartypeId_dictText'
dataIndex: 'cartypeId'
},
{
title:'关联二级分类id',
@ -316,8 +311,8 @@
fieldList.push({type:'string',value:'phone',text:'联系人电话',dictCode:''})
fieldList.push({type:'string',value:'area',text:'所在区域',dictCode:''})
fieldList.push({type:'string',value:'status',text:'审核状态',dictCode:'authentic_status'})
fieldList.push({type:'string',value:'cartypeId',text:'关联一级分类id',dictCode:"carrent_categoryone,name,id"})
fieldList.push({type:'string',value:'categorytwoId',text:'关联二级分类id',dictCode:"carrent_categorytwo,name,id"})
fieldList.push({type:'string',value:'cartypeId',text:'关联一级分类id'})
fieldList.push({type:'string',value:'categorytwoId',text:'关联二级分类id',dictCode:''})
fieldList.push({type:'string',value:'userId',text:'关联用户id',dictCode:"han_hai_member,nick_name,id"})
fieldList.push({type:'string',value:'remark',text:'审核备注',dictCode:''})
this.superFieldList = fieldList


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/modules/CarrentGoodsForm.vue View File

@ -100,12 +100,12 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="关联一级分类id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cartypeId">
<j-dict-select-tag type="list" v-model="model.cartypeId" dictCode="carrent_categoryone,name,id" placeholder="请选择关联一级分类id" />
<a-input v-model="model.cartypeId" placeholder="请输入关联一级分类id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="关联二级分类id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categorytwoId">
<j-dict-select-tag type="list" v-model="model.categorytwoId" dictCode="carrent_categorytwo,name,id" placeholder="请选择关联二级分类id" />
<j-dict-select-tag type="list" v-model="model.categorytwoId" dictCode="" placeholder="请选择关联二级分类id" />
</a-form-model-item>
</a-col>
<a-col :span="24">


+ 3
- 15
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue3/CarrentGoods.data.ts View File

@ -108,7 +108,7 @@ export const columns: BasicColumn[] = [
{
title: '关联一级分类id',
align:"center",
dataIndex: 'cartypeId_dictText'
dataIndex: 'cartypeId'
},
{
title: '关联二级分类id',
@ -137,15 +137,6 @@ export const searchFormSchema: FormSchema[] = [
},
colProps: {span: 6},
},
{
label: "关联一级分类id",
field: "cartypeId",
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_categoryone,name,id"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -262,17 +253,14 @@ export const formSchema: FormSchema[] = [
{
label: '关联一级分类id',
field: 'cartypeId',
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_categoryone,name,id"
},
component: 'Input',
},
{
label: '关联二级分类id',
field: 'categorytwoId',
component: 'JDictSelectTag',
componentProps:{
dictCode:"carrent_categorytwo,name,id"
dictCode:""
},
},
{


+ 16
- 16
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/carrentController/ConfigController.java View File

@ -28,11 +28,11 @@ public class ConfigController {
return configService.queryModuleList(pageBean);
}
@ApiOperation(value="配置信息-获取商品类型列表", notes="配置信息-获取商品类型列表")
@RequestMapping(value = "/queryTypeList", method = {RequestMethod.GET})
public Result<?> queryTypeList(PageBean pageBean){
return configService.queryTypeList(pageBean);
}
// @ApiOperation(value="配置信息-获取商品类型列表", notes="配置信息-获取商品类型列表")
// @RequestMapping(value = "/queryTypeList", method = {RequestMethod.GET})
// public Result<?> queryTypeList(PageBean pageBean){
// return configService.queryTypeList(pageBean);
// }
@ApiOperation(value="配置信息-获取商品分类列表", notes="配置信息-获取商品分类列表")
@RequestMapping(value = "/queryCategoryList", method = {RequestMethod.GET})
@ -40,17 +40,17 @@ public class ConfigController {
return configService.queryCatogoryList(categoryOneId);
}
@ApiOperation(value="配置信息-获取商品一级分类列表", notes="配置信息-获取商品一级分类列表")
@RequestMapping(value = "/queryCategoryOneList", method = {RequestMethod.GET})
public Result<?> queryCategoryOneList(PageBean pageBean){
return configService.queryCatogoryOneList(pageBean);
}
@ApiOperation(value="配置信息-获取商品二级分类列表", notes="配置信息-获取商品二级分类列表")
@RequestMapping(value = "/queryCategoryTwoList", method = {RequestMethod.GET})
public Result<?> queryCategoryTwoList(PageBean pageBean){
return configService.queryCatogoryTwoList(pageBean);
}
// @ApiOperation(value="配置信息-获取商品一级分类列表", notes="配置信息-获取商品一级分类列表")
// @RequestMapping(value = "/queryCategoryOneList", method = {RequestMethod.GET})
// public Result<?> queryCategoryOneList(PageBean pageBean){
// return configService.queryCatogoryOneList(pageBean);
// }
//
// @ApiOperation(value="配置信息-获取商品二级分类列表", notes="配置信息-获取商品二级分类列表")
// @RequestMapping(value = "/queryCategoryTwoList", method = {RequestMethod.GET})
// public Result<?> queryCategoryTwoList(PageBean pageBean){
// return configService.queryCatogoryTwoList(pageBean);
// }
@ApiOperation(value="配置信息-获取公里数列表", notes="配置信息-获取公里数列表")
@RequestMapping(value = "/queryMileageList", method = {RequestMethod.GET})


+ 59
- 44
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ConfigServiceImpl.java View File

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.PageBean;
import org.jeecg.modules.apiService.ConfigService;
import org.jeecg.modules.carrentCategory.entity.CarrentCategory;
import org.jeecg.modules.carrentCategory.service.ICarrentCategoryService;
import org.jeecg.modules.carrentCategoryone.entity.CarrentCategoryone;
import org.jeecg.modules.carrentCategoryone.service.ICarrentCategoryoneService;
import org.jeecg.modules.carrentCategorytwo.entity.CarrentCategorytwo;
@ -40,6 +42,10 @@ public class ConfigServiceImpl implements ConfigService {
@Resource
private ICarrentTypeService carrentTypeService;
//商品分类
@Resource
private ICarrentCategoryService carrentCategoryService;
//商品一级分类
@Resource
private ICarrentCategoryoneService carrentCategoryoneService;
@ -48,7 +54,7 @@ public class ConfigServiceImpl implements ConfigService {
@Resource
private ICarrentCategorytwoService carrentCategorytwoService;
//商品二级分类
//配置信息
@Resource
private ICarrentConfigService carrentConfigService;
/*************************************************************************************/
@ -126,24 +132,13 @@ public class ConfigServiceImpl implements ConfigService {
try{
//一级分类列表
List<CarrentCategoryone> carrentCategoryoneList = getCatogoryOneList(categoryOneId);
List<CarrentCategory> carrentCategoryoneList = getCatogoryoneList(categoryOneId);
//二级分类列表
List<CarrentCategorytwo> carrentCategorytwoList = getCatogoryTwoList();
//将二级分类放至对应一级分类下
for (CarrentCategoryone carrentCategoryone : carrentCategoryoneList) {
//二级分类列表
List<CarrentCategorytwo> carrentCategorytwos = new ArrayList<>();
for (CarrentCategorytwo carrentCategorytwo : carrentCategorytwoList) {
//判断二级分类是否属于当前一级分类
if(carrentCategoryone.getId().equals(carrentCategorytwo.getCategoryoneId())){
carrentCategorytwos.add(carrentCategorytwo);
}
}
//将二级分类列表放至对应一级分类对象中
carrentCategoryone.setCarrentCategorytwoList(carrentCategorytwos);
message = "商品分类列表信息";
for (CarrentCategory category : carrentCategoryoneList) {
List<CarrentCategory> carrentCategorytwoList = getCatogoryTwoList(category.getId());
category.setCarrentCategorytwoList(carrentCategorytwoList);
}
message = "商品分类列表信息";
return Result.OK(message, carrentCategoryoneList);
@ -160,14 +155,21 @@ public class ConfigServiceImpl implements ConfigService {
//返回信息
String message = "商品一级分类列表查询失败!";
//商品一级分类列表
Page<CarrentCategoryone> pageList = null;
Page<CarrentCategory> pageList = null;
try{
//顶级分类
CarrentCategory category = carrentCategoryService
.lambdaQuery()
.isNull(CarrentCategory::getPid)
.one();
//分页
Page<CarrentCategoryone> page = new Page<CarrentCategoryone>(pageBean.getPageNo(), pageBean.getPageSize());
Page<CarrentCategory> page = new Page<CarrentCategory>(pageBean.getPageNo(), pageBean.getPageSize());
//获取商品一级分类列表
pageList = carrentCategoryoneService
pageList = carrentCategoryService
.lambdaQuery()
.eq(CarrentCategory::getPid, category.getId())
.page(page);
//判断执行结果
@ -193,14 +195,27 @@ public class ConfigServiceImpl implements ConfigService {
//返回信息
String message = "商品二级分类列表查询失败!";
//商品一级分类列表
Page<CarrentCategorytwo> pageList = null;
Page<CarrentCategory> pageList = null;
try{
//顶级分类
CarrentCategory category = carrentCategoryService
.lambdaQuery()
.isNull(CarrentCategory::getPid)
.one();
//一级分类列表
List<CarrentCategory> carrentCategoryoneList = getCatogoryoneList(null);
List<String> ids = new ArrayList<>();
for (CarrentCategory carrentCategory : carrentCategoryoneList) {
ids.add(carrentCategory.getId());
}
//分页
Page<CarrentCategorytwo> page = new Page<CarrentCategorytwo>(pageBean.getPageNo(), pageBean.getPageSize());
//获取商品二级分类列表
pageList = carrentCategorytwoService
Page<CarrentCategory> page = new Page<CarrentCategory>(pageBean.getPageNo(), pageBean.getPageSize());
//获取二级分类列表
pageList = carrentCategoryService
.lambdaQuery()
.in(CarrentCategory::getPid, ids)
.page(page);
//判断执行结果
@ -210,6 +225,7 @@ public class ConfigServiceImpl implements ConfigService {
message = "商品二级分类列表为空";
}
//返回执行结果
return Result.OK(message, pageList);
}catch (Exception e){
@ -220,7 +236,7 @@ public class ConfigServiceImpl implements ConfigService {
}
//配置信息-获取商品二级分类列表
//配置信息-获取公里数列表
@Override
public Result<?> queryMileageList() {
//返回信息
@ -270,31 +286,29 @@ public class ConfigServiceImpl implements ConfigService {
}
/*****************************************************************************************************************/
//获取一级分类列表信息
public List<CarrentCategoryone> getCatogoryOneList(String categoryOneId) {
//获取分类信息列表
public List<CarrentCategory> getCatogoryoneList(String categoryOneId) {
//返回信息
String message = "商品一级分类列表查询失败!";
String message = "商品分类信息列表查询失败!";
try{
//组装查询内容
LambdaQueryChainWrapper<CarrentCategoryone> query = carrentCategoryoneService
LambdaQueryChainWrapper<CarrentCategory> query = carrentCategoryService
.lambdaQuery();
//组装查询条件
if(null != categoryOneId){
//车辆类型
query.eq(CarrentCategoryone::getId, categoryOneId);
}
//获取商品类型列表
List<CarrentCategoryone> pageList = query.list();
//判断执行结果
if(null != pageList){
message = "商品一级分类列表信息";
query.eq(CarrentCategory::getId, categoryOneId);
}else {
message = "商品一级分类列表为空";
//如果一级分类id为空则查询所有一级分类
CarrentCategory category = carrentCategoryService
.lambdaQuery()
.isNull(CarrentCategory::getPid)
.one();
query.eq(CarrentCategory::getPid, category.getId());
}
//获取分类列表
List<CarrentCategory> pageList = query.list();
//返回执行结果
return pageList;
}catch (Exception e){
@ -306,14 +320,15 @@ public class ConfigServiceImpl implements ConfigService {
}
//获取二级分类列表信息
public List<CarrentCategorytwo> getCatogoryTwoList() {
public List<CarrentCategory> getCatogoryTwoList(String categoryoneId) {
//返回信息
String message = "商品二级分类列表查询失败!";
try{
//获取商品类列表
List<CarrentCategorytwo> pageList = carrentCategorytwoService
//获取商品二级分类列表
List<CarrentCategory> pageList = carrentCategoryService
.lambdaQuery()
.eq(CarrentCategory::getPid, categoryoneId)
.list();
//判断执行结果


+ 30
- 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/GoodsServiceImpl.java View File

@ -6,6 +6,8 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.apiBean.PageBean;
import org.jeecg.modules.apiService.GoodsService;
import org.jeecg.modules.carrentCategory.entity.CarrentCategory;
import org.jeecg.modules.carrentCategory.service.ICarrentCategoryService;
import org.jeecg.modules.carrentCategoryone.entity.CarrentCategoryone;
import org.jeecg.modules.carrentCategoryone.service.ICarrentCategoryoneService;
import org.jeecg.modules.carrentCategorytwo.entity.CarrentCategorytwo;
@ -33,6 +35,10 @@ public class GoodsServiceImpl implements GoodsService {
@Resource
private ICarrentGoodsService carrentGoodsService;
//分类信息
@Resource
private ICarrentCategoryService carrentCategoryService;
//一级分类信息
@Resource
private ICarrentCategoryoneService carrentCategoryoneService;
@ -127,23 +133,30 @@ public class GoodsServiceImpl implements GoodsService {
//获取商品信息详情
one = carrentGoodsService.getById(goodsId);
//获取一级分类列表
List<CarrentCategoryone> categoryoneList = carrentCategoryoneService.list();
for (CarrentCategoryone categoryone : categoryoneList) {
if(one.getCartypeId().equals(categoryone.getId())){
one.setCategoryoneName(categoryone.getName());
break;
}
}
//获取二级分类列表
List<CarrentCategorytwo> categorytwoList = carrentCategorytwoService.list();
for (CarrentCategorytwo categorytwo : categorytwoList) {
if(one.getCategorytwoId().equals(categorytwo.getId())){
one.setCategorytwoName(categorytwo.getName());
break;
}
}
//获取一级分类信息
CarrentCategory categoryone = carrentCategoryService.getById(one.getCartypeId());
one.setCategoryoneName(categoryone.getName());
//获取二级分类信息
CarrentCategory categorytwo = carrentCategoryService.getById(one.getCategorytwoId());
one.setCategorytwoName(categorytwo.getName());
// List<CarrentCategoryone> categoryoneList = carrentCategoryoneService.list();
// for (CarrentCategoryone categoryone : categoryoneList) {
// if(one.getCartypeId().equals(categoryone.getId())){
// one.setCategoryoneName(categoryone.getName());
// break;
// }
// }
//
// //获取二级分类列表
// List<CarrentCategorytwo> categorytwoList = carrentCategorytwoService.list();
// for (CarrentCategorytwo categorytwo : categorytwoList) {
// if(one.getCategorytwoId().equals(categorytwo.getId())){
// one.setCategorytwoName(categorytwo.getName());
// break;
// }
// }
//判断执行结果
if(null != one){


Loading…
Cancel
Save