zhouhaibin
6 months ago
86 changed files with 5911 additions and 0 deletions
@ -0,0 +1,75 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<parent> |
|||
<groupId>tech.abc</groupId> |
|||
<artifactId>abc-development-platform</artifactId> |
|||
<version>5.1.0</version> |
|||
</parent> |
|||
|
|||
<artifactId>platform-boot-started-productManagement</artifactId> |
|||
<version>5.1.0</version> |
|||
<name>platform-boot-started-productManagement</name> |
|||
<description>产品管理模块</description> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>tech.abc</groupId> |
|||
<artifactId>platform-common</artifactId> |
|||
</dependency> |
|||
|
|||
|
|||
</dependencies> |
|||
|
|||
<build> |
|||
<plugins> |
|||
<!--编译插件 --> |
|||
<plugin> |
|||
<groupId>org.apache.maven.plugins</groupId> |
|||
<artifactId>maven-compiler-plugin</artifactId> |
|||
<version>3.8.1</version> |
|||
<configuration> |
|||
<!--指定JDK编译版本 --> |
|||
<source>1.8</source> |
|||
<target>1.8</target> |
|||
<encoding>UTF-8</encoding> |
|||
</configuration> |
|||
</plugin> |
|||
<!-- 测试插件 --> |
|||
<plugin> |
|||
<groupId>org.apache.maven.plugins</groupId> |
|||
<artifactId>maven-surefire-plugin</artifactId> |
|||
<version>2.22.2</version> |
|||
<configuration> |
|||
<!-- 跳过测试 --> |
|||
<skipTests>true</skipTests> |
|||
</configuration> |
|||
</plugin> |
|||
|
|||
</plugins> |
|||
<resources> |
|||
<!--处理mybatis的mapper.xml文件--> |
|||
<resource> |
|||
<directory>src/main/java</directory> |
|||
<includes> |
|||
<include>**/*.xml</include> |
|||
</includes> |
|||
</resource> |
|||
<!--处理其他资源文件--> |
|||
<resource> |
|||
<directory>src/main/resources</directory> |
|||
<includes> |
|||
<!--系统配置文件--> |
|||
<include>*.yml</include> |
|||
<!--excel模板--> |
|||
<include>**/*.xlsx</include> |
|||
<!--其他配置文件--> |
|||
<include>*.xml</include> |
|||
</includes> |
|||
</resource> |
|||
</resources> |
|||
</build> |
|||
|
|||
</project> |
@ -0,0 +1,238 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.CompanyProductModel; |
|||
import tech.abc.platform.productManagement.service.CompanyProductModelService; |
|||
import tech.abc.platform.productManagement.vo.CompanyProductModelVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import tech.abc.platform.productManagement.vo.CompanyProductModelDetailsVO; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/companyProductModel") |
|||
@Slf4j |
|||
public class CompanyProductModelController extends BaseController { |
|||
@Autowired |
|||
private CompanyProductModelService companyProductModelService; |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/addModel") |
|||
@SystemLog(value = "-新增型号与规格") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:add')") |
|||
public ResponseEntity<Result> addModel(@Validated @RequestBody ProductModelViewVO<CompanyProductModelDetailsVO> vo) { |
|||
companyProductModelService.addModel(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/modifyModel") |
|||
@SystemLog(value = "-修改型号与规格") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:modify')") |
|||
public ResponseEntity<Result> modifyModel(@Validated @RequestBody ProductModelViewVO<CompanyProductModelDetailsVO> vo) { |
|||
companyProductModelService.modifyModel(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/getModelDetails/{id}") |
|||
@SystemLog(value = "-获取型号详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:query')") |
|||
public ResponseEntity<Result> getModelDetails(@PathVariable("id") String id) { |
|||
List<CompanyProductModelDetailsVO> detailsList=companyProductModelService.getModelDetails(id); |
|||
return ResultUtil.success(detailsList); |
|||
} |
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
CompanyProductModel entity=companyProductModelService.init(); |
|||
CompanyProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody CompanyProductModelVO vo) { |
|||
CompanyProductModel entity=convert2Entity(vo); |
|||
companyProductModelService.add(entity); |
|||
CompanyProductModelVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody CompanyProductModelVO vo) { |
|||
CompanyProductModel entity=convert2Entity(vo); |
|||
companyProductModelService.modify(entity); |
|||
CompanyProductModelVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
companyProductModelService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:query')") |
|||
public ResponseEntity<Result> page(CompanyProductModelVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<CompanyProductModel> page = new Page<CompanyProductModel>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<CompanyProductModel> queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModel.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
companyProductModelService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<CompanyProductModelVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<CompanyProductModelVO> companyProductModelVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(companyProductModelVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:query')") |
|||
public ResponseEntity<Result> list(CompanyProductModelVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<CompanyProductModel> queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModel.class, queryVO,sortInfo); |
|||
List<CompanyProductModel> list= companyProductModelService.list(queryWrapper); |
|||
//转换vo
|
|||
List<CompanyProductModelVO> companyProductModelVOList=convert2VO(list); |
|||
return ResultUtil.success(companyProductModelVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
CompanyProductModel entity = companyProductModelService.query(id); |
|||
CompanyProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
companyProductModelService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModel:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
CompanyProductModel entity = companyProductModelService.addSingleByCopy(id); |
|||
CompanyProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected CompanyProductModelVO convert2VO(CompanyProductModel entity){ |
|||
CompanyProductModelVO vo=mapperFacade.map(entity,CompanyProductModelVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<CompanyProductModelVO> convert2VO(List<CompanyProductModel> entityList) { |
|||
List<CompanyProductModelVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
CompanyProductModelVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private CompanyProductModel convert2Entity(CompanyProductModelVO vo){ |
|||
CompanyProductModel entity=mapperFacade.map(vo,CompanyProductModel.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,206 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.CompanyProductModelDetails; |
|||
import tech.abc.platform.productManagement.service.CompanyProductModelDetailsService; |
|||
import tech.abc.platform.productManagement.vo.CompanyProductModelDetailsVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/companyProductModelDetails") |
|||
@Slf4j |
|||
public class CompanyProductModelDetailsController extends BaseController { |
|||
@Autowired |
|||
private CompanyProductModelDetailsService companyProductModelDetailsService; |
|||
|
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
CompanyProductModelDetails entity=companyProductModelDetailsService.init(); |
|||
CompanyProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody CompanyProductModelDetailsVO vo) { |
|||
CompanyProductModelDetails entity=convert2Entity(vo); |
|||
companyProductModelDetailsService.add(entity); |
|||
CompanyProductModelDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody CompanyProductModelDetailsVO vo) { |
|||
CompanyProductModelDetails entity=convert2Entity(vo); |
|||
companyProductModelDetailsService.modify(entity); |
|||
CompanyProductModelDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
companyProductModelDetailsService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:query')") |
|||
public ResponseEntity<Result> page(CompanyProductModelDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<CompanyProductModelDetails> page = new Page<CompanyProductModelDetails>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<CompanyProductModelDetails> queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModelDetails.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
companyProductModelDetailsService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<CompanyProductModelDetailsVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<CompanyProductModelDetailsVO> companyProductModelDetailsVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(companyProductModelDetailsVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:query')") |
|||
public ResponseEntity<Result> list(CompanyProductModelDetailsVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<CompanyProductModelDetails> queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModelDetails.class, queryVO,sortInfo); |
|||
List<CompanyProductModelDetails> list= companyProductModelDetailsService.list(queryWrapper); |
|||
//转换vo
|
|||
List<CompanyProductModelDetailsVO> companyProductModelDetailsVOList=convert2VO(list); |
|||
return ResultUtil.success(companyProductModelDetailsVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
CompanyProductModelDetails entity = companyProductModelDetailsService.query(id); |
|||
CompanyProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
companyProductModelDetailsService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
CompanyProductModelDetails entity = companyProductModelDetailsService.addSingleByCopy(id); |
|||
CompanyProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected CompanyProductModelDetailsVO convert2VO(CompanyProductModelDetails entity){ |
|||
CompanyProductModelDetailsVO vo=mapperFacade.map(entity,CompanyProductModelDetailsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<CompanyProductModelDetailsVO> convert2VO(List<CompanyProductModelDetails> entityList) { |
|||
List<CompanyProductModelDetailsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
CompanyProductModelDetailsVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private CompanyProductModelDetails convert2Entity(CompanyProductModelDetailsVO vo){ |
|||
CompanyProductModelDetails entity=mapperFacade.map(vo,CompanyProductModelDetails.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,214 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.CompanyProducts; |
|||
import tech.abc.platform.productManagement.service.CompanyProductModelService; |
|||
import tech.abc.platform.productManagement.service.CompanyProductsService; |
|||
import tech.abc.platform.productManagement.vo.CompanyProductsVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-09 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/companyProducts") |
|||
@Slf4j |
|||
public class CompanyProductsController extends BaseController { |
|||
@Autowired |
|||
private CompanyProductsService companyProductsService; |
|||
@Autowired |
|||
private CompanyProductModelService companyProductModelService; |
|||
|
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
CompanyProducts entity=companyProductsService.init(); |
|||
CompanyProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody CompanyProductsVO vo) { |
|||
CompanyProducts entity=convert2Entity(vo); |
|||
companyProductsService.add(entity); |
|||
CompanyProductsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody CompanyProductsVO vo) { |
|||
CompanyProducts entity=convert2Entity(vo); |
|||
companyProductsService.modify(entity); |
|||
CompanyProductsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
companyProductsService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:query')") |
|||
public ResponseEntity<Result> page(CompanyProductsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<CompanyProducts> page = new Page<CompanyProducts>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<CompanyProducts> queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProducts.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
companyProductsService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<CompanyProductsVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<CompanyProductsVO> companyProductsVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(companyProductsVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:query')") |
|||
public ResponseEntity<Result> list(CompanyProductsVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<CompanyProducts> queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProducts.class, queryVO,sortInfo); |
|||
List<CompanyProducts> list= companyProductsService.list(queryWrapper); |
|||
//转换vo
|
|||
List<CompanyProductsVO> companyProductsVOList=convert2VO(list); |
|||
return ResultUtil.success(companyProductsVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
CompanyProducts entity = companyProductsService.query(id); |
|||
CompanyProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
companyProductsService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:companyProducts:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
CompanyProducts entity = companyProductsService.addSingleByCopy(id); |
|||
CompanyProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected CompanyProductsVO convert2VO(CompanyProducts entity){ |
|||
CompanyProductsVO vo=mapperFacade.map(entity,CompanyProductsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<CompanyProductsVO> convert2VO(List<CompanyProducts> entityList) { |
|||
List<CompanyProductsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
CompanyProductsVO vo = convert2VO(x); |
|||
if(StringUtils.isNotEmpty(vo.getModelId())){ |
|||
String description = companyProductModelService.getById(vo.getModelId()).getDescription(); |
|||
vo.setModelDescription(description); |
|||
} |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private CompanyProducts convert2Entity(CompanyProductsVO vo){ |
|||
CompanyProducts entity=mapperFacade.map(vo,CompanyProducts.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,238 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.PersonProductModel; |
|||
import tech.abc.platform.productManagement.service.PersonProductModelService; |
|||
import tech.abc.platform.productManagement.vo.PersonProductModelVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
import tech.abc.platform.productManagement.vo.PersonProductModelDetailsVO; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/personProductModel") |
|||
@Slf4j |
|||
public class PersonProductModelController extends BaseController { |
|||
@Autowired |
|||
private PersonProductModelService personProductModelService; |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/addModel") |
|||
@SystemLog(value = "-新增型号与规格") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:add')") |
|||
public ResponseEntity<Result> addModel(@Validated @RequestBody ProductModelViewVO<PersonProductModelDetailsVO> vo) { |
|||
personProductModelService.addModel(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/modifyModel") |
|||
@SystemLog(value = "-修改型号与规格") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:modify')") |
|||
public ResponseEntity<Result> modifyModel(@Validated @RequestBody ProductModelViewVO<PersonProductModelDetailsVO> vo) { |
|||
personProductModelService.modifyModel(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/getModelDetails/{id}") |
|||
@SystemLog(value = "-获取型号详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:query')") |
|||
public ResponseEntity<Result> getModelDetails(@PathVariable("id") String id) { |
|||
List<PersonProductModelDetailsVO> detailsList=personProductModelService.getModelDetails(id); |
|||
return ResultUtil.success(detailsList); |
|||
} |
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
PersonProductModel entity=personProductModelService.init(); |
|||
PersonProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody PersonProductModelVO vo) { |
|||
PersonProductModel entity=convert2Entity(vo); |
|||
personProductModelService.add(entity); |
|||
PersonProductModelVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody PersonProductModelVO vo) { |
|||
PersonProductModel entity=convert2Entity(vo); |
|||
personProductModelService.modify(entity); |
|||
PersonProductModelVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
personProductModelService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:query')") |
|||
public ResponseEntity<Result> page(PersonProductModelVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<PersonProductModel> page = new Page<PersonProductModel>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<PersonProductModel> queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModel.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
personProductModelService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<PersonProductModelVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<PersonProductModelVO> personProductModelVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(personProductModelVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:query')") |
|||
public ResponseEntity<Result> list(PersonProductModelVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<PersonProductModel> queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModel.class, queryVO,sortInfo); |
|||
List<PersonProductModel> list= personProductModelService.list(queryWrapper); |
|||
//转换vo
|
|||
List<PersonProductModelVO> personProductModelVOList=convert2VO(list); |
|||
return ResultUtil.success(personProductModelVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
PersonProductModel entity = personProductModelService.query(id); |
|||
PersonProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
personProductModelService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProductModel:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
PersonProductModel entity = personProductModelService.addSingleByCopy(id); |
|||
PersonProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected PersonProductModelVO convert2VO(PersonProductModel entity){ |
|||
PersonProductModelVO vo=mapperFacade.map(entity,PersonProductModelVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<PersonProductModelVO> convert2VO(List<PersonProductModel> entityList) { |
|||
List<PersonProductModelVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
PersonProductModelVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private PersonProductModel convert2Entity(PersonProductModelVO vo){ |
|||
PersonProductModel entity=mapperFacade.map(vo,PersonProductModel.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,206 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.PersonProductModelDetails; |
|||
import tech.abc.platform.productManagement.service.PersonProductModelDetailsService; |
|||
import tech.abc.platform.productManagement.vo.PersonProductModelDetailsVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/costManagement/personProductModelDetails") |
|||
@Slf4j |
|||
public class PersonProductModelDetailsController extends BaseController { |
|||
@Autowired |
|||
private PersonProductModelDetailsService personProductModelDetailsService; |
|||
|
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
PersonProductModelDetails entity=personProductModelDetailsService.init(); |
|||
PersonProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody PersonProductModelDetailsVO vo) { |
|||
PersonProductModelDetails entity=convert2Entity(vo); |
|||
personProductModelDetailsService.add(entity); |
|||
PersonProductModelDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody PersonProductModelDetailsVO vo) { |
|||
PersonProductModelDetails entity=convert2Entity(vo); |
|||
personProductModelDetailsService.modify(entity); |
|||
PersonProductModelDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
personProductModelDetailsService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:query')") |
|||
public ResponseEntity<Result> page(PersonProductModelDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<PersonProductModelDetails> page = new Page<PersonProductModelDetails>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<PersonProductModelDetails> queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModelDetails.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
personProductModelDetailsService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<PersonProductModelDetailsVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<PersonProductModelDetailsVO> personProductModelDetailsVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(personProductModelDetailsVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:query')") |
|||
public ResponseEntity<Result> list(PersonProductModelDetailsVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<PersonProductModelDetails> queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModelDetails.class, queryVO,sortInfo); |
|||
List<PersonProductModelDetails> list= personProductModelDetailsService.list(queryWrapper); |
|||
//转换vo
|
|||
List<PersonProductModelDetailsVO> personProductModelDetailsVOList=convert2VO(list); |
|||
return ResultUtil.success(personProductModelDetailsVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
PersonProductModelDetails entity = personProductModelDetailsService.query(id); |
|||
PersonProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
personProductModelDetailsService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
PersonProductModelDetails entity = personProductModelDetailsService.addSingleByCopy(id); |
|||
PersonProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected PersonProductModelDetailsVO convert2VO(PersonProductModelDetails entity){ |
|||
PersonProductModelDetailsVO vo=mapperFacade.map(entity,PersonProductModelDetailsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<PersonProductModelDetailsVO> convert2VO(List<PersonProductModelDetails> entityList) { |
|||
List<PersonProductModelDetailsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
PersonProductModelDetailsVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private PersonProductModelDetails convert2Entity(PersonProductModelDetailsVO vo){ |
|||
PersonProductModelDetails entity=mapperFacade.map(vo,PersonProductModelDetails.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,216 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.PersonProducts; |
|||
import tech.abc.platform.productManagement.service.PersonProductModelService; |
|||
import tech.abc.platform.productManagement.service.PersonProductsService; |
|||
import tech.abc.platform.productManagement.vo.PersonProductsVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/personProducts") |
|||
@Slf4j |
|||
public class PersonProductsController extends BaseController { |
|||
@Autowired |
|||
private PersonProductsService personProductsService; |
|||
@Autowired |
|||
private PersonProductModelService personProductModelService; |
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
PersonProducts entity=personProductsService.init(); |
|||
PersonProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody PersonProductsVO vo) { |
|||
PersonProducts entity=convert2Entity(vo); |
|||
personProductsService.add(entity); |
|||
PersonProductsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody PersonProductsVO vo) { |
|||
PersonProducts entity=convert2Entity(vo); |
|||
personProductsService.modify(entity); |
|||
PersonProductsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
personProductsService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:query')") |
|||
public ResponseEntity<Result> page(PersonProductsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<PersonProducts> page = new Page<PersonProducts>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<PersonProducts> queryWrapper = QueryGenerator.generateQueryWrapper(PersonProducts.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
personProductsService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<PersonProductsVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<PersonProductsVO> personProductsVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(personProductsVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:query')") |
|||
public ResponseEntity<Result> list(PersonProductsVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<PersonProducts> queryWrapper = QueryGenerator.generateQueryWrapper(PersonProducts.class, queryVO,sortInfo); |
|||
List<PersonProducts> list= personProductsService.list(queryWrapper); |
|||
//转换vo
|
|||
List<PersonProductsVO> personProductsVOList=convert2VO(list); |
|||
return ResultUtil.success(personProductsVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
PersonProducts entity = personProductsService.query(id); |
|||
PersonProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
personProductsService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:personProducts:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
PersonProducts entity = personProductsService.addSingleByCopy(id); |
|||
PersonProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected PersonProductsVO convert2VO(PersonProducts entity){ |
|||
PersonProductsVO vo=mapperFacade.map(entity,PersonProductsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<PersonProductsVO> convert2VO(List<PersonProducts> entityList) { |
|||
List<PersonProductsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
PersonProductsVO vo = convert2VO(x); |
|||
String modelId = vo.getModelId(); |
|||
//获取型号描述信息
|
|||
if(StringUtils.isNotEmpty(modelId)){ |
|||
String description = personProductModelService.getById(modelId).getDescription(); |
|||
vo.setModelDescription(description); |
|||
} |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private PersonProducts convert2Entity(PersonProductsVO vo){ |
|||
PersonProducts entity=mapperFacade.map(vo,PersonProducts.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,214 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.ProductModelTemplate; |
|||
import tech.abc.platform.productManagement.service.ProductModelTemplateDetailsService; |
|||
import tech.abc.platform.productManagement.service.ProductModelTemplateService; |
|||
import tech.abc.platform.productManagement.vo.ProductModelTemplateVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/productModelTemplate") |
|||
@Slf4j |
|||
public class ProductModelTemplateController extends BaseController { |
|||
@Autowired |
|||
private ProductModelTemplateService productModelTemplateService; |
|||
@Autowired |
|||
private ProductModelTemplateDetailsService productModelTemplateDetailsService; |
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
ProductModelTemplate entity=productModelTemplateService.init(); |
|||
ProductModelTemplateVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody ProductModelTemplateVO vo) { |
|||
ProductModelTemplate entity=convert2Entity(vo); |
|||
productModelTemplateService.add(entity); |
|||
ProductModelTemplateVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody ProductModelTemplateVO vo) { |
|||
ProductModelTemplate entity=convert2Entity(vo); |
|||
productModelTemplateService.modify(entity); |
|||
ProductModelTemplateVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
productModelTemplateService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:query')") |
|||
public ResponseEntity<Result> page(ProductModelTemplateVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<ProductModelTemplate> page = new Page<ProductModelTemplate>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<ProductModelTemplate> queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplate.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
productModelTemplateService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<ProductModelTemplateVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<ProductModelTemplateVO> productModelTemplateVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(productModelTemplateVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:query')") |
|||
public ResponseEntity<Result> list(ProductModelTemplateVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<ProductModelTemplate> queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplate.class, queryVO,sortInfo); |
|||
List<ProductModelTemplate> list= productModelTemplateService.list(queryWrapper); |
|||
//转换vo
|
|||
List<ProductModelTemplateVO> productModelTemplateVOList=convert2VO(list); |
|||
return ResultUtil.success(productModelTemplateVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
ProductModelTemplate entity = productModelTemplateService.query(id); |
|||
ProductModelTemplateVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
productModelTemplateService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
ProductModelTemplate entity = productModelTemplateService.addSingleByCopy(id); |
|||
ProductModelTemplateVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected ProductModelTemplateVO convert2VO(ProductModelTemplate entity){ |
|||
ProductModelTemplateVO vo=mapperFacade.map(entity,ProductModelTemplateVO.class); |
|||
String id = vo.getId(); |
|||
String description = productModelTemplateDetailsService.getDetailsDescriptionByModelId(id); |
|||
vo.setTemplateDetailsDescription(description); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<ProductModelTemplateVO> convert2VO(List<ProductModelTemplate> entityList) { |
|||
List<ProductModelTemplateVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
ProductModelTemplateVO vo = convert2VO(x); |
|||
String id = vo.getId(); |
|||
String description = productModelTemplateDetailsService.getDetailsDescriptionByModelId(id); |
|||
vo.setTemplateDetailsDescription(description); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private ProductModelTemplate convert2Entity(ProductModelTemplateVO vo){ |
|||
ProductModelTemplate entity=mapperFacade.map(vo,ProductModelTemplate.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,225 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.ProductModelTemplateDetails; |
|||
import tech.abc.platform.productManagement.service.ProductModelTemplateDetailsService; |
|||
import tech.abc.platform.productManagement.vo.ProductModelTemplateDetailsVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/productModelTemplateDetails") |
|||
@Slf4j |
|||
public class ProductModelTemplateDetailsController extends BaseController { |
|||
@Autowired |
|||
private ProductModelTemplateDetailsService productModelTemplateDetailsService; |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/addList") |
|||
@SystemLog(value = "-新增型号规格明细") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:add')") |
|||
public ResponseEntity<Result> addList(@Validated @RequestBody List<ProductModelTemplateDetailsVO> vo) { |
|||
productModelTemplateDetailsService.addList(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/modifyList") |
|||
@SystemLog(value = "-修改型号规格明细") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:modify')") |
|||
public ResponseEntity<Result> modifyList(@Validated @RequestBody List<ProductModelTemplateDetailsVO> vo) { |
|||
productModelTemplateDetailsService.modifyList(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
ProductModelTemplateDetails entity=productModelTemplateDetailsService.init(); |
|||
ProductModelTemplateDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody ProductModelTemplateDetailsVO vo) { |
|||
ProductModelTemplateDetails entity=convert2Entity(vo); |
|||
productModelTemplateDetailsService.add(entity); |
|||
ProductModelTemplateDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody ProductModelTemplateDetailsVO vo) { |
|||
ProductModelTemplateDetails entity=convert2Entity(vo); |
|||
productModelTemplateDetailsService.modify(entity); |
|||
ProductModelTemplateDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
productModelTemplateDetailsService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:query')") |
|||
public ResponseEntity<Result> page(ProductModelTemplateDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<ProductModelTemplateDetails> page = new Page<ProductModelTemplateDetails>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<ProductModelTemplateDetails> queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplateDetails.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
productModelTemplateDetailsService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<ProductModelTemplateDetailsVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<ProductModelTemplateDetailsVO> productModelTemplateDetailsVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(productModelTemplateDetailsVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:query')") |
|||
public ResponseEntity<Result> list(ProductModelTemplateDetailsVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<ProductModelTemplateDetails> queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplateDetails.class, queryVO,sortInfo); |
|||
List<ProductModelTemplateDetails> list= productModelTemplateDetailsService.list(queryWrapper); |
|||
//转换vo
|
|||
List<ProductModelTemplateDetailsVO> productModelTemplateDetailsVOList=convert2VO(list); |
|||
return ResultUtil.success(productModelTemplateDetailsVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
ProductModelTemplateDetails entity = productModelTemplateDetailsService.query(id); |
|||
ProductModelTemplateDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
productModelTemplateDetailsService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
ProductModelTemplateDetails entity = productModelTemplateDetailsService.addSingleByCopy(id); |
|||
ProductModelTemplateDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected ProductModelTemplateDetailsVO convert2VO(ProductModelTemplateDetails entity){ |
|||
ProductModelTemplateDetailsVO vo=mapperFacade.map(entity,ProductModelTemplateDetailsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<ProductModelTemplateDetailsVO> convert2VO(List<ProductModelTemplateDetails> entityList) { |
|||
List<ProductModelTemplateDetailsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
ProductModelTemplateDetailsVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private ProductModelTemplateDetails convert2Entity(ProductModelTemplateDetailsVO vo){ |
|||
ProductModelTemplateDetails entity=mapperFacade.map(vo,ProductModelTemplateDetails.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,206 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.SupplierInformation; |
|||
import tech.abc.platform.productManagement.service.SupplierInformationService; |
|||
import tech.abc.platform.productManagement.vo.SupplierInformationVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-07 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierInformation") |
|||
@Slf4j |
|||
public class SupplierInformationController extends BaseController { |
|||
@Autowired |
|||
private SupplierInformationService supplierInformationService; |
|||
|
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
SupplierInformation entity=supplierInformationService.init(); |
|||
SupplierInformationVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody SupplierInformationVO vo) { |
|||
SupplierInformation entity=convert2Entity(vo); |
|||
supplierInformationService.add(entity); |
|||
SupplierInformationVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody SupplierInformationVO vo) { |
|||
SupplierInformation entity=convert2Entity(vo); |
|||
supplierInformationService.modify(entity); |
|||
SupplierInformationVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
supplierInformationService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:query')") |
|||
public ResponseEntity<Result> page(SupplierInformationVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<SupplierInformation> page = new Page<SupplierInformation>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<SupplierInformation> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierInformation.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
supplierInformationService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<SupplierInformationVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<SupplierInformationVO> supplierInformationVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(supplierInformationVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:query')") |
|||
public ResponseEntity<Result> list(SupplierInformationVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<SupplierInformation> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierInformation.class, queryVO,sortInfo); |
|||
List<SupplierInformation> list= supplierInformationService.list(queryWrapper); |
|||
//转换vo
|
|||
List<SupplierInformationVO> supplierInformationVOList=convert2VO(list); |
|||
return ResultUtil.success(supplierInformationVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
SupplierInformation entity = supplierInformationService.query(id); |
|||
SupplierInformationVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
supplierInformationService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierInformation:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
SupplierInformation entity = supplierInformationService.addSingleByCopy(id); |
|||
SupplierInformationVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected SupplierInformationVO convert2VO(SupplierInformation entity){ |
|||
SupplierInformationVO vo=mapperFacade.map(entity,SupplierInformationVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<SupplierInformationVO> convert2VO(List<SupplierInformation> entityList) { |
|||
List<SupplierInformationVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
SupplierInformationVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private SupplierInformation convert2Entity(SupplierInformationVO vo){ |
|||
SupplierInformation entity=mapperFacade.map(vo,SupplierInformation.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,238 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.SupplierProductModel; |
|||
import tech.abc.platform.productManagement.service.SupplierProductModelService; |
|||
import tech.abc.platform.productManagement.vo.SupplierProductModelDetailsVO; |
|||
import tech.abc.platform.productManagement.vo.SupplierProductModelVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierProductModel") |
|||
@Slf4j |
|||
public class SupplierProductModelController extends BaseController { |
|||
@Autowired |
|||
private SupplierProductModelService supplierProductModelService; |
|||
//拓展操作
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/addModel") |
|||
@SystemLog(value = "-新增型号与规格") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:add')") |
|||
public ResponseEntity<Result> addModel(@Validated @RequestBody ProductModelViewVO<SupplierProductModelDetailsVO> vo) { |
|||
supplierProductModelService.addModel(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/modifyModel") |
|||
@SystemLog(value = "-修改型号与规格") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:modify')") |
|||
public ResponseEntity<Result> modifyModel(@Validated @RequestBody ProductModelViewVO<SupplierProductModelDetailsVO> vo) { |
|||
supplierProductModelService.modifyModel(vo); |
|||
return ResultUtil.success(); |
|||
} |
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/getModelDetails/{id}") |
|||
@SystemLog(value = "-获取型号详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:query')") |
|||
public ResponseEntity<Result> getModelDetails(@PathVariable("id") String id) { |
|||
List<SupplierProductModelDetailsVO> detailsList=supplierProductModelService.getModelDetails(id); |
|||
return ResultUtil.success(detailsList); |
|||
} |
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
SupplierProductModel entity=supplierProductModelService.init(); |
|||
SupplierProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody SupplierProductModelVO vo) { |
|||
SupplierProductModel entity=convert2Entity(vo); |
|||
supplierProductModelService.add(entity); |
|||
SupplierProductModelVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody SupplierProductModelVO vo) { |
|||
SupplierProductModel entity=convert2Entity(vo); |
|||
supplierProductModelService.modify(entity); |
|||
SupplierProductModelVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
supplierProductModelService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:query')") |
|||
public ResponseEntity<Result> page(SupplierProductModelVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<SupplierProductModel> page = new Page<SupplierProductModel>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<SupplierProductModel> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModel.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
supplierProductModelService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<SupplierProductModelVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<SupplierProductModelVO> supplierProductModelVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(supplierProductModelVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:query')") |
|||
public ResponseEntity<Result> list(SupplierProductModelVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<SupplierProductModel> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModel.class, queryVO,sortInfo); |
|||
List<SupplierProductModel> list= supplierProductModelService.list(queryWrapper); |
|||
//转换vo
|
|||
List<SupplierProductModelVO> supplierProductModelVOList=convert2VO(list); |
|||
return ResultUtil.success(supplierProductModelVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
SupplierProductModel entity = supplierProductModelService.query(id); |
|||
SupplierProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
supplierProductModelService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
SupplierProductModel entity = supplierProductModelService.addSingleByCopy(id); |
|||
SupplierProductModelVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected SupplierProductModelVO convert2VO(SupplierProductModel entity){ |
|||
SupplierProductModelVO vo=mapperFacade.map(entity,SupplierProductModelVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<SupplierProductModelVO> convert2VO(List<SupplierProductModel> entityList) { |
|||
List<SupplierProductModelVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
SupplierProductModelVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private SupplierProductModel convert2Entity(SupplierProductModelVO vo){ |
|||
SupplierProductModel entity=mapperFacade.map(vo,SupplierProductModel.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,205 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.SupplierProductModelDetails; |
|||
import tech.abc.platform.productManagement.service.SupplierProductModelDetailsService; |
|||
import tech.abc.platform.productManagement.vo.SupplierProductModelDetailsVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierProductModelDetails") |
|||
@Slf4j |
|||
public class SupplierProductModelDetailsController extends BaseController { |
|||
@Autowired |
|||
private SupplierProductModelDetailsService supplierProductModelDetailsService; |
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
SupplierProductModelDetails entity=supplierProductModelDetailsService.init(); |
|||
SupplierProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody SupplierProductModelDetailsVO vo) { |
|||
SupplierProductModelDetails entity=convert2Entity(vo); |
|||
supplierProductModelDetailsService.add(entity); |
|||
SupplierProductModelDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody SupplierProductModelDetailsVO vo) { |
|||
SupplierProductModelDetails entity=convert2Entity(vo); |
|||
supplierProductModelDetailsService.modify(entity); |
|||
SupplierProductModelDetailsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
supplierProductModelDetailsService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:query')") |
|||
public ResponseEntity<Result> page(SupplierProductModelDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<SupplierProductModelDetails> page = new Page<SupplierProductModelDetails>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<SupplierProductModelDetails> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModelDetails.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
supplierProductModelDetailsService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<SupplierProductModelDetailsVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<SupplierProductModelDetailsVO> supplierProductModelDetailsVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(supplierProductModelDetailsVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:query')") |
|||
public ResponseEntity<Result> list(SupplierProductModelDetailsVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<SupplierProductModelDetails> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModelDetails.class, queryVO,sortInfo); |
|||
List<SupplierProductModelDetails> list= supplierProductModelDetailsService.list(queryWrapper); |
|||
//转换vo
|
|||
List<SupplierProductModelDetailsVO> supplierProductModelDetailsVOList=convert2VO(list); |
|||
return ResultUtil.success(supplierProductModelDetailsVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
SupplierProductModelDetails entity = supplierProductModelDetailsService.query(id); |
|||
SupplierProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
supplierProductModelDetailsService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
SupplierProductModelDetails entity = supplierProductModelDetailsService.addSingleByCopy(id); |
|||
SupplierProductModelDetailsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected SupplierProductModelDetailsVO convert2VO(SupplierProductModelDetails entity){ |
|||
SupplierProductModelDetailsVO vo=mapperFacade.map(entity,SupplierProductModelDetailsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<SupplierProductModelDetailsVO> convert2VO(List<SupplierProductModelDetails> entityList) { |
|||
List<SupplierProductModelDetailsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
SupplierProductModelDetailsVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private SupplierProductModelDetails convert2Entity(SupplierProductModelDetailsVO vo){ |
|||
SupplierProductModelDetails entity=mapperFacade.map(vo,SupplierProductModelDetails.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,217 @@ |
|||
package tech.abc.platform.productManagement.controller; |
|||
|
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import tech.abc.platform.common.base.BaseController; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import tech.abc.platform.common.annotation.SystemLog; |
|||
import tech.abc.platform.common.query.QueryGenerator; |
|||
import tech.abc.platform.common.utils.ResultUtil; |
|||
import tech.abc.platform.common.vo.PageInfo; |
|||
import tech.abc.platform.common.vo.Result; |
|||
import tech.abc.platform.common.vo.SortInfo; |
|||
import tech.abc.platform.productManagement.entity.SupplierProducts; |
|||
import tech.abc.platform.productManagement.service.SupplierProductModelService; |
|||
import tech.abc.platform.productManagement.service.SupplierProductsService; |
|||
import tech.abc.platform.productManagement.vo.SupplierProductsVO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 前端控制器类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-08 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/productManagement/supplierProducts") |
|||
@Slf4j |
|||
public class SupplierProductsController extends BaseController { |
|||
@Autowired |
|||
private SupplierProductsService supplierProductsService; |
|||
|
|||
@Autowired |
|||
private SupplierProductModelService supplierProductModelService; |
|||
|
|||
//region 基本操作
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
@GetMapping("/init") |
|||
public ResponseEntity<Result> init() { |
|||
SupplierProducts entity=supplierProductsService.init(); |
|||
SupplierProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
*/ |
|||
@PostMapping("/") |
|||
@SystemLog(value = "-新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:add')") |
|||
public ResponseEntity<Result> add(@Validated @RequestBody SupplierProductsVO vo) { |
|||
SupplierProducts entity=convert2Entity(vo); |
|||
supplierProductsService.add(entity); |
|||
SupplierProductsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
*/ |
|||
@PutMapping("/") |
|||
@SystemLog(value = "-修改") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:modify')") |
|||
public ResponseEntity<Result> modify(@Validated @RequestBody SupplierProductsVO vo) { |
|||
SupplierProducts entity=convert2Entity(vo); |
|||
supplierProductsService.modify(entity); |
|||
SupplierProductsVO newVO = convert2VO(entity); |
|||
return ResultUtil.success(newVO); |
|||
} |
|||
|
|||
/** |
|||
* 删除数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@DeleteMapping("/{id}") |
|||
@SystemLog(value = "-删除") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:remove')") |
|||
public ResponseEntity<Result> remove(@PathVariable("id") String id) { |
|||
supplierProductsService.remove(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
/** |
|||
* 分页 |
|||
*/ |
|||
@GetMapping("/page") |
|||
@SystemLog(value = "-分页") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:query')") |
|||
public ResponseEntity<Result> page(SupplierProductsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { |
|||
//构造分页对象
|
|||
IPage<SupplierProducts> page = new Page<SupplierProducts>(pageInfo.getPageNum(), pageInfo.getPageSize()); |
|||
|
|||
|
|||
//构造查询条件
|
|||
QueryWrapper<SupplierProducts> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProducts.class,queryVO,sortInfo); |
|||
|
|||
//查询数据
|
|||
supplierProductsService.page(page, queryWrapper); |
|||
//转换vo
|
|||
IPage<SupplierProductsVO> pageVO = mapperFacade.map(page, IPage.class); |
|||
List<SupplierProductsVO> supplierProductsVOList=convert2VO(page.getRecords()); |
|||
pageVO.setRecords(supplierProductsVOList); |
|||
return ResultUtil.success(pageVO); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 列表 |
|||
*/ |
|||
@GetMapping("/list") |
|||
@SystemLog(value = "-列表") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:query')") |
|||
public ResponseEntity<Result> list(SupplierProductsVO queryVO, SortInfo sortInfo) { |
|||
//构造查询条件
|
|||
QueryWrapper<SupplierProducts> queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProducts.class, queryVO,sortInfo); |
|||
List<SupplierProducts> list= supplierProductsService.list(queryWrapper); |
|||
//转换vo
|
|||
List<SupplierProductsVO> supplierProductsVOList=convert2VO(list); |
|||
return ResultUtil.success(supplierProductsVOList); |
|||
} |
|||
|
|||
/** |
|||
* 获取单条数据 |
|||
*/ |
|||
@GetMapping("/{id}") |
|||
@SystemLog(value = "-详情") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:view')") |
|||
public ResponseEntity<Result> get(@PathVariable("id") String id) { |
|||
SupplierProducts entity = supplierProductsService.query(id); |
|||
SupplierProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
|
|||
/** |
|||
* 复制新增数据,单条数据标识,或多条数据标识用逗号间隔拼成的字符串 |
|||
*/ |
|||
@PostMapping("/{id}") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:addByCopy')") |
|||
public ResponseEntity<Result> addByCopy(@PathVariable("id") String id) { |
|||
supplierProductsService.addByCopy(id); |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 复制新增单条数据,返回复制后的对象 |
|||
*/ |
|||
@PostMapping("/{id}/addSingleByCopy") |
|||
@SystemLog(value = "-复制新增") |
|||
@PreAuthorize("hasPermission(null,'productManagement:supplierProducts:addByCopy')") |
|||
public ResponseEntity<Result> addSingleByCopy(@PathVariable("id") String id) { |
|||
SupplierProducts entity = supplierProductsService.addSingleByCopy(id); |
|||
SupplierProductsVO vo = convert2VO(entity); |
|||
return ResultUtil.success(vo); |
|||
} |
|||
//endregion
|
|||
|
|||
//region 扩展操作
|
|||
|
|||
//endregion
|
|||
|
|||
//region 辅助操作
|
|||
|
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected SupplierProductsVO convert2VO(SupplierProducts entity){ |
|||
SupplierProductsVO vo=mapperFacade.map(entity,SupplierProductsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<SupplierProductsVO> convert2VO(List<SupplierProducts> entityList) { |
|||
List<SupplierProductsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
SupplierProductsVO vo = convert2VO(x); |
|||
String modelId = vo.getModelId(); |
|||
//获取型号描述信息
|
|||
if(StringUtils.isNotEmpty(modelId)){ |
|||
String description = supplierProductModelService.getById(modelId).getDescription(); |
|||
vo.setModelDescription(description); |
|||
} |
|||
|
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
|
|||
|
|||
private SupplierProducts convert2Entity(SupplierProductsVO vo){ |
|||
SupplierProducts entity=mapperFacade.map(vo,SupplierProducts.class); |
|||
return entity; |
|||
} |
|||
|
|||
//endregion
|
|||
} |
@ -0,0 +1,42 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_company_product_model") |
|||
public class CompanyProductModel extends BaseEntity { |
|||
|
|||
/** |
|||
* 产品描述 |
|||
*/ |
|||
@TableField("description") |
|||
private String description; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
@TableField("is_temporary") |
|||
private String isTemporary; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
@TableField("product_model_template_id") |
|||
private String productModelTemplateId; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,54 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_company_product_model_details") |
|||
public class CompanyProductModelDetails extends BaseEntity { |
|||
|
|||
/** |
|||
* 公司产品型号表id |
|||
*/ |
|||
@TableField("model_id") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
@TableField("param_name") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
@TableField("parameter_value") |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
@TableField("is_key_parameter") |
|||
private String isKeyParameter; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
@TableField("is_temporary") |
|||
private String isTemporary; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,72 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
|
|||
import java.math.BigDecimal; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-09 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_company_products") |
|||
public class CompanyProducts extends BaseEntity { |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
@TableField("supplier_information_id") |
|||
private String supplierInformationId; |
|||
|
|||
/** |
|||
* 公司产品型号id |
|||
*/ |
|||
@TableField("model_id") |
|||
private String modelId; |
|||
/** |
|||
* 供应商产品id |
|||
*/ |
|||
@TableField("supplier_products_id") |
|||
private String supplierProductsId; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
@TableField("product_name") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
@TableField("product_identity") |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
@TableField(value="product_price",updateStrategy= FieldStrategy.IGNORED) |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
@TableField("source_information") |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@TableField("remarks") |
|||
private String remarks; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,41 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_person_product_model") |
|||
public class PersonProductModel extends BaseEntity { |
|||
|
|||
/** |
|||
* 个人产品指标描述 |
|||
*/ |
|||
@TableField("description") |
|||
private String description; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
@TableField("is_temporary") |
|||
private String isTemporary; |
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
@TableField("product_model_template_id") |
|||
private String productModelTemplateId; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,54 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_person_product_model_details") |
|||
public class PersonProductModelDetails extends BaseEntity { |
|||
|
|||
/** |
|||
* 个人产品型号表id |
|||
*/ |
|||
@TableField("model_id") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
@TableField("param_name") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
@TableField("parameter_value") |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
@TableField("is_key_parameter") |
|||
private String isKeyParameter; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
@TableField("is_temporary") |
|||
private String isTemporary; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,73 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
|
|||
import java.math.BigDecimal; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_person_products") |
|||
public class PersonProducts extends BaseEntity { |
|||
|
|||
/** |
|||
* 个人产品型号id |
|||
*/ |
|||
@TableField("model_id") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
@TableField("supplier_information_id") |
|||
private String supplierInformationId; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
@TableField("product_name") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
@TableField("product_identity") |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
@TableField(value="product_price",updateStrategy= FieldStrategy.IGNORED) |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
@TableField("source_information") |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@TableField("remarks") |
|||
private String remarks; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
@TableField("supplier_products_id") |
|||
private String supplierProductsId; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,42 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_product_model_template") |
|||
public class ProductModelTemplate extends BaseEntity { |
|||
|
|||
/** |
|||
* 模板名称 |
|||
*/ |
|||
@TableField("template_name") |
|||
private String templateName; |
|||
|
|||
/** |
|||
* 模板类型 |
|||
*/ |
|||
@TableField("template_type") |
|||
private String templateType; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@TableField("remarks") |
|||
private String remarks; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,47 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_product_model_template_details") |
|||
public class ProductModelTemplateDetails extends BaseEntity { |
|||
|
|||
/** |
|||
* 产品型号表id |
|||
*/ |
|||
@TableField("model_template_id") |
|||
private String modelTemplateId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
@TableField("param_name") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
@TableField("is_key_parameter") |
|||
private String isKeyParameter; |
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
@TableField("is_temporary") |
|||
|
|||
private String isTemporary; |
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,55 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-07 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_supplier_information") |
|||
public class SupplierInformation extends BaseEntity { |
|||
|
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
@TableField("supplier_name") |
|||
private String supplierName; |
|||
|
|||
/** |
|||
* 供应商联系人 |
|||
*/ |
|||
@TableField("supplier_contacts") |
|||
private String supplierContacts; |
|||
/** |
|||
* 职位 |
|||
*/ |
|||
@TableField("position") |
|||
private String position; |
|||
|
|||
/** |
|||
* 供应商联系电话 |
|||
*/ |
|||
@TableField("supplier_contacts_phone") |
|||
private String supplierContactsPhone; |
|||
|
|||
/** |
|||
* 供应商类型 |
|||
*/ |
|||
@TableField("supplier_type") |
|||
private String supplierType; |
|||
|
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,41 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_supplier_product_model") |
|||
public class SupplierProductModel extends BaseEntity { |
|||
|
|||
/** |
|||
* 厂商产品参数描述 |
|||
*/ |
|||
@TableField("description") |
|||
private String description; |
|||
|
|||
/** |
|||
* 产品参数模板id |
|||
*/ |
|||
@TableField("product_model_template_id") |
|||
private String productModelTemplateId; |
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
@TableField("is_temporary") |
|||
private String isTemporary; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,53 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_supplier_product_model_details") |
|||
public class SupplierProductModelDetails extends BaseEntity { |
|||
|
|||
/** |
|||
* 厂商产品参数表id |
|||
*/ |
|||
@TableField("model_id") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 参数名称` |
|||
*/ |
|||
@TableField("param_name") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 参数指标 |
|||
*/ |
|||
@TableField("parameter_value") |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键参数 |
|||
*/ |
|||
@TableField("is_key_parameter") |
|||
private String isKeyParameter; |
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
@TableField("is_temporary") |
|||
private String isTemporary; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,67 @@ |
|||
package tech.abc.platform.productManagement.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
|
|||
import java.math.BigDecimal; |
|||
import tech.abc.platform.common.base.BaseEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-08 |
|||
* |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
@TableName("cmg_supplier_products") |
|||
public class SupplierProducts extends BaseEntity { |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
@TableField("supplier_information_id") |
|||
private String supplierInformationId; |
|||
|
|||
/** |
|||
* 厂商产品型号id |
|||
*/ |
|||
@TableField("model_id") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
@TableField("product_name") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
@TableField("product_identity") |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
@TableField(value="product_price",updateStrategy= FieldStrategy.IGNORED) |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
@TableField("source_information") |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@TableField("remarks") |
|||
private String remarks; |
|||
|
|||
/********非库表存储属性*****/ |
|||
} |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.CompanyProductModelDetails; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface CompanyProductModelDetailsMapper extends BaseMapper<CompanyProductModelDetails> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.CompanyProductModelDetailsMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.CompanyProductModel; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface CompanyProductModelMapper extends BaseMapper<CompanyProductModel> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.CompanyProductModelMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.CompanyProducts; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-09 |
|||
*/ |
|||
public interface CompanyProductsMapper extends BaseMapper<CompanyProducts> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.CompanyProductsMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.PersonProductModelDetails; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface PersonProductModelDetailsMapper extends BaseMapper<PersonProductModelDetails> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.PersonProductModelDetailsMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.PersonProductModel; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface PersonProductModelMapper extends BaseMapper<PersonProductModel> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.PersonProductModelMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.PersonProducts; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
public interface PersonProductsMapper extends BaseMapper<PersonProducts> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.PersonProductsMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.ProductModelTemplateDetails; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
public interface ProductModelTemplateDetailsMapper extends BaseMapper<ProductModelTemplateDetails> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.ProductModelTemplateDetailsMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.ProductModelTemplate; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
public interface ProductModelTemplateMapper extends BaseMapper<ProductModelTemplate> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.ProductModelTemplateMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierInformation; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-07 |
|||
*/ |
|||
public interface SupplierInformationMapper extends BaseMapper<SupplierInformation> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.SupplierInformationMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierProductModelDetails; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
public interface SupplierProductModelDetailsMapper extends BaseMapper<SupplierProductModelDetails> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.SupplierProductModelDetailsMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierProductModel; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
public interface SupplierProductModelMapper extends BaseMapper<SupplierProductModel> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.SupplierProductModelMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,16 @@ |
|||
package tech.abc.platform.productManagement.mapper; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierProducts; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
|
|||
/** |
|||
* Mapper 接口 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-08 |
|||
*/ |
|||
public interface SupplierProductsMapper extends BaseMapper<SupplierProducts> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="tech.abc.platform.productManagement.mapper.SupplierProductsMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,24 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.CompanyProductModelDetails; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface CompanyProductModelDetailsService extends BaseService<CompanyProductModelDetails> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
} |
|||
|
@ -0,0 +1,33 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.CompanyProductModel; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import tech.abc.platform.productManagement.vo.CompanyProductModelDetailsVO; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface CompanyProductModelService extends BaseService<CompanyProductModel> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
|
|||
void addModel(ProductModelViewVO vo); |
|||
|
|||
void modifyModel(ProductModelViewVO vo); |
|||
|
|||
List<CompanyProductModelDetailsVO> getModelDetails(String id); |
|||
} |
|||
|
@ -0,0 +1,24 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.CompanyProducts; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-09 |
|||
*/ |
|||
public interface CompanyProductsService extends BaseService<CompanyProducts> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
} |
|||
|
@ -0,0 +1,24 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.PersonProductModelDetails; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface PersonProductModelDetailsService extends BaseService<PersonProductModelDetails> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
} |
|||
|
@ -0,0 +1,33 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.PersonProductModel; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import tech.abc.platform.productManagement.vo.PersonProductModelDetailsVO; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
public interface PersonProductModelService extends BaseService<PersonProductModel> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
|
|||
void addModel(ProductModelViewVO<PersonProductModelDetailsVO> vo); |
|||
|
|||
void modifyModel(ProductModelViewVO<PersonProductModelDetailsVO> vo); |
|||
|
|||
List<PersonProductModelDetailsVO> getModelDetails(String id); |
|||
} |
|||
|
@ -0,0 +1,24 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.PersonProducts; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
public interface PersonProductsService extends BaseService<PersonProducts> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
} |
|||
|
@ -0,0 +1,37 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.ProductModelTemplateDetails; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import tech.abc.platform.productManagement.vo.ProductModelTemplateDetailsVO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
public interface ProductModelTemplateDetailsService extends BaseService<ProductModelTemplateDetails> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
|
|||
void addList(List<ProductModelTemplateDetailsVO> vo); |
|||
|
|||
void modifyList(List<ProductModelTemplateDetailsVO> vo); |
|||
|
|||
/** |
|||
* 根据产品型号id获取产品型号规格描述 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
String getDetailsDescriptionByModelId(String id); |
|||
} |
|||
|
@ -0,0 +1,24 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.ProductModelTemplate; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
public interface ProductModelTemplateService extends BaseService<ProductModelTemplate> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
} |
|||
|
@ -0,0 +1,25 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.common.base.BaseService; |
|||
import tech.abc.platform.productManagement.entity.SupplierInformation; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-07 |
|||
*/ |
|||
public interface SupplierInformationService extends BaseService<SupplierInformation> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
} |
|||
|
@ -0,0 +1,24 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierProductModelDetails; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
public interface SupplierProductModelDetailsService extends BaseService<SupplierProductModelDetails> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
} |
|||
|
@ -0,0 +1,46 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierProductModel; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import tech.abc.platform.productManagement.vo.SupplierProductModelDetailsVO; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
public interface SupplierProductModelService extends BaseService<SupplierProductModel> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
|
|||
/** |
|||
* 添加供应商产品型号与型号详情 |
|||
* @param vo 参数对象 |
|||
*/ |
|||
void addModel(ProductModelViewVO vo); |
|||
|
|||
/** |
|||
* 获取型号详情 |
|||
* @param id 型号ID |
|||
* @return 型号详情 |
|||
*/ |
|||
List<SupplierProductModelDetailsVO> getModelDetails(String id); |
|||
|
|||
/** |
|||
* 修改型号 |
|||
* @param vo 参数对象 |
|||
*/ |
|||
void modifyModel(ProductModelViewVO vo); |
|||
} |
|||
|
@ -0,0 +1,25 @@ |
|||
package tech.abc.platform.productManagement.service; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierProducts; |
|||
import tech.abc.platform.common.base.BaseService; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 服务接口类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-08 |
|||
*/ |
|||
public interface SupplierProductsService extends BaseService<SupplierProducts> { |
|||
|
|||
/** |
|||
* 获取标识与名称的Map集合 |
|||
* |
|||
* @param idList 标识列表 |
|||
* @return 集合 |
|||
*/ |
|||
Map<String,String> getNameMap(List<String> idList); |
|||
|
|||
} |
|||
|
@ -0,0 +1,54 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import tech.abc.platform.productManagement.entity.CompanyProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.CompanyProductModelDetailsMapper; |
|||
import tech.abc.platform.productManagement.service.CompanyProductModelDetailsService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class CompanyProductModelDetailsServiceImpl extends BaseServiceImpl<CompanyProductModelDetailsMapper, CompanyProductModelDetails> implements CompanyProductModelDetailsService { |
|||
|
|||
@Override |
|||
public CompanyProductModelDetails init() { |
|||
CompanyProductModelDetails entity=new CompanyProductModelDetails(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(CompanyProductModelDetails entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(CompanyProductModelDetails entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(CompanyProductModelDetails entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,134 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import tech.abc.platform.productManagement.entity.CompanyProductModel; |
|||
import tech.abc.platform.productManagement.entity.CompanyProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.CompanyProductModelMapper; |
|||
import tech.abc.platform.productManagement.service.CompanyProductModelDetailsService; |
|||
import tech.abc.platform.productManagement.service.CompanyProductModelService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import org.apache.commons.collections.CollectionUtils; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
import tech.abc.platform.productManagement.vo.CompanyProductModelDetailsVO; |
|||
|
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class CompanyProductModelServiceImpl extends BaseServiceImpl<CompanyProductModelMapper, CompanyProductModel> implements CompanyProductModelService { |
|||
@Autowired |
|||
private CompanyProductModelDetailsService companyProductModelDetailsService; |
|||
@Override |
|||
public void addModel(ProductModelViewVO vo) { |
|||
List<CompanyProductModelDetailsVO> modelDeatilOV = vo.getModelDeatils(); |
|||
//给型号指标设置型号id,并保存
|
|||
for (CompanyProductModelDetailsVO item :modelDeatilOV |
|||
) { |
|||
item.setModelId(vo.getId()); |
|||
CompanyProductModelDetails companyProductModelDetails = mapperFacade.map(item, CompanyProductModelDetails.class); |
|||
companyProductModelDetailsService.save(companyProductModelDetails); |
|||
} |
|||
//保存型号
|
|||
CompanyProductModel companyProductModel = mapperFacade.map(vo, CompanyProductModel.class); |
|||
save(companyProductModel); |
|||
} |
|||
@Override |
|||
public void modifyModel(ProductModelViewVO vo) { |
|||
String id = vo.getId(); |
|||
//删除原型号指标参数
|
|||
LambdaQueryWrapper<CompanyProductModelDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(CompanyProductModelDetails::getModelId, id); |
|||
companyProductModelDetailsService.remove(queryWrapper); |
|||
List<CompanyProductModelDetailsVO> modelDeatilOV = vo.getModelDeatils(); |
|||
//给型号指标设置型号id,并保存
|
|||
for (CompanyProductModelDetailsVO item :modelDeatilOV |
|||
) { |
|||
item.setModelId(vo.getId()); |
|||
item.setId(null); |
|||
item.setUpdateId(null); |
|||
item.setUpdateTime(null); |
|||
CompanyProductModelDetails companyProductModelDetails = mapperFacade.map(item, CompanyProductModelDetails.class); |
|||
companyProductModelDetails.setIsTemporary("0");//修改的化,将临时标记改为0,表示非临时
|
|||
companyProductModelDetailsService.save(companyProductModelDetails); |
|||
} |
|||
//保存型号
|
|||
CompanyProductModel companyProductModel = mapperFacade.map(vo, CompanyProductModel.class); |
|||
updateById(companyProductModel); |
|||
} |
|||
@Override |
|||
public List<CompanyProductModelDetailsVO> getModelDetails(String id) { |
|||
//根据型号id查询型号详情规格指标
|
|||
LambdaQueryWrapper<CompanyProductModelDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(CompanyProductModelDetails::getModelId, id); |
|||
List<CompanyProductModelDetails> list = companyProductModelDetailsService.list(queryWrapper); |
|||
if (CollectionUtils.isEmpty(list)) { |
|||
return new ArrayList<>(); |
|||
} |
|||
List<CompanyProductModelDetailsVO> result =convert2DetailsVO(list); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public CompanyProductModel init() { |
|||
CompanyProductModel entity=new CompanyProductModel(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(CompanyProductModel entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(CompanyProductModel entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(CompanyProductModel entity, String... value) { |
|||
} |
|||
protected List<CompanyProductModelDetailsVO> convert2DetailsVO(List<CompanyProductModelDetails> entityList) { |
|||
List<CompanyProductModelDetailsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
CompanyProductModelDetailsVO vo = convert2DetailsVO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected CompanyProductModelDetailsVO convert2DetailsVO(CompanyProductModelDetails entity){ |
|||
CompanyProductModelDetailsVO vo=mapperFacade.map(entity,CompanyProductModelDetailsVO.class); |
|||
return vo; |
|||
} |
|||
} |
|||
|
@ -0,0 +1,95 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import tech.abc.platform.productManagement.entity.CompanyProducts; |
|||
import tech.abc.platform.productManagement.entity.CompanyProductModel; |
|||
import tech.abc.platform.productManagement.entity.CompanyProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.CompanyProductsMapper; |
|||
import tech.abc.platform.productManagement.mapper.CompanyProductModelDetailsMapper; |
|||
import tech.abc.platform.productManagement.mapper.CompanyProductModelMapper; |
|||
import tech.abc.platform.productManagement.service.CompanyProductsService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-09 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class CompanyProductsServiceImpl extends BaseServiceImpl<CompanyProductsMapper, CompanyProducts> implements CompanyProductsService { |
|||
@Autowired |
|||
private CompanyProductModelMapper companyProductModelMapper; |
|||
@Autowired |
|||
private CompanyProductModelDetailsMapper companyProductModelDetailsMapper; |
|||
@Override |
|||
public CompanyProducts init() { |
|||
CompanyProducts entity=new CompanyProducts(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
@Override |
|||
public void afterAdd(CompanyProducts entity) { |
|||
// 新增供应商产品信息时,将厂商产品型号和型号规格参数变成的is_temporary标记为非临时数据
|
|||
String modelId = entity.getModelId(); |
|||
if (StringUtils.isNotBlank(modelId)) { |
|||
LambdaUpdateWrapper<CompanyProductModel> modelUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
modelUpdateWrapper.eq(CompanyProductModel::getId, modelId); |
|||
modelUpdateWrapper.set(CompanyProductModel::getIsTemporary, "0"); |
|||
companyProductModelMapper.update(null,modelUpdateWrapper); |
|||
// 更新型号规格参数的is_temporary标记为非临时数据
|
|||
LambdaUpdateWrapper<CompanyProductModelDetails> detailsUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
detailsUpdateWrapper.eq(CompanyProductModelDetails::getModelId, modelId); |
|||
detailsUpdateWrapper.set(CompanyProductModelDetails::getIsTemporary, "0"); |
|||
companyProductModelDetailsMapper.update(null,detailsUpdateWrapper); |
|||
} |
|||
|
|||
} |
|||
@Override |
|||
public void afterRemove(CompanyProducts entity) { |
|||
// 删除供应商产品信息时,将厂商产品型号和型号规格参数删除
|
|||
String modelId = entity.getModelId(); |
|||
if (StringUtils.isNotBlank(modelId)) { |
|||
LambdaUpdateWrapper<CompanyProductModel> modelUpdateWrapper = new LambdaUpdateWrapper<>(); // 临时数据标记
|
|||
modelUpdateWrapper.eq(CompanyProductModel::getId, modelId); |
|||
companyProductModelMapper.delete(modelUpdateWrapper); |
|||
// 更新型号规格参数的is_temporary标记为临时数据
|
|||
LambdaUpdateWrapper<CompanyProductModelDetails> detailsUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
detailsUpdateWrapper.eq(CompanyProductModelDetails::getModelId, modelId); |
|||
companyProductModelDetailsMapper.delete(detailsUpdateWrapper); |
|||
} |
|||
} |
|||
@Override |
|||
public void beforeAdd(CompanyProducts entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(CompanyProducts entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(CompanyProducts entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,54 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import tech.abc.platform.productManagement.entity.PersonProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.PersonProductModelDetailsMapper; |
|||
import tech.abc.platform.productManagement.service.PersonProductModelDetailsService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class PersonProductModelDetailsServiceImpl extends BaseServiceImpl<PersonProductModelDetailsMapper, PersonProductModelDetails> implements PersonProductModelDetailsService { |
|||
|
|||
@Override |
|||
public PersonProductModelDetails init() { |
|||
PersonProductModelDetails entity=new PersonProductModelDetails(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(PersonProductModelDetails entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(PersonProductModelDetails entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(PersonProductModelDetails entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,141 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import tech.abc.platform.productManagement.entity.PersonProductModel; |
|||
import tech.abc.platform.productManagement.entity.PersonProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.PersonProductModelMapper; |
|||
import tech.abc.platform.productManagement.service.PersonProductModelService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import org.apache.commons.collections.CollectionUtils; |
|||
|
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import tech.abc.platform.productManagement.service.PersonProductModelDetailsService; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
import tech.abc.platform.productManagement.vo.PersonProductModelDetailsVO; |
|||
|
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class PersonProductModelServiceImpl extends BaseServiceImpl<PersonProductModelMapper, PersonProductModel> implements PersonProductModelService { |
|||
@Autowired |
|||
private PersonProductModelDetailsService personProductModelDetailsService; |
|||
@Override |
|||
public void addModel(ProductModelViewVO vo) { |
|||
List<PersonProductModelDetailsVO> modelDeatilOV = vo.getModelDeatils(); |
|||
//给型号指标设置型号id,并保存
|
|||
for (PersonProductModelDetailsVO item :modelDeatilOV |
|||
) { |
|||
item.setModelId(vo.getId()); |
|||
PersonProductModelDetails personProductModelDetails = mapperFacade.map(item, PersonProductModelDetails.class); |
|||
personProductModelDetailsService.save(personProductModelDetails); |
|||
} |
|||
//保存型号
|
|||
PersonProductModel personProductModel = mapperFacade.map(vo, PersonProductModel.class); |
|||
save(personProductModel); |
|||
} |
|||
@Override |
|||
public void modifyModel(ProductModelViewVO vo) { |
|||
String id = vo.getId(); |
|||
//删除原型号指标参数
|
|||
LambdaQueryWrapper<PersonProductModelDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(PersonProductModelDetails::getModelId, id); |
|||
personProductModelDetailsService.remove(queryWrapper); |
|||
List<PersonProductModelDetailsVO> modelDeatilOV = vo.getModelDeatils(); |
|||
//给型号指标设置型号id,并保存
|
|||
for (PersonProductModelDetailsVO item :modelDeatilOV |
|||
) { |
|||
item.setModelId(vo.getId()); |
|||
item.setId(null); |
|||
item.setUpdateId(null); |
|||
item.setUpdateTime(null); |
|||
PersonProductModelDetails personProductModelDetails = mapperFacade.map(item, PersonProductModelDetails.class); |
|||
personProductModelDetails.setIsTemporary("0");//修改的化,将临时标记改为0,表示非临时
|
|||
personProductModelDetailsService.save(personProductModelDetails); |
|||
} |
|||
//保存型号
|
|||
PersonProductModel personProductModel = mapperFacade.map(vo, PersonProductModel.class); |
|||
updateById(personProductModel); |
|||
} |
|||
@Override |
|||
public List<PersonProductModelDetailsVO> getModelDetails(String id) { |
|||
//根据型号id查询型号详情规格指标
|
|||
LambdaQueryWrapper<PersonProductModelDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(PersonProductModelDetails::getModelId, id); |
|||
List<PersonProductModelDetails> list = personProductModelDetailsService.list(queryWrapper); |
|||
if (CollectionUtils.isEmpty(list)) { |
|||
return new ArrayList<>(); |
|||
} |
|||
List<PersonProductModelDetailsVO> result =convert2DetailsVO(list); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public PersonProductModel init() { |
|||
PersonProductModel entity=new PersonProductModel(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(PersonProductModel entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(PersonProductModel entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(PersonProductModel entity, String... value) { |
|||
} |
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<PersonProductModelDetailsVO> convert2DetailsVO(List<PersonProductModelDetails> entityList) { |
|||
List<PersonProductModelDetailsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
PersonProductModelDetailsVO vo = convert2DetailsVO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected PersonProductModelDetailsVO convert2DetailsVO(PersonProductModelDetails entity){ |
|||
PersonProductModelDetailsVO vo=mapperFacade.map(entity,PersonProductModelDetailsVO.class); |
|||
return vo; |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,95 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import tech.abc.platform.productManagement.entity.PersonProducts; |
|||
import tech.abc.platform.productManagement.entity.PersonProductModel; |
|||
import tech.abc.platform.productManagement.entity.PersonProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.PersonProductsMapper; |
|||
import tech.abc.platform.productManagement.mapper.PersonProductModelDetailsMapper; |
|||
import tech.abc.platform.productManagement.mapper.PersonProductModelMapper; |
|||
import tech.abc.platform.productManagement.service.PersonProductsService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class PersonProductsServiceImpl extends BaseServiceImpl<PersonProductsMapper, PersonProducts> implements PersonProductsService { |
|||
@Autowired |
|||
private PersonProductModelMapper personProductModelMapper; |
|||
@Autowired |
|||
private PersonProductModelDetailsMapper personProductModelDetailsMapper; |
|||
@Override |
|||
public PersonProducts init() { |
|||
PersonProducts entity=new PersonProducts(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
@Override |
|||
public void afterAdd(PersonProducts entity) { |
|||
// 新增供应商产品信息时,将厂商产品型号和型号规格参数变成的is_temporary标记为非临时数据
|
|||
String modelId = entity.getModelId(); |
|||
if (StringUtils.isNotBlank(modelId)) { |
|||
LambdaUpdateWrapper<PersonProductModel> modelUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
modelUpdateWrapper.eq(PersonProductModel::getId, modelId); |
|||
modelUpdateWrapper.set(PersonProductModel::getIsTemporary, "0"); |
|||
personProductModelMapper.update(null,modelUpdateWrapper); |
|||
// 更新型号规格参数的is_temporary标记为非临时数据
|
|||
LambdaUpdateWrapper<PersonProductModelDetails> detailsUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
detailsUpdateWrapper.eq(PersonProductModelDetails::getModelId, modelId); |
|||
detailsUpdateWrapper.set(PersonProductModelDetails::getIsTemporary, "0"); |
|||
personProductModelDetailsMapper.update(null,detailsUpdateWrapper); |
|||
} |
|||
|
|||
} |
|||
@Override |
|||
public void afterRemove(PersonProducts entity) { |
|||
// 删除供应商产品信息时,将厂商产品型号和型号规格参数删除
|
|||
String modelId = entity.getModelId(); |
|||
if (StringUtils.isNotBlank(modelId)) { |
|||
LambdaUpdateWrapper<PersonProductModel> modelUpdateWrapper = new LambdaUpdateWrapper<>(); // 临时数据标记
|
|||
modelUpdateWrapper.eq(PersonProductModel::getId, modelId); |
|||
personProductModelMapper.delete(modelUpdateWrapper); |
|||
// 更新型号规格参数的is_temporary标记为临时数据
|
|||
LambdaUpdateWrapper<PersonProductModelDetails> detailsUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
detailsUpdateWrapper.eq(PersonProductModelDetails::getModelId, modelId); |
|||
personProductModelDetailsMapper.delete(detailsUpdateWrapper); |
|||
} |
|||
} |
|||
@Override |
|||
public void beforeAdd(PersonProducts entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(PersonProducts entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(PersonProducts entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,93 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import tech.abc.platform.productManagement.entity.ProductModelTemplateDetails; |
|||
import tech.abc.platform.productManagement.mapper.ProductModelTemplateDetailsMapper; |
|||
import tech.abc.platform.productManagement.service.ProductModelTemplateDetailsService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.HashMap; |
|||
import java.util.stream.Collectors; |
|||
|
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import tech.abc.platform.productManagement.vo.ProductModelTemplateDetailsVO; |
|||
|
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class ProductModelTemplateDetailsServiceImpl extends BaseServiceImpl<ProductModelTemplateDetailsMapper, ProductModelTemplateDetails> implements ProductModelTemplateDetailsService { |
|||
@Override |
|||
public void addList(List<ProductModelTemplateDetailsVO> vo) { |
|||
for(ProductModelTemplateDetailsVO item:vo){ |
|||
ProductModelTemplateDetails productModelTemplateDetails = mapperFacade.map(item, ProductModelTemplateDetails.class); |
|||
save(productModelTemplateDetails); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void modifyList(List<ProductModelTemplateDetailsVO> vo) { |
|||
//先删后增
|
|||
LambdaQueryWrapper<ProductModelTemplateDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(ProductModelTemplateDetails::getModelTemplateId, vo.get(0).getModelTemplateId()); |
|||
remove(queryWrapper); |
|||
//增加
|
|||
for(ProductModelTemplateDetailsVO item:vo){ |
|||
ProductModelTemplateDetails productModelTemplateDetails = mapperFacade.map(item, ProductModelTemplateDetails.class); |
|||
productModelTemplateDetails.setId(null); |
|||
productModelTemplateDetails.setUpdateId(null); |
|||
productModelTemplateDetails.setUpdateTime(null); |
|||
productModelTemplateDetails.setIsTemporary("0");//修改的话,新数据为非临时数据
|
|||
save(productModelTemplateDetails); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public String getDetailsDescriptionByModelId(String id) { |
|||
LambdaQueryWrapper<ProductModelTemplateDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(ProductModelTemplateDetails::getModelTemplateId, id); |
|||
List<ProductModelTemplateDetails> list = list(queryWrapper); |
|||
String description = list.stream().map(ProductModelTemplateDetails::getParamName).collect(Collectors.joining(";")); |
|||
return description; |
|||
} |
|||
|
|||
@Override |
|||
public ProductModelTemplateDetails init() { |
|||
ProductModelTemplateDetails entity=new ProductModelTemplateDetails(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(ProductModelTemplateDetails entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(ProductModelTemplateDetails entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(ProductModelTemplateDetails entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,74 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import tech.abc.platform.productManagement.entity.*; |
|||
import tech.abc.platform.productManagement.mapper.ProductModelTemplateDetailsMapper; |
|||
import tech.abc.platform.productManagement.mapper.ProductModelTemplateMapper; |
|||
import tech.abc.platform.productManagement.service.ProductModelTemplateService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class ProductModelTemplateServiceImpl extends BaseServiceImpl<ProductModelTemplateMapper, ProductModelTemplate> implements ProductModelTemplateService { |
|||
@Autowired |
|||
private ProductModelTemplateDetailsMapper productModelTemplateDetailsMapper; |
|||
@Override |
|||
public ProductModelTemplate init() { |
|||
ProductModelTemplate entity=new ProductModelTemplate(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(ProductModelTemplate entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
@Override |
|||
public void afterAdd(ProductModelTemplate entity) { |
|||
//新增后设置型号规格为非临时数据
|
|||
String id = entity.getId(); |
|||
LambdaUpdateWrapper<ProductModelTemplateDetails> updateWrapper = new LambdaUpdateWrapper<>(); |
|||
updateWrapper.eq(ProductModelTemplateDetails::getModelTemplateId, id).set(ProductModelTemplateDetails::getIsTemporary, "0"); |
|||
productModelTemplateDetailsMapper.update(null,updateWrapper); |
|||
} |
|||
@Override |
|||
public void afterRemove(ProductModelTemplate entity) { |
|||
// 删除供应商产品信息时,将厂商产品型号和型号规格参数删除
|
|||
String modelId = entity.getId(); |
|||
LambdaQueryWrapper<ProductModelTemplateDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(ProductModelTemplateDetails::getModelTemplateId, modelId); |
|||
productModelTemplateDetailsMapper.delete(queryWrapper); |
|||
} |
|||
@Override |
|||
public void beforeModify(ProductModelTemplate entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(ProductModelTemplate entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,56 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import tech.abc.platform.productManagement.entity.SupplierInformation; |
|||
import tech.abc.platform.productManagement.mapper.SupplierInformationMapper; |
|||
import tech.abc.platform.productManagement.service.SupplierInformationService; |
|||
|
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-07 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class SupplierInformationServiceImpl extends BaseServiceImpl<SupplierInformationMapper, SupplierInformation> implements SupplierInformationService { |
|||
|
|||
@Override |
|||
public SupplierInformation init() { |
|||
SupplierInformation entity=new SupplierInformation(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(SupplierInformation entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(SupplierInformation entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(SupplierInformation entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,54 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import tech.abc.platform.productManagement.entity.SupplierProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.SupplierProductModelDetailsMapper; |
|||
import tech.abc.platform.productManagement.service.SupplierProductModelDetailsService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class SupplierProductModelDetailsServiceImpl extends BaseServiceImpl<SupplierProductModelDetailsMapper, SupplierProductModelDetails> implements SupplierProductModelDetailsService { |
|||
|
|||
@Override |
|||
public SupplierProductModelDetails init() { |
|||
SupplierProductModelDetails entity=new SupplierProductModelDetails(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(SupplierProductModelDetails entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(SupplierProductModelDetails entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(SupplierProductModelDetails entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,172 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import tech.abc.platform.productManagement.entity.SupplierProductModel; |
|||
import tech.abc.platform.productManagement.entity.SupplierProductModelDetails; |
|||
import tech.abc.platform.productManagement.mapper.SupplierProductModelMapper; |
|||
import tech.abc.platform.productManagement.service.SupplierProductModelDetailsService; |
|||
import tech.abc.platform.productManagement.service.SupplierProductModelService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import org.apache.commons.collections.CollectionUtils; |
|||
|
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import tech.abc.platform.productManagement.vo.SupplierProductModelDetailsVO; |
|||
import tech.abc.platform.productManagement.vo.SupplierProductModelVO; |
|||
import tech.abc.platform.productManagement.vo.ProductModelViewVO; |
|||
|
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class SupplierProductModelServiceImpl extends BaseServiceImpl<SupplierProductModelMapper, SupplierProductModel> implements SupplierProductModelService { |
|||
@Autowired |
|||
private SupplierProductModelDetailsService supplierProductModelDetailsService; |
|||
@Override |
|||
public void addModel(ProductModelViewVO vo) { |
|||
List<SupplierProductModelDetailsVO> modelDeatilOV = vo.getModelDeatils(); |
|||
//给型号指标设置型号id,并保存
|
|||
for (SupplierProductModelDetailsVO item :modelDeatilOV |
|||
) { |
|||
item.setModelId(vo.getId()); |
|||
SupplierProductModelDetails supplierProductModelDetails = mapperFacade.map(item, SupplierProductModelDetails.class); |
|||
supplierProductModelDetailsService.save(supplierProductModelDetails); |
|||
} |
|||
//保存型号
|
|||
SupplierProductModel supplierProductModel = mapperFacade.map(vo, SupplierProductModel.class); |
|||
save(supplierProductModel); |
|||
} |
|||
@Override |
|||
public void modifyModel(ProductModelViewVO vo) { |
|||
String id = vo.getId(); |
|||
//删除原型号指标参数
|
|||
LambdaQueryWrapper<SupplierProductModelDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(SupplierProductModelDetails::getModelId, id); |
|||
supplierProductModelDetailsService.remove(queryWrapper); |
|||
List<SupplierProductModelDetailsVO> modelDeatilOV = vo.getModelDeatils(); |
|||
//给型号指标设置型号id,并保存
|
|||
for (SupplierProductModelDetailsVO item :modelDeatilOV |
|||
) { |
|||
item.setModelId(vo.getId()); |
|||
item.setId(null); |
|||
item.setUpdateId(null); |
|||
item.setUpdateTime(null); |
|||
SupplierProductModelDetails supplierProductModelDetails = mapperFacade.map(item, SupplierProductModelDetails.class); |
|||
supplierProductModelDetails.setIsTemporary("0");//修改的化,将临时标记改为0,表示非临时
|
|||
supplierProductModelDetailsService.save(supplierProductModelDetails); |
|||
} |
|||
//保存型号
|
|||
SupplierProductModel supplierProductModel = mapperFacade.map(vo, SupplierProductModel.class); |
|||
updateById(supplierProductModel); |
|||
} |
|||
@Override |
|||
public List<SupplierProductModelDetailsVO> getModelDetails(String id) { |
|||
//根据型号id查询型号详情规格指标
|
|||
// QueryWrapper<SupplierProductModelDetails> queryWrapper = new QueryWrapper<>();
|
|||
// queryWrapper.lambda().eq(SupplierProductModelDetails::getModelId, id);
|
|||
LambdaQueryWrapper<SupplierProductModelDetails> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(SupplierProductModelDetails::getModelId, id); |
|||
List<SupplierProductModelDetails> list = supplierProductModelDetailsService.list(queryWrapper); |
|||
if (CollectionUtils.isEmpty(list)) { |
|||
return new ArrayList<>(); |
|||
} |
|||
List<SupplierProductModelDetailsVO> result =convert2DetailsVO(list); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
@Override |
|||
public SupplierProductModel init() { |
|||
SupplierProductModel entity=new SupplierProductModel(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
|
|||
@Override |
|||
public void beforeAdd(SupplierProductModel entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(SupplierProductModel entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(SupplierProductModel entity, String... value) { |
|||
} |
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<SupplierProductModelVO> convert2VO(List<SupplierProductModel> entityList) { |
|||
List<SupplierProductModelVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
SupplierProductModelVO vo = convert2VO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected SupplierProductModelVO convert2VO(SupplierProductModel entity){ |
|||
SupplierProductModelVO vo=mapperFacade.map(entity,SupplierProductModelVO.class); |
|||
return vo; |
|||
} |
|||
/** |
|||
* 将实体列表转换为视图对象列表 |
|||
* |
|||
* @param entityList 实体列表 |
|||
* @return {@link List}<{@link EntityVO}> 视图对象列表 |
|||
*/ |
|||
protected List<SupplierProductModelDetailsVO> convert2DetailsVO(List<SupplierProductModelDetails> entityList) { |
|||
List<SupplierProductModelDetailsVO> voList = new ArrayList<>(entityList.size()); |
|||
|
|||
entityList.stream().forEach(x -> { |
|||
SupplierProductModelDetailsVO vo = convert2DetailsVO(x); |
|||
voList.add(vo); |
|||
}); |
|||
return voList; |
|||
} |
|||
/** |
|||
* 将单条实体转换为视图对象 |
|||
* |
|||
* @param entity 实体 |
|||
* @return {@link EntityVO} 视图对象 |
|||
*/ |
|||
protected SupplierProductModelDetailsVO convert2DetailsVO(SupplierProductModelDetails entity){ |
|||
SupplierProductModelDetailsVO vo=mapperFacade.map(entity,SupplierProductModelDetailsVO.class); |
|||
return vo; |
|||
} |
|||
} |
|||
|
@ -0,0 +1,95 @@ |
|||
package tech.abc.platform.productManagement.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import tech.abc.platform.productManagement.entity.SupplierProductModel; |
|||
import tech.abc.platform.productManagement.entity.SupplierProductModelDetails; |
|||
import tech.abc.platform.productManagement.entity.SupplierProducts; |
|||
import tech.abc.platform.productManagement.mapper.SupplierProductModelDetailsMapper; |
|||
import tech.abc.platform.productManagement.mapper.SupplierProductModelMapper; |
|||
import tech.abc.platform.productManagement.mapper.SupplierProductsMapper; |
|||
import tech.abc.platform.productManagement.service.SupplierProductsService; |
|||
import tech.abc.platform.common.base.BaseServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
import java.util.HashMap; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
/** |
|||
* 服务实现类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-08 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class SupplierProductsServiceImpl extends BaseServiceImpl<SupplierProductsMapper, SupplierProducts> implements SupplierProductsService { |
|||
@Autowired |
|||
private SupplierProductModelMapper supplierProductModelMapper; |
|||
@Autowired |
|||
private SupplierProductModelDetailsMapper supplierProductModelDetailsMapper; |
|||
@Override |
|||
public SupplierProducts init() { |
|||
SupplierProducts entity=new SupplierProducts(); |
|||
// 预先分配标识
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
//默认值处理
|
|||
return entity; |
|||
} |
|||
@Override |
|||
public void afterAdd(SupplierProducts entity) { |
|||
// 新增供应商产品信息时,将厂商产品型号和型号规格参数变成的is_temporary标记为非临时数据
|
|||
String modelId = entity.getModelId(); |
|||
if (StringUtils.isNotBlank(modelId)) { |
|||
LambdaUpdateWrapper<SupplierProductModel> modelUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
modelUpdateWrapper.eq(SupplierProductModel::getId, modelId); |
|||
modelUpdateWrapper.set(SupplierProductModel::getIsTemporary, "0"); |
|||
supplierProductModelMapper.update(null,modelUpdateWrapper); |
|||
// 更新型号规格参数的is_temporary标记为非临时数据
|
|||
LambdaUpdateWrapper<SupplierProductModelDetails> detailsUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
detailsUpdateWrapper.eq(SupplierProductModelDetails::getModelId, modelId); |
|||
detailsUpdateWrapper.set(SupplierProductModelDetails::getIsTemporary, "0"); |
|||
supplierProductModelDetailsMapper.update(null,detailsUpdateWrapper); |
|||
} |
|||
|
|||
} |
|||
@Override |
|||
public void afterRemove(SupplierProducts entity) { |
|||
// 删除供应商产品信息时,将厂商产品型号和型号规格参数删除
|
|||
String modelId = entity.getModelId(); |
|||
if (StringUtils.isNotBlank(modelId)) { |
|||
LambdaUpdateWrapper<SupplierProductModel> modelUpdateWrapper = new LambdaUpdateWrapper<>(); // 临时数据标记
|
|||
modelUpdateWrapper.eq(SupplierProductModel::getId, modelId); |
|||
supplierProductModelMapper.delete(modelUpdateWrapper); |
|||
// 更新型号规格参数的is_temporary标记为临时数据
|
|||
LambdaUpdateWrapper<SupplierProductModelDetails> detailsUpdateWrapper = new LambdaUpdateWrapper<>(); |
|||
detailsUpdateWrapper.eq(SupplierProductModelDetails::getModelId, modelId); |
|||
supplierProductModelDetailsMapper.delete(detailsUpdateWrapper); |
|||
} |
|||
} |
|||
@Override |
|||
public void beforeAdd(SupplierProducts entity) { |
|||
//唯一性验证
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void beforeModify(SupplierProducts entity) { |
|||
//唯一性验证
|
|||
} |
|||
|
|||
@Override |
|||
public Map<String, String> getNameMap(List<String> idList) { |
|||
Map<String, String> result = new HashMap<>(5); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
protected void copyPropertyHandle(SupplierProducts entity, String... value) { |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,69 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class CompanyProductModelDetailsVO extends BaseVO { |
|||
/** |
|||
* 公司产品型号表id |
|||
*/ |
|||
@NotBlank(message = "【公司产品型号表id】不能为空") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
@NotBlank(message = "【指标名称】不能为空") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
@NotBlank(message = "【指标参数】不能为空") |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
@NotBlank(message = "【是否关键指标】不能为空") |
|||
private String isKeyParameter; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
private String isTemporary; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class CompanyProductModelVO extends BaseVO { |
|||
/** |
|||
* 产品描述 |
|||
*/ |
|||
@NotBlank(message = "【产品描述】不能为空") |
|||
private String description; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
@NotBlank(message = "【产品型号】不能为空") |
|||
private String productModelTemplateId; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.math.BigDecimal; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class CompanyProductsVO extends BaseVO { |
|||
/** |
|||
* 供应商ID |
|||
*/ |
|||
private String supplierInformationId; |
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
private String supplierName; |
|||
|
|||
/** |
|||
* 公司产品型号id |
|||
*/ |
|||
@NotBlank(message = "【产品型号】不能为空") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
@NotBlank(message = "【产品名称】不能为空") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
|
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
@NotBlank(message = "【产品价格】不能为空") |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
/** |
|||
* 产品描述 |
|||
*/ |
|||
private String modelDescription; |
|||
/** |
|||
* 供应商产品id |
|||
*/ |
|||
private String supplierProductsId; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class PersonProductModelDetailsVO extends BaseVO { |
|||
/** |
|||
* 个人产品型号表id |
|||
*/ |
|||
@NotBlank(message = "【个人产品型号表id】不能为空") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
@NotBlank(message = "【指标名称】不能为空") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 指标参数 |
|||
*/ |
|||
@NotBlank(message = "【指标参数】不能为空") |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
@NotBlank(message = "【是否关键指标】不能为空") |
|||
private String isKeyParameter; |
|||
|
|||
/** |
|||
* 是否临时数据 |
|||
*/ |
|||
private String isTemporary; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class PersonProductModelVO extends BaseVO { |
|||
/** |
|||
* 个人产品指标描述 |
|||
*/ |
|||
@NotBlank(message = "【个人产品指标描述】不能为空") |
|||
private String description; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
@NotBlank(message = "【产品型号模板id】不能为空") |
|||
private String productModelTemplateId; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,84 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.math.BigDecimal; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-17 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class PersonProductsVO extends BaseVO { |
|||
/** |
|||
* 个人产品型号id |
|||
*/ |
|||
@NotBlank(message = "【个人产品型号id】不能为空") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 供应商id |
|||
*/ |
|||
private String supplierInformationId; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
@NotBlank(message = "【产品名称】不能为空") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
@NotBlank(message = "【产品价格】不能为空") |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
|
|||
/** |
|||
* 关联厂商产品id |
|||
*/ |
|||
private String supplierProductsId; |
|||
private String ModelDescription; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class ProductModelTemplateDetailsVO extends BaseVO { |
|||
/** |
|||
* 产品型号表id |
|||
*/ |
|||
@NotBlank(message = "【产品型号表id】不能为空") |
|||
private String modelTemplateId; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
@NotBlank(message = "【指标名称】不能为空") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 是否关键指标 |
|||
*/ |
|||
@NotBlank(message = "【是否关键指标】不能为空") |
|||
private String isKeyParameter; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-16 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class ProductModelTemplateVO extends BaseVO { |
|||
/** |
|||
* 模板名称 |
|||
*/ |
|||
@NotBlank(message = "【模板名称】不能为空") |
|||
private String templateName; |
|||
private String templateDetailsDescription; |
|||
|
|||
/** |
|||
* 模板类型 |
|||
*/ |
|||
private String templateType; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
// /**
|
|||
// * 模型详情
|
|||
// */
|
|||
// private String templateDetails;
|
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class ProductModelViewVO<T> extends BaseVO { |
|||
/** |
|||
* 厂商产品型号描述 |
|||
*/ |
|||
@NotBlank(message = "【厂商产品型号描述】不能为空") |
|||
private String description; |
|||
|
|||
/** |
|||
* 产品型号模板id |
|||
*/ |
|||
private String productModelTemplateId; |
|||
|
|||
private List<T> modelDeatils; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-07 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class SupplierInformationVO extends BaseVO { |
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
@NotBlank(message = "【供应商名称】不能为空") |
|||
private String supplierName; |
|||
|
|||
/** |
|||
* 供应商联系人 |
|||
*/ |
|||
@NotBlank(message = "【供应商联系人】不能为空") |
|||
private String supplierContacts; |
|||
|
|||
/** |
|||
* 供应商联系电话 |
|||
*/ |
|||
@NotBlank(message = "【供应商联系电话】不能为空") |
|||
private String supplierContactsPhone; |
|||
|
|||
/** |
|||
* 供应商类型 |
|||
*/ |
|||
@NotBlank(message = "【供应商类型】不能为空") |
|||
private String supplierType; |
|||
/** |
|||
* 职位 |
|||
*/ |
|||
@NotBlank(message = "【职位】不能为空") |
|||
private String position; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class SupplierProductModelDetailsVO extends BaseVO { |
|||
/** |
|||
* 厂商产品型号表id |
|||
*/ |
|||
@NotBlank(message = "【厂商产品型号表id】不能为空") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 参数名称` |
|||
*/ |
|||
@NotBlank(message = "【指标名称`】不能为空") |
|||
private String paramName; |
|||
|
|||
/** |
|||
* 参数指标 |
|||
*/ |
|||
@NotBlank(message = "【指标参数】不能为空") |
|||
private String parameterValue; |
|||
|
|||
/** |
|||
* 是否关键参数 |
|||
*/ |
|||
@NotBlank(message = "【是否关键参数】不能为空") |
|||
private String isKeyParameter; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-14 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class SupplierProductModelVO extends BaseVO { |
|||
/** |
|||
* 厂商产品参数描述 |
|||
*/ |
|||
@NotBlank(message = "【厂商产品参数描述】不能为空") |
|||
private String description; |
|||
|
|||
/** |
|||
* 产品参数模板id |
|||
*/ |
|||
@NotBlank(message = "【产品型号】不能为空") |
|||
private String productModelTemplateId; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
package tech.abc.platform.productManagement.vo; |
|||
|
|||
|
|||
import tech.abc.platform.common.base.BaseVO; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.math.BigDecimal; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
/** |
|||
* 视图对象类 |
|||
* |
|||
* @author ZHB |
|||
* @date 2024-05-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Accessors(chain = true) |
|||
public class SupplierProductsVO extends BaseVO { |
|||
/** |
|||
* 供应商ID |
|||
*/ |
|||
private String supplierInformationId; |
|||
/** |
|||
* 供应商名称 |
|||
*/ |
|||
private String supplierName; |
|||
|
|||
/** |
|||
* 厂商产品型参数id |
|||
*/ |
|||
@NotBlank(message = "【产品型号】不能为空") |
|||
private String modelId; |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
@NotBlank(message = "【产品名称】不能为空") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 产品标识(型号) |
|||
*/ |
|||
private String productIdentity; |
|||
|
|||
/** |
|||
* 产品价格 |
|||
*/ |
|||
@NotBlank(message = "【产品价格】不能为空") |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 信息来源 |
|||
*/ |
|||
private String sourceInformation; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remarks; |
|||
/** |
|||
* 产品描述 |
|||
*/ |
|||
private String modelDescription; |
|||
|
|||
|
|||
/********非库表存储属性*****/ |
|||
|
|||
|
|||
|
|||
/********字典类*****/ |
|||
|
|||
/********实体类、用户单选、组织机构单选*****/ |
|||
|
|||
/********范围查询*****/ |
|||
|
|||
/********自定义扩展*****/ |
|||
|
|||
/********子对象*****/ |
|||
|
|||
|
|||
|
|||
|
|||
} |
Loading…
Reference in new issue