|
|
@@ -8,7 +8,9 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
|
+import shop.alien.entity.store.StoreInfo;
|
|
|
import shop.alien.entity.store.StorePrice;
|
|
|
+import shop.alien.mapper.StoreInfoMapper;
|
|
|
import shop.alien.store.service.StorePriceService;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -30,6 +32,8 @@ public class StorePriceController {
|
|
|
|
|
|
private final StorePriceService storePriceService;
|
|
|
|
|
|
+ private final StoreInfoMapper storeInfoMapper;
|
|
|
+
|
|
|
@ApiOperation("新增通用价目")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@PostMapping("/save")
|
|
|
@@ -80,8 +84,14 @@ public class StorePriceController {
|
|
|
log.info("StorePriceController.getById?id={}", id);
|
|
|
StorePrice storePrice = storePriceService.getById(id);
|
|
|
if (storePrice != null) {
|
|
|
- List<StorePrice> storePrices = storePriceService.list(new LambdaQueryWrapper<StorePrice>().eq(StorePrice :: getStroeId, storePrice.getStroeId()));
|
|
|
+ List<StorePrice> storePrices = storePriceService.list(new LambdaQueryWrapper<StorePrice>().eq(StorePrice :: getStoreId, storePrice.getStoreId()));
|
|
|
storePrice.setStorePriceList(storePrices);
|
|
|
+ //查询门店 获取 门店电话和门店名称
|
|
|
+ StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo :: getId, storePrice.getStoreId()));
|
|
|
+ if(storeInfo != null){
|
|
|
+ storePrice.setStorePhone(storeInfo.getStoreTel());
|
|
|
+ storePrice.setStoreName(storeInfo.getStoreName());
|
|
|
+ }
|
|
|
return R.data(storePrice);
|
|
|
}
|
|
|
return R.fail("查询失败");
|
|
|
@@ -117,7 +127,7 @@ public class StorePriceController {
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
|
|
|
@ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
|
|
|
- @ApiImplicitParam(name = "stroeId", value = "商户id", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "storeId", value = "商户id", dataType = "Integer", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "name", value = "名字", dataType = "String", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "status", value = "状态:0-待审核 1-审核通过 2-审核拒绝", dataType = "Integer", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "shelfStatus", value = "上下架状态:1-上架,2-下架", dataType = "Integer", paramType = "query")
|
|
|
@@ -126,16 +136,16 @@ public class StorePriceController {
|
|
|
public R<IPage<StorePrice>> getPage(
|
|
|
@RequestParam(defaultValue = "1") int pageNum,
|
|
|
@RequestParam(defaultValue = "10") int pageSize,
|
|
|
- @RequestParam(required = false) Integer stroeId,
|
|
|
+ @RequestParam(required = false) Integer storeId,
|
|
|
@RequestParam(required = false) String name,
|
|
|
@RequestParam(required = false) Integer status,
|
|
|
@RequestParam(required = false) Integer shelfStatus) {
|
|
|
- log.info("StorePriceController.getPage?pageNum={},pageSize={},stroeId={},name={},status={},shelfStatus={}",
|
|
|
- pageNum, pageSize, stroeId, name, status, shelfStatus);
|
|
|
+ log.info("StorePriceController.getPage?pageNum={},pageSize={},storeId={},name={},status={},shelfStatus={}",
|
|
|
+ pageNum, pageSize, storeId, name, status, shelfStatus);
|
|
|
Page<StorePrice> page = new Page<>(pageNum, pageSize);
|
|
|
LambdaQueryWrapper<StorePrice> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if (stroeId != null) {
|
|
|
- queryWrapper.eq(StorePrice::getStroeId, stroeId);
|
|
|
+ if (storeId != null) {
|
|
|
+ queryWrapper.eq(StorePrice::getStoreId, storeId);
|
|
|
}
|
|
|
if (name != null && !name.isEmpty()) {
|
|
|
queryWrapper.like(StorePrice::getName, name);
|
|
|
@@ -154,19 +164,19 @@ public class StorePriceController {
|
|
|
@ApiOperation("查询所有通用价目")
|
|
|
@ApiOperationSupport(order = 7)
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "stroeId", value = "商户id", dataType = "Integer", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "storeId", value = "商户id", dataType = "Integer", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "status", value = "状态:0-待审核 1-审核通过 2-审核拒绝", dataType = "Integer", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "shelfStatus", value = "上下架状态:1-上架,2-下架", dataType = "Integer", paramType = "query")
|
|
|
})
|
|
|
@GetMapping("/list")
|
|
|
public R<List<StorePrice>> list(
|
|
|
- @RequestParam(required = false) Integer stroeId,
|
|
|
+ @RequestParam(required = false) Integer storeId,
|
|
|
@RequestParam(required = false) Integer status,
|
|
|
@RequestParam(required = false) Integer shelfStatus) {
|
|
|
- log.info("StorePriceController.list?stroeId={},status={},shelfStatus={}", stroeId, status, shelfStatus);
|
|
|
+ log.info("StorePriceController.list?storeId={},status={},shelfStatus={}", storeId, status, shelfStatus);
|
|
|
LambdaQueryWrapper<StorePrice> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if (stroeId != null) {
|
|
|
- queryWrapper.eq(StorePrice::getStroeId, stroeId);
|
|
|
+ if (storeId != null) {
|
|
|
+ queryWrapper.eq(StorePrice::getStoreId, storeId);
|
|
|
}
|
|
|
if (status != null) {
|
|
|
queryWrapper.eq(StorePrice::getStatus, status);
|