From 9ba6f6fa222e9ae8a1bd695d0ca285554dd46b57 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Sat, 3 Aug 2024 18:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 8 +- hiver-modules/hiver-mall/pom.xml | 11 ++ .../hiver/mall/controller/ShopController.java | 89 +++++++++++++--- .../controller/ShopRelationsController.java | 4 + .../shoprelations/entity/ShopRelations.java | 4 + .../mapper/ShopRelationsMapper.java | 4 + .../service/ShopRelationsService.java | 4 + .../impl/ShopRelationsServiceImpl.java | 4 + .../java/cc/hiver/mall/utils/QRCodeUtils.java | 100 ++++++++++++++++++ .../warehouse/constant/WarehouseConstant.java | 6 +- .../mall/warehouse/entity/Warehouse.java | 3 + .../mall/warehouse/entity/WarehouseShop.java | 3 + .../warehouse/mapper/WarehouseMappper.java | 6 +- .../service/impl/WarehouseServiceImpl.java | 8 +- .../impl/WarehouseShopServiceImpl.java | 2 +- .../resources/mapper/WarehouseMappper.xml | 10 +- .../resources/mapper/WarehouseShopMappper.xml | 12 +-- 17 files changed, 243 insertions(+), 35 deletions(-) create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/controller/ShopRelationsController.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/entity/ShopRelations.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/mapper/ShopRelationsMapper.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/ShopRelationsService.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/impl/ShopRelationsServiceImpl.java create mode 100644 hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/QRCodeUtils.java diff --git a/hiver-admin/src/main/resources/application.yml b/hiver-admin/src/main/resources/application.yml index dde87d6f..b423c524 100644 --- a/hiver-admin/src/main/resources/application.yml +++ b/hiver-admin/src/main/resources/application.yml @@ -25,8 +25,8 @@ spring: timeout-per-shutdown-phase: 10S # 数据源 datasource: -# url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true - url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true + url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true +# url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true username: reddoor # Jasypt加密 可到common-utils中找到JasyptUtil加解密工具类生成加密结果 格式为ENC(加密结果) 以下解密结果为123456 password: ENC(Zla4U4+yRLPhicvuX2TmiEgxEpzP4dk8BHzFDEtiEhwLQIIaftZrrEUJZce6efoe) @@ -67,8 +67,8 @@ spring: ddl-auto: update # Redis 若设有密码自行添加配置password redis: -# host: 154.8.162.157 - host: 8.140.198.243 + host: 154.8.162.157 +# host: 8.140.198.243 password: reddoor168 # 数据库索引 默认0 database: 1 diff --git a/hiver-modules/hiver-mall/pom.xml b/hiver-modules/hiver-mall/pom.xml index 4fff5c97..302a9dbd 100644 --- a/hiver-modules/hiver-mall/pom.xml +++ b/hiver-modules/hiver-mall/pom.xml @@ -28,6 +28,17 @@ + + + com.google.zxing + core + 3.4.1 + + + com.google.zxing + javase + 3.4.1 + \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java index b6245094..0625e8be 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ShopController.java @@ -35,6 +35,11 @@ import cc.hiver.mall.pojo.vo.QueryShopRevenueVO; import cc.hiver.mall.service.ShopAreaService; import cc.hiver.mall.service.ShopService; import cc.hiver.mall.service.ShopUserService; +import cc.hiver.mall.warehouse.constant.WarehouseConstant; +import cc.hiver.mall.warehouse.entity.Warehouse; +import cc.hiver.mall.warehouse.entity.WarehouseShop; +import cc.hiver.mall.warehouse.service.WarehouseService; +import cc.hiver.mall.warehouse.service.WarehouseShopService; import cn.hutool.core.text.CharSequenceUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -42,6 +47,7 @@ import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; @@ -76,6 +82,12 @@ public class ShopController { @Autowired private InviteLogService inviteLogService; + @Autowired + private WarehouseService warehouseService; + + @Autowired + private WarehouseShopService warehouseShopService; + @RequestMapping(value = "/getAll", method = RequestMethod.GET) @ApiOperation("获取全部数据") public Result> getAll() { @@ -206,11 +218,54 @@ public class ShopController { @RequestMapping(value = "/enable", method = RequestMethod.POST) @ApiOperation("启用店铺") + @Transactional public Result enable(@RequestParam String id) { - final Shop shop = shopService.get(id); - shop.setStatus(ShopConstant.SHOP_STATUS_NORMAL); - shopService.update(shop); - return ResultUtil.success("操作成功"); + if(StringUtils.isEmpty(id)){ + return ResultUtil.error("id不能为空"); + } + try{ + final Shop shop = shopService.get(id); + shop.setStatus(ShopConstant.SHOP_STATUS_NORMAL); + shopService.update(shop); + // 20240803启用店铺,增加默认仓库。 + // 根据店铺的ownerId查,有没有仓库,没有直接给一个“默认仓库” + if (StringUtils.isNotEmpty(shop.getShopOwnerId())) { + // 获取店主信息 + final User loadUser = securityUtil.getCurrUser(); + final User owner = userService.findById(shop.getShopOwnerId()); + final List warehouses = warehouseService.getWarehouseByShopOwnerId(shop.getShopOwnerId()); + if (warehouses.isEmpty()) { + final Warehouse warehouse = new Warehouse(); + warehouse.setCreateBy(loadUser.getId()); + warehouse.setCreateByName(loadUser.getNickname()); + warehouse.setShopOwnerId(shop.getShopOwnerId()); + warehouse.setShopOwnerName(owner.getNickname()); + warehouse.setWarehouseName("默认仓库"); + // 默认为共用 + warehouse.setWarehouseStatus(WarehouseConstant.WAREHOUSE_STATUS[0]); + // 默认为启用 + warehouse.setIsUse(WarehouseConstant.IS_USE[0]); + warehouse.setSort(0); + warehouseService.addWarehouse(warehouse); + // 增加店铺与仓库的关联关系 + final WarehouseShop warehouseShop = new WarehouseShop(); + warehouseShop.setCreateBy(loadUser.getId()); + warehouseShop.setCreateByName(loadUser.getNickname()); + warehouseShop.setShopOwnerId(shop.getShopOwnerId()); + warehouseShop.setShopOwnerName(owner.getNickname()); + warehouseShop.setShopId(shop.getId()); + warehouseShop.setShopName(shop.getShopName()); + warehouseShop.setWarehouseId(warehouse.getId()); + warehouseShop.setWarehouseName(warehouse.getWarehouseName()); + warehouseShopService.addWarehouseShop(warehouseShop); + } + } + + return ResultUtil.success("操作成功"); + }catch (Exception e){ + log.error(e.getMessage(),e); + return ResultUtil.error("启用失败"); + } } @RequestMapping(value = "/disable", method = RequestMethod.POST) @@ -254,48 +309,50 @@ public class ShopController { @RequestMapping(value = "/getShopRebateBalance", method = RequestMethod.POST) @ApiOperation("获取返佣余额及累计返佣") - public Result getShopRebateBalance(){ - final Map shopRebateBalance = shopService.getShopRebateBalance(); + public Result getShopRebateBalance() { + final Map shopRebateBalance = shopService.getShopRebateBalance(); return ResultUtil.data(shopRebateBalance); } /** * 根据店铺id获取店铺信息 - * @author 王富康 - * @date 2024/7/27 + * * @param id * @return Result + * @author 王富康 + * @date 2024/7/27 */ @RequestMapping(value = "/getShopInfoById", method = RequestMethod.POST) @ApiOperation("根据店铺id获取店铺信息") - public Result getShopInfoById(String id){ - if(StringUtils.isEmpty(id)){ + public Result getShopInfoById(String id) { + if (StringUtils.isEmpty(id)) { return ResultUtil.error("店铺id不能为空"); } - final Shop shop = shopService.findById(id); + final Shop shop = shopService.findById(id); return ResultUtil.data(shop); } /** * 更新店铺图标及备注 - * @author 王富康 - * @date 2024/7/27 + * * @param shop * @return Result + * @author 王富康 + * @date 2024/7/27 */ @RequestMapping(value = "/updateShopIconAndRemark", method = RequestMethod.POST) @ApiOperation("更新店铺图标及备注") public Result updateShopIconAndRemark(@RequestBody Shop shop) { final String id = shop.getId(); - if(StringUtils.isEmpty(id)){ + if (StringUtils.isEmpty(id)) { return ResultUtil.error("店铺id不能为空"); } final Shop oldShop = shopService.get(id); // 20240803 不更新店铺图标,可更新店铺地址 - if(shop.getShopAddress() != null){ + if (shop.getShopAddress() != null) { oldShop.setShopAddress(shop.getShopAddress()); } - if(shop.getRemark() != null){ + if (shop.getRemark() != null) { oldShop.setRemark(shop.getRemark()); } shopService.update(oldShop); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/controller/ShopRelationsController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/controller/ShopRelationsController.java new file mode 100644 index 00000000..da2c8f3e --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/controller/ShopRelationsController.java @@ -0,0 +1,4 @@ +package cc.hiver.mall.shoprelations.controller; + +public class ShopRelationsController { +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/entity/ShopRelations.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/entity/ShopRelations.java new file mode 100644 index 00000000..f00a1221 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/entity/ShopRelations.java @@ -0,0 +1,4 @@ +package cc.hiver.mall.shoprelations.entity; + +public class ShopRelations { +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/mapper/ShopRelationsMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/mapper/ShopRelationsMapper.java new file mode 100644 index 00000000..cf99f477 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/mapper/ShopRelationsMapper.java @@ -0,0 +1,4 @@ +package cc.hiver.mall.shoprelations.mapper; + +public interface ShopRelationsMapper { +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/ShopRelationsService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/ShopRelationsService.java new file mode 100644 index 00000000..43c35a1b --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/ShopRelationsService.java @@ -0,0 +1,4 @@ +package cc.hiver.mall.shoprelations.service; + +public class ShopRelationsService { +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/impl/ShopRelationsServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/impl/ShopRelationsServiceImpl.java new file mode 100644 index 00000000..74918df2 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/service/impl/ShopRelationsServiceImpl.java @@ -0,0 +1,4 @@ +package cc.hiver.mall.shoprelations.service.impl; + +public class ShopRelationsServiceImpl { +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/QRCodeUtils.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/QRCodeUtils.java new file mode 100644 index 00000000..9cca5f79 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/utils/QRCodeUtils.java @@ -0,0 +1,100 @@ +package cc.hiver.mall.utils; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import lombok.extern.slf4j.Slf4j; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; + +@Slf4j +public class QRCodeUtils { + + public static void main(String[] args) { + //type是1,生成活动详情、报名的二维码,type是2,生成活动签到的二维码 + String content = "https://u.wechat.com/EOykWgVw3wwnB_JIawG96wY?1111111111112323232323231111112123132132111"; + //获取一个二维码图片 + try { + BitMatrix bitMatrix = createCode(content); + BufferedImage qrImage = MatrixToImageWriter.toBufferedImage(bitMatrix); + + // 调整图像大小 + BufferedImage resizedQrImage = new BufferedImage(250, 250, BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = resizedQrImage.createGraphics(); + g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); + g2d.drawImage(qrImage, 0, 0, 250, 250, null); + g2d.dispose(); + + Path path = FileSystems.getDefault().getPath("测试"); + ImageIO.write(resizedQrImage, "png", path.toFile()); + }catch (Exception e){ + log.error("生成二维码失败",e); + } + + } + + /** + * 生成二维码 + * @param content 二维码的内容 + * @return BitMatrix对象 + * */ + public static BitMatrix createCode(String content) throws IOException { + //二维码的宽高 + int width = 200; + int height = 200; + + //其他参数,如字符集编码 + Map hints = new HashMap(); + hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); + //容错级别为H + hints.put(EncodeHintType.ERROR_CORRECTION , ErrorCorrectionLevel.H); + //白边的宽度,可取0~4 + hints.put(EncodeHintType.MARGIN , 0); + + BitMatrix bitMatrix = null; + try { + //生成矩阵,因为我的业务场景传来的是编码之后的URL,所以先解码 + bitMatrix = new MultiFormatWriter().encode(content, + BarcodeFormat.QR_CODE, width, height, hints); + + //bitMatrix = deleteWhite(bitMatrix); + } catch (WriterException e) { + e.printStackTrace(); + } + + return bitMatrix; + } + + /** + * 删除生成的二维码周围的白边,根据审美决定是否删除 + * @param matrix BitMatrix对象 + * @return BitMatrix对象 + * */ + private static BitMatrix deleteWhite(BitMatrix matrix) { + int[] rec = matrix.getEnclosingRectangle(); + int resWidth = rec[2] + 1; + int resHeight = rec[3] + 1; + + BitMatrix resMatrix = new BitMatrix(resWidth, resHeight); + resMatrix.clear(); + for (int i = 0; i < resWidth; i++) { + for (int j = 0; j < resHeight; j++) { + if (matrix.get(i + rec[0], j + rec[1])) { + resMatrix.set(i, j); + } + } + } + return resMatrix; + } +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/constant/WarehouseConstant.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/constant/WarehouseConstant.java index 5d79178e..873c9587 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/constant/WarehouseConstant.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/constant/WarehouseConstant.java @@ -6,15 +6,15 @@ package cc.hiver.mall.warehouse.constant; * @author 王富康 * @date 2024/8/3 */ -public class WarehouseConstant { +public interface WarehouseConstant { /** * 是否启用:0:是;1:否 */ - String[] IS_USE = {"0","1"}; + int[] IS_USE = {0,1}; /** * 店铺状态:0:共用;1:按需分配 */ - String[] WAREHOUSE_STATUS = {"0","1"}; + int[] WAREHOUSE_STATUS = {0,0}; } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/Warehouse.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/Warehouse.java index f59df6ec..6efa654b 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/Warehouse.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/Warehouse.java @@ -11,6 +11,9 @@ import lombok.Data; @TableName(value = "t_warehouse", autoResultMap = true) public class Warehouse extends HiverBaseEntity { + @ApiModelProperty(value = "创建人名称") + private String createByName; + @ApiModelProperty(value = "仓库名称") private String warehouseName; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/WarehouseShop.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/WarehouseShop.java index 29ff3134..198afb4b 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/WarehouseShop.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/entity/WarehouseShop.java @@ -11,6 +11,9 @@ import lombok.Data; @TableName(value = "t_warehouse_shop", autoResultMap = true) public class WarehouseShop extends HiverBaseEntity { + @ApiModelProperty(value = "创建人名称") + private String createByName; + @ApiModelProperty(value = "店主id") private String shopOwnerId; diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/mapper/WarehouseMappper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/mapper/WarehouseMappper.java index f0658cf8..f0d4754e 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/mapper/WarehouseMappper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/mapper/WarehouseMappper.java @@ -7,11 +7,13 @@ import org.apache.ibatis.annotations.Param; import java.util.List; public interface WarehouseMappper extends BaseMapper { - Warehouse addWarehouse(@Param("warehouse") Warehouse warehouse); + int addWarehouse(@Param("warehouse") Warehouse warehouse); - Warehouse updateWarehouse(@Param("warehouse") Warehouse warehouse); + int updateWarehouse(@Param("warehouse") Warehouse warehouse); int deleteWarehouse(@Param("id") String id); List getWarehouseByShopOwnerId(@Param("shopOwnerId") String shopOwnerId); + + Warehouse getWarehouseById(@Param("id") String id); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseServiceImpl.java index cd6ef9e8..5bbf3884 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseServiceImpl.java @@ -16,12 +16,16 @@ public class WarehouseServiceImpl implements WarehouseService { @Override public Warehouse addWarehouse(Warehouse warehouse) { - return warehouseMappper.addWarehouse(warehouse); + final String id = warehouse.getId(); + warehouseMappper.insert(warehouse); + return warehouseMappper.getWarehouseById(id); } @Override public Warehouse updateWarehouse(Warehouse warehouse) { - return warehouseMappper.updateWarehouse(warehouse); + final String id = warehouse.getId(); + warehouseMappper.updateById(warehouse); + return warehouseMappper.getWarehouseById(id); } @Override diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseShopServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseShopServiceImpl.java index 124dece9..f5857be6 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseShopServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/warehouse/service/impl/WarehouseShopServiceImpl.java @@ -16,7 +16,7 @@ public class WarehouseShopServiceImpl implements WarehouseShopService { @Override public void addWarehouseShop(WarehouseShop warehouseShop) { - warehouseShopMapper.addWarehouseShop(warehouseShop); + warehouseShopMapper.insert(warehouseShop); } @Override diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseMappper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseMappper.xml index adc0c790..590afb5d 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseMappper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseMappper.xml @@ -32,7 +32,7 @@ values (#{warehouse.id,jdbcType=VARCHAR}, #{warehouse.createBy,jdbcType=VARCHAR},#{warehouse.createByName,jdbcType=VARCHAR}, #{warehouse.createTime,jdbcType=TIMESTAMP}, #{warehouse.delFlag,jdbcType=INTEGER}, #{warehouse.updateBy,jdbcType=VARCHAR}, #{warehouse.updateTime,jdbcType=TIMESTAMP}, #{warehouse.warehouseName,jdbcType=VARCHAR}, #{warehouse.warehouseAddress,jdbcType=VARCHAR}, - #{warehouse.warehouseStatus,jdbcType=INTEGER}, #{warehouse.isUse,jdbcType=INTEGER}, #{warehouse.shopOwnerId,jdbcType}, + #{warehouse.warehouseStatus,jdbcType=INTEGER}, #{warehouse.isUse,jdbcType=INTEGER}, #{warehouse.shopOwnerId,jdbcType=VARCHAR}, #{warehouse.shopOwnerName,jdbcType=VARCHAR}, #{warehouse.remark,jdbcType=VARCHAR}, #{warehouse.sort,jdbcType=INTEGER}) @@ -74,4 +74,12 @@ from t_warehouse where shop_owner_id = #{shopOwnerId} + + + \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseShopMappper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseShopMappper.xml index 42e418e0..a692afbf 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseShopMappper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/WarehouseShopMappper.xml @@ -1,6 +1,6 @@ - + @@ -34,11 +34,11 @@ insert into t_warehouse_shop (id, create_by, create_by_name, create_time, del_flag, update_by, update_time, shop_owner_id, shop_owner_name, warehouse_id, warehouse_name, warehouse_address, shop_id, shop_name, remark) - values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},#{createByName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, - #{shopOwnerId,jdbcType=VARCHAR}, #{shopOwnerName,jdbcType=VARCHAR}, #{warehouseId,jdbcType=VARCHAR}, - #{warehouseName,jdbcType=VARCHAR}, #{warehouseAddress,jdbcType=VARCHAR}, - #{shopId,jdbcType=VARCHAR}, #{shopName,jdbcType=VARCHAR}, #{remark,jdbc}) + values (#{warehouseShop.id,jdbcType=VARCHAR}, #{warehouseShop.createBy,jdbcType=VARCHAR},#{warehouseShop.createByName,jdbcType=VARCHAR}, + #{warehouseShop.createTime,jdbcType=TIMESTAMP}, #{warehouseShop.delFlag,jdbcType=INTEGER}, #{warehouseShop.updateBy,jdbcType=VARCHAR}, + #{warehouseShop.updateTime,jdbcType=TIMESTAMP},#{warehouseShop.shopOwnerId,jdbcType=VARCHAR}, #{warehouseShop.shopOwnerName,jdbcType=VARCHAR}, + #{warehouseShop.warehouseId,jdbcType=VARCHAR}, #{warehouseShop.warehouseName,jdbcType=VARCHAR}, #{warehouseShop.warehouseAddress,jdbcType=VARCHAR}, + #{warehouseShop.shopId,jdbcType=VARCHAR}, #{warehouseShop.shopName,jdbcType=VARCHAR}, #{warehouseShop.remark,jdbcType=VARCHAR})