diff --git a/platform-boot-started-productManagement/pom.xml b/platform-boot-started-productManagement/pom.xml new file mode 100644 index 0000000..a96b691 --- /dev/null +++ b/platform-boot-started-productManagement/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + + tech.abc + abc-development-platform + 5.1.0 + + + platform-boot-started-productManagement + 5.1.0 + platform-boot-started-productManagement + 产品管理模块 + + + + tech.abc + platform-common + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + 1.8 + 1.8 + UTF-8 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + true + + + + + + + + src/main/java + + **/*.xml + + + + + src/main/resources + + + *.yml + + **/*.xlsx + + *.xml + + + + + + \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductModelController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductModelController.java new file mode 100644 index 0000000..2b8c5f4 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductModelController.java @@ -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 addModel(@Validated @RequestBody ProductModelViewVO vo) { + companyProductModelService.addModel(vo); + return ResultUtil.success(); + } + /** + * 修改 + */ + @PutMapping("/modifyModel") + @SystemLog(value = "-修改型号与规格") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModel:modify')") + public ResponseEntity modifyModel(@Validated @RequestBody ProductModelViewVO vo) { + companyProductModelService.modifyModel(vo); + return ResultUtil.success(); + } + /** + * 获取单条数据 + */ + @GetMapping("/getModelDetails/{id}") + @SystemLog(value = "-获取型号详情") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModel:query')") + public ResponseEntity getModelDetails(@PathVariable("id") String id) { + List detailsList=companyProductModelService.getModelDetails(id); + return ResultUtil.success(detailsList); + } + //region 基本操作 + /** + * 初始化 + */ + @GetMapping("/init") + public ResponseEntity init() { + CompanyProductModel entity=companyProductModelService.init(); + CompanyProductModelVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModel:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + companyProductModelService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModel:query')") + public ResponseEntity page(CompanyProductModelVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModel.class,queryVO,sortInfo); + + //查询数据 + companyProductModelService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List companyProductModelVOList=convert2VO(page.getRecords()); + pageVO.setRecords(companyProductModelVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModel:query')") + public ResponseEntity list(CompanyProductModelVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModel.class, queryVO,sortInfo); + List list= companyProductModelService.list(queryWrapper); + //转换vo + List companyProductModelVOList=convert2VO(list); + return ResultUtil.success(companyProductModelVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModel:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + companyProductModelService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModel:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductModelDetailsController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductModelDetailsController.java new file mode 100644 index 0000000..f0a01bb --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductModelDetailsController.java @@ -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 init() { + CompanyProductModelDetails entity=companyProductModelDetailsService.init(); + CompanyProductModelDetailsVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + companyProductModelDetailsService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:query')") + public ResponseEntity page(CompanyProductModelDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModelDetails.class,queryVO,sortInfo); + + //查询数据 + companyProductModelDetailsService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List companyProductModelDetailsVOList=convert2VO(page.getRecords()); + pageVO.setRecords(companyProductModelDetailsVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:query')") + public ResponseEntity list(CompanyProductModelDetailsVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProductModelDetails.class, queryVO,sortInfo); + List list= companyProductModelDetailsService.list(queryWrapper); + //转换vo + List companyProductModelDetailsVOList=convert2VO(list); + return ResultUtil.success(companyProductModelDetailsVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + companyProductModelDetailsService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:companyProductModelDetails:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductsController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductsController.java new file mode 100644 index 0000000..717880e --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/CompanyProductsController.java @@ -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 init() { + CompanyProducts entity=companyProductsService.init(); + CompanyProductsVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:companyProducts:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + companyProductsService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:companyProducts:query')") + public ResponseEntity page(CompanyProductsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProducts.class,queryVO,sortInfo); + + //查询数据 + companyProductsService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List companyProductsVOList=convert2VO(page.getRecords()); + pageVO.setRecords(companyProductsVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:companyProducts:query')") + public ResponseEntity list(CompanyProductsVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(CompanyProducts.class, queryVO,sortInfo); + List list= companyProductsService.list(queryWrapper); + //转换vo + List companyProductsVOList=convert2VO(list); + return ResultUtil.success(companyProductsVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:companyProducts:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + companyProductsService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:companyProducts:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductModelController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductModelController.java new file mode 100644 index 0000000..df54b7e --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductModelController.java @@ -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 addModel(@Validated @RequestBody ProductModelViewVO vo) { + personProductModelService.addModel(vo); + return ResultUtil.success(); + } + /** + * 修改 + */ + @PutMapping("/modifyModel") + @SystemLog(value = "-修改型号与规格") + @PreAuthorize("hasPermission(null,'productManagement:personProductModel:modify')") + public ResponseEntity modifyModel(@Validated @RequestBody ProductModelViewVO vo) { + personProductModelService.modifyModel(vo); + return ResultUtil.success(); + } + /** + * 获取单条数据 + */ + @GetMapping("/getModelDetails/{id}") + @SystemLog(value = "-获取型号详情") + @PreAuthorize("hasPermission(null,'productManagement:personProductModel:query')") + public ResponseEntity getModelDetails(@PathVariable("id") String id) { + List detailsList=personProductModelService.getModelDetails(id); + return ResultUtil.success(detailsList); + } + //region 基本操作 + /** + * 初始化 + */ + @GetMapping("/init") + public ResponseEntity init() { + PersonProductModel entity=personProductModelService.init(); + PersonProductModelVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:personProductModel:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + personProductModelService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:personProductModel:query')") + public ResponseEntity page(PersonProductModelVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModel.class,queryVO,sortInfo); + + //查询数据 + personProductModelService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List personProductModelVOList=convert2VO(page.getRecords()); + pageVO.setRecords(personProductModelVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:personProductModel:query')") + public ResponseEntity list(PersonProductModelVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModel.class, queryVO,sortInfo); + List list= personProductModelService.list(queryWrapper); + //转换vo + List personProductModelVOList=convert2VO(list); + return ResultUtil.success(personProductModelVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:personProductModel:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + personProductModelService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:personProductModel:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductModelDetailsController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductModelDetailsController.java new file mode 100644 index 0000000..9cf717e --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductModelDetailsController.java @@ -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 init() { + PersonProductModelDetails entity=personProductModelDetailsService.init(); + PersonProductModelDetailsVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + personProductModelDetailsService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:query')") + public ResponseEntity page(PersonProductModelDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModelDetails.class,queryVO,sortInfo); + + //查询数据 + personProductModelDetailsService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List personProductModelDetailsVOList=convert2VO(page.getRecords()); + pageVO.setRecords(personProductModelDetailsVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:query')") + public ResponseEntity list(PersonProductModelDetailsVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(PersonProductModelDetails.class, queryVO,sortInfo); + List list= personProductModelDetailsService.list(queryWrapper); + //转换vo + List personProductModelDetailsVOList=convert2VO(list); + return ResultUtil.success(personProductModelDetailsVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + personProductModelDetailsService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'costManagement:personProductModelDetails:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductsController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductsController.java new file mode 100644 index 0000000..e84840f --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/PersonProductsController.java @@ -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 init() { + PersonProducts entity=personProductsService.init(); + PersonProductsVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:personProducts:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + personProductsService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:personProducts:query')") + public ResponseEntity page(PersonProductsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(PersonProducts.class,queryVO,sortInfo); + + //查询数据 + personProductsService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List personProductsVOList=convert2VO(page.getRecords()); + pageVO.setRecords(personProductsVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:personProducts:query')") + public ResponseEntity list(PersonProductsVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(PersonProducts.class, queryVO,sortInfo); + List list= personProductsService.list(queryWrapper); + //转换vo + List personProductsVOList=convert2VO(list); + return ResultUtil.success(personProductsVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:personProducts:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + personProductsService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:personProducts:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/ProductModelTemplateController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/ProductModelTemplateController.java new file mode 100644 index 0000000..c4cdb70 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/ProductModelTemplateController.java @@ -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 init() { + ProductModelTemplate entity=productModelTemplateService.init(); + ProductModelTemplateVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + productModelTemplateService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:query')") + public ResponseEntity page(ProductModelTemplateVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplate.class,queryVO,sortInfo); + + //查询数据 + productModelTemplateService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List productModelTemplateVOList=convert2VO(page.getRecords()); + pageVO.setRecords(productModelTemplateVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:query')") + public ResponseEntity list(ProductModelTemplateVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplate.class, queryVO,sortInfo); + List list= productModelTemplateService.list(queryWrapper); + //转换vo + List productModelTemplateVOList=convert2VO(list); + return ResultUtil.success(productModelTemplateVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + productModelTemplateService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplate:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/ProductModelTemplateDetailsController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/ProductModelTemplateDetailsController.java new file mode 100644 index 0000000..b79aaad --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/ProductModelTemplateDetailsController.java @@ -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 addList(@Validated @RequestBody List vo) { + productModelTemplateDetailsService.addList(vo); + return ResultUtil.success(); + } + /** + * 修改 + */ + @PutMapping("/modifyList") + @SystemLog(value = "-修改型号规格明细") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:modify')") + public ResponseEntity modifyList(@Validated @RequestBody List vo) { + productModelTemplateDetailsService.modifyList(vo); + return ResultUtil.success(); + } + //region 基本操作 + /** + * 初始化 + */ + @GetMapping("/init") + public ResponseEntity init() { + ProductModelTemplateDetails entity=productModelTemplateDetailsService.init(); + ProductModelTemplateDetailsVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + productModelTemplateDetailsService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:query')") + public ResponseEntity page(ProductModelTemplateDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplateDetails.class,queryVO,sortInfo); + + //查询数据 + productModelTemplateDetailsService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List productModelTemplateDetailsVOList=convert2VO(page.getRecords()); + pageVO.setRecords(productModelTemplateDetailsVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:query')") + public ResponseEntity list(ProductModelTemplateDetailsVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(ProductModelTemplateDetails.class, queryVO,sortInfo); + List list= productModelTemplateDetailsService.list(queryWrapper); + //转换vo + List productModelTemplateDetailsVOList=convert2VO(list); + return ResultUtil.success(productModelTemplateDetailsVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + productModelTemplateDetailsService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:productModelTemplateDetails:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierInformationController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierInformationController.java new file mode 100644 index 0000000..4d12fb8 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierInformationController.java @@ -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 init() { + SupplierInformation entity=supplierInformationService.init(); + SupplierInformationVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierInformation:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + supplierInformationService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:supplierInformation:query')") + public ResponseEntity page(SupplierInformationVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierInformation.class,queryVO,sortInfo); + + //查询数据 + supplierInformationService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List supplierInformationVOList=convert2VO(page.getRecords()); + pageVO.setRecords(supplierInformationVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:supplierInformation:query')") + public ResponseEntity list(SupplierInformationVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierInformation.class, queryVO,sortInfo); + List list= supplierInformationService.list(queryWrapper); + //转换vo + List supplierInformationVOList=convert2VO(list); + return ResultUtil.success(supplierInformationVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:supplierInformation:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + supplierInformationService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierInformation:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductModelController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductModelController.java new file mode 100644 index 0000000..315a176 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductModelController.java @@ -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 addModel(@Validated @RequestBody ProductModelViewVO vo) { + supplierProductModelService.addModel(vo); + return ResultUtil.success(); + } + /** + * 修改 + */ + @PutMapping("/modifyModel") + @SystemLog(value = "-修改型号与规格") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:modify')") + public ResponseEntity modifyModel(@Validated @RequestBody ProductModelViewVO vo) { + supplierProductModelService.modifyModel(vo); + return ResultUtil.success(); + } + /** + * 获取单条数据 + */ + @GetMapping("/getModelDetails/{id}") + @SystemLog(value = "-获取型号详情") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:query')") + public ResponseEntity getModelDetails(@PathVariable("id") String id) { + List detailsList=supplierProductModelService.getModelDetails(id); + return ResultUtil.success(detailsList); + } + //region 基本操作 + /** + * 初始化 + */ + @GetMapping("/init") + public ResponseEntity init() { + SupplierProductModel entity=supplierProductModelService.init(); + SupplierProductModelVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + supplierProductModelService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:query')") + public ResponseEntity page(SupplierProductModelVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModel.class,queryVO,sortInfo); + + //查询数据 + supplierProductModelService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List supplierProductModelVOList=convert2VO(page.getRecords()); + pageVO.setRecords(supplierProductModelVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:query')") + public ResponseEntity list(SupplierProductModelVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModel.class, queryVO,sortInfo); + List list= supplierProductModelService.list(queryWrapper); + //转换vo + List supplierProductModelVOList=convert2VO(list); + return ResultUtil.success(supplierProductModelVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + supplierProductModelService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModel:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductModelDetailsController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductModelDetailsController.java new file mode 100644 index 0000000..5f767f4 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductModelDetailsController.java @@ -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 init() { + SupplierProductModelDetails entity=supplierProductModelDetailsService.init(); + SupplierProductModelDetailsVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + supplierProductModelDetailsService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:query')") + public ResponseEntity page(SupplierProductModelDetailsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModelDetails.class,queryVO,sortInfo); + + //查询数据 + supplierProductModelDetailsService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List supplierProductModelDetailsVOList=convert2VO(page.getRecords()); + pageVO.setRecords(supplierProductModelDetailsVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:query')") + public ResponseEntity list(SupplierProductModelDetailsVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProductModelDetails.class, queryVO,sortInfo); + List list= supplierProductModelDetailsService.list(queryWrapper); + //转换vo + List supplierProductModelDetailsVOList=convert2VO(list); + return ResultUtil.success(supplierProductModelDetailsVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + supplierProductModelDetailsService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierProductModelDetails:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductsController.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductsController.java new file mode 100644 index 0000000..ffcae02 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/controller/SupplierProductsController.java @@ -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 init() { + SupplierProducts entity=supplierProductsService.init(); + SupplierProductsVO vo = convert2VO(entity); + return ResultUtil.success(vo); + } + + /** + * 新增 + */ + @PostMapping("/") + @SystemLog(value = "-新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierProducts:add')") + public ResponseEntity 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 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 remove(@PathVariable("id") String id) { + supplierProductsService.remove(id); + return ResultUtil.success(); + } + + /** + * 分页 + */ + @GetMapping("/page") + @SystemLog(value = "-分页") + @PreAuthorize("hasPermission(null,'productManagement:supplierProducts:query')") + public ResponseEntity page(SupplierProductsVO queryVO, PageInfo pageInfo, SortInfo sortInfo) { + //构造分页对象 + IPage page = new Page(pageInfo.getPageNum(), pageInfo.getPageSize()); + + + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProducts.class,queryVO,sortInfo); + + //查询数据 + supplierProductsService.page(page, queryWrapper); + //转换vo + IPage pageVO = mapperFacade.map(page, IPage.class); + List supplierProductsVOList=convert2VO(page.getRecords()); + pageVO.setRecords(supplierProductsVOList); + return ResultUtil.success(pageVO); + } + + + /** + * 列表 + */ + @GetMapping("/list") + @SystemLog(value = "-列表") + @PreAuthorize("hasPermission(null,'productManagement:supplierProducts:query')") + public ResponseEntity list(SupplierProductsVO queryVO, SortInfo sortInfo) { + //构造查询条件 + QueryWrapper queryWrapper = QueryGenerator.generateQueryWrapper(SupplierProducts.class, queryVO,sortInfo); + List list= supplierProductsService.list(queryWrapper); + //转换vo + List supplierProductsVOList=convert2VO(list); + return ResultUtil.success(supplierProductsVOList); + } + + /** + * 获取单条数据 + */ + @GetMapping("/{id}") + @SystemLog(value = "-详情") + @PreAuthorize("hasPermission(null,'productManagement:supplierProducts:view')") + public ResponseEntity 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 addByCopy(@PathVariable("id") String id) { + supplierProductsService.addByCopy(id); + return ResultUtil.success(); + } + + + /** + * 复制新增单条数据,返回复制后的对象 + */ + @PostMapping("/{id}/addSingleByCopy") + @SystemLog(value = "-复制新增") + @PreAuthorize("hasPermission(null,'productManagement:supplierProducts:addByCopy')") + public ResponseEntity 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 convert2VO(List entityList) { + List 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 + } \ No newline at end of file diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProductModel.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProductModel.java new file mode 100644 index 0000000..b18d860 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProductModel.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProductModelDetails.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProductModelDetails.java new file mode 100644 index 0000000..eb7026f --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProductModelDetails.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProducts.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProducts.java new file mode 100644 index 0000000..b5cf83f --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/CompanyProducts.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProductModel.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProductModel.java new file mode 100644 index 0000000..f2c7ab9 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProductModel.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProductModelDetails.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProductModelDetails.java new file mode 100644 index 0000000..fd44e55 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProductModelDetails.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProducts.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProducts.java new file mode 100644 index 0000000..50bca11 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/PersonProducts.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/ProductModelTemplate.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/ProductModelTemplate.java new file mode 100644 index 0000000..bee78b7 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/ProductModelTemplate.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/ProductModelTemplateDetails.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/ProductModelTemplateDetails.java new file mode 100644 index 0000000..cdcd0a9 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/ProductModelTemplateDetails.java @@ -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; + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierInformation.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierInformation.java new file mode 100644 index 0000000..8797d7d --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierInformation.java @@ -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; + + + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProductModel.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProductModel.java new file mode 100644 index 0000000..fbe6b76 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProductModel.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProductModelDetails.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProductModelDetails.java new file mode 100644 index 0000000..5b7baaf --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProductModelDetails.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProducts.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProducts.java new file mode 100644 index 0000000..ede2a2f --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/entity/SupplierProducts.java @@ -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; + + /********非库表存储属性*****/ +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelDetailsMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelDetailsMapper.java new file mode 100644 index 0000000..aa94935 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelDetailsMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelDetailsMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelDetailsMapper.xml new file mode 100644 index 0000000..6b49c64 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelDetailsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelMapper.java new file mode 100644 index 0000000..6bb0243 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelMapper.xml new file mode 100644 index 0000000..289b3e1 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductModelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductsMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductsMapper.java new file mode 100644 index 0000000..2308744 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductsMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductsMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductsMapper.xml new file mode 100644 index 0000000..b1050cb --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/CompanyProductsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelDetailsMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelDetailsMapper.java new file mode 100644 index 0000000..2a3dae8 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelDetailsMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelDetailsMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelDetailsMapper.xml new file mode 100644 index 0000000..4261dcb --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelDetailsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelMapper.java new file mode 100644 index 0000000..f88054a --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelMapper.xml new file mode 100644 index 0000000..8dc8299 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductModelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductsMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductsMapper.java new file mode 100644 index 0000000..67baf6f --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductsMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductsMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductsMapper.xml new file mode 100644 index 0000000..3c2eaa5 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/PersonProductsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateDetailsMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateDetailsMapper.java new file mode 100644 index 0000000..fda3f2c --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateDetailsMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateDetailsMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateDetailsMapper.xml new file mode 100644 index 0000000..777c5f2 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateDetailsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateMapper.java new file mode 100644 index 0000000..8b44107 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateMapper.xml new file mode 100644 index 0000000..cdf710a --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/ProductModelTemplateMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierInformationMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierInformationMapper.java new file mode 100644 index 0000000..eb90780 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierInformationMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierInformationMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierInformationMapper.xml new file mode 100644 index 0000000..4fb5e6b --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierInformationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelDetailsMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelDetailsMapper.java new file mode 100644 index 0000000..aeeb554 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelDetailsMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelDetailsMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelDetailsMapper.xml new file mode 100644 index 0000000..06fe1c5 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelDetailsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelMapper.java new file mode 100644 index 0000000..a7cf211 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelMapper.xml new file mode 100644 index 0000000..a4f4ab4 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductModelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductsMapper.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductsMapper.java new file mode 100644 index 0000000..80a4d8a --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductsMapper.java @@ -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 { + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductsMapper.xml b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductsMapper.xml new file mode 100644 index 0000000..0dc4557 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/mapper/SupplierProductsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductModelDetailsService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductModelDetailsService.java new file mode 100644 index 0000000..2bd7a92 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductModelDetailsService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductModelService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductModelService.java new file mode 100644 index 0000000..50547f6 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductModelService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); + + void addModel(ProductModelViewVO vo); + + void modifyModel(ProductModelViewVO vo); + + List getModelDetails(String id); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductsService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductsService.java new file mode 100644 index 0000000..b3560bb --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/CompanyProductsService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductModelDetailsService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductModelDetailsService.java new file mode 100644 index 0000000..e0c1141 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductModelDetailsService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductModelService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductModelService.java new file mode 100644 index 0000000..82ea17f --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductModelService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); + + void addModel(ProductModelViewVO vo); + + void modifyModel(ProductModelViewVO vo); + + List getModelDetails(String id); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductsService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductsService.java new file mode 100644 index 0000000..520bcc9 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/PersonProductsService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/ProductModelTemplateDetailsService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/ProductModelTemplateDetailsService.java new file mode 100644 index 0000000..ca91d2e --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/ProductModelTemplateDetailsService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); + + void addList(List vo); + + void modifyList(List vo); + + /** + * 根据产品型号id获取产品型号规格描述 + * @param id + * @return + */ + String getDetailsDescriptionByModelId(String id); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/ProductModelTemplateService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/ProductModelTemplateService.java new file mode 100644 index 0000000..448c73f --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/ProductModelTemplateService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierInformationService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierInformationService.java new file mode 100644 index 0000000..60fc2c2 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierInformationService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductModelDetailsService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductModelDetailsService.java new file mode 100644 index 0000000..7d7e6b6 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductModelDetailsService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductModelService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductModelService.java new file mode 100644 index 0000000..6226da6 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductModelService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); + + /** + * 添加供应商产品型号与型号详情 + * @param vo 参数对象 + */ + void addModel(ProductModelViewVO vo); + + /** + * 获取型号详情 + * @param id 型号ID + * @return 型号详情 + */ + List getModelDetails(String id); + + /** + * 修改型号 + * @param vo 参数对象 + */ + void modifyModel(ProductModelViewVO vo); +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductsService.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductsService.java new file mode 100644 index 0000000..ad32395 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/SupplierProductsService.java @@ -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 { + + /** + * 获取标识与名称的Map集合 + * + * @param idList 标识列表 + * @return 集合 + */ + Map getNameMap(List idList); + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductModelDetailsServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductModelDetailsServiceImpl.java new file mode 100644 index 0000000..9a6cf55 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductModelDetailsServiceImpl.java @@ -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 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(CompanyProductModelDetails entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductModelServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductModelServiceImpl.java new file mode 100644 index 0000000..b6faf13 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductModelServiceImpl.java @@ -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 implements CompanyProductModelService { + @Autowired + private CompanyProductModelDetailsService companyProductModelDetailsService; + @Override + public void addModel(ProductModelViewVO vo) { + List 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 queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CompanyProductModelDetails::getModelId, id); + companyProductModelDetailsService.remove(queryWrapper); + List 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 getModelDetails(String id) { + //根据型号id查询型号详情规格指标 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CompanyProductModelDetails::getModelId, id); + List list = companyProductModelDetailsService.list(queryWrapper); + if (CollectionUtils.isEmpty(list)) { + return new ArrayList<>(); + } + List 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(CompanyProductModel entity, String... value) { + } + protected List convert2DetailsVO(List entityList) { + List 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; + } +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductsServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductsServiceImpl.java new file mode 100644 index 0000000..60ce5ca --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/CompanyProductsServiceImpl.java @@ -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 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 modelUpdateWrapper = new LambdaUpdateWrapper<>(); + modelUpdateWrapper.eq(CompanyProductModel::getId, modelId); + modelUpdateWrapper.set(CompanyProductModel::getIsTemporary, "0"); + companyProductModelMapper.update(null,modelUpdateWrapper); + // 更新型号规格参数的is_temporary标记为非临时数据 + LambdaUpdateWrapper 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 modelUpdateWrapper = new LambdaUpdateWrapper<>(); // 临时数据标记 + modelUpdateWrapper.eq(CompanyProductModel::getId, modelId); + companyProductModelMapper.delete(modelUpdateWrapper); + // 更新型号规格参数的is_temporary标记为临时数据 + LambdaUpdateWrapper 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(CompanyProducts entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductModelDetailsServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductModelDetailsServiceImpl.java new file mode 100644 index 0000000..7a43bea --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductModelDetailsServiceImpl.java @@ -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 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(PersonProductModelDetails entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductModelServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductModelServiceImpl.java new file mode 100644 index 0000000..06c90c1 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductModelServiceImpl.java @@ -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 implements PersonProductModelService { + @Autowired + private PersonProductModelDetailsService personProductModelDetailsService; + @Override + public void addModel(ProductModelViewVO vo) { + List 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 queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PersonProductModelDetails::getModelId, id); + personProductModelDetailsService.remove(queryWrapper); + List 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 getModelDetails(String id) { + //根据型号id查询型号详情规格指标 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PersonProductModelDetails::getModelId, id); + List list = personProductModelDetailsService.list(queryWrapper); + if (CollectionUtils.isEmpty(list)) { + return new ArrayList<>(); + } + List 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(PersonProductModel entity, String... value) { + } + /** + * 将实体列表转换为视图对象列表 + * + * @param entityList 实体列表 + * @return {@link List}<{@link EntityVO}> 视图对象列表 + */ + protected List convert2DetailsVO(List entityList) { + List 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; + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductsServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductsServiceImpl.java new file mode 100644 index 0000000..9e44644 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/PersonProductsServiceImpl.java @@ -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 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 modelUpdateWrapper = new LambdaUpdateWrapper<>(); + modelUpdateWrapper.eq(PersonProductModel::getId, modelId); + modelUpdateWrapper.set(PersonProductModel::getIsTemporary, "0"); + personProductModelMapper.update(null,modelUpdateWrapper); + // 更新型号规格参数的is_temporary标记为非临时数据 + LambdaUpdateWrapper 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 modelUpdateWrapper = new LambdaUpdateWrapper<>(); // 临时数据标记 + modelUpdateWrapper.eq(PersonProductModel::getId, modelId); + personProductModelMapper.delete(modelUpdateWrapper); + // 更新型号规格参数的is_temporary标记为临时数据 + LambdaUpdateWrapper 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(PersonProducts entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/ProductModelTemplateDetailsServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/ProductModelTemplateDetailsServiceImpl.java new file mode 100644 index 0000000..f01f95b --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/ProductModelTemplateDetailsServiceImpl.java @@ -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 implements ProductModelTemplateDetailsService { + @Override + public void addList(List vo) { + for(ProductModelTemplateDetailsVO item:vo){ + ProductModelTemplateDetails productModelTemplateDetails = mapperFacade.map(item, ProductModelTemplateDetails.class); + save(productModelTemplateDetails); + } + } + + @Override + public void modifyList(List vo) { + //先删后增 + LambdaQueryWrapper 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 queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ProductModelTemplateDetails::getModelTemplateId, id); + List 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + + @Override + protected void copyPropertyHandle(ProductModelTemplateDetails entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/ProductModelTemplateServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/ProductModelTemplateServiceImpl.java new file mode 100644 index 0000000..c210bd0 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/ProductModelTemplateServiceImpl.java @@ -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 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 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 queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ProductModelTemplateDetails::getModelTemplateId, modelId); + productModelTemplateDetailsMapper.delete(queryWrapper); + } + @Override + public void beforeModify(ProductModelTemplate entity) { + //唯一性验证 + } + + @Override + public Map getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(ProductModelTemplate entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierInformationServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierInformationServiceImpl.java new file mode 100644 index 0000000..50cc0f6 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierInformationServiceImpl.java @@ -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 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(SupplierInformation entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductModelDetailsServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductModelDetailsServiceImpl.java new file mode 100644 index 0000000..3d4c08c --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductModelDetailsServiceImpl.java @@ -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 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(SupplierProductModelDetails entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductModelServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductModelServiceImpl.java new file mode 100644 index 0000000..bd30ae9 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductModelServiceImpl.java @@ -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 implements SupplierProductModelService { + @Autowired + private SupplierProductModelDetailsService supplierProductModelDetailsService; + @Override + public void addModel(ProductModelViewVO vo) { + List 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 queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SupplierProductModelDetails::getModelId, id); + supplierProductModelDetailsService.remove(queryWrapper); + List 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 getModelDetails(String id) { + //根据型号id查询型号详情规格指标 +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.lambda().eq(SupplierProductModelDetails::getModelId, id); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SupplierProductModelDetails::getModelId, id); + List list = supplierProductModelDetailsService.list(queryWrapper); + if (CollectionUtils.isEmpty(list)) { + return new ArrayList<>(); + } + List 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + + @Override + protected void copyPropertyHandle(SupplierProductModel entity, String... value) { + } + /** + * 将实体列表转换为视图对象列表 + * + * @param entityList 实体列表 + * @return {@link List}<{@link EntityVO}> 视图对象列表 + */ + protected List convert2VO(List entityList) { + List 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 convert2DetailsVO(List entityList) { + List 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; + } +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductsServiceImpl.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductsServiceImpl.java new file mode 100644 index 0000000..54bb54c --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/service/impl/SupplierProductsServiceImpl.java @@ -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 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 modelUpdateWrapper = new LambdaUpdateWrapper<>(); + modelUpdateWrapper.eq(SupplierProductModel::getId, modelId); + modelUpdateWrapper.set(SupplierProductModel::getIsTemporary, "0"); + supplierProductModelMapper.update(null,modelUpdateWrapper); + // 更新型号规格参数的is_temporary标记为非临时数据 + LambdaUpdateWrapper 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 modelUpdateWrapper = new LambdaUpdateWrapper<>(); // 临时数据标记 + modelUpdateWrapper.eq(SupplierProductModel::getId, modelId); + supplierProductModelMapper.delete(modelUpdateWrapper); + // 更新型号规格参数的is_temporary标记为临时数据 + LambdaUpdateWrapper 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 getNameMap(List idList) { + Map result = new HashMap<>(5); + return result; + } + + @Override + protected void copyPropertyHandle(SupplierProducts entity, String... value) { + } + +} + diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductModelDetailsVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductModelDetailsVO.java new file mode 100644 index 0000000..ba68ec8 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductModelDetailsVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductModelVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductModelVO.java new file mode 100644 index 0000000..a79c862 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductModelVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductsVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductsVO.java new file mode 100644 index 0000000..72cdc9d --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/CompanyProductsVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductModelDetailsVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductModelDetailsVO.java new file mode 100644 index 0000000..27210ad --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductModelDetailsVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductModelVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductModelVO.java new file mode 100644 index 0000000..9f2bcaf --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductModelVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductsVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductsVO.java new file mode 100644 index 0000000..d010aa8 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/PersonProductsVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelTemplateDetailsVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelTemplateDetailsVO.java new file mode 100644 index 0000000..ec8ec36 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelTemplateDetailsVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelTemplateVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelTemplateVO.java new file mode 100644 index 0000000..180814a --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelTemplateVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelViewVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelViewVO.java new file mode 100644 index 0000000..925caf2 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/ProductModelViewVO.java @@ -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 extends BaseVO { + /** + * 厂商产品型号描述 + */ + @NotBlank(message = "【厂商产品型号描述】不能为空") + private String description; + + /** + * 产品型号模板id + */ + private String productModelTemplateId; + + private List modelDeatils; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierInformationVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierInformationVO.java new file mode 100644 index 0000000..bdefb1a --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierInformationVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductModelDetailsVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductModelDetailsVO.java new file mode 100644 index 0000000..ea31da7 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductModelDetailsVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductModelVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductModelVO.java new file mode 100644 index 0000000..98a6f86 --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductModelVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +} diff --git a/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductsVO.java b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductsVO.java new file mode 100644 index 0000000..95f2a4c --- /dev/null +++ b/platform-boot-started-productManagement/src/main/java/tech/abc/platform/productManagement/vo/SupplierProductsVO.java @@ -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; + + + /********非库表存储属性*****/ + + + + /********字典类*****/ + + /********实体类、用户单选、组织机构单选*****/ + + /********范围查询*****/ + + /********自定义扩展*****/ + + /********子对象*****/ + + + + +}