From 050e37afe98f65ce60ba728858ec399f2a3d8a0e Mon Sep 17 00:00:00 2001
From: zjf <1799650030@qq.com>
Date: Mon, 23 Dec 2024 19:10:34 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E6=88=B7=E4=BA=8C?=
=?UTF-8?q?=E7=BB=B4=E7=A0=81=E4=B8=8A=E4=BC=A0=EF=BC=8C=E6=96=B0=E5=A2=9E?=
=?UTF-8?q?=E5=93=81=E7=89=8C=EF=BC=8C=E8=BE=85=E5=8A=A9=E6=9D=A1=E7=A0=81?=
=?UTF-8?q?=EF=BC=8Cspu?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pjcloud-canteen/pjcloud-canteen-biz/pom.xml | 4 +-
.../controller/CanteenCategoryController.java | 6 +-
.../controller/MerchantInfoController.java | 64 +++-
.../canteen/entity/CanteenCategoryEntity.java | 12 +-
.../mapper/CanteenCategoryMapper.xml | 2 +-
pjcloud-common/pjcloud-common-core/pom.xml | 6 +
.../core/util/QRCodeImageGenerator.java | 62 ++++
.../SupermarketAuxiliaryCodeController.java | 122 +++++++
.../SupermarketBrandController.java | 121 +++++++
.../controller/SupermarketSpuController.java | 123 +++++++
.../SupermarketAuxiliaryCodeEntity.java | 85 +++++
.../entity/SupermarketBrandEntity.java | 103 ++++++
.../entity/SupermarketSpuEntity.java | 310 ++++++++++++++++++
.../SupermarketAuxiliaryCodeMapper.java | 11 +
.../mapper/SupermarketBrandMapper.java | 11 +
.../mapper/SupermarketSpuMapper.java | 11 +
.../SupermarketAuxiliaryCodeService.java | 8 +
.../service/SupermarketBrandService.java | 8 +
.../service/SupermarketSpuService.java | 8 +
.../SupermarketAuxiliaryCodeServiceImpl.java | 16 +
.../impl/SupermarketBrandServiceImpl.java | 16 +
.../impl/SupermarketSpuServiceImpl.java | 16 +
.../src/main/resources/application.yml | 2 +-
.../mapper/SupermarketAuxiliaryCodeMapper.xml | 17 +
.../mapper/SupermarketBrandMapper.xml | 20 ++
.../resources/mapper/SupermarketSpuMapper.xml | 54 +++
.../admin/api/feign/RemoteFileService.java | 12 +
.../service/impl/SysFileServiceImpl.java | 2 +-
.../service/impl/SysMessageServiceImpl.java | 1 +
.../src/main/resources/logback-spring.xml | 2 +-
seata/logs/seata_gc.log.0 | 8 +-
seata/logs/seata_gc.log.4 | 12 +-
32 files changed, 1216 insertions(+), 39 deletions(-)
create mode 100644 pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/util/QRCodeImageGenerator.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketAuxiliaryCodeController.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketBrandController.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketAuxiliaryCodeEntity.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketBrandEntity.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketSpuEntity.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketAuxiliaryCodeMapper.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketBrandMapper.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketSpuMapper.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketAuxiliaryCodeService.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketBrandService.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketAuxiliaryCodeServiceImpl.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketBrandServiceImpl.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketAuxiliaryCodeMapper.xml
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketBrandMapper.xml
create mode 100644 pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketSpuMapper.xml
diff --git a/pjcloud-canteen/pjcloud-canteen-biz/pom.xml b/pjcloud-canteen/pjcloud-canteen-biz/pom.xml
index 7191c226..0d79971c 100644
--- a/pjcloud-canteen/pjcloud-canteen-biz/pom.xml
+++ b/pjcloud-canteen/pjcloud-canteen-biz/pom.xml
@@ -13,7 +13,9 @@
pjcloud-canteen-biz
-
+
+
+
com.bsd
pjcloud-common-job
diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java
index 1bbb090e..aaa45697 100644
--- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java
+++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java
@@ -12,6 +12,7 @@ import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.common.security.util.SecurityUtils;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springdoc.core.annotations.ParameterObject;
@@ -124,15 +125,16 @@ public class CanteenCategoryController {
/**
* 查询所有的菜品分类
+ * @param categoryType 餐段类型,1早餐 2中 3晚餐 不传默认所有
* @return R
*/
@Operation(summary = "通过id查询" , description = "通过id查询" )
@GetMapping("/getAllSimple" )
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')" )
- public R getAllSimple(@RequestParam("systemType")Integer systemType) {
+ public R getAllSimple(@RequestParam(value = "categoryType",required = false)String categoryType) {
LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
- wrapper.eq(CanteenCategoryEntity::getSystemType,systemType);
wrapper.orderByAsc(CanteenCategoryEntity::getSort);
+ wrapper.eq(StringUtils.isNotEmpty(categoryType),CanteenCategoryEntity::getCategoryType,categoryType);
List list = canteenCategoryService.list(wrapper);
return R.ok(list);
}
diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/MerchantInfoController.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/MerchantInfoController.java
index 6dc28df2..a10a339b 100644
--- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/MerchantInfoController.java
+++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/MerchantInfoController.java
@@ -2,7 +2,6 @@ package com.bsd.pjcloud.canteen.controller;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.qrcode.QrCodeUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -10,15 +9,21 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bsd.pjcloud.admin.api.entity.SysDept;
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
+import com.bsd.pjcloud.admin.api.feign.RemoteFileService;
import com.bsd.pjcloud.canteen.vo.MerchantCollectMoneyCodeDto;
import com.bsd.pjcloud.canteen.vo.MerchantInfoVO;
+import com.bsd.pjcloud.common.core.util.QRCodeImageGenerator;
import com.bsd.pjcloud.common.core.util.R;
+import com.bsd.pjcloud.common.file.core.FileProperties;
import com.bsd.pjcloud.common.file.core.FileTemplate;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.canteen.entity.MerchantInfoEntity;
import com.bsd.pjcloud.canteen.service.MerchantInfoService;
+import feign.Response;
+import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.mock.web.MockMultipartFile;
import org.springframework.security.access.prepost.PreAuthorize;
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
@@ -28,6 +33,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.util.List;
@@ -52,9 +58,7 @@ public class MerchantInfoController {
private final RemoteDeptService remoteDeptService;
- @Autowired
- private FileTemplate template;
-
+ private final RemoteFileService remoteFileService;
/**
* 分页查询
* @param page 分页对象
@@ -117,25 +121,22 @@ public class MerchantInfoController {
// 生成二维码
MerchantCollectMoneyCodeDto merchantCollectMoneyCodeDto = new MerchantCollectMoneyCodeDto();
BeanUtils.copyProperties(merchantInfo, merchantCollectMoneyCodeDto);
- String collectMoneyCodeImg = this.generateMerchantCollectMoneyCode(merchantCollectMoneyCodeDto);
+ String fileName = "merchant_collect_money_code" + merchantCollectMoneyCodeDto.getId();
+ byte[] bytes = QRCodeImageGenerator.generateQrCodeImage(JSON.toJSONString(merchantCollectMoneyCodeDto), 1024);
+ // 使用字节流创建 MockMultipartFile
+ MultipartFile multipartFile = new MockMultipartFile("file", fileName+".png", "image/png", new ByteArrayInputStream(bytes));
+ R upload = remoteFileService.upload(multipartFile,null,null,null);
+ Map data = (Map) upload.getData();
+ String url = (String) data.get("url");
MerchantInfoEntity merchantInfoEntity = new MerchantInfoEntity();
- merchantInfoEntity.setCollectMoneyCode(collectMoneyCodeImg);
+ merchantInfoEntity.setCollectMoneyCode(url);
merchantInfoEntity.setId(merchantInfo.getId());
merchantInfoService.updateById(merchantInfoEntity);
-// /admin/sys-file/oss/file?fileName=76109ebb7ecb4a0ca3a58d7444eebe04.png
-
return R.ok();
}
- // 生成商户收款码
- private String generateMerchantCollectMoneyCode(MerchantCollectMoneyCodeDto dto) throws Exception {
- String fileName = "merchant_collect_money_code" + dto.getId();
- byte[] image = QrCodeUtil.generatePng(JSON.toJSONString(dto), 300, 300);
- ByteArrayInputStream inputStream = new ByteArrayInputStream(image);
- template.putObject("canteen",fileName + ".png", inputStream);
- return "/admin/sys-file/oss/file?fileName=76109ebb7ecb4a0ca3a58d7444eebe04.png";
- }
+
/**
* 修改商户管理
* @param merchantInfo 商户管理
@@ -145,7 +146,20 @@ public class MerchantInfoController {
@SysLog("修改商户管理" )
@PutMapping
@PreAuthorize("@pms.hasPermission('canteen_merchantInfo_edit')" )
- public R updateById(@RequestBody MerchantInfoEntity merchantInfo) {
+ public R updateById(@RequestBody MerchantInfoEntity merchantInfo) throws Exception {
+// String bucketName = properties.getBucketName();
+// // 生成二维码
+// MerchantCollectMoneyCodeDto merchantCollectMoneyCodeDto = new MerchantCollectMoneyCodeDto();
+// BeanUtils.copyProperties(merchantInfo, merchantCollectMoneyCodeDto);
+// String fileName = "merchant_collect_money_code" + merchantCollectMoneyCodeDto.getId();
+// byte[] bytes = QRCodeImageGenerator.generateQrCodeImage(JSON.toJSONString(merchantCollectMoneyCodeDto), 1024);
+// // 使用字节流创建 MockMultipartFile
+// MultipartFile multipartFile = new MockMultipartFile("file", fileName+".png", "image/png", new ByteArrayInputStream(bytes));
+//
+// R upload = remoteFileService.upload(multipartFile,null,null,null);
+// Map data = (Map) upload.getData();
+// String url = (String) data.get("url");
+// merchantInfo.setCollectMoneyCode(url);
return R.ok(merchantInfoService.updateById(merchantInfo));
}
@@ -187,4 +201,20 @@ public class MerchantInfoController {
List list=merchantInfoService.selectMerchantList(type);
return R.ok(list);
}
+
+
+// ---------------APP------------------------
+// @GetMapping("/page-join")
+// @Operation(summary = "获得商户管理分页连表")
+// public CommonResult> getManagePageJoin() {
+// PageResult pageResult = manageService.getManagePageJoin();
+// return success(pageResult);
+// }
+//
+// @GetMapping("/get")
+// @Operation(summary = "获得商户管理详情")
+// @Parameter(name = "id", description = "编号", required = true, example = "1024")
+// public CommonResult getManage(@RequestParam("id") Long id) {
+// return success(manageMapper.selectJoin(id));
+// }
}
\ No newline at end of file
diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/entity/CanteenCategoryEntity.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/entity/CanteenCategoryEntity.java
index 19b22316..c83c9f3b 100644
--- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/entity/CanteenCategoryEntity.java
+++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/entity/CanteenCategoryEntity.java
@@ -80,11 +80,7 @@ public class CanteenCategoryEntity extends Model {
@TableField(fill = FieldFill.INSERT)
@Schema(description = "是否删除 -1:已删除 0:正常")
private String delFlag;
- /**
- * 系统类型 1商品 2每日 3在线订餐
- */
- @Schema(description="系统类型 1商品 2每日 3在线订餐")
- private Integer systemType;
+
/**
* 部门id
@@ -111,4 +107,10 @@ public class CanteenCategoryEntity extends Model {
*/
@Schema(description="租户编号")
private Long tenantId;
+
+ /**
+ * 餐段类型
+ */
+ @Schema(description="餐段类型")
+ private String categoryType;
}
\ No newline at end of file
diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenCategoryMapper.xml b/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenCategoryMapper.xml
index 25a94fb9..5b15ed33 100644
--- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenCategoryMapper.xml
+++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenCategoryMapper.xml
@@ -13,10 +13,10 @@
-
+
\ No newline at end of file
diff --git a/pjcloud-common/pjcloud-common-core/pom.xml b/pjcloud-common/pjcloud-common-core/pom.xml
index aa4a2eb6..67355758 100644
--- a/pjcloud-common/pjcloud-common-core/pom.xml
+++ b/pjcloud-common/pjcloud-common-core/pom.xml
@@ -34,6 +34,12 @@
+
+
+ io.nayuki
+ qrcodegen
+ 1.8.0
+
cn.hutool
diff --git a/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/util/QRCodeImageGenerator.java b/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/util/QRCodeImageGenerator.java
new file mode 100644
index 00000000..af990307
--- /dev/null
+++ b/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/util/QRCodeImageGenerator.java
@@ -0,0 +1,62 @@
+package com.bsd.pjcloud.common.core.util;
+
+import io.nayuki.qrcodegen.QrCode;
+import io.nayuki.qrcodegen.QrCode.Ecc;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+
+public class QRCodeImageGenerator {
+
+ public static byte[] generateQrCodeImage(String content, int size) throws Exception {
+ // 生成二维码对象
+ QrCode qrCode = QrCode.encodeText(content, Ecc.MEDIUM);
+
+ // 创建BufferedImage
+ BufferedImage image = toBufferedImage(qrCode, size);
+
+ // 将图片写入字节数组输出流
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ ImageIO.write(image, "png", outputStream);
+
+ return outputStream.toByteArray();
+ }
+
+ private static BufferedImage toBufferedImage(QrCode qrCode, int size) {
+ int scale = size / qrCode.size; // 计算像素点的缩放比例
+ int border = 4; // 留白边框宽度(单位:像素)
+
+ int imageSize = (qrCode.size + border * 2) * scale;
+ BufferedImage image = new BufferedImage(imageSize, imageSize, BufferedImage.TYPE_INT_RGB);
+ Graphics2D g = image.createGraphics();
+
+ g.setColor(Color.WHITE); // 设置背景为白色
+ g.fillRect(0, 0, imageSize, imageSize);
+
+ g.setColor(Color.BLACK); // 设置二维码像素点为黑色
+ for (int y = 0; y < qrCode.size; y++) {
+ for (int x = 0; x < qrCode.size; x++) {
+ if (qrCode.getModule(x, y)) {
+ g.fillRect((x + border) * scale, (y + border) * scale, scale, scale);
+ }
+ }
+ }
+
+ g.dispose();
+ return image;
+ }
+
+ public static void main(String[] args) throws Exception {
+ String content = "Hello, QR Code!";
+ int size = 300;
+
+ // 生成二维码字节流
+ byte[] imageBytes = generateQrCodeImage(content, size);
+
+ System.out.println("QR Code image generated, size: " + imageBytes.length + " bytes.");
+ // 可以保存到文件验证
+ // Files.write(Path.of("qrcode.png"), imageBytes);
+ }
+}
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketAuxiliaryCodeController.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketAuxiliaryCodeController.java
new file mode 100644
index 00000000..9c6da36d
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketAuxiliaryCodeController.java
@@ -0,0 +1,122 @@
+package com.bsd.pjcloud.supermarket.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.bsd.pjcloud.common.core.util.R;
+import com.bsd.pjcloud.common.log.annotation.SysLog;
+import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
+import com.bsd.pjcloud.supermarket.service.SupermarketAuxiliaryCodeService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 商品辅助条码
+ *
+ * @author zjf
+ * @date 2024-12-23 10:15:43
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/supermarketAuxiliaryCode" )
+@Tag(description = "supermarketAuxiliaryCode" , name = "商品辅助条码管理" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class SupermarketAuxiliaryCodeController {
+
+ private final SupermarketAuxiliaryCodeService supermarketAuxiliaryCodeService;
+
+ /**
+ * 分页查询
+ * @param page 分页对象
+ * @param supermarketAuxiliaryCode 商品辅助条码
+ * @return
+ */
+ @Operation(summary = "分页查询" , description = "分页查询" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketAuxiliaryCode_view')" )
+ public R getSupermarketAuxiliaryCodePage(@ParameterObject Page page, @ParameterObject SupermarketAuxiliaryCodeEntity supermarketAuxiliaryCode) {
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(supermarketAuxiliaryCode.getBarCode()),SupermarketAuxiliaryCodeEntity::getBarCode,supermarketAuxiliaryCode.getBarCode());
+ wrapper.eq(Objects.nonNull(supermarketAuxiliaryCode.getSpuId()),SupermarketAuxiliaryCodeEntity::getSpuId,supermarketAuxiliaryCode.getSpuId());
+ return R.ok(supermarketAuxiliaryCodeService.page(page, wrapper));
+ }
+
+
+ /**
+ * 通过id查询商品辅助条码
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "通过id查询" , description = "通过id查询" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketAuxiliaryCode_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(supermarketAuxiliaryCodeService.getById(id));
+ }
+
+ /**
+ * 新增商品辅助条码
+ * @param supermarketAuxiliaryCode 商品辅助条码
+ * @return R
+ */
+ @Operation(summary = "新增商品辅助条码" , description = "新增商品辅助条码" )
+ @SysLog("新增商品辅助条码" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketAuxiliaryCode_add')" )
+ public R save(@RequestBody SupermarketAuxiliaryCodeEntity supermarketAuxiliaryCode) {
+ return R.ok(supermarketAuxiliaryCodeService.save(supermarketAuxiliaryCode));
+ }
+
+ /**
+ * 修改商品辅助条码
+ * @param supermarketAuxiliaryCode 商品辅助条码
+ * @return R
+ */
+ @Operation(summary = "修改商品辅助条码" , description = "修改商品辅助条码" )
+ @SysLog("修改商品辅助条码" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketAuxiliaryCode_edit')" )
+ public R updateById(@RequestBody SupermarketAuxiliaryCodeEntity supermarketAuxiliaryCode) {
+ return R.ok(supermarketAuxiliaryCodeService.updateById(supermarketAuxiliaryCode));
+ }
+
+ /**
+ * 通过id删除商品辅助条码
+ * @param ids id列表
+ * @return R
+ */
+ @Operation(summary = "通过id删除商品辅助条码" , description = "通过id删除商品辅助条码" )
+ @SysLog("通过id删除商品辅助条码" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketAuxiliaryCode_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(supermarketAuxiliaryCodeService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 导出excel 表格
+ * @param supermarketAuxiliaryCode 查询条件
+ * @param ids 导出指定ID
+ * @return excel 文件流
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketAuxiliaryCode_export')" )
+ public List export(SupermarketAuxiliaryCodeEntity supermarketAuxiliaryCode,Long[] ids) {
+ return supermarketAuxiliaryCodeService.list(Wrappers.lambdaQuery(supermarketAuxiliaryCode).in(ArrayUtil.isNotEmpty(ids), SupermarketAuxiliaryCodeEntity::getId, ids));
+ }
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketBrandController.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketBrandController.java
new file mode 100644
index 00000000..d1096523
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketBrandController.java
@@ -0,0 +1,121 @@
+package com.bsd.pjcloud.supermarket.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.bsd.pjcloud.common.core.util.R;
+import com.bsd.pjcloud.common.log.annotation.SysLog;
+import com.bsd.pjcloud.supermarket.entity.SupermarketBrandEntity;
+import com.bsd.pjcloud.supermarket.service.SupermarketBrandService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 超市品牌
+ *
+ * @author zjf
+ * @date 2024-12-23 10:10:22
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/supermarketBrand" )
+@Tag(description = "supermarketBrand" , name = "超市品牌管理" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class SupermarketBrandController {
+
+ private final SupermarketBrandService supermarketBrandService;
+
+ /**
+ * 分页查询
+ * @param page 分页对象
+ * @param supermarketBrand 超市品牌
+ * @return
+ */
+ @Operation(summary = "分页查询" , description = "分页查询" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketBrand_view')" )
+ public R getSupermarketBrandPage(@ParameterObject Page page, @ParameterObject SupermarketBrandEntity supermarketBrand) {
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.like(StrUtil.isNotBlank(supermarketBrand.getName()),SupermarketBrandEntity::getName,supermarketBrand.getName());
+ return R.ok(supermarketBrandService.page(page, wrapper));
+ }
+
+
+ /**
+ * 通过id查询超市品牌
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "通过id查询" , description = "通过id查询" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketBrand_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(supermarketBrandService.getById(id));
+ }
+
+ /**
+ * 新增超市品牌
+ * @param supermarketBrand 超市品牌
+ * @return R
+ */
+ @Operation(summary = "新增超市品牌" , description = "新增超市品牌" )
+ @SysLog("新增超市品牌" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketBrand_add')" )
+ public R save(@RequestBody SupermarketBrandEntity supermarketBrand) {
+ return R.ok(supermarketBrandService.save(supermarketBrand));
+ }
+
+ /**
+ * 修改超市品牌
+ * @param supermarketBrand 超市品牌
+ * @return R
+ */
+ @Operation(summary = "修改超市品牌" , description = "修改超市品牌" )
+ @SysLog("修改超市品牌" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketBrand_edit')" )
+ public R updateById(@RequestBody SupermarketBrandEntity supermarketBrand) {
+ return R.ok(supermarketBrandService.updateById(supermarketBrand));
+ }
+
+ /**
+ * 通过id删除超市品牌
+ * @param ids id列表
+ * @return R
+ */
+ @Operation(summary = "通过id删除超市品牌" , description = "通过id删除超市品牌" )
+ @SysLog("通过id删除超市品牌" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketBrand_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(supermarketBrandService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 导出excel 表格
+ * @param supermarketBrand 查询条件
+ * @param ids 导出指定ID
+ * @return excel 文件流
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketBrand_export')" )
+ public List export(SupermarketBrandEntity supermarketBrand,Long[] ids) {
+ return supermarketBrandService.list(Wrappers.lambdaQuery(supermarketBrand).in(ArrayUtil.isNotEmpty(ids), SupermarketBrandEntity::getId, ids));
+ }
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java
new file mode 100644
index 00000000..6e7695e4
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java
@@ -0,0 +1,123 @@
+package com.bsd.pjcloud.supermarket.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.bsd.pjcloud.common.core.util.R;
+import com.bsd.pjcloud.common.log.annotation.SysLog;
+import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
+import com.bsd.pjcloud.supermarket.service.SupermarketSpuService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import org.springdoc.core.annotations.ParameterObject;
+import org.springframework.http.HttpHeaders;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 商品spu
+ *
+ * @author zjf
+ * @date 2024-12-23 10:42:43
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/supermarketSpu" )
+@Tag(description = "supermarketSpu" , name = "商品spu管理" )
+@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
+public class SupermarketSpuController {
+
+ private final SupermarketSpuService supermarketSpuService;
+
+ /**
+ * 分页查询
+ * @param page 分页对象
+ * @param supermarketSpu 商品spu
+ * @return
+ */
+ @Operation(summary = "分页查询" , description = "分页查询" )
+ @GetMapping("/page" )
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_view')" )
+ public R getSupermarketSpuPage(@ParameterObject Page page, @ParameterObject SupermarketSpuEntity supermarketSpu) {
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(StrUtil.isNotBlank(supermarketSpu.getProductCode()),SupermarketSpuEntity::getProductCode,supermarketSpu.getProductCode());
+ wrapper.eq(StrUtil.isNotBlank(supermarketSpu.getBarcode()),SupermarketSpuEntity::getBarcode,supermarketSpu.getBarcode());
+ wrapper.eq(StrUtil.isNotBlank(supermarketSpu.getProductName()),SupermarketSpuEntity::getProductName,supermarketSpu.getProductName());
+ return R.ok(supermarketSpuService.page(page, wrapper));
+ }
+
+
+ /**
+ * 通过id查询商品spu
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "通过id查询" , description = "通过id查询" )
+ @GetMapping("/{id}" )
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_view')" )
+ public R getById(@PathVariable("id" ) Long id) {
+ return R.ok(supermarketSpuService.getById(id));
+ }
+
+ /**
+ * 新增商品spu
+ * @param supermarketSpu 商品spu
+ * @return R
+ */
+ @Operation(summary = "新增商品spu" , description = "新增商品spu" )
+ @SysLog("新增商品spu" )
+ @PostMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_add')" )
+ public R save(@RequestBody SupermarketSpuEntity supermarketSpu) {
+ return R.ok(supermarketSpuService.save(supermarketSpu));
+ }
+
+ /**
+ * 修改商品spu
+ * @param supermarketSpu 商品spu
+ * @return R
+ */
+ @Operation(summary = "修改商品spu" , description = "修改商品spu" )
+ @SysLog("修改商品spu" )
+ @PutMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_edit')" )
+ public R updateById(@RequestBody SupermarketSpuEntity supermarketSpu) {
+ return R.ok(supermarketSpuService.updateById(supermarketSpu));
+ }
+
+ /**
+ * 通过id删除商品spu
+ * @param ids id列表
+ * @return R
+ */
+ @Operation(summary = "通过id删除商品spu" , description = "通过id删除商品spu" )
+ @SysLog("通过id删除商品spu" )
+ @DeleteMapping
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_del')" )
+ public R removeById(@RequestBody Long[] ids) {
+ return R.ok(supermarketSpuService.removeBatchByIds(CollUtil.toList(ids)));
+ }
+
+
+ /**
+ * 导出excel 表格
+ * @param supermarketSpu 查询条件
+ * @param ids 导出指定ID
+ * @return excel 文件流
+ */
+ @ResponseExcel
+ @GetMapping("/export")
+ @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_export')" )
+ public List export(SupermarketSpuEntity supermarketSpu,Long[] ids) {
+ return supermarketSpuService.list(Wrappers.lambdaQuery(supermarketSpu).in(ArrayUtil.isNotEmpty(ids), SupermarketSpuEntity::getId, ids));
+ }
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketAuxiliaryCodeEntity.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketAuxiliaryCodeEntity.java
new file mode 100644
index 00000000..7f64f7c3
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketAuxiliaryCodeEntity.java
@@ -0,0 +1,85 @@
+package com.bsd.pjcloud.supermarket.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import com.bsd.pjcloud.common.core.util.TenantTable;
+import java.time.LocalDateTime;
+
+/**
+ * 商品辅助条码
+ *
+ * @author zjf
+ * @date 2024-12-23 10:15:43
+ */
+@Data
+@TenantTable
+@TableName("supermarket_auxiliary_code")
+@EqualsAndHashCode(callSuper = true)
+@Schema(description = "商品辅助条码")
+public class SupermarketAuxiliaryCodeEntity extends Model {
+
+
+ /**
+ * 辅助条码id
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ @Schema(description="辅助条码id")
+ private Long id;
+
+ /**
+ * 条码
+ */
+ @Schema(description="条码")
+ private String barCode;
+
+ /**
+ * spuID
+ */
+ @Schema(description="spuID")
+ private Long spuId;
+
+ /**
+ * 创建者
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="创建者")
+ private String createBy;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="创建时间")
+ private LocalDateTime createTime;
+
+ /**
+ * 更新者
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @Schema(description="更新者")
+ private String updateBy;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @Schema(description="更新时间")
+ private LocalDateTime updateTime;
+
+ /**
+ * 是否删除
+ */
+ @TableLogic
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="是否删除")
+ private String delFlag;
+
+ /**
+ * 租户编号
+ */
+ @Schema(description="租户编号")
+ private Long tenantId;
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketBrandEntity.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketBrandEntity.java
new file mode 100644
index 00000000..d112f346
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketBrandEntity.java
@@ -0,0 +1,103 @@
+package com.bsd.pjcloud.supermarket.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import com.bsd.pjcloud.common.core.util.TenantTable;
+import java.time.LocalDateTime;
+
+/**
+ * 超市品牌
+ *
+ * @author zjf
+ * @date 2024-12-23 10:10:22
+ */
+@Data
+@TenantTable
+@TableName("supermarket_brand")
+@EqualsAndHashCode(callSuper = true)
+@Schema(description = "超市品牌")
+public class SupermarketBrandEntity extends Model {
+
+
+ /**
+ * 品牌编号
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ @Schema(description="品牌编号")
+ private Long id;
+
+ /**
+ * 品牌名称
+ */
+ @Schema(description="品牌名称")
+ private String name;
+
+ /**
+ * 品牌图片
+ */
+ @Schema(description="品牌图片")
+ private String picUrl;
+
+ /**
+ * 品牌排序
+ */
+ @Schema(description="品牌排序")
+ private Integer sort;
+
+ /**
+ * 品牌描述
+ */
+ @Schema(description="品牌描述")
+ private String description;
+
+ /**
+ * 状态
+ */
+ @Schema(description="状态")
+ private String status;
+
+ /**
+ * 创建者
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="创建者")
+ private String createBy;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="创建时间")
+ private LocalDateTime createTime;
+
+ /**
+ * 更新者
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @Schema(description="更新者")
+ private String updateBy;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @Schema(description="更新时间")
+ private LocalDateTime updateTime;
+
+ /**
+ * 是否删除
+ */
+ @TableLogic
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="是否删除")
+ private String delFlag;
+
+ /**
+ * 租户编号
+ */
+ @Schema(description="租户编号")
+ private Long tenantId;
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketSpuEntity.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketSpuEntity.java
new file mode 100644
index 00000000..3b140cec
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/entity/SupermarketSpuEntity.java
@@ -0,0 +1,310 @@
+package com.bsd.pjcloud.supermarket.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import com.bsd.pjcloud.common.core.util.TenantTable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 商品spu
+ *
+ * @author zjf
+ * @date 2024-12-23 10:42:43
+ */
+@Data
+@TenantTable
+@TableName("supermarket_spu")
+@EqualsAndHashCode(callSuper = true)
+@Schema(description = "商品spu")
+public class SupermarketSpuEntity extends Model {
+
+
+ /**
+ * 商品 SPU 编号,自增
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ @Schema(description="商品 SPU 编号,自增")
+ private Long id;
+
+ /**
+ * 货号
+ */
+ @Schema(description="货号")
+ private String productCode;
+
+ /**
+ * 自编码/条码
+ */
+ @Schema(description="自编码/条码")
+ private String barcode;
+
+ /**
+ * 商品名称
+ */
+ @Schema(description="商品名称")
+ private String productName;
+
+ /**
+ * 单位
+ */
+ @Schema(description="单位")
+ private String unit;
+
+ /**
+ * 商品简介
+ */
+ @Schema(description="商品简介")
+ private String introduction;
+
+ /**
+ * 商品详情
+ */
+ @Schema(description="商品详情")
+ private String description;
+
+ /**
+ * 商品分类编号
+ */
+ @Schema(description="商品分类编号")
+ private Long categoryId;
+
+ /**
+ * 商品封面图
+ */
+ @Schema(description="商品封面图")
+ private String picUrl;
+
+ /**
+ * 商品轮播图地址
+ 数组,以逗号分隔
+ 最多上传15张
+ */
+ @Schema(description="商品轮播图地址")
+ private String sliderPicUrls;
+
+ /**
+ * 排序字段
+ */
+ @Schema(description="排序字段")
+ private Integer sort;
+
+ /**
+ * 商品状态: 1 上架(开启) 0 下架(禁用) -1 回收
+ */
+ @Schema(description="商品状态: 1 上架(开启) 0 下架(禁用) -1 回收")
+ private String status;
+
+ /**
+ * 成本单价,单位: 分
+ */
+ @Schema(description="成本单价,单位: 分")
+ private Integer costPrice;
+
+ /**
+ * 库存
+ */
+ @Schema(description="库存")
+ private Integer stock;
+
+ /**
+ * 赠送积分
+ */
+ @Schema(description="赠送积分")
+ private Integer giveIntegral;
+
+ /**
+ * 商户编号
+ */
+ @Schema(description="商户编号")
+ private Long merchantId;
+
+ /**
+ * 部门id
+ */
+ @Schema(description="部门id")
+ private Long deptId;
+
+ /**
+ * 规格
+ */
+ @Schema(description="规格")
+ private String specification;
+
+ /**
+ * 产地
+ */
+ @Schema(description="产地")
+ private String origin;
+
+ /**
+ * 装数
+ */
+ @Schema(description="装数")
+ private Integer packingQuantity;
+
+ /**
+ * 进价(分为单位)
+ */
+ @Schema(description="进价(分为单位)")
+ private Integer purchasePrice;
+
+ /**
+ * 零售价(分为单位)
+ */
+ @Schema(description="零售价(分为单位)")
+ private Integer retailPrice;
+
+ /**
+ * 会员价1(分为单位)
+ */
+ @Schema(description="会员价1(分为单位)")
+ private Integer memberPrice1;
+
+ /**
+ * 会员价2(分为单位)
+ */
+ @Schema(description="会员价2(分为单位)")
+ private Integer memberPrice2;
+
+ /**
+ * 会员价3(分为单位)
+ */
+ @Schema(description="会员价3(分为单位)")
+ private Integer memberPrice3;
+
+ /**
+ * 批发价1(分为单位)
+ */
+ @Schema(description="批发价1(分为单位)")
+ private Integer wholesalePrice1;
+
+ /**
+ * 批发价2(分为单位)
+ */
+ @Schema(description="批发价2(分为单位)")
+ private Integer wholesalePrice2;
+
+ /**
+ * 批发价3(分为单位)
+ */
+ @Schema(description="批发价3(分为单位)")
+ private Integer wholesalePrice3;
+
+ /**
+ * 促销价(分为单位)
+ */
+ @Schema(description="促销价(分为单位)")
+ private Integer promotionPrice;
+
+ /**
+ * 商品性质(字典)
+ */
+ @Schema(description="商品性质(字典)")
+ private String productNature;
+
+ /**
+ * 签名上锁
+ */
+ @Schema(description="签名上锁")
+ private String archiverSignature;
+
+ /**
+ * 区管理库存
+ */
+ @Schema(description="区管理库存")
+ private String inventoryArea;
+
+ /**
+ * 比例提成
+ */
+ @Schema(description="比例提成")
+ private BigDecimal commissionRate;
+
+ /**
+ * 联营扣率
+ */
+ @Schema(description="联营扣率")
+ private BigDecimal jointDeductionRate;
+
+ /**
+ * 库存上限
+ */
+ @Schema(description="库存上限")
+ private Integer inventoryUpperLimit;
+
+ /**
+ * 库存下限
+ */
+ @Schema(description="库存下限")
+ private Integer inventoryLowerLimit;
+
+ /**
+ * 毛利率
+ */
+ @Schema(description="毛利率")
+ private BigDecimal grossMargin;
+
+ /**
+ * 辅助条码id
+ */
+ @Schema(description="辅助条码id")
+ private String auxiliaryBarcodeId;
+
+ /**
+ * 品牌id
+ */
+ @Schema(description="品牌id")
+ private Long brandId;
+
+ /**
+ * 货商id
+ */
+ @Schema(description="货商id")
+ private Long supplierId;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="创建人")
+ private String createBy;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="创建时间")
+ private LocalDateTime createTime;
+
+ /**
+ * 更新人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @Schema(description="更新人")
+ private String updateBy;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @Schema(description="更新时间")
+ private LocalDateTime updateTime;
+
+ /**
+ * 是否删除
+ */
+ @TableLogic
+ @TableField(fill = FieldFill.INSERT)
+ @Schema(description="是否删除")
+ private String delFlag;
+
+ /**
+ * 租户编号
+ */
+ @Schema(description="租户编号")
+ private Long tenantId;
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketAuxiliaryCodeMapper.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketAuxiliaryCodeMapper.java
new file mode 100644
index 00000000..e3078e50
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketAuxiliaryCodeMapper.java
@@ -0,0 +1,11 @@
+package com.bsd.pjcloud.supermarket.mapper;
+
+import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
+import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SupermarketAuxiliaryCodeMapper extends PjcloudBaseMapper {
+
+
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketBrandMapper.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketBrandMapper.java
new file mode 100644
index 00000000..adb9821c
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketBrandMapper.java
@@ -0,0 +1,11 @@
+package com.bsd.pjcloud.supermarket.mapper;
+
+import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
+import com.bsd.pjcloud.supermarket.entity.SupermarketBrandEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SupermarketBrandMapper extends PjcloudBaseMapper {
+
+
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketSpuMapper.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketSpuMapper.java
new file mode 100644
index 00000000..cdb01825
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/mapper/SupermarketSpuMapper.java
@@ -0,0 +1,11 @@
+package com.bsd.pjcloud.supermarket.mapper;
+
+import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
+import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SupermarketSpuMapper extends PjcloudBaseMapper {
+
+
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketAuxiliaryCodeService.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketAuxiliaryCodeService.java
new file mode 100644
index 00000000..91f24fec
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketAuxiliaryCodeService.java
@@ -0,0 +1,8 @@
+package com.bsd.pjcloud.supermarket.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
+
+public interface SupermarketAuxiliaryCodeService extends IService {
+
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketBrandService.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketBrandService.java
new file mode 100644
index 00000000..c63b8c17
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketBrandService.java
@@ -0,0 +1,8 @@
+package com.bsd.pjcloud.supermarket.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.bsd.pjcloud.supermarket.entity.SupermarketBrandEntity;
+
+public interface SupermarketBrandService extends IService {
+
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java
new file mode 100644
index 00000000..3b4a3a0d
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java
@@ -0,0 +1,8 @@
+package com.bsd.pjcloud.supermarket.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
+
+public interface SupermarketSpuService extends IService {
+
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketAuxiliaryCodeServiceImpl.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketAuxiliaryCodeServiceImpl.java
new file mode 100644
index 00000000..55615371
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketAuxiliaryCodeServiceImpl.java
@@ -0,0 +1,16 @@
+package com.bsd.pjcloud.supermarket.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity;
+import com.bsd.pjcloud.supermarket.mapper.SupermarketAuxiliaryCodeMapper;
+import com.bsd.pjcloud.supermarket.service.SupermarketAuxiliaryCodeService;
+import org.springframework.stereotype.Service;
+/**
+ * 商品辅助条码
+ *
+ * @author zjf
+ * @date 2024-12-23 10:15:43
+ */
+@Service
+public class SupermarketAuxiliaryCodeServiceImpl extends ServiceImpl implements SupermarketAuxiliaryCodeService {
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketBrandServiceImpl.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketBrandServiceImpl.java
new file mode 100644
index 00000000..25d328a1
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketBrandServiceImpl.java
@@ -0,0 +1,16 @@
+package com.bsd.pjcloud.supermarket.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.bsd.pjcloud.supermarket.entity.SupermarketBrandEntity;
+import com.bsd.pjcloud.supermarket.mapper.SupermarketBrandMapper;
+import com.bsd.pjcloud.supermarket.service.SupermarketBrandService;
+import org.springframework.stereotype.Service;
+/**
+ * 超市品牌
+ *
+ * @author zjf
+ * @date 2024-12-23 10:10:22
+ */
+@Service
+public class SupermarketBrandServiceImpl extends ServiceImpl implements SupermarketBrandService {
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java
new file mode 100644
index 00000000..7f11749c
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java
@@ -0,0 +1,16 @@
+package com.bsd.pjcloud.supermarket.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity;
+import com.bsd.pjcloud.supermarket.mapper.SupermarketSpuMapper;
+import com.bsd.pjcloud.supermarket.service.SupermarketSpuService;
+import org.springframework.stereotype.Service;
+/**
+ * 商品spu
+ *
+ * @author zjf
+ * @date 2024-12-23 10:42:43
+ */
+@Service
+public class SupermarketSpuServiceImpl extends ServiceImpl implements SupermarketSpuService {
+}
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/application.yml b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/application.yml
index dda8f7e9..baae3156 100644
--- a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/application.yml
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
- port: 6060
+ port: 6062
spring:
application:
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketAuxiliaryCodeMapper.xml b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketAuxiliaryCodeMapper.xml
new file mode 100644
index 00000000..85a313f3
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketAuxiliaryCodeMapper.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketBrandMapper.xml b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketBrandMapper.xml
new file mode 100644
index 00000000..9d2709fa
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketBrandMapper.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketSpuMapper.xml b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketSpuMapper.xml
new file mode 100644
index 00000000..675c8c4d
--- /dev/null
+++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/resources/mapper/SupermarketSpuMapper.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteFileService.java b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteFileService.java
index b166f67f..d1ad1d1d 100644
--- a/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteFileService.java
+++ b/pjcloud-upms/pjcloud-upms-api/src/main/java/com/bsd/pjcloud/admin/api/feign/RemoteFileService.java
@@ -1,10 +1,15 @@
package com.bsd.pjcloud.admin.api.feign;
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
+import com.bsd.pjcloud.common.core.util.R;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.multipart.MultipartFile;
/**
* 文件读取
@@ -17,4 +22,11 @@ public interface RemoteFileService {
@GetMapping("/sys-file/oss/file")
Response getFile(@RequestParam String fileName);
+
+
+ @PostMapping(value = "/sys-file/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+ R upload(@RequestPart("file") MultipartFile file,
+ @RequestParam(value = "dir", required = false) String dir,
+ @RequestParam(value = "groupId", required = false) Long groupId,
+ @RequestParam(value = "type", required = false) String type);
}
diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysFileServiceImpl.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysFileServiceImpl.java
index 18df3f4b..8c706cec 100644
--- a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysFileServiceImpl.java
+++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysFileServiceImpl.java
@@ -87,7 +87,6 @@ public class SysFileServiceImpl extends ServiceImpl impl
resultMap.put("fileName", fileName);
resultMap.put("url", String.format("/admin/sys-file/oss/file?fileName=%s", fileName));
-
try (InputStream inputStream = file.getInputStream()) {
fileTemplate.putObject(properties.getBucketName(), dir, fileName, inputStream, file.getContentType());
// 文件管理数据记录,收集管理追踪文件
@@ -96,6 +95,7 @@ public class SysFileServiceImpl extends ServiceImpl impl
log.error("上传失败", e);
return R.failed(e.getLocalizedMessage());
}
+
return R.ok(resultMap);
}
diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysMessageServiceImpl.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysMessageServiceImpl.java
index b9ce5e11..29dcf944 100644
--- a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysMessageServiceImpl.java
+++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/SysMessageServiceImpl.java
@@ -8,6 +8,7 @@ import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;
+import cn.hutool.extra.qrcode.QrCodeUtil;
import cn.hutool.extra.template.Template;
import cn.hutool.extra.template.TemplateConfig;
import cn.hutool.extra.template.TemplateEngine;
diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/resources/logback-spring.xml b/pjcloud-upms/pjcloud-upms-biz/src/main/resources/logback-spring.xml
index 435b2160..9a84839f 100644
--- a/pjcloud-upms/pjcloud-upms-biz/src/main/resources/logback-spring.xml
+++ b/pjcloud-upms/pjcloud-upms-biz/src/main/resources/logback-spring.xml
@@ -26,7 +26,7 @@
-
+
${log.path}/debug.log
${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz
diff --git a/seata/logs/seata_gc.log.0 b/seata/logs/seata_gc.log.0
index e6734b3a..43060bec 100644
--- a/seata/logs/seata_gc.log.0
+++ b/seata/logs/seata_gc.log.0
@@ -1,4 +1,4 @@
-[0.013s][info][gc] Using G1
-[1.613s][info][gc] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 102M->12M(2048M) 6.797ms
-[2.469s][info][gc] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 103M->16M(2048M) 5.423ms
-[3.061s][info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 125M->18M(2048M) 3.776ms
+[0.016s][info][gc] Using G1
+[1.841s][info][gc] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 102M->12M(2048M) 5.965ms
+[5.293s][info][gc] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 103M->16M(2048M) 5.465ms
+[5.899s][info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 125M->19M(2048M) 3.037ms
diff --git a/seata/logs/seata_gc.log.4 b/seata/logs/seata_gc.log.4
index 2528bde1..5e9f530c 100644
--- a/seata/logs/seata_gc.log.4
+++ b/seata/logs/seata_gc.log.4
@@ -1,6 +1,6 @@
-[0.013s][info][gc] Using G1
-[1.389s][info][gc] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 102M->13M(2048M) 5.780ms
-[2.397s][info][gc] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 104M->16M(2048M) 6.254ms
-[2.942s][info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 125M->19M(2048M) 4.206ms
-[7402.241s][info][gc] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 398M->28M(2048M) 252.226ms
-[14703.441s][info][gc] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 163M->29M(2048M) 13.963ms
+[0.020s][info][gc] Using G1
+[2.040s][info][gc] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 102M->12M(2048M) 7.226ms
+[3.557s][info][gc] GC(1) Pause Young (Normal) (G1 Evacuation Pause) 103M->16M(2048M) 6.736ms
+[4.546s][info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 124M->19M(2048M) 4.293ms
+[11048.308s][info][gc] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 469M->28M(2048M) 85.613ms
+[29256.227s][info][gc] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 367M->27M(2048M) 56.145ms