商城商品 , 商品分类, 收货地址 , 省市区信息

This commit is contained in:
2026-02-05 17:45:45 +08:00
parent 381c29794c
commit 2a73036bc1
45 changed files with 3048 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2016445919294554113, 0, 'mall', '商城', 'menu', '/mall', 'iconfont iconicon_message', 11, 1, null, 1, null, '', 0);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2019338015981219841, 0, 'common', '公共信息', 'menu', '/common', 'iconfont iconicon_message', 8, 1, null, 1, null, '', 0);

View File

@@ -0,0 +1,10 @@
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061003980801', '2016445919294554113', 'mallCategory', '商品分类', 'menu', '/mall/mallCategory', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061003980802', '2019341061003980801', 'mallCategory_add', '新增', 'add', '/mall/mallCategory/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061003980803', '2019341061003980801', 'mallCategory_edit', '修改', 'edit', '/mall/mallCategory/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061003980804', '2019341061003980801', 'mallCategory_delete', '删除', 'delete', '/api/blade-mallcategory/mallCategory/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061003980805', '2019341061003980801', 'mallCategory_view', '查看', 'view', '/mall/mallCategory/view', 'file-text', 4, 2, 2, 1, NULL, 0);

View File

@@ -0,0 +1,10 @@
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061775732737', '2016445919294554113', 'mallProduct', '商城商品', 'menu', '/mall/mallProduct', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061775732738', '2019341061775732737', 'mallProduct_add', '新增', 'add', '/mall/mallProduct/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061775732739', '2019341061775732737', 'mallProduct_edit', '修改', 'edit', '/mall/mallProduct/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061775732740', '2019341061775732737', 'mallProduct_delete', '删除', 'delete', '/api/blade-mallproduct/mallProduct/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341061775732741', '2019341061775732737', 'mallProduct_view', '查看', 'view', '/mall/mallProduct/view', 'file-text', 4, 2, 2, 1, NULL, 0);

View File

@@ -0,0 +1,10 @@
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341060219645953', '2019338015981219841', 'regionsInfo', '省市区信息', 'menu', '/common/regionsInfo', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341060219645954', '2019341060219645953', 'regionsInfo_add', '新增', 'add', '/common/regionsInfo/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341060219645955', '2019341060219645953', 'regionsInfo_edit', '修改', 'edit', '/common/regionsInfo/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341060219645956', '2019341060219645953', 'regionsInfo_delete', '删除', 'delete', '/api/blade-regionsinfo/regionsInfo/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341060219645957', '2019341060219645953', 'regionsInfo_view', '查看', 'view', '/common/regionsInfo/view', 'file-text', 4, 2, 2, 1, NULL, 0);

View File

@@ -0,0 +1,10 @@
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341062694285314', '2019338015981219841', 'userAddress', '用户收货地址', 'menu', '/common/userAddress', NULL, 1, 1, 0, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341062694285315', '2019341062694285314', 'userAddress_add', '新增', 'add', '/common/userAddress/add', 'plus', 1, 2, 1, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341062694285316', '2019341062694285314', 'userAddress_edit', '修改', 'edit', '/common/userAddress/edit', 'form', 2, 2, 2, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341062694285317', '2019341062694285314', 'userAddress_delete', '删除', 'delete', '/api/blade-useraddress/userAddress/remove', 'delete', 3, 2, 3, 1, NULL, 0);
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
VALUES ('2019341062694285318', '2019341062694285314', 'userAddress_view', '查看', 'view', '/common/userAddress/view', 'file-text', 4, 2, 2, 1, NULL, 0);

View File

@@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.common.pojo.entity.RegionsInfoEntity;
import org.springblade.modules.common.pojo.vo.RegionsInfoVO;
import org.springblade.modules.common.excel.RegionsInfoExcel;
import org.springblade.modules.common.wrapper.RegionsInfoWrapper;
import org.springblade.modules.common.service.IRegionsInfoService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 地区详情表 控制器
*
* @author BladeX
* @since 2026-02-05
*/
@RestController
@AllArgsConstructor
@RequestMapping("blade-regionsinfo/regionsInfo")
@Tag(name = "地区详情表", description = "地区详情表接口")
public class RegionsInfoController extends BladeController {
private final IRegionsInfoService regionsInfoService;
/**
* 地区详情表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入regionsInfo")
public R<RegionsInfoVO> detail(RegionsInfoEntity regionsInfo) {
RegionsInfoEntity detail = regionsInfoService.getOne(Condition.getQueryWrapper(regionsInfo));
return R.data(RegionsInfoWrapper.build().entityVO(detail));
}
/**
* 地区详情表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入regionsInfo")
public R<IPage<RegionsInfoVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> regionsInfo, Query query) {
IPage<RegionsInfoEntity> pages = regionsInfoService.page(Condition.getPage(query), Condition.getQueryWrapper(regionsInfo, RegionsInfoEntity.class));
return R.data(RegionsInfoWrapper.build().pageVO(pages));
}
/**
* 地区详情表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入regionsInfo")
public R<IPage<RegionsInfoVO>> page(RegionsInfoVO regionsInfo, Query query) {
IPage<RegionsInfoVO> pages = regionsInfoService.selectRegionsInfoPage(Condition.getPage(query), regionsInfo);
return R.data(pages);
}
/**
* 地区详情表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入regionsInfo")
public R save(@Valid @RequestBody RegionsInfoEntity regionsInfo) {
return R.status(regionsInfoService.save(regionsInfo));
}
/**
* 地区详情表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入regionsInfo")
public R update(@Valid @RequestBody RegionsInfoEntity regionsInfo) {
return R.status(regionsInfoService.updateById(regionsInfo));
}
/**
* 地区详情表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入regionsInfo")
public R submit(@Valid @RequestBody RegionsInfoEntity regionsInfo) {
return R.status(regionsInfoService.saveOrUpdate(regionsInfo));
}
/**
* 地区详情表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(regionsInfoService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-regionsInfo")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入regionsInfo")
public void exportRegionsInfo(@Parameter(hidden = true) @RequestParam Map<String, Object> regionsInfo, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<RegionsInfoEntity> queryWrapper = Condition.getQueryWrapper(regionsInfo, RegionsInfoEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(RegionsInfo::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(RegionsInfoEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<RegionsInfoExcel> list = regionsInfoService.exportRegionsInfo(queryWrapper);
ExcelUtil.export(response, "地区详情表数据" + DateUtil.time(), "地区详情表数据表", list, RegionsInfoExcel.class);
}
}

View File

@@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.common.pojo.entity.UserAddressEntity;
import org.springblade.modules.common.pojo.vo.UserAddressVO;
import org.springblade.modules.common.excel.UserAddressExcel;
import org.springblade.modules.common.wrapper.UserAddressWrapper;
import org.springblade.modules.common.service.IUserAddressService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 用户地址表 控制器
*
* @author BladeX
* @since 2026-02-05
*/
@RestController
@AllArgsConstructor
@RequestMapping("blade-useraddress/userAddress")
@Tag(name = "用户地址表", description = "用户地址表接口")
public class UserAddressController extends BladeController {
private final IUserAddressService userAddressService;
/**
* 用户地址表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入userAddress")
public R<UserAddressVO> detail(UserAddressEntity userAddress) {
UserAddressEntity detail = userAddressService.getOne(Condition.getQueryWrapper(userAddress));
return R.data(UserAddressWrapper.build().entityVO(detail));
}
/**
* 用户地址表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入userAddress")
public R<IPage<UserAddressVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> userAddress, Query query) {
IPage<UserAddressEntity> pages = userAddressService.page(Condition.getPage(query), Condition.getQueryWrapper(userAddress, UserAddressEntity.class));
return R.data(UserAddressWrapper.build().pageVO(pages));
}
/**
* 用户地址表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入userAddress")
public R<IPage<UserAddressVO>> page(UserAddressVO userAddress, Query query) {
IPage<UserAddressVO> pages = userAddressService.selectUserAddressPage(Condition.getPage(query), userAddress);
return R.data(pages);
}
/**
* 用户地址表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入userAddress")
public R save(@Valid @RequestBody UserAddressEntity userAddress) {
return R.status(userAddressService.save(userAddress));
}
/**
* 用户地址表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入userAddress")
public R update(@Valid @RequestBody UserAddressEntity userAddress) {
return R.status(userAddressService.updateById(userAddress));
}
/**
* 用户地址表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入userAddress")
public R submit(@Valid @RequestBody UserAddressEntity userAddress) {
return R.status(userAddressService.saveOrUpdate(userAddress));
}
/**
* 用户地址表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(userAddressService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-userAddress")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入userAddress")
public void exportUserAddress(@Parameter(hidden = true) @RequestParam Map<String, Object> userAddress, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<UserAddressEntity> queryWrapper = Condition.getQueryWrapper(userAddress, UserAddressEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(UserAddress::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(UserAddressEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<UserAddressExcel> list = userAddressService.exportUserAddress(queryWrapper);
ExcelUtil.export(response, "用户地址表数据" + DateUtil.time(), "用户地址表数据表", list, UserAddressExcel.class);
}
}

View File

@@ -0,0 +1,104 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.excel;
import lombok.Data;
import java.util.Date;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 地区详情表 Excel实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class RegionsInfoExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 父主键
*/
@ColumnWidth(20)
@ExcelProperty("父主键")
private Integer pid;
/**
* 主键
*/
@ColumnWidth(20)
@ExcelProperty("主键")
private Integer id;
/**
* 名称
*/
@ColumnWidth(20)
@ExcelProperty("名称")
private String name;
/**
* 层级
*/
@ColumnWidth(20)
@ExcelProperty("层级")
private Integer level;
/**
* 坐标
*/
@ColumnWidth(20)
@ExcelProperty("坐标")
private Object coordinates;
/**
* 地区编码
*/
@ColumnWidth(20)
@ExcelProperty("地区编码")
private String regionCode;
/**
* 全称
*/
@ColumnWidth(20)
@ExcelProperty("全称")
private String fullName;
/**
* 是否删除
*/
@ColumnWidth(20)
@ExcelProperty("是否删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,128 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.excel;
import lombok.Data;
import java.util.Date;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 用户地址表 Excel实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class UserAddressExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ColumnWidth(20)
@ExcelProperty("主键")
private Long id;
/**
* 用户id
*/
@ColumnWidth(20)
@ExcelProperty("用户id")
private Long userId;
/**
* 地区信息id
*/
@ColumnWidth(20)
@ExcelProperty("地区信息id")
private Long regionsInfoId;
/**
* 省份
*/
@ColumnWidth(20)
@ExcelProperty("省份")
private String province;
/**
* 城市
*/
@ColumnWidth(20)
@ExcelProperty("城市")
private String city;
/**
* 区县
*/
@ColumnWidth(20)
@ExcelProperty("区县")
private String district;
/**
* 街道
*/
@ColumnWidth(20)
@ExcelProperty("街道")
private String street;
/**
* 详细地址
*/
@ColumnWidth(20)
@ExcelProperty("详细地址")
private String detail;
/**
* 收货人
*/
@ColumnWidth(20)
@ExcelProperty("收货人")
private String consignee;
/**
* 联系电话
*/
@ColumnWidth(20)
@ExcelProperty("联系电话")
private String phone;
/**
* 是否默认地址(0=否,1=是)
*/
@ColumnWidth(20)
@ExcelProperty("是否默认地址(0=否,1=是)")
private Integer isDefault;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.mapper;
import org.springblade.modules.common.pojo.entity.RegionsInfoEntity;
import org.springblade.modules.common.pojo.vo.RegionsInfoVO;
import org.springblade.modules.common.excel.RegionsInfoExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 地区详情表 Mapper 接口
*
* @author BladeX
* @since 2026-02-05
*/
public interface RegionsInfoMapper extends BaseMapper<RegionsInfoEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param regionsInfo 查询参数
* @return List<RegionsInfoVO>
*/
List<RegionsInfoVO> selectRegionsInfoPage(IPage page, RegionsInfoVO regionsInfo);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<RegionsInfoExcel>
*/
List<RegionsInfoExcel> exportRegionsInfo(@Param("ew") Wrapper<RegionsInfoEntity> queryWrapper);
}

View File

@@ -0,0 +1,33 @@
<?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.springblade.modules.common.mapper.RegionsInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="regionsInfoResultMap" type="org.springblade.modules.common.pojo.entity.RegionsInfoEntity">
<result column="pid" property="pid"/>
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="level" property="level"/>
<result column="coordinates" property="coordinates"/>
<result column="region_code" property="regionCode"/>
<result column="full_name" property="fullName"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_time" property="createTime"/>
<result column="create_user" property="createUser"/>
<result column="update_time" property="updateTime"/>
<result column="update_user" property="updateUser"/>
<result column="status" property="status"/>
<result column="create_dept" property="createDept"/>
</resultMap>
<select id="selectRegionsInfoPage" resultMap="regionsInfoResultMap">
select * from regions_info where is_deleted = 0
</select>
<select id="exportRegionsInfo" resultType="org.springblade.modules.common.excel.RegionsInfoExcel">
SELECT * FROM regions_info ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.mapper;
import org.springblade.modules.common.pojo.entity.UserAddressEntity;
import org.springblade.modules.common.pojo.vo.UserAddressVO;
import org.springblade.modules.common.excel.UserAddressExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户地址表 Mapper 接口
*
* @author BladeX
* @since 2026-02-05
*/
public interface UserAddressMapper extends BaseMapper<UserAddressEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param userAddress 查询参数
* @return List<UserAddressVO>
*/
List<UserAddressVO> selectUserAddressPage(IPage page, UserAddressVO userAddress);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<UserAddressExcel>
*/
List<UserAddressExcel> exportUserAddress(@Param("ew") Wrapper<UserAddressEntity> queryWrapper);
}

View File

@@ -0,0 +1,37 @@
<?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.springblade.modules.common.mapper.UserAddressMapper">
<!-- 通用查询映射结果 -->
<resultMap id="userAddressResultMap" type="org.springblade.modules.common.pojo.entity.UserAddressEntity">
<result column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="regions_info_id" property="regionsInfoId"/>
<result column="province" property="province"/>
<result column="city" property="city"/>
<result column="district" property="district"/>
<result column="street" property="street"/>
<result column="detail" property="detail"/>
<result column="consignee" property="consignee"/>
<result column="phone" property="phone"/>
<result column="is_default" property="isDefault"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<select id="selectUserAddressPage" resultMap="userAddressResultMap">
select * from user_address where is_deleted = 0
</select>
<select id="exportUserAddress" resultType="org.springblade.modules.common.excel.UserAddressExcel">
SELECT * FROM user_address ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.pojo.dto;
import org.springblade.modules.common.pojo.entity.RegionsInfoEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 地区详情表 数据传输对象实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class RegionsInfoDTO extends RegionsInfoEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.pojo.dto;
import org.springblade.modules.common.pojo.entity.UserAddressEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 用户地址表 数据传输对象实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class UserAddressDTO extends UserAddressEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,81 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 地区详情表 实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@TableName("regions_info")
@Schema(description = "RegionsInfo对象")
@EqualsAndHashCode(callSuper = true)
public class RegionsInfoEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 父主键
*/
@Schema(description = "父主键")
private Integer pid;
/**
* 名称
*/
@Schema(description = "名称")
private String name;
/**
* 层级
*/
@Schema(description = "层级")
private Integer level;
/**
* 坐标
*/
@Schema(description = "坐标")
private Object coordinates;
/**
* 地区编码
*/
@Schema(description = "地区编码")
private String regionCode;
/**
* 全称
*/
@Schema(description = "全称")
private String fullName;
}

View File

@@ -0,0 +1,101 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 用户地址表 实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@TableName("user_address")
@Schema(description = "UserAddress对象")
@EqualsAndHashCode(callSuper = true)
public class UserAddressEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
@Schema(description = "用户id")
private Long userId;
/**
* 地区信息id
*/
@Schema(description = "地区信息id")
private Long regionsInfoId;
/**
* 省份
*/
@Schema(description = "省份")
private String province;
/**
* 城市
*/
@Schema(description = "城市")
private String city;
/**
* 区县
*/
@Schema(description = "区县")
private String district;
/**
* 街道
*/
@Schema(description = "街道")
private String street;
/**
* 详细地址
*/
@Schema(description = "详细地址")
private String detail;
/**
* 收货人
*/
@Schema(description = "收货人")
private String consignee;
/**
* 联系电话
*/
@Schema(description = "联系电话")
private String phone;
/**
* 是否默认地址(0=否,1=是)
*/
@Schema(description = "是否默认地址(0=否,1=是)")
private Integer isDefault;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.pojo.vo;
import org.springblade.modules.common.pojo.entity.RegionsInfoEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 地区详情表 视图实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class RegionsInfoVO extends RegionsInfoEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.pojo.vo;
import org.springblade.modules.common.pojo.entity.UserAddressEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 用户地址表 视图实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class UserAddressVO extends UserAddressEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.common.pojo.entity.RegionsInfoEntity;
import org.springblade.modules.common.pojo.vo.RegionsInfoVO;
import org.springblade.modules.common.excel.RegionsInfoExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 地区详情表 服务类
*
* @author BladeX
* @since 2026-02-05
*/
public interface IRegionsInfoService extends BaseService<RegionsInfoEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param regionsInfo 查询参数
* @return IPage<RegionsInfoVO>
*/
IPage<RegionsInfoVO> selectRegionsInfoPage(IPage<RegionsInfoVO> page, RegionsInfoVO regionsInfo);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<RegionsInfoExcel>
*/
List<RegionsInfoExcel> exportRegionsInfo(Wrapper<RegionsInfoEntity> queryWrapper);
}

View File

@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.common.pojo.entity.UserAddressEntity;
import org.springblade.modules.common.pojo.vo.UserAddressVO;
import org.springblade.modules.common.excel.UserAddressExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 用户地址表 服务类
*
* @author BladeX
* @since 2026-02-05
*/
public interface IUserAddressService extends BaseService<UserAddressEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param userAddress 查询参数
* @return IPage<UserAddressVO>
*/
IPage<UserAddressVO> selectUserAddressPage(IPage<UserAddressVO> page, UserAddressVO userAddress);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<UserAddressExcel>
*/
List<UserAddressExcel> exportUserAddress(Wrapper<UserAddressEntity> queryWrapper);
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.service.impl;
import org.springblade.modules.common.pojo.entity.RegionsInfoEntity;
import org.springblade.modules.common.pojo.vo.RegionsInfoVO;
import org.springblade.modules.common.excel.RegionsInfoExcel;
import org.springblade.modules.common.mapper.RegionsInfoMapper;
import org.springblade.modules.common.service.IRegionsInfoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 地区详情表 服务实现类
*
* @author BladeX
* @since 2026-02-05
*/
@Service
public class RegionsInfoServiceImpl extends BaseServiceImpl<RegionsInfoMapper, RegionsInfoEntity> implements IRegionsInfoService {
@Override
public IPage<RegionsInfoVO> selectRegionsInfoPage(IPage<RegionsInfoVO> page, RegionsInfoVO regionsInfo) {
return page.setRecords(baseMapper.selectRegionsInfoPage(page, regionsInfo));
}
@Override
public List<RegionsInfoExcel> exportRegionsInfo(Wrapper<RegionsInfoEntity> queryWrapper) {
List<RegionsInfoExcel> regionsInfoList = baseMapper.exportRegionsInfo(queryWrapper);
//regionsInfoList.forEach(regionsInfo -> {
// regionsInfo.setTypeName(DictCache.getValue(DictEnum.YES_NO, RegionsInfo.getType()));
//});
return regionsInfoList;
}
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.service.impl;
import org.springblade.modules.common.pojo.entity.UserAddressEntity;
import org.springblade.modules.common.pojo.vo.UserAddressVO;
import org.springblade.modules.common.excel.UserAddressExcel;
import org.springblade.modules.common.mapper.UserAddressMapper;
import org.springblade.modules.common.service.IUserAddressService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 用户地址表 服务实现类
*
* @author BladeX
* @since 2026-02-05
*/
@Service
public class UserAddressServiceImpl extends BaseServiceImpl<UserAddressMapper, UserAddressEntity> implements IUserAddressService {
@Override
public IPage<UserAddressVO> selectUserAddressPage(IPage<UserAddressVO> page, UserAddressVO userAddress) {
return page.setRecords(baseMapper.selectUserAddressPage(page, userAddress));
}
@Override
public List<UserAddressExcel> exportUserAddress(Wrapper<UserAddressEntity> queryWrapper) {
List<UserAddressExcel> userAddressList = baseMapper.exportUserAddress(queryWrapper);
//userAddressList.forEach(userAddress -> {
// userAddress.setTypeName(DictCache.getValue(DictEnum.YES_NO, UserAddress.getType()));
//});
return userAddressList;
}
}

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.common.pojo.entity.RegionsInfoEntity;
import org.springblade.modules.common.pojo.vo.RegionsInfoVO;
import java.util.Objects;
/**
* 地区详情表 包装类,返回视图层所需的字段
*
* @author BladeX
* @since 2026-02-05
*/
public class RegionsInfoWrapper extends BaseEntityWrapper<RegionsInfoEntity, RegionsInfoVO> {
public static RegionsInfoWrapper build() {
return new RegionsInfoWrapper();
}
@Override
public RegionsInfoVO entityVO(RegionsInfoEntity regionsInfo) {
RegionsInfoVO regionsInfoVO = Objects.requireNonNull(BeanUtil.copyProperties(regionsInfo, RegionsInfoVO.class));
//User createUser = UserCache.getUser(regionsInfo.getCreateUser());
//User updateUser = UserCache.getUser(regionsInfo.getUpdateUser());
//regionsInfoVO.setCreateUserName(createUser.getName());
//regionsInfoVO.setUpdateUserName(updateUser.getName());
return regionsInfoVO;
}
}

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.common.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.common.pojo.entity.UserAddressEntity;
import org.springblade.modules.common.pojo.vo.UserAddressVO;
import java.util.Objects;
/**
* 用户地址表 包装类,返回视图层所需的字段
*
* @author BladeX
* @since 2026-02-05
*/
public class UserAddressWrapper extends BaseEntityWrapper<UserAddressEntity, UserAddressVO> {
public static UserAddressWrapper build() {
return new UserAddressWrapper();
}
@Override
public UserAddressVO entityVO(UserAddressEntity userAddress) {
UserAddressVO userAddressVO = Objects.requireNonNull(BeanUtil.copyProperties(userAddress, UserAddressVO.class));
//User createUser = UserCache.getUser(userAddress.getCreateUser());
//User updateUser = UserCache.getUser(userAddress.getUpdateUser());
//userAddressVO.setCreateUserName(createUser.getName());
//userAddressVO.setUpdateUserName(updateUser.getName());
return userAddressVO;
}
}

View File

@@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
import org.springblade.modules.mall.pojo.vo.MallCategoryVO;
import org.springblade.modules.mall.excel.MallCategoryExcel;
import org.springblade.modules.mall.wrapper.MallCategoryWrapper;
import org.springblade.modules.mall.service.IMallCategoryService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 商品分类 控制器
*
* @author BladeX
* @since 2026-02-05
*/
@RestController
@AllArgsConstructor
@RequestMapping("blade-mallcategory/mallCategory")
@Tag(name = "商品分类", description = "商品分类接口")
public class MallCategoryController extends BladeController {
private final IMallCategoryService mallCategoryService;
/**
* 商品分类 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入mallCategory")
public R<MallCategoryVO> detail(MallCategoryEntity mallCategory) {
MallCategoryEntity detail = mallCategoryService.getOne(Condition.getQueryWrapper(mallCategory));
return R.data(MallCategoryWrapper.build().entityVO(detail));
}
/**
* 商品分类 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入mallCategory")
public R<IPage<MallCategoryVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> mallCategory, Query query) {
IPage<MallCategoryEntity> pages = mallCategoryService.page(Condition.getPage(query), Condition.getQueryWrapper(mallCategory, MallCategoryEntity.class));
return R.data(MallCategoryWrapper.build().pageVO(pages));
}
/**
* 商品分类 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入mallCategory")
public R<IPage<MallCategoryVO>> page(MallCategoryVO mallCategory, Query query) {
IPage<MallCategoryVO> pages = mallCategoryService.selectMallCategoryPage(Condition.getPage(query), mallCategory);
return R.data(pages);
}
/**
* 商品分类 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入mallCategory")
public R save(@Valid @RequestBody MallCategoryEntity mallCategory) {
return R.status(mallCategoryService.save(mallCategory));
}
/**
* 商品分类 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入mallCategory")
public R update(@Valid @RequestBody MallCategoryEntity mallCategory) {
return R.status(mallCategoryService.updateById(mallCategory));
}
/**
* 商品分类 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入mallCategory")
public R submit(@Valid @RequestBody MallCategoryEntity mallCategory) {
return R.status(mallCategoryService.saveOrUpdate(mallCategory));
}
/**
* 商品分类 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(mallCategoryService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-mallCategory")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入mallCategory")
public void exportMallCategory(@Parameter(hidden = true) @RequestParam Map<String, Object> mallCategory, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<MallCategoryEntity> queryWrapper = Condition.getQueryWrapper(mallCategory, MallCategoryEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(MallCategory::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(MallCategoryEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<MallCategoryExcel> list = mallCategoryService.exportMallCategory(queryWrapper);
ExcelUtil.export(response, "商品分类数据" + DateUtil.time(), "商品分类数据表", list, MallCategoryExcel.class);
}
}

View File

@@ -0,0 +1,161 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.controller;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import jakarta.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.IsAdmin;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
import org.springblade.modules.mall.pojo.vo.MallProductVO;
import org.springblade.modules.mall.excel.MallProductExcel;
import org.springblade.modules.mall.wrapper.MallProductWrapper;
import org.springblade.modules.mall.service.IMallProductService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import java.util.Map;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
/**
* 商城商品 控制器
*
* @author BladeX
* @since 2026-02-05
*/
@RestController
@AllArgsConstructor
@RequestMapping("blade-mallproduct/mallProduct")
@Tag(name = "商城商品", description = "商城商品接口")
public class MallProductController extends BladeController {
private final IMallProductService mallProductService;
/**
* 商城商品 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@Operation(summary = "详情", description = "传入mallProduct")
public R<MallProductVO> detail(MallProductEntity mallProduct) {
MallProductEntity detail = mallProductService.getOne(Condition.getQueryWrapper(mallProduct));
return R.data(MallProductWrapper.build().entityVO(detail));
}
/**
* 商城商品 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入mallProduct")
public R<IPage<MallProductVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> mallProduct, Query query) {
IPage<MallProductEntity> pages = mallProductService.page(Condition.getPage(query), Condition.getQueryWrapper(mallProduct, MallProductEntity.class));
return R.data(MallProductWrapper.build().pageVO(pages));
}
/**
* 商城商品 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@Operation(summary = "分页", description = "传入mallProduct")
public R<IPage<MallProductVO>> page(MallProductVO mallProduct, Query query) {
IPage<MallProductVO> pages = mallProductService.selectMallProductPage(Condition.getPage(query), mallProduct);
return R.data(pages);
}
/**
* 商城商品 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@Operation(summary = "新增", description = "传入mallProduct")
public R save(@Valid @RequestBody MallProductEntity mallProduct) {
return R.status(mallProductService.save(mallProduct));
}
/**
* 商城商品 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@Operation(summary = "修改", description = "传入mallProduct")
public R update(@Valid @RequestBody MallProductEntity mallProduct) {
return R.status(mallProductService.updateById(mallProduct));
}
/**
* 商城商品 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@Operation(summary = "新增或修改", description = "传入mallProduct")
public R submit(@Valid @RequestBody MallProductEntity mallProduct) {
return R.status(mallProductService.saveOrUpdate(mallProduct));
}
/**
* 商城商品 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@Operation(summary = "逻辑删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
return R.status(mallProductService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@IsAdmin
@GetMapping("/export-mallProduct")
@ApiOperationSupport(order = 9)
@Operation(summary = "导出数据", description = "传入mallProduct")
public void exportMallProduct(@Parameter(hidden = true) @RequestParam Map<String, Object> mallProduct, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<MallProductEntity> queryWrapper = Condition.getQueryWrapper(mallProduct, MallProductEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(MallProduct::getTenantId, bladeUser.getTenantId());
//}
//queryWrapper.lambda().eq(MallProductEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<MallProductExcel> list = mallProductService.exportMallProduct(queryWrapper);
ExcelUtil.export(response, "商城商品数据" + DateUtil.time(), "商城商品数据表", list, MallProductExcel.class);
}
}

View File

@@ -0,0 +1,92 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.excel;
import lombok.Data;
import java.util.Date;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 商品分类 Excel实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class MallCategoryExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ColumnWidth(20)
@ExcelProperty("主键")
private Long id;
/**
* 分类名称
*/
@ColumnWidth(20)
@ExcelProperty("分类名称")
private String cname;
/**
* 图片
*/
@ColumnWidth(20)
@ExcelProperty("图片")
private String img;
/**
* pid
*/
@ColumnWidth(20)
@ExcelProperty("pid")
private Long pid;
/**
* level
*/
@ColumnWidth(20)
@ExcelProperty("level")
private Integer level;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,165 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
import java.io.Serial;
/**
* 商城商品 Excel实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class MallProductExcel implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ColumnWidth(20)
@ExcelProperty("主键")
private Long id;
/**
* 商品编码
*/
@ColumnWidth(20)
@ExcelProperty("商品编码")
private String spuSn;
/**
* 商品名称
*/
@ColumnWidth(20)
@ExcelProperty("商品名称")
private String spuName;
/**
* 主图
*/
@ColumnWidth(20)
@ExcelProperty("主图")
private String mainImg;
/**
* 详情图(多图,逗号分割)
*/
@ColumnWidth(20)
@ExcelProperty("详情图(多图,逗号分割)")
private String detailImg;
/**
* 顶图(多图,逗号分割)
*/
@ColumnWidth(20)
@ExcelProperty("顶图(多图,逗号分割)")
private String topImg;
/**
* 规格详情
*/
@ColumnWidth(20)
@ExcelProperty("规格详情")
private String attribute;
/**
* 单位
*/
@ColumnWidth(20)
@ExcelProperty("单位")
private String unit;
/**
* cate_id分类
*/
@ColumnWidth(20)
@ExcelProperty("cate_id分类")
private String categoryId;
/**
* cate_id分类
*/
@ColumnWidth(20)
@ExcelProperty("cate_id分类")
private String categoryIds;
/**
* 成本价
*/
@ColumnWidth(20)
@ExcelProperty("成本价")
private BigDecimal costPrice;
/**
* 原价
*/
@ColumnWidth(20)
@ExcelProperty("原价")
private BigDecimal originalPrice;
/**
* 销售价
*/
@ColumnWidth(20)
@ExcelProperty("销售价")
private BigDecimal retailPrice;
/**
* 利润
*/
@ColumnWidth(20)
@ExcelProperty("利润")
private BigDecimal profit;
/**
* 销量
*/
@ColumnWidth(20)
@ExcelProperty("销量")
private Integer sales;
/**
* 库存
*/
@ColumnWidth(20)
@ExcelProperty("库存")
private Integer spuQty;
/**
* 标签(多标签,逗号分割 )
*/
@ColumnWidth(20)
@ExcelProperty("标签(多标签,逗号分割 )")
private String tags;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.mapper;
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
import org.springblade.modules.mall.pojo.vo.MallCategoryVO;
import org.springblade.modules.mall.excel.MallCategoryExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品分类 Mapper 接口
*
* @author BladeX
* @since 2026-02-05
*/
public interface MallCategoryMapper extends BaseMapper<MallCategoryEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param mallCategory 查询参数
* @return List<MallCategoryVO>
*/
List<MallCategoryVO> selectMallCategoryPage(IPage page, MallCategoryVO mallCategory);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<MallCategoryExcel>
*/
List<MallCategoryExcel> exportMallCategory(@Param("ew") Wrapper<MallCategoryEntity> queryWrapper);
}

View File

@@ -0,0 +1,31 @@
<?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.springblade.modules.mall.mapper.MallCategoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="mallCategoryResultMap" type="org.springblade.modules.mall.pojo.entity.MallCategoryEntity">
<result column="id" property="id"/>
<result column="cname" property="cname"/>
<result column="img" property="img"/>
<result column="pid" property="pid"/>
<result column="level" property="level"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_time" property="createTime"/>
<result column="create_user" property="createUser"/>
<result column="update_time" property="updateTime"/>
<result column="update_user" property="updateUser"/>
<result column="status" property="status"/>
<result column="create_dept" property="createDept"/>
</resultMap>
<select id="selectMallCategoryPage" resultMap="mallCategoryResultMap">
select * from mall_category where is_deleted = 0
</select>
<select id="exportMallCategory" resultType="org.springblade.modules.mall.excel.MallCategoryExcel">
SELECT * FROM mall_category ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.mapper;
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
import org.springblade.modules.mall.pojo.vo.MallProductVO;
import org.springblade.modules.mall.excel.MallProductExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商城商品 Mapper 接口
*
* @author BladeX
* @since 2026-02-05
*/
public interface MallProductMapper extends BaseMapper<MallProductEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param mallProduct 查询参数
* @return List<MallProductVO>
*/
List<MallProductVO> selectMallProductPage(IPage page, MallProductVO mallProduct);
/**
* 获取导出数据
*
* @param queryWrapper 查询条件
* @return List<MallProductExcel>
*/
List<MallProductExcel> exportMallProduct(@Param("ew") Wrapper<MallProductEntity> queryWrapper);
}

View File

@@ -0,0 +1,43 @@
<?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.springblade.modules.mall.mapper.MallProductMapper">
<!-- 通用查询映射结果 -->
<resultMap id="mallProductResultMap" type="org.springblade.modules.mall.pojo.entity.MallProductEntity">
<result column="id" property="id"/>
<result column="spu_sn" property="spuSn"/>
<result column="spu_name" property="spuName"/>
<result column="main_img" property="mainImg"/>
<result column="detail_img" property="detailImg"/>
<result column="top_img" property="topImg"/>
<result column="attribute" property="attribute"/>
<result column="unit" property="unit"/>
<result column="category_id" property="categoryId"/>
<result column="category_ids" property="categoryIds"/>
<result column="cost_price" property="costPrice"/>
<result column="original_price" property="originalPrice"/>
<result column="retail_price" property="retailPrice"/>
<result column="profit" property="profit"/>
<result column="sales" property="sales"/>
<result column="spu_qty" property="spuQty"/>
<result column="tags" property="tags"/>
<result column="status" property="status"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<select id="selectMallProductPage" resultMap="mallProductResultMap">
select * from mall_product where is_deleted = 0
</select>
<select id="exportMallProduct" resultType="org.springblade.modules.mall.excel.MallProductExcel">
SELECT * FROM mall_product ${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.dto;
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 商品分类 数据传输对象实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class MallCategoryDTO extends MallCategoryEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.dto;
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 商城商品 数据传输对象实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class MallProductDTO extends MallProductEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,71 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 商品分类 实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@TableName("mall_category")
@Schema(description = "MallCategory对象")
@EqualsAndHashCode(callSuper = true)
public class MallCategoryEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 分类名称
*/
@Schema(description = "分类名称")
private String cname;
/**
* 图片
*/
@Schema(description = "图片")
private String img;
/**
* pid
*/
@Schema(description = "pid")
private Long pid;
/**
* level
*/
@Schema(description = "level")
private Integer level;
}

View File

@@ -0,0 +1,132 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.entity;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import java.io.Serial;
/**
* 商城商品 实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@TableName("mall_product")
@Schema(description = "MallProduct对象")
@EqualsAndHashCode(callSuper = true)
public class MallProductEntity extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 商品编码
*/
@Schema(description = "商品编码")
private String spuSn;
/**
* 商品名称
*/
@Schema(description = "商品名称")
private String spuName;
/**
* 主图
*/
@Schema(description = "主图")
private String mainImg;
/**
* 详情图(多图,逗号分割)
*/
@Schema(description = "详情图(多图,逗号分割)")
private String detailImg;
/**
* 顶图(多图,逗号分割)
*/
@Schema(description = "顶图(多图,逗号分割)")
private String topImg;
/**
* 规格详情
*/
@Schema(description = "规格详情")
private String attribute;
/**
* 单位
*/
@Schema(description = "单位")
private String unit;
/**
* cate_id分类
*/
@Schema(description = "cate_id分类")
private String categoryId;
/**
* cate_id分类
*/
@Schema(description = "cate_id分类")
private String categoryIds;
/**
* 成本价
*/
@Schema(description = "成本价")
private BigDecimal costPrice;
/**
* 原价
*/
@Schema(description = "原价")
private BigDecimal originalPrice;
/**
* 销售价
*/
@Schema(description = "销售价")
private BigDecimal retailPrice;
/**
* 利润
*/
@Schema(description = "利润")
private BigDecimal profit;
/**
* 销量
*/
@Schema(description = "销量")
private Integer sales;
/**
* 库存
*/
@Schema(description = "库存")
private Integer spuQty;
/**
* 标签(多标签,逗号分割 )
*/
@Schema(description = "标签(多标签,逗号分割 )")
private String tags;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.vo;
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 商品分类 视图实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class MallCategoryVO extends MallCategoryEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,45 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.pojo.vo;
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 商城商品 视图实体类
*
* @author BladeX
* @since 2026-02-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class MallProductVO extends MallProductEntity {
@Serial
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
import org.springblade.modules.mall.pojo.vo.MallCategoryVO;
import org.springblade.modules.mall.excel.MallCategoryExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 商品分类 服务类
*
* @author BladeX
* @since 2026-02-05
*/
public interface IMallCategoryService extends BaseService<MallCategoryEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param mallCategory 查询参数
* @return IPage<MallCategoryVO>
*/
IPage<MallCategoryVO> selectMallCategoryPage(IPage<MallCategoryVO> page, MallCategoryVO mallCategory);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<MallCategoryExcel>
*/
List<MallCategoryExcel> exportMallCategory(Wrapper<MallCategoryEntity> queryWrapper);
}

View File

@@ -0,0 +1,61 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
import org.springblade.modules.mall.pojo.vo.MallProductVO;
import org.springblade.modules.mall.excel.MallProductExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 商城商品 服务类
*
* @author BladeX
* @since 2026-02-05
*/
public interface IMallProductService extends BaseService<MallProductEntity> {
/**
* 自定义分页
*
* @param page 分页参数
* @param mallProduct 查询参数
* @return IPage<MallProductVO>
*/
IPage<MallProductVO> selectMallProductPage(IPage<MallProductVO> page, MallProductVO mallProduct);
/**
* 导出数据
*
* @param queryWrapper 查询条件
* @return List<MallProductExcel>
*/
List<MallProductExcel> exportMallProduct(Wrapper<MallProductEntity> queryWrapper);
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.service.impl;
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
import org.springblade.modules.mall.pojo.vo.MallCategoryVO;
import org.springblade.modules.mall.excel.MallCategoryExcel;
import org.springblade.modules.mall.mapper.MallCategoryMapper;
import org.springblade.modules.mall.service.IMallCategoryService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 商品分类 服务实现类
*
* @author BladeX
* @since 2026-02-05
*/
@Service
public class MallCategoryServiceImpl extends BaseServiceImpl<MallCategoryMapper, MallCategoryEntity> implements IMallCategoryService {
@Override
public IPage<MallCategoryVO> selectMallCategoryPage(IPage<MallCategoryVO> page, MallCategoryVO mallCategory) {
return page.setRecords(baseMapper.selectMallCategoryPage(page, mallCategory));
}
@Override
public List<MallCategoryExcel> exportMallCategory(Wrapper<MallCategoryEntity> queryWrapper) {
List<MallCategoryExcel> mallCategoryList = baseMapper.exportMallCategory(queryWrapper);
//mallCategoryList.forEach(mallCategory -> {
// mallCategory.setTypeName(DictCache.getValue(DictEnum.YES_NO, MallCategory.getType()));
//});
return mallCategoryList;
}
}

View File

@@ -0,0 +1,63 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.service.impl;
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
import org.springblade.modules.mall.pojo.vo.MallProductVO;
import org.springblade.modules.mall.excel.MallProductExcel;
import org.springblade.modules.mall.mapper.MallProductMapper;
import org.springblade.modules.mall.service.IMallProductService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 商城商品 服务实现类
*
* @author BladeX
* @since 2026-02-05
*/
@Service
public class MallProductServiceImpl extends BaseServiceImpl<MallProductMapper, MallProductEntity> implements IMallProductService {
@Override
public IPage<MallProductVO> selectMallProductPage(IPage<MallProductVO> page, MallProductVO mallProduct) {
return page.setRecords(baseMapper.selectMallProductPage(page, mallProduct));
}
@Override
public List<MallProductExcel> exportMallProduct(Wrapper<MallProductEntity> queryWrapper) {
List<MallProductExcel> mallProductList = baseMapper.exportMallProduct(queryWrapper);
//mallProductList.forEach(mallProduct -> {
// mallProduct.setTypeName(DictCache.getValue(DictEnum.YES_NO, MallProduct.getType()));
//});
return mallProductList;
}
}

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.mall.pojo.entity.MallCategoryEntity;
import org.springblade.modules.mall.pojo.vo.MallCategoryVO;
import java.util.Objects;
/**
* 商品分类 包装类,返回视图层所需的字段
*
* @author BladeX
* @since 2026-02-05
*/
public class MallCategoryWrapper extends BaseEntityWrapper<MallCategoryEntity, MallCategoryVO> {
public static MallCategoryWrapper build() {
return new MallCategoryWrapper();
}
@Override
public MallCategoryVO entityVO(MallCategoryEntity mallCategory) {
MallCategoryVO mallCategoryVO = Objects.requireNonNull(BeanUtil.copyProperties(mallCategory, MallCategoryVO.class));
//User createUser = UserCache.getUser(mallCategory.getCreateUser());
//User updateUser = UserCache.getUser(mallCategory.getUpdateUser());
//mallCategoryVO.setCreateUserName(createUser.getName());
//mallCategoryVO.setUpdateUserName(updateUser.getName());
return mallCategoryVO;
}
}

View File

@@ -0,0 +1,59 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.modules.mall.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
import org.springblade.modules.mall.pojo.vo.MallProductVO;
import java.util.Objects;
/**
* 商城商品 包装类,返回视图层所需的字段
*
* @author BladeX
* @since 2026-02-05
*/
public class MallProductWrapper extends BaseEntityWrapper<MallProductEntity, MallProductVO> {
public static MallProductWrapper build() {
return new MallProductWrapper();
}
@Override
public MallProductVO entityVO(MallProductEntity mallProduct) {
MallProductVO mallProductVO = Objects.requireNonNull(BeanUtil.copyProperties(mallProduct, MallProductVO.class));
//User createUser = UserCache.getUser(mallProduct.getCreateUser());
//User updateUser = UserCache.getUser(mallProduct.getUpdateUser());
//mallProductVO.setCreateUserName(createUser.getName());
//mallProductVO.setUpdateUserName(updateUser.getName());
return mallProductVO;
}
}