diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/controller/CarrentApplyController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/controller/CarrentApplyController.java index efc10b6..d262c1f 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/controller/CarrentApplyController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/controller/CarrentApplyController.java @@ -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="寻车申请表") diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/entity/CarrentApply.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/entity/CarrentApply.java index 4835922..a80ab76 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/entity/CarrentApply.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/entity/CarrentApply.java @@ -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; /**关联用户*/ diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/mapper/CarrentApplyMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/mapper/CarrentApplyMapper.java index 15e995f..cbe6a45 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/mapper/CarrentApplyMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/mapper/CarrentApplyMapper.java @@ -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 { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/ICarrentApplyService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/ICarrentApplyService.java index 3956262..1ab60fe 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/ICarrentApplyService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/ICarrentApplyService.java @@ -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 { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/impl/CarrentApplyServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/impl/CarrentApplyServiceImpl.java index b7b4a14..7dc9f0a 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/impl/CarrentApplyServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/service/impl/CarrentApplyServiceImpl.java @@ -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 diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/CarrentApplyList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/CarrentApplyList.vue index 590c1e6..8e1eccb 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/CarrentApplyList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/CarrentApplyList.vue @@ -4,26 +4,6 @@
- - - - - - - - - - - - - 查询 - 重置 - - {{ toggleSearchStatus ? '收起' : '展开' }} - - - -
@@ -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 } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/modules/CarrentApplyForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/modules/CarrentApplyForm.vue index 2e97089..a220334 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/modules/CarrentApplyForm.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue/modules/CarrentApplyForm.vue @@ -35,12 +35,12 @@ - + - + diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue3/CarrentApply.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue3/CarrentApply.data.ts index 07e240f..fbb5d69 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue3/CarrentApply.data.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentApply/vue3/CarrentApply.data.ts @@ -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:"" }, }, { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/controller/CarrentCategoryController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/controller/CarrentCategoryController.java new file mode 100644 index 0000000..68f5f17 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/controller/CarrentCategoryController.java @@ -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 { + @Autowired + private ICarrentCategoryService carrentCategoryService; + + /** + * 分页列表查询 + * + * @param carrentCategory + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "二级联动菜单表-分页列表查询") + @ApiOperation(value="二级联动菜单表-分页列表查询", notes="二级联动菜单表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CarrentCategory carrentCategory, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(carrentCategory, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = carrentCategoryService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param carrentCategory + * @return + */ + @AutoLog(value = "二级联动菜单表-添加") + @ApiOperation(value="二级联动菜单表-添加", notes="二级联动菜单表-添加") + @PostMapping(value = "/add") + public Result 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 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 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 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 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); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/entity/CarrentCategory.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/entity/CarrentCategory.java new file mode 100644 index 0000000..5f894d4 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/entity/CarrentCategory.java @@ -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 carrentCategorytwoList; +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/CarrentCategoryMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/CarrentCategoryMapper.java new file mode 100644 index 0000000..1d3291b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/CarrentCategoryMapper.java @@ -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 { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/xml/CarrentCategoryMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/xml/CarrentCategoryMapper.xml new file mode 100644 index 0000000..de96a74 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/mapper/xml/CarrentCategoryMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/ICarrentCategoryService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/ICarrentCategoryService.java new file mode 100644 index 0000000..8cc437b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/ICarrentCategoryService.java @@ -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 { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/impl/CarrentCategoryServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/impl/CarrentCategoryServiceImpl.java new file mode 100644 index 0000000..21a8c4b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/service/impl/CarrentCategoryServiceImpl.java @@ -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 implements ICarrentCategoryService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/CarrentCategoryList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/CarrentCategoryList.vue new file mode 100644 index 0000000..37a2d41 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/CarrentCategoryList.vue @@ -0,0 +1,178 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryForm.vue new file mode 100644 index 0000000..d30bb9d --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryForm.vue @@ -0,0 +1,109 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.Style#Drawer.vue new file mode 100644 index 0000000..68edbc5 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.vue new file mode 100644 index 0000000..9e6a44a --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue/modules/CarrentCategoryModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.api.ts new file mode 100644 index 0000000..03c3f19 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.api.ts @@ -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}); +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.data.ts new file mode 100644 index 0000000..f6c89e2 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategory.data.ts @@ -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', + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategoryList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategoryList.vue new file mode 100644 index 0000000..3842f29 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/CarrentCategoryList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/components/CarrentCategoryModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/components/CarrentCategoryModal.vue new file mode 100644 index 0000000..7fc2a3c --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentCategory/vue3/components/CarrentCategoryModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/controller/CarrentGoodsController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/controller/CarrentGoodsController.java index 6e83c66..114eae9 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/controller/CarrentGoodsController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/controller/CarrentGoodsController.java @@ -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="商品信息表") diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/entity/CarrentGoods.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/entity/CarrentGoods.java index f91350a..cd9e5ac 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/entity/CarrentGoods.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/entity/CarrentGoods.java @@ -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*/ diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/mapper/CarrentGoodsMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/mapper/CarrentGoodsMapper.java index f791f1d..2d1e81b 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/mapper/CarrentGoodsMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/mapper/CarrentGoodsMapper.java @@ -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 { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/ICarrentGoodsService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/ICarrentGoodsService.java index 1726d0b..561c157 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/ICarrentGoodsService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/ICarrentGoodsService.java @@ -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 { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/impl/CarrentGoodsServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/impl/CarrentGoodsServiceImpl.java index 20be66a..5aaefe9 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/impl/CarrentGoodsServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/service/impl/CarrentGoodsServiceImpl.java @@ -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 diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/CarrentGoodsList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/CarrentGoodsList.vue index 9db26fe..2f6ee32 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/CarrentGoodsList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/CarrentGoodsList.vue @@ -9,11 +9,6 @@ - - - - - 查询 @@ -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 diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/modules/CarrentGoodsForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/modules/CarrentGoodsForm.vue index b8f9cb0..54723bb 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/modules/CarrentGoodsForm.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue/modules/CarrentGoodsForm.vue @@ -100,12 +100,12 @@ - + - + diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue3/CarrentGoods.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue3/CarrentGoods.data.ts index bcc4eda..fdc6c79 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue3/CarrentGoods.data.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/carrentGoods/vue3/CarrentGoods.data.ts @@ -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:"" }, }, { diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/carrentController/ConfigController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/carrentController/ConfigController.java index 7f31ce7..fc5952d 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/carrentController/ConfigController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/carrentController/ConfigController.java @@ -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}) diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ConfigServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ConfigServiceImpl.java index 6cf6fb3..c4fbb81 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ConfigServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ConfigServiceImpl.java @@ -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 carrentCategoryoneList = getCatogoryOneList(categoryOneId); + List carrentCategoryoneList = getCatogoryoneList(categoryOneId); //二级分类列表 - List carrentCategorytwoList = getCatogoryTwoList(); - - //将二级分类放至对应一级分类下 - for (CarrentCategoryone carrentCategoryone : carrentCategoryoneList) { - //二级分类列表 - List 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 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 pageList = null; + Page pageList = null; try{ + //顶级分类 + CarrentCategory category = carrentCategoryService + .lambdaQuery() + .isNull(CarrentCategory::getPid) + .one(); + //分页 - Page page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + Page page = new Page(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 pageList = null; + Page pageList = null; try{ + //顶级分类 + CarrentCategory category = carrentCategoryService + .lambdaQuery() + .isNull(CarrentCategory::getPid) + .one(); + + //一级分类列表 + List carrentCategoryoneList = getCatogoryoneList(null); + List ids = new ArrayList<>(); + for (CarrentCategory carrentCategory : carrentCategoryoneList) { + ids.add(carrentCategory.getId()); + } //分页 - Page page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); - //获取商品二级分类列表 - pageList = carrentCategorytwoService + Page page = new Page(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 getCatogoryOneList(String categoryOneId) { + //获取分类信息列表 + public List getCatogoryoneList(String categoryOneId) { //返回信息 - String message = "商品一级分类列表查询失败!"; + String message = "商品分类信息列表查询失败!"; try{ - //组装查询内容 - LambdaQueryChainWrapper query = carrentCategoryoneService + LambdaQueryChainWrapper query = carrentCategoryService .lambdaQuery(); - //组装查询条件 if(null != categoryOneId){ - //车辆类型 - query.eq(CarrentCategoryone::getId, categoryOneId); - } - //获取商品类型列表 - List 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 pageList = query.list(); + //返回执行结果 return pageList; }catch (Exception e){ @@ -306,14 +320,15 @@ public class ConfigServiceImpl implements ConfigService { } //获取二级分类列表信息 - public List getCatogoryTwoList() { + public List getCatogoryTwoList(String categoryoneId) { //返回信息 String message = "商品二级分类列表查询失败!"; try{ - //获取商品类型列表 - List pageList = carrentCategorytwoService + //获取商品二级分类列表 + List pageList = carrentCategoryService .lambdaQuery() + .eq(CarrentCategory::getPid, categoryoneId) .list(); //判断执行结果 diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/GoodsServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/GoodsServiceImpl.java index 3b25755..5096469 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/GoodsServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/GoodsServiceImpl.java @@ -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 categoryoneList = carrentCategoryoneService.list(); - for (CarrentCategoryone categoryone : categoryoneList) { - if(one.getCartypeId().equals(categoryone.getId())){ - one.setCategoryoneName(categoryone.getName()); - break; - } - } - - //获取二级分类列表 - List 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 categoryoneList = carrentCategoryoneService.list(); +// for (CarrentCategoryone categoryone : categoryoneList) { +// if(one.getCartypeId().equals(categoryone.getId())){ +// one.setCategoryoneName(categoryone.getName()); +// break; +// } +// } +// +// //获取二级分类列表 +// List categorytwoList = carrentCategorytwoService.list(); +// for (CarrentCategorytwo categorytwo : categorytwoList) { +// if(one.getCategorytwoId().equals(categorytwo.getId())){ +// one.setCategorytwoName(categorytwo.getName()); +// break; +// } +// } //判断执行结果 if(null != one){