修改商户二维码上传,新增品牌,辅助条码,spu
This commit is contained in:
1 parent
9b2f155f5a
commit
050e37afe9
32 files changed
+1216
-39
No files matched your search
@@ -13,7 +13,9 @@
|
||||
<artifactId>pjcloud-canteen-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- 分布式任务-->
|
||||
|
||||
|
||||
<!-- 分布式任务-->
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-job</artifactId>
|
||||
|
||||
+4
-2
@@ -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<CanteenCategoryEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(CanteenCategoryEntity::getSystemType,systemType);
|
||||
wrapper.orderByAsc(CanteenCategoryEntity::getSort);
|
||||
wrapper.eq(StringUtils.isNotEmpty(categoryType),CanteenCategoryEntity::getCategoryType,categoryType);
|
||||
List<CanteenCategoryEntity> list = canteenCategoryService.list(wrapper);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
+47
-17
@@ -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<MerchantInfoVO> list=merchantInfoService.selectMerchantList(type);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
// ---------------APP------------------------
|
||||
// @GetMapping("/page-join")
|
||||
// @Operation(summary = "获得商户管理分页连表")
|
||||
// public CommonResult<PageResult<ManageRespVO>> getManagePageJoin() {
|
||||
// PageResult<ManageRespVO> pageResult = manageService.getManagePageJoin();
|
||||
// return success(pageResult);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/get")
|
||||
// @Operation(summary = "获得商户管理详情")
|
||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// public CommonResult<ManageRespVO> getManage(@RequestParam("id") Long id) {
|
||||
// return success(manageMapper.selectJoin(id));
|
||||
// }
|
||||
}
|
||||
+7
-5
@@ -80,11 +80,7 @@ public class CanteenCategoryEntity extends Model<CanteenCategoryEntity> {
|
||||
@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<CanteenCategoryEntity> {
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 餐段类型
|
||||
*/
|
||||
@Schema(description="餐段类型")
|
||||
private String categoryType;
|
||||
}
|
||||
+1
-1
@@ -13,10 +13,10 @@
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="systemType" column="system_type"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="categoryType" column="category_type"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -34,6 +34,12 @@
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!-- QRCode Generator 是一个轻量级的二维码生成库,依赖少,适配性强。-->
|
||||
<dependency>
|
||||
<groupId>io.nayuki</groupId>
|
||||
<artifactId>qrcodegen</artifactId>
|
||||
<version>1.8.0</version>
|
||||
</dependency>
|
||||
<!--hutool-->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
|
||||
+62
@@ -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);
|
||||
}
|
||||
}
|
||||
+122
@@ -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<SupermarketAuxiliaryCodeEntity> 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<SupermarketAuxiliaryCodeEntity> export(SupermarketAuxiliaryCodeEntity supermarketAuxiliaryCode,Long[] ids) {
|
||||
return supermarketAuxiliaryCodeService.list(Wrappers.lambdaQuery(supermarketAuxiliaryCode).in(ArrayUtil.isNotEmpty(ids), SupermarketAuxiliaryCodeEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+121
@@ -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<SupermarketBrandEntity> 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<SupermarketBrandEntity> export(SupermarketBrandEntity supermarketBrand,Long[] ids) {
|
||||
return supermarketBrandService.list(Wrappers.lambdaQuery(supermarketBrand).in(ArrayUtil.isNotEmpty(ids), SupermarketBrandEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+123
@@ -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<SupermarketSpuEntity> 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<SupermarketSpuEntity> export(SupermarketSpuEntity supermarketSpu,Long[] ids) {
|
||||
return supermarketSpuService.list(Wrappers.lambdaQuery(supermarketSpu).in(ArrayUtil.isNotEmpty(ids), SupermarketSpuEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+85
@@ -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<SupermarketAuxiliaryCodeEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 辅助条码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;
|
||||
}
|
||||
+103
@@ -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<SupermarketBrandEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 品牌编号
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+310
@@ -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<SupermarketSpuEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 商品 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;
|
||||
}
|
||||
+11
@@ -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<SupermarketAuxiliaryCodeEntity> {
|
||||
|
||||
|
||||
}
|
||||
+11
@@ -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<SupermarketBrandEntity> {
|
||||
|
||||
|
||||
}
|
||||
+11
@@ -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<SupermarketSpuEntity> {
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -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<SupermarketAuxiliaryCodeEntity> {
|
||||
|
||||
}
|
||||
+8
@@ -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<SupermarketBrandEntity> {
|
||||
|
||||
}
|
||||
+8
@@ -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<SupermarketSpuEntity> {
|
||||
|
||||
}
|
||||
+16
@@ -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<SupermarketAuxiliaryCodeMapper, SupermarketAuxiliaryCodeEntity> implements SupermarketAuxiliaryCodeService {
|
||||
}
|
||||
+16
@@ -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<SupermarketBrandMapper, SupermarketBrandEntity> implements SupermarketBrandService {
|
||||
}
|
||||
+16
@@ -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<SupermarketSpuMapper, SupermarketSpuEntity> implements SupermarketSpuService {
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 6060
|
||||
port: 6062
|
||||
|
||||
spring:
|
||||
application:
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?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="com.bsd.pjcloud.supermarket.mapper.SupermarketAuxiliaryCodeMapper">
|
||||
|
||||
<resultMap id="supermarketAuxiliaryCodeMap" type="com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="barCode" column="bar_code"/>
|
||||
<result property="spuId" column="spu_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?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="com.bsd.pjcloud.supermarket.mapper.SupermarketBrandMapper">
|
||||
|
||||
<resultMap id="supermarketBrandMap" type="com.bsd.pjcloud.supermarket.entity.SupermarketBrandEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="picUrl" column="pic_url"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?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="com.bsd.pjcloud.supermarket.mapper.SupermarketSpuMapper">
|
||||
|
||||
<resultMap id="supermarketSpuMap" type="com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="productCode" column="product_code"/>
|
||||
<result property="barcode" column="barcode"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="introduction" column="introduction"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="picUrl" column="pic_url"/>
|
||||
<result property="sliderPicUrls" column="slider_pic_urls"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="costPrice" column="cost_price"/>
|
||||
<result property="stock" column="stock"/>
|
||||
<result property="giveIntegral" column="give_integral"/>
|
||||
<result property="merchantId" column="merchant_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="specification" column="specification"/>
|
||||
<result property="origin" column="origin"/>
|
||||
<result property="packingQuantity" column="packing_quantity"/>
|
||||
<result property="purchasePrice" column="purchase_price"/>
|
||||
<result property="retailPrice" column="retail_price"/>
|
||||
<result property="memberPrice1" column="member_price1"/>
|
||||
<result property="memberPrice2" column="member_price2"/>
|
||||
<result property="memberPrice3" column="member_price3"/>
|
||||
<result property="wholesalePrice1" column="wholesale_price1"/>
|
||||
<result property="wholesalePrice2" column="wholesale_price2"/>
|
||||
<result property="wholesalePrice3" column="wholesale_price3"/>
|
||||
<result property="promotionPrice" column="promotion_price"/>
|
||||
<result property="productNature" column="product_nature"/>
|
||||
<result property="archiverSignature" column="archiver_signature"/>
|
||||
<result property="inventoryArea" column="inventory_area"/>
|
||||
<result property="commissionRate" column="commission_rate"/>
|
||||
<result property="jointDeductionRate" column="joint_deduction_rate"/>
|
||||
<result property="inventoryUpperLimit" column="inventory_upper_limit"/>
|
||||
<result property="inventoryLowerLimit" column="inventory_lower_limit"/>
|
||||
<result property="grossMargin" column="gross_margin"/>
|
||||
<result property="auxiliaryBarcodeId" column="auxiliary_barcode_id"/>
|
||||
<result property="brandId" column="brand_id"/>
|
||||
<result property="supplierId" column="supplier_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+12
@@ -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);
|
||||
}
|
||||
+1
-1
@@ -87,7 +87,6 @@ public class SysFileServiceImpl extends ServiceImpl<SysFileMapper, SysFile> 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<SysFileMapper, SysFile> impl
|
||||
log.error("上传失败", e);
|
||||
return R.failed(e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
return R.ok(resultMap);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -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;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</appender>
|
||||
|
||||
<!-- Log file debug output -->
|
||||
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user