品牌添加

dev798
wxy 2024-03-12 14:40:05 +08:00
parent 68d52854e5
commit 01489bcb0d
16 changed files with 165 additions and 4 deletions

View File

@ -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)));
}
}

View File

@ -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> {
}

View File

@ -0,0 +1,8 @@
package com.muyu.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/*
* Mapper
* */
public interface AsBrandProjectMapper extends BaseMapper<AsBrandProjectMapper> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -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> {
}

View File

@ -0,0 +1,4 @@
package com.muyu.product.service;
public interface AsCategoryBrandService {
}

View File

@ -0,0 +1,4 @@
package com.muyu.product.service;
public interface AsProductAttributeInfoService {
}

View File

@ -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> {
}

View File

@ -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);
}

View File

@ -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 {
}

View File

@ -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);
}
}