diff --git a/hiver-admin/src/main/resources/application.yml b/hiver-admin/src/main/resources/application.yml index 766361e3..41083a4f 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 @@ -338,6 +338,7 @@ ignored: # # 临时增加 - /hiver/app/purchase/getPurchaseListOfSupplier - /hiver/app/purchase/cancelPurchase + - /hiver/shopRelations/addShopRelations # 限流及黑名单不拦截的路径 limitUrls: - /**/*.js diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java index ec328414..357104a3 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchaseocr/mapper/PurchaseOcrPictureMapper.java @@ -12,7 +12,7 @@ public interface PurchaseOcrPictureMapper extends BaseMapper void batchUpdate(@Param("purchaseOcrPictureList") List purchaseOcrPictureAddList); - List queryAllPictureStatus(@Param("purchaseId")String purchaseId); + List queryAllPictureStatus(@Param("purchaseId") String purchaseId); List getOcrCount(String shopId); } 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 index 7e8fa75f..d328c414 100644 --- 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 @@ -4,14 +4,19 @@ import cc.hiver.core.common.utils.ResultUtil; import cc.hiver.core.common.vo.Result; import cc.hiver.mall.shoprelations.entity.ShopRelations; import cc.hiver.mall.shoprelations.service.ShopRelationsService; +import cc.hiver.mall.shoprelations.vo.ShopRelationsVo; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 店铺关联 * @@ -29,7 +34,16 @@ public class ShopRelationsController { @Autowired private ShopRelationsService shopRelationsService; - // 新增店铺关联信息 + /** + * 新增店铺关联信息 + * + * @param shopRelations + * @return Result + * @author 王富康 + * @date 2024/8/4 + */ + @RequestMapping(value = "/addShopRelations", method = RequestMethod.POST) + @ApiOperation("新增店铺关联信息") public Result addShopRelations(ShopRelations shopRelations) { if (StringUtils.isEmpty(shopRelations.getRelatedShopId())) { @@ -47,5 +61,27 @@ public class ShopRelationsController { } } - // 根据店铺id获取关联的店铺信息 + /** + * 根据店铺id获取关联的店铺信息 + * + * @param shopId + * @return Result + * @author 王富康 + * @date 2024/8/4 + */ + @RequestMapping(value = "/getShopRelations", method = RequestMethod.POST) + @ApiOperation("根据店铺id获取关联的店铺信息") + public Result getShopRelations(String shopId) { + + if (StringUtils.isEmpty(shopId)) { + return ResultUtil.error("店铺id不能为空"); + } + try { + List shopRelationsVoList = shopRelationsService.getShopRelations(shopId); + return new ResultUtil>().setData(shopRelationsVoList); + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResultUtil.error("获取店铺关联信息失败"); + } + } } 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 index 5cf95e46..0d09d2ff 100644 --- 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 @@ -1,7 +1,12 @@ package cc.hiver.mall.shoprelations.mapper; import cc.hiver.mall.shoprelations.entity.ShopRelations; +import cc.hiver.mall.shoprelations.vo.ShopRelationsVo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; public interface ShopRelationsMapper extends BaseMapper { + List getShopRelations(@Param("shopId") String shopId); } 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 index b5d8ee1b..bfe0e0d8 100644 --- 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 @@ -1,7 +1,12 @@ package cc.hiver.mall.shoprelations.service; import cc.hiver.mall.shoprelations.entity.ShopRelations; +import cc.hiver.mall.shoprelations.vo.ShopRelationsVo; + +import java.util.List; public interface ShopRelationsService { void addShopRelations(ShopRelations shopRelations); + + List getShopRelations(String shopId); } 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 index b8012f85..b29fbbc9 100644 --- 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 @@ -3,9 +3,12 @@ package cc.hiver.mall.shoprelations.service.impl; import cc.hiver.mall.shoprelations.entity.ShopRelations; import cc.hiver.mall.shoprelations.mapper.ShopRelationsMapper; import cc.hiver.mall.shoprelations.service.ShopRelationsService; +import cc.hiver.mall.shoprelations.vo.ShopRelationsVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class ShopRelationsServiceImpl implements ShopRelationsService { @@ -16,4 +19,9 @@ public class ShopRelationsServiceImpl implements ShopRelationsService { public void addShopRelations(ShopRelations shopRelations) { shopRelationsMapper.insert(shopRelations); } + + @Override + public List getShopRelations(String shopId) { + return shopRelationsMapper.getShopRelations(shopId); + } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/vo/ShopRelationsVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/vo/ShopRelationsVo.java new file mode 100644 index 00000000..569d54df --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/shoprelations/vo/ShopRelationsVo.java @@ -0,0 +1,16 @@ +package cc.hiver.mall.shoprelations.vo; + +import io.swagger.annotations.ApiModelProperty; + +public class ShopRelationsVo { + + @ApiModelProperty(value = "关联id") + private String id; + + @ApiModelProperty(value = "关联店铺名称") + private String shopName; + + @ApiModelProperty(value = "被关联店铺id") + private String shopId; + +}