品牌添加
parent
68d52854e5
commit
01489bcb0d
|
@ -2,18 +2,22 @@ package com.muyu.product.controller;
|
|||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
import com.muyu.product.domain.req.BrandInfoQueryReq;
|
||||
import com.muyu.product.domain.req.BrandInfoSaveReq;
|
||||
import com.muyu.product.service.BrandInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "品牌信息")
|
||||
|
@ -35,4 +39,37 @@ public class BrandInfoController extends BaseController {
|
|||
List<BrandInfo>list=brandInfoService.list(BrandInfo.queryBuild(brandInfoQueryReq));
|
||||
return isPage ? getDataTable(list) : Result.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出品牌信息列表")
|
||||
@RequiresPermissions("product:brand:export")
|
||||
@Log(title = "品牌信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BrandInfo brandInfo) {
|
||||
List<BrandInfo> list = brandInfoService.list(brandInfo);
|
||||
ExcelUtil<BrandInfo> util = new ExcelUtil<BrandInfo>(BrandInfo.class);
|
||||
util.exportExcel(response, list, "品牌信息数据");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取品牌信息详细信息")
|
||||
@RequiresPermissions("product:brand:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<BrandInfo> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(brandInfoService.getById(id));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*新增品牌信息
|
||||
* */
|
||||
@RequiresPermissions("product:brand:add")
|
||||
@Log(title = "品牌信息",businessType =BusinessType.INSERT )
|
||||
@PostMapping
|
||||
@ApiOperation("新增品牌信息")
|
||||
public Result<String> add(@RequestBody BrandInfoSaveReq brandInfoSaveReq){
|
||||
return toAjax(brandInfoService.save(BrandInfo.saveBuild(brandInfoSaveReq)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
/**
|
||||
* 属性与组中间Mapper接口
|
||||
*
|
||||
* */
|
||||
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
/*
|
||||
* 品牌商品中间Mapper接口
|
||||
* */
|
||||
public interface AsBrandProjectMapper extends BaseMapper<AsBrandProjectMapper> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsCategoryAttributeGroup;
|
||||
/*
|
||||
* 品类属性组中间Mapper接口
|
||||
* */
|
||||
public interface AsCategoryAttributeGroupMapper extends BaseMapper<AsCategoryAttributeGroup> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsCategoryAttribute;
|
||||
/*
|
||||
* 品类属性中间Mapper接口
|
||||
* */
|
||||
public interface AsCategoryAttributeMapper extends BaseMapper<AsCategoryAttribute> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsCategoryBrand;
|
||||
/*
|
||||
* 品类品牌中间Mapper接口
|
||||
* */
|
||||
public interface AsCategoryBrandMapper extends BaseMapper<AsCategoryBrand> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsProductAttributeInfo;
|
||||
/*
|
||||
* 商品属性Mapper接口
|
||||
* */
|
||||
public interface AsProductAttributeInfoMapper extends BaseMapper<AsProductAttributeInfo> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
|
||||
public interface AsAttributeGroupService extends IService<AsAttributeGroup> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.AsBrandProject;
|
||||
|
||||
public interface AsBrandProjectService extends IService<AsBrandProject> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.AsCategoryAttributeGroup;
|
||||
|
||||
public interface AsCategoryAttributeGroupService extends IService<AsCategoryAttributeGroup> {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
public interface AsCategoryBrandService {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
public interface AsProductAttributeInfoService {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.AsCategoryAttribute;
|
||||
|
||||
public interface AssCategoryAttributeService extends IService<AsCategoryAttribute> {
|
||||
}
|
|
@ -1,11 +1,14 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface BrandInfoService {
|
||||
public interface BrandInfoService extends IService<BrandInfo> {
|
||||
|
||||
List<BrandInfo> list(BrandInfo brandInfo);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
import com.muyu.product.mapper.AsAttributeGroupMapper;
|
||||
import com.muyu.product.service.AsAttributeGroupService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
/*
|
||||
* 属性与组中间Service业务层处理
|
||||
* */
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AsAttributeGroupServiceimpl extends ServiceImpl<AsAttributeGroupMapper, AsAttributeGroup>implements AsAttributeGroupService {
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.muyu.product.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.uuid.ObjUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
import com.muyu.product.mapper.BrandInfoMapper;
|
||||
import com.muyu.product.service.BrandInfoService;
|
||||
|
@ -10,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
@ -36,4 +38,18 @@ public class BrandInfoServiceimpl extends ServiceImpl<BrandInfoMapper, BrandInfo
|
|||
}
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean save(BrandInfo entity) {
|
||||
entity.setCreateBy(SecurityUtils.getUsername());
|
||||
entity.setCreateTime(new Date());
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateById(BrandInfo entity) {
|
||||
entity.setUpdateBy(SecurityUtils.getUsername());
|
||||
entity.setUpdateTime(new Date());
|
||||
return super.updateById(entity);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue