From e4e69912a618760378fd55d1ef5c24a598c9a0b8 Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Thu, 24 Oct 2024 11:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 +- ruoyi-admin/pom.xml | 19 +- .../controller/BsDesignTypeController.java | 115 +++++ .../system/controller/BsGoodsController.java | 107 +++++ .../controller/BsTechnicalTypeController.java | 104 +++++ .../com/ruoyi/system/domain/BsDesignType.java | 79 ++++ .../java/com/ruoyi/system/domain/BsGoods.java | 165 +++++++ .../ruoyi/system/domain/BsTechnicalType.java | 79 ++++ .../ruoyi/system/domain/dto/BsGoodDTO.java | 26 ++ .../com/ruoyi/system/domain/vo/BsGoodsVO.java | 26 ++ .../system/mapper/BsDesignTypeMapper.java | 86 ++++ .../ruoyi/system/mapper/BsGoodsMapper.java | 80 ++++ .../system/mapper/BsTechnicalTypeMapper.java | 77 ++++ .../system/service/IBsDesignTypeService.java | 69 +++ .../ruoyi/system/service/IBsGoodsService.java | 71 +++ .../service/IBsTechnicalTypeService.java | 61 +++ .../service/impl/BsDesignTypeServiceImpl.java | 117 +++++ .../service/impl/BsGoodsServiceImpl.java | 131 ++++++ .../impl/BsTechnicalTypeServiceImpl.java | 105 +++++ .../src/main/resources/application-druid.yml | 16 +- .../src/main/resources/application.yml | 10 +- .../mapper/system/BsDesignTypeMapper.xml | 86 ++++ .../resources/mapper/system/BsGoodsMapper.xml | 158 +++++++ .../mapper/system/BsTechnicalTypeMapper.xml | 86 ++++ ruoyi-ui/package.json | 1 + ruoyi-ui/src/api/system/designType.js | 52 +++ ruoyi-ui/src/api/system/goods.js | 53 +++ ruoyi-ui/src/api/system/type.js | 44 ++ ruoyi-ui/src/components/FileUpload/index.vue | 4 +- ruoyi-ui/src/permission.js | 2 +- ruoyi-ui/src/router/index.js | 15 + ruoyi-ui/src/utils/auth.js | 2 +- .../src/views/system/designType/index.vue | 266 ++++++++++++ ruoyi-ui/src/views/system/goods/index.vue | 405 +++++++++++++++++ ruoyi-ui/src/views/system/type/index.vue | 266 ++++++++++++ .../src/views/system/userFront/details.vue | 406 ++++++++++++++++++ ruoyi-ui/src/views/system/userFront/index.vue | 345 +++++++++++++++ 37 files changed, 3717 insertions(+), 23 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsDesignTypeController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsGoodsController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsTechnicalTypeController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsDesignType.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsGoods.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsTechnicalType.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/BsGoodDTO.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/vo/BsGoodsVO.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsDesignTypeMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsGoodsMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsTechnicalTypeMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsDesignTypeService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsGoodsService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsTechnicalTypeService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsDesignTypeServiceImpl.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsGoodsServiceImpl.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsTechnicalTypeServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/system/BsDesignTypeMapper.xml create mode 100644 ruoyi-admin/src/main/resources/mapper/system/BsGoodsMapper.xml create mode 100644 ruoyi-admin/src/main/resources/mapper/system/BsTechnicalTypeMapper.xml create mode 100644 ruoyi-ui/src/api/system/designType.js create mode 100644 ruoyi-ui/src/api/system/goods.js create mode 100644 ruoyi-ui/src/api/system/type.js create mode 100644 ruoyi-ui/src/views/system/designType/index.vue create mode 100644 ruoyi-ui/src/views/system/goods/index.vue create mode 100644 ruoyi-ui/src/views/system/type/index.vue create mode 100644 ruoyi-ui/src/views/system/userFront/details.vue create mode 100644 ruoyi-ui/src/views/system/userFront/index.vue diff --git a/pom.xml b/pom.xml index 5994ea89..eaa394dd 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + com.ruoyi ruoyi 3.8.8 @@ -11,7 +11,7 @@ ruoyi http://www.ruoyi.vip 若依管理系统 - + 3.8.8 UTF-8 @@ -235,4 +235,4 @@ - \ No newline at end of file + diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index ce384b46..4c196ea4 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -60,6 +60,11 @@ com.ruoyi ruoyi-generator + + org.projectlombok + lombok + provided + @@ -80,17 +85,17 @@ - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 + + org.apache.maven.plugins + maven-war-plugin + 3.1.0 false ${project.artifactId} - - + + ${project.artifactId} - \ No newline at end of file + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsDesignTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsDesignTypeController.java new file mode 100644 index 00000000..bd76ef7c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsDesignTypeController.java @@ -0,0 +1,115 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BsDesignType; +import com.ruoyi.system.service.IBsDesignTypeService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 设计类型Controller + * + * @author ruoyi + * @date 2024-10-22 + */ +@RestController +@RequestMapping("/system/designType") +public class BsDesignTypeController extends BaseController +{ + @Autowired + private IBsDesignTypeService bsDesignTypeService; + + /** + * 查询设计类型列表 + */ + @PreAuthorize("@ss.hasPermi('system:designType:list')") + @GetMapping("/list") + public TableDataInfo list(BsDesignType bsDesignType) + { + startPage(); + List list = bsDesignTypeService.selectBsDesignTypeList(bsDesignType); + return getDataTable(list); + } + + /** + * 导出设计类型列表 + */ + @PreAuthorize("@ss.hasPermi('system:designType:export')") + @Log(title = "设计类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BsDesignType bsDesignType) + { + List list = bsDesignTypeService.selectBsDesignTypeList(bsDesignType); + ExcelUtil util = new ExcelUtil(BsDesignType.class); + util.exportExcel(response, list, "设计类型数据"); + } + + /** + * 获取设计类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:designType:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(bsDesignTypeService.selectBsDesignTypeById(id)); + } + + /** + * 新增设计类型 + */ + @PreAuthorize("@ss.hasPermi('system:designType:add')") + @Log(title = "设计类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BsDesignType bsDesignType) + { + return toAjax(bsDesignTypeService.insertBsDesignType(bsDesignType)); + } + + /** + * 修改设计类型 + */ + @PreAuthorize("@ss.hasPermi('system:designType:edit')") + @Log(title = "设计类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BsDesignType bsDesignType) + { + return toAjax(bsDesignTypeService.updateBsDesignType(bsDesignType)); + } + + /** + * 删除设计类型 + */ + @PreAuthorize("@ss.hasPermi('system:designType:remove')") + @Log(title = "设计类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(bsDesignTypeService.deleteBsDesignTypeByIds(ids)); + } + + /** + * 根据编号查询设计类型名称 + */ + @PreAuthorize("@ss.hasPermi('system:designType:query')") + @GetMapping("nameByType/{type}") + public AjaxResult nameByType(@PathVariable("type") int type) + { + return success(bsDesignTypeService.selectBsDesignNameByType(type)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsGoodsController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsGoodsController.java new file mode 100644 index 00000000..bc23c5de --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsGoodsController.java @@ -0,0 +1,107 @@ +package com.ruoyi.system.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.BsGoods; +import com.ruoyi.system.domain.dto.BsGoodDTO; +import com.ruoyi.system.domain.vo.BsGoodsVO; +import com.ruoyi.system.service.IBsGoodsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 商品Controller + * + * @author ruoyi + * @date 2024-10-22 + */ +@RestController +@RequestMapping("/system/goods") +public class BsGoodsController extends BaseController { + @Autowired + private IBsGoodsService bsGoodsService; + + /** + * 查询商品列表 + */ + @PreAuthorize("@ss.hasPermi('system:goods:list')") + @GetMapping("/list") + public TableDataInfo list(BsGoods bsGoods) { + startPage(); + List list = bsGoodsService.selectBsGoodsList(bsGoods); + return getDataTable(list); + } + + /** + * 导出商品列表 + */ + @PreAuthorize("@ss.hasPermi('system:goods:export')") + @Log(title = "商品", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BsGoodDTO bsGoodDTO) { + + List list = bsGoodsService.selectAllList(bsGoodDTO); + ExcelUtil util = new ExcelUtil(BsGoodsVO.class); + util.exportExcel(response, list, "商品数据"); + } + + /** + * 获取商品详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:goods:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(bsGoodsService.selectBsGoodsById(id)); + } + + /** + * 新增商品 + */ + @PreAuthorize("@ss.hasPermi('system:goods:add')") + @Log(title = "商品", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BsGoods bsGoods) { + return toAjax(bsGoodsService.insertBsGoods(bsGoods)); + } + + /** + * 修改商品 + */ + @PreAuthorize("@ss.hasPermi('system:goods:edit')") + @Log(title = "商品", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BsGoods bsGoods) { + return toAjax(bsGoodsService.updateBsGoods(bsGoods)); + } + + /** + * 删除商品 + */ + @PreAuthorize("@ss.hasPermi('system:goods:remove')") + @Log(title = "商品", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(bsGoodsService.deleteBsGoodsByIds(ids)); + } + + /** + * 连表查询商品 + */ + @GetMapping("/allList") + public TableDataInfo allList(BsGoodDTO bsGoodDTO) { + startPage(); + List list = bsGoodsService.selectAllList(bsGoodDTO); + return getDataTable(list); + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsTechnicalTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsTechnicalTypeController.java new file mode 100644 index 00000000..fdecd4f7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BsTechnicalTypeController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BsTechnicalType; +import com.ruoyi.system.service.IBsTechnicalTypeService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 技术类型Controller + * + * @author ruoyi + * @date 2024-10-22 + */ +@RestController +@RequestMapping("/system/type") +public class BsTechnicalTypeController extends BaseController +{ + @Autowired + private IBsTechnicalTypeService bsTechnicalTypeService; + + /** + * 查询技术类型列表 + */ + @PreAuthorize("@ss.hasPermi('system:type:list')") + @GetMapping("/list") + public TableDataInfo list(BsTechnicalType bsTechnicalType) + { + startPage(); + List list = bsTechnicalTypeService.selectBsTechnicalTypeList(bsTechnicalType); + return getDataTable(list); + } + + /** + * 导出技术类型列表 + */ + @PreAuthorize("@ss.hasPermi('system:type:export')") + @Log(title = "技术类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BsTechnicalType bsTechnicalType) + { + List list = bsTechnicalTypeService.selectBsTechnicalTypeList(bsTechnicalType); + ExcelUtil util = new ExcelUtil(BsTechnicalType.class); + util.exportExcel(response, list, "技术类型数据"); + } + + /** + * 获取技术类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:type:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(bsTechnicalTypeService.selectBsTechnicalTypeById(id)); + } + + /** + * 新增技术类型 + */ + @PreAuthorize("@ss.hasPermi('system:type:add')") + @Log(title = "技术类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BsTechnicalType bsTechnicalType) + { + return toAjax(bsTechnicalTypeService.insertBsTechnicalType(bsTechnicalType)); + } + + /** + * 修改技术类型 + */ + @PreAuthorize("@ss.hasPermi('system:type:edit')") + @Log(title = "技术类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BsTechnicalType bsTechnicalType) + { + return toAjax(bsTechnicalTypeService.updateBsTechnicalType(bsTechnicalType)); + } + + /** + * 删除技术类型 + */ + @PreAuthorize("@ss.hasPermi('system:type:remove')") + @Log(title = "技术类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(bsTechnicalTypeService.deleteBsTechnicalTypeByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsDesignType.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsDesignType.java new file mode 100644 index 00000000..82d8ce98 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsDesignType.java @@ -0,0 +1,79 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 设计类型对象 bs_design_type + * + * @author ruoyi + * @date 2024-10-22 + */ +public class BsDesignType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 类型名称 */ + @Excel(name = "类型名称") + private String name; + + /** 类型编号 */ + @Excel(name = "类型编号") + private Long type; + + /** 创建者id */ + private String createId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setType(Long type) + { + this.type = type; + } + + public Long getType() + { + return type; + } + public void setCreateId(String createId) + { + this.createId = createId; + } + + public String getCreateId() + { + return createId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("type", getType()) + .append("createId", getCreateId()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsGoods.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsGoods.java new file mode 100644 index 00000000..15f04f4e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsGoods.java @@ -0,0 +1,165 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + +/** + * 商品对象 bs_goods + * + * @author ruoyi + * @date 2024-10-22 + */ +public class BsGoods extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 商品名称 */ + @Excel(name = "商品名称") + private String name; + + /** 商品封面图片 */ + @Excel(name = "商品封面图片") + private String cover; + + /** 商品技术类型 */ + @Excel(name = "商品技术类型") + private Long technicalTypeId; + + /** 设计类型 */ + @Excel(name = "设计类型") + private Long designTypeId; + + /** 商品价格 */ + @Excel(name = "商品价格") + private BigDecimal price; + + /** 商品简介 */ + @Excel(name = "商品简介") + private String introduction; + + /** 商品详情 */ + @Excel(name = "商品详情") + private String details; + + /** 商品资源 */ + @Excel(name = "商品资源") + private String resource; + + /** 创建者id */ + private String createId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setCover(String cover) + { + this.cover = cover; + } + + public String getCover() + { + return cover; + } + public void setTechnicalTypeId(Long technicalTypeId) + { + this.technicalTypeId = technicalTypeId; + } + + public Long getTechnicalTypeId() + { + return technicalTypeId; + } + public void setDesignTypeId(Long designTypeId) + { + this.designTypeId = designTypeId; + } + + public Long getDesignTypeId() + { + return designTypeId; + } + public void setPrice(BigDecimal price) + { + this.price = price; + } + + public BigDecimal getPrice() + { + return price; + } + public void setIntroduction(String introduction) + { + this.introduction = introduction; + } + + public String getIntroduction() + { + return introduction; + } + public void setDetails(String details) + { + this.details = details; + } + + public String getDetails() + { + return details; + } + public void setResource(String resource) + { + this.resource = resource; + } + + public String getResource() + { + return resource; + } + public void setCreateId(String createId) + { + this.createId = createId; + } + + public String getCreateId() + { + return createId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("cover", getCover()) + .append("technicalTypeId", getTechnicalTypeId()) + .append("designTypeId", getDesignTypeId()) + .append("price", getPrice()) + .append("introduction", getIntroduction()) + .append("details", getDetails()) + .append("resource", getResource()) + .append("createId", getCreateId()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsTechnicalType.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsTechnicalType.java new file mode 100644 index 00000000..1f34d9c7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BsTechnicalType.java @@ -0,0 +1,79 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 技术类型对象 bs_technical_type + * + * @author ruoyi + * @date 2024-10-22 + */ +public class BsTechnicalType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 技术类型名称 */ + @Excel(name = "技术类型名称") + private String name; + + /** 技术类型编号 */ + @Excel(name = "技术类型编号") + private Long number; + + /** 创建者id */ + private String createId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + public void setCreateId(String createId) + { + this.createId = createId; + } + + public String getCreateId() + { + return createId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("number", getNumber()) + .append("createId", getCreateId()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/BsGoodDTO.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/BsGoodDTO.java new file mode 100644 index 00000000..ce2add23 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/BsGoodDTO.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.domain.dto; + + +import com.ruoyi.system.domain.BsGoods; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 商品列表 连表查询时使用 + * + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BsGoodDTO extends BsGoods { + + /** 设计类型名称 */ + private String designName; + + /** 技术类型名称 */ + private String technicalName; + + /** 创建人 */ + private String createName; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/vo/BsGoodsVO.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/vo/BsGoodsVO.java new file mode 100644 index 00000000..b8982101 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/vo/BsGoodsVO.java @@ -0,0 +1,26 @@ +package com.ruoyi.system.domain.vo; + +import com.ruoyi.system.domain.BsGoods; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * 商品列表 连表查询时使用 + * + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class BsGoodsVO extends BsGoods { + + /** 设计类型名称 */ + private String designName; + + /** 技术类型名称 */ + private String technicalName; + + /** 创建人 */ + private String createName; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsDesignTypeMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsDesignTypeMapper.java new file mode 100644 index 00000000..160d2ac6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsDesignTypeMapper.java @@ -0,0 +1,86 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BsDesignType; + +/** + * 设计类型Mapper接口 + * + * @author ruoyi + * @date 2024-10-22 + */ +public interface BsDesignTypeMapper +{ + /** + * 查询设计类型 + * + * @param id 设计类型主键 + * @return 设计类型 + */ + public BsDesignType selectBsDesignTypeById(Long id); + + /** + * 查询设计类型列表 + * + * @param bsDesignType 设计类型 + * @return 设计类型集合 + */ + public List selectBsDesignTypeList(BsDesignType bsDesignType); + + /** + * 新增设计类型 + * + * @param bsDesignType 设计类型 + * @return 结果 + */ + public int insertBsDesignType(BsDesignType bsDesignType); + + /** + * 修改设计类型 + * + * @param bsDesignType 设计类型 + * @return 结果 + */ + public int updateBsDesignType(BsDesignType bsDesignType); + + /** + * 删除设计类型 + * + * @param id 设计类型主键 + * @return 结果 + */ + public int deleteBsDesignTypeById(Long id); + + /** + * 批量删除设计类型 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBsDesignTypeByIds(Long[] ids); + + /** + * 根据编号查询名称 + * + * @param type 设计类型编号 + * @return 结果 + */ + public String selectBsDesignNameByType(int type); + + /** + * 根据名称查询设计类型 + * + * @param name 设计类型名称 + * @return 结果 + */ + BsDesignType selectByDesignTypeName(String name); + + // + /** + * 根据类型查询设计类型 + * + * @param type 设计类型编号 + * @return 结果 + */ + BsDesignType selectByDesignType(Integer type); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsGoodsMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsGoodsMapper.java new file mode 100644 index 00000000..a86c444b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsGoodsMapper.java @@ -0,0 +1,80 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BsGoods; +import com.ruoyi.system.domain.dto.BsGoodDTO; +import com.ruoyi.system.domain.vo.BsGoodsVO; + +/** + * 商品Mapper接口 + * + * @author ruoyi + * @date 2024-10-22 + */ +public interface BsGoodsMapper +{ + /** + * 查询商品 + * + * @param id 商品主键 + * @return 商品 + */ + public BsGoods selectBsGoodsById(Long id); + + /** + * 查询商品列表 + * + * @param bsGoods 商品 + * @return 商品集合 + */ + public List selectBsGoodsList(BsGoods bsGoods); + + /** + * 新增商品 + * + * @param bsGoods 商品 + * @return 结果 + */ + public int insertBsGoods(BsGoods bsGoods); + + /** + * 修改商品 + * + * @param bsGoods 商品 + * @return 结果 + */ + public int updateBsGoods(BsGoods bsGoods); + + /** + * 删除商品 + * + * @param id 商品主键 + * @return 结果 + */ + public int deleteBsGoodsById(Long id); + + /** + * 批量删除商品 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBsGoodsByIds(Long[] ids); + + /** + * 根据名称查询 + * + * @param name 需要删除的数据主键集合 + * @return 结果 + */ + public BsGoods selectByGoodsName(String name); + + /** + * 连表查询商品列表 + * + * @param bsGoodDTO 查询使用到的DTO + * @return 结果 + */ + public List selectAllList(BsGoodDTO bsGoodDTO); + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsTechnicalTypeMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsTechnicalTypeMapper.java new file mode 100644 index 00000000..ba2d6395 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BsTechnicalTypeMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BsTechnicalType; + +/** + * 技术类型Mapper接口 + * + * @author ruoyi + * @date 2024-10-22 + */ +public interface BsTechnicalTypeMapper +{ + /** + * 查询技术类型 + * + * @param id 技术类型主键 + * @return 技术类型 + */ + public BsTechnicalType selectBsTechnicalTypeById(Long id); + + /** + * 查询技术类型列表 + * + * @param bsTechnicalType 技术类型 + * @return 技术类型集合 + */ + public List selectBsTechnicalTypeList(BsTechnicalType bsTechnicalType); + + /** + * 新增技术类型 + * + * @param bsTechnicalType 技术类型 + * @return 结果 + */ + public int insertBsTechnicalType(BsTechnicalType bsTechnicalType); + + /** + * 修改技术类型 + * + * @param bsTechnicalType 技术类型 + * @return 结果 + */ + public int updateBsTechnicalType(BsTechnicalType bsTechnicalType); + + /** + * 删除技术类型 + * + * @param id 技术类型主键 + * @return 结果 + */ + public int deleteBsTechnicalTypeById(Long id); + + /** + * 批量删除技术类型 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBsTechnicalTypeByIds(Long[] ids); + + /** + * 检查技术类型名称是否存在 + * + * @param name 技术类型的名称 + * @return 结果 + */ + boolean existsByName(String name); + + /** + * 检查技术类型编号是否存在 + * + * @param number 技术类型的编号 + * @return 结果 + */ + boolean existsByNumber(String number); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsDesignTypeService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsDesignTypeService.java new file mode 100644 index 00000000..4b42408a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsDesignTypeService.java @@ -0,0 +1,69 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BsDesignType; + +/** + * 设计类型Service接口 + * + * @author ruoyi + * @date 2024-10-22 + */ +public interface IBsDesignTypeService +{ + /** + * 查询设计类型 + * + * @param id 设计类型主键 + * @return 设计类型 + */ + public BsDesignType selectBsDesignTypeById(Long id); + + /** + * 查询设计类型列表 + * + * @param bsDesignType 设计类型 + * @return 设计类型集合 + */ + public List selectBsDesignTypeList(BsDesignType bsDesignType); + + /** + * 新增设计类型 + * + * @param bsDesignType 设计类型 + * @return 结果 + */ + public int insertBsDesignType(BsDesignType bsDesignType); + + /** + * 修改设计类型 + * + * @param bsDesignType 设计类型 + * @return 结果 + */ + public int updateBsDesignType(BsDesignType bsDesignType); + + /** + * 批量删除设计类型 + * + * @param ids 需要删除的设计类型主键集合 + * @return 结果 + */ + public int deleteBsDesignTypeByIds(Long[] ids); + + /** + * 删除设计类型信息 + * + * @param id 设计类型主键 + * @return 结果 + */ + public int deleteBsDesignTypeById(Long id); + + /** + * 根据编号查询名称 + * + * @param type 设计类型编号 + * @return 结果 + */ + public String selectBsDesignNameByType(int type); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsGoodsService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsGoodsService.java new file mode 100644 index 00000000..63d734e7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsGoodsService.java @@ -0,0 +1,71 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BsGoods; +import com.ruoyi.system.domain.dto.BsGoodDTO; +import com.ruoyi.system.domain.vo.BsGoodsVO; + +/** + * 商品Service接口 + * + * @author ruoyi + * @date 2024-10-22 + */ +public interface IBsGoodsService +{ + /** + * 查询商品 + * + * @param id 商品主键 + * @return 商品 + */ + public BsGoods selectBsGoodsById(Long id); + + /** + * 查询商品列表 + * + * @param bsGoods 商品 + * @return 商品集合 + */ + public List selectBsGoodsList(BsGoods bsGoods); + + /** + * 新增商品 + * + * @param bsGoods 商品 + * @return 结果 + */ + public int insertBsGoods(BsGoods bsGoods); + + /** + * 修改商品 + * + * @param bsGoods 商品 + * @return 结果 + */ + public int updateBsGoods(BsGoods bsGoods); + + /** + * 批量删除商品 + * + * @param ids 需要删除的商品主键集合 + * @return 结果 + */ + public int deleteBsGoodsByIds(Long[] ids); + + /** + * 删除商品信息 + * + * @param id 商品主键 + * @return 结果 + */ + public int deleteBsGoodsById(Long id); + + /** + * 连表查询商品列表 + * + * @param bsGoodDTO 查询使用到的DTO + * @return 结果 + */ + public List selectAllList(BsGoodDTO bsGoodDTO); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsTechnicalTypeService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsTechnicalTypeService.java new file mode 100644 index 00000000..02224cc2 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBsTechnicalTypeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BsTechnicalType; + +/** + * 技术类型Service接口 + * + * @author ruoyi + * @date 2024-10-22 + */ +public interface IBsTechnicalTypeService +{ + /** + * 查询技术类型 + * + * @param id 技术类型主键 + * @return 技术类型 + */ + public BsTechnicalType selectBsTechnicalTypeById(Long id); + + /** + * 查询技术类型列表 + * + * @param bsTechnicalType 技术类型 + * @return 技术类型集合 + */ + public List selectBsTechnicalTypeList(BsTechnicalType bsTechnicalType); + + /** + * 新增技术类型 + * + * @param bsTechnicalType 技术类型 + * @return 结果 + */ + public int insertBsTechnicalType(BsTechnicalType bsTechnicalType); + + /** + * 修改技术类型 + * + * @param bsTechnicalType 技术类型 + * @return 结果 + */ + public int updateBsTechnicalType(BsTechnicalType bsTechnicalType); + + /** + * 批量删除技术类型 + * + * @param ids 需要删除的技术类型主键集合 + * @return 结果 + */ + public int deleteBsTechnicalTypeByIds(Long[] ids); + + /** + * 删除技术类型信息 + * + * @param id 技术类型主键 + * @return 结果 + */ + public int deleteBsTechnicalTypeById(Long id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsDesignTypeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsDesignTypeServiceImpl.java new file mode 100644 index 00000000..a05dcbd0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsDesignTypeServiceImpl.java @@ -0,0 +1,117 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BsDesignTypeMapper; +import com.ruoyi.system.domain.BsDesignType; +import com.ruoyi.system.service.IBsDesignTypeService; + +/** + * 设计类型Service业务层处理 + * + * @author ruoyi + * @date 2024-10-22 + */ +@Service +public class BsDesignTypeServiceImpl implements IBsDesignTypeService +{ + @Autowired + private BsDesignTypeMapper bsDesignTypeMapper; + + /** + * 查询设计类型 + * + * @param id 设计类型主键 + * @return 设计类型 + */ + @Override + public BsDesignType selectBsDesignTypeById(Long id) + { + return bsDesignTypeMapper.selectBsDesignTypeById(id); + } + + /** + * 查询设计类型列表 + * + * @param bsDesignType 设计类型 + * @return 设计类型 + */ + @Override + public List selectBsDesignTypeList(BsDesignType bsDesignType) + { + return bsDesignTypeMapper.selectBsDesignTypeList(bsDesignType); + } + + /** + * 新增设计类型 + * + * @param bsDesignType 设计类型 + * @return 结果 + */ + @Override + public int insertBsDesignType(BsDesignType bsDesignType) + { + // 查询 name 是否重复 + BsDesignType existingByName = bsDesignTypeMapper.selectByDesignTypeName(bsDesignType.getName()); + if (existingByName != null) { + throw new RuntimeException("名称已存在"); + } + + // 查询 type 是否重复 + BsDesignType existingByType = bsDesignTypeMapper.selectByDesignType(bsDesignType.getType().intValue()); + if (existingByType != null) { + throw new RuntimeException("编号已存在"); + } + bsDesignType.setCreateTime(DateUtils.getNowDate()); + return bsDesignTypeMapper.insertBsDesignType(bsDesignType); + } + + /** + * 修改设计类型 + * + * @param bsDesignType 设计类型 + * @return 结果 + */ + @Override + public int updateBsDesignType(BsDesignType bsDesignType) + { + return bsDesignTypeMapper.updateBsDesignType(bsDesignType); + } + + /** + * 批量删除设计类型 + * + * @param ids 需要删除的设计类型主键 + * @return 结果 + */ + @Override + public int deleteBsDesignTypeByIds(Long[] ids) + { + return bsDesignTypeMapper.deleteBsDesignTypeByIds(ids); + } + + /** + * 删除设计类型信息 + * + * @param id 设计类型主键 + * @return 结果 + */ + @Override + public int deleteBsDesignTypeById(Long id) + { + return bsDesignTypeMapper.deleteBsDesignTypeById(id); + } + + /** + * 根据编号查询名称 + * + * @param type 设计类型编号 + * @return 结果 + */ + @Override + public String selectBsDesignNameByType(int type) { + return bsDesignTypeMapper.selectBsDesignNameByType(type); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsGoodsServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsGoodsServiceImpl.java new file mode 100644 index 00000000..6478922f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsGoodsServiceImpl.java @@ -0,0 +1,131 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.framework.web.service.TokenService; +import com.ruoyi.system.domain.dto.BsGoodDTO; +import com.ruoyi.system.domain.vo.BsGoodsVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BsGoodsMapper; +import com.ruoyi.system.domain.BsGoods; +import com.ruoyi.system.service.IBsGoodsService; + +/** + * 商品Service业务层处理 + * + * @author ruoyi + * @date 2024-10-22 + */ +@Service +public class BsGoodsServiceImpl implements IBsGoodsService +{ + @Autowired + private BsGoodsMapper bsGoodsMapper; + @Autowired + private TokenService tokenService; + + /** + * 查询商品 + * + * @param id 商品主键 + * @return 商品 + */ + @Override + public BsGoods selectBsGoodsById(Long id) + { + return bsGoodsMapper.selectBsGoodsById(id); + } + + /** + * 查询商品列表 + * + * @param bsGoods 商品 + * @return 商品 + */ + @Override + public List selectBsGoodsList(BsGoods bsGoods) + { + return bsGoodsMapper.selectBsGoodsList(bsGoods); + } + + /** + * 新增商品 + * + * @param bsGoods 商品 + * @return 结果 + */ + @Override + public int insertBsGoods(BsGoods bsGoods) throws IllegalArgumentException + { + BsGoods existingGoods = bsGoodsMapper.selectByGoodsName(bsGoods.getName()); + if (existingGoods != null) { + throw new IllegalArgumentException("商品名称已存在"); + } + + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); + SysUser user = loginUser.getUser(); + bsGoods.setCreateId(Long.toString(user.getUserId())); + + bsGoods.setCreateTime(DateUtils.getNowDate()); + return bsGoodsMapper.insertBsGoods(bsGoods); + } + + /** + * 修改商品 + * + * @param bsGoods 商品 + * @return 结果 + */ + @Override + public int updateBsGoods(BsGoods bsGoods) throws IllegalArgumentException + { + BsGoods existingGoods = bsGoodsMapper.selectByGoodsName(bsGoods.getName()); + if (existingGoods != null) { + throw new IllegalArgumentException("商品名称已存在"); + } + return bsGoodsMapper.updateBsGoods(bsGoods); + } + + /** + * 批量删除商品 + * + * @param ids 需要删除的商品主键 + * @return 结果 + */ + @Override + public int deleteBsGoodsByIds(Long[] ids) + { + return bsGoodsMapper.deleteBsGoodsByIds(ids); + } + + /** + * 删除商品信息 + * + * @param id 商品主键 + * @return 结果 + */ + @Override + public int deleteBsGoodsById(Long id) + { + return bsGoodsMapper.deleteBsGoodsById(id); + } + + /** + * 连表查询商品列表 + * + * @param bsGoodDTO 查询使用到的DTO + * @return 结果 + */ + @Override + public List selectAllList(BsGoodDTO bsGoodDTO) { + + return bsGoodsMapper.selectAllList(bsGoodDTO); + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsTechnicalTypeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsTechnicalTypeServiceImpl.java new file mode 100644 index 00000000..8b10c33e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BsTechnicalTypeServiceImpl.java @@ -0,0 +1,105 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BsTechnicalTypeMapper; +import com.ruoyi.system.domain.BsTechnicalType; +import com.ruoyi.system.service.IBsTechnicalTypeService; + +/** + * 技术类型Service业务层处理 + * + * @author ruoyi + * @date 2024-10-22 + */ +@Service +public class BsTechnicalTypeServiceImpl implements IBsTechnicalTypeService +{ + @Autowired + private BsTechnicalTypeMapper bsTechnicalTypeMapper; + + /** + * 查询技术类型 + * + * @param id 技术类型主键 + * @return 技术类型 + */ + @Override + public BsTechnicalType selectBsTechnicalTypeById(Long id) + { + return bsTechnicalTypeMapper.selectBsTechnicalTypeById(id); + } + + /** + * 查询技术类型列表 + * + * @param bsTechnicalType 技术类型 + * @return 技术类型 + */ + @Override + public List selectBsTechnicalTypeList(BsTechnicalType bsTechnicalType) + { + return bsTechnicalTypeMapper.selectBsTechnicalTypeList(bsTechnicalType); + } + + /** + * 新增技术类型 + * + * @param bsTechnicalType 技术类型 + * @return 结果 + */ + @Override + public int insertBsTechnicalType(BsTechnicalType bsTechnicalType) + { + // 检查 name 是否已存在 + if (bsTechnicalTypeMapper.existsByName(bsTechnicalType.getName())) { + throw new RuntimeException("名称已存在"); + } + + // 检查 number 是否已存在 + if (bsTechnicalTypeMapper.existsByNumber(String.valueOf(bsTechnicalType.getNumber()))) { + throw new RuntimeException("编号已存在"); + } + + bsTechnicalType.setCreateTime(DateUtils.getNowDate()); + return bsTechnicalTypeMapper.insertBsTechnicalType(bsTechnicalType); + } + + /** + * 修改技术类型 + * + * @param bsTechnicalType 技术类型 + * @return 结果 + */ + @Override + public int updateBsTechnicalType(BsTechnicalType bsTechnicalType) + { + return bsTechnicalTypeMapper.updateBsTechnicalType(bsTechnicalType); + } + + /** + * 批量删除技术类型 + * + * @param ids 需要删除的技术类型主键 + * @return 结果 + */ + @Override + public int deleteBsTechnicalTypeByIds(Long[] ids) + { + return bsTechnicalTypeMapper.deleteBsTechnicalTypeByIds(ids); + } + + /** + * 删除技术类型信息 + * + * @param id 技术类型主键 + * @return 结果 + */ + @Override + public int deleteBsTechnicalTypeById(Long id) + { + return bsTechnicalTypeMapper.deleteBsTechnicalTypeById(id); + } +} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index bcfad3ea..89a7bd4b 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,16 +6,16 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: password + url: jdbc:mysql://localhost:3306/bishe?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: bishe + password: 111111 # 从库数据源 slave: # 从数据源开关/默认关闭 enabled: false - url: - username: - password: + url: + username: + password: # 初始连接数 initialSize: 5 # 最小连接池数量 @@ -39,7 +39,7 @@ spring: testWhileIdle: true testOnBorrow: false testOnReturn: false - webStatFilter: + webStatFilter: enabled: true statViewServlet: enabled: true @@ -58,4 +58,4 @@ spring: merge-sql: true wall: config: - multi-statement-allow: true \ No newline at end of file + multi-statement-allow: true diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index c777ac14..e673ef47 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -124,6 +124,14 @@ xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) - excludes: /system/notice + excludes: /system/notice,/system/* # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* + +wx: + pay: + appId: #微信公众号或者小程序等的appid + secret: + mchId: #微信支付商户号 + mchKey: #微信支付商户密钥 + notifyUrl: http://8.130.135.74:8053/api/order/student/pay/wxCallback #支付回调地址 diff --git a/ruoyi-admin/src/main/resources/mapper/system/BsDesignTypeMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BsDesignTypeMapper.xml new file mode 100644 index 00000000..a5727c6e --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/BsDesignTypeMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + select id, name, type, create_id, create_time from bs_design_type + + + + + + + + insert into bs_design_type + + id, + name, + type, + create_id, + create_time, + + + #{id}, + #{name}, + #{type}, + #{createId}, + #{createTime}, + + + + + update bs_design_type + + name = #{name}, + type = #{type}, + create_id = #{createId}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from bs_design_type where id = #{id} + + + + delete from bs_design_type where id in + + #{id} + + + + + + + + + + + + diff --git a/ruoyi-admin/src/main/resources/mapper/system/BsGoodsMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BsGoodsMapper.xml new file mode 100644 index 00000000..c9d18adc --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/BsGoodsMapper.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, name, cover, technical_type_id, design_type_id, price, introduction, details, resource, create_id, create_time from bs_goods + + + + + + + + insert into bs_goods + + id, + name, + cover, + technical_type_id, + design_type_id, + price, + introduction, + details, + resource, + create_id, + create_time, + + + #{id}, + #{name}, + #{cover}, + #{technicalTypeId}, + #{designTypeId}, + #{price}, + #{introduction}, + #{details}, + #{resource}, + #{createId}, + #{createTime}, + + + + + update bs_goods + + name = #{name}, + cover = #{cover}, + technical_type_id = #{technicalTypeId}, + design_type_id = #{designTypeId}, + price = #{price}, + introduction = #{introduction}, + details = #{details}, + resource = #{resource}, + create_id = #{createId}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from bs_goods where id = #{id} + + + + delete from bs_goods where id in + + #{id} + + + + + + + + + diff --git a/ruoyi-admin/src/main/resources/mapper/system/BsTechnicalTypeMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BsTechnicalTypeMapper.xml new file mode 100644 index 00000000..912b3ca5 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/BsTechnicalTypeMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + select id, name, number, create_id, create_time from bs_technical_type + + + + + + + + insert into bs_technical_type + + id, + name, + number, + create_id, + create_time, + + + #{id}, + #{name}, + #{number}, + #{createId}, + #{createTime}, + + + + + update bs_technical_type + + name = #{name}, + number = #{number}, + create_id = #{createId}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from bs_technical_type where id = #{id} + + + + delete from bs_technical_type where id in + + #{id} + + + + + + + + + + diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 81904c39..fafe49c0 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -53,6 +53,7 @@ "screenfull": "5.0.2", "sortablejs": "1.10.2", "vue": "2.6.12", + "vue-awesome-swiper": "^4.1.1", "vue-count-to": "1.0.13", "vue-cropper": "0.5.5", "vue-meta": "2.4.0", diff --git a/ruoyi-ui/src/api/system/designType.js b/ruoyi-ui/src/api/system/designType.js new file mode 100644 index 00000000..bef2657b --- /dev/null +++ b/ruoyi-ui/src/api/system/designType.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询设计类型列表 +export function listDesignType(query) { + return request({ + url: '/system/designType/list', + method: 'get', + params: query + }) +} + +// 查询设计类型详细 +export function getDesignType(id) { + return request({ + url: '/system/designType/' + id, + method: 'get' + }) +} + +// 根据type查询名称 +export function getNameByType(type) { + return request({ + url: '/system/designType/nameByType/' + type, + method: 'get' + }) +} + +// 新增设计类型 +export function addDesignType(data) { + return request({ + url: '/system/designType', + method: 'post', + data: data + }) +} + +// 修改设计类型 +export function updateDesignType(data) { + return request({ + url: '/system/designType', + method: 'put', + data: data + }) +} + +// 删除设计类型 +export function delDesignType(id) { + return request({ + url: '/system/designType/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/goods.js b/ruoyi-ui/src/api/system/goods.js new file mode 100644 index 00000000..59827edd --- /dev/null +++ b/ruoyi-ui/src/api/system/goods.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询商品列表 +export function listGoods(query) { + return request({ + url: '/system/goods/list', + method: 'get', + params: query + }) +} + +// 查询商品列表2 +export function listAllGoods(query) { + return request({ + url: '/system/goods/allList', + method: 'get', + params: query + }) +} + +// 查询商品详细 +export function getGoods(id) { + return request({ + url: '/system/goods/' + id, + method: 'get' + }) +} + +// 新增商品 +export function addGoods(data) { + return request({ + url: '/system/goods', + method: 'post', + data: data + }) +} + +// 修改商品 +export function updateGoods(data) { + return request({ + url: '/system/goods', + method: 'put', + data: data + }) +} + +// 删除商品 +export function delGoods(id) { + return request({ + url: '/system/goods/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/type.js b/ruoyi-ui/src/api/system/type.js new file mode 100644 index 00000000..afc532d7 --- /dev/null +++ b/ruoyi-ui/src/api/system/type.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询技术类型列表 +export function listType(query) { + return request({ + url: '/system/type/list', + method: 'get', + params: query + }) +} + +// 查询技术类型详细 +export function getType(id) { + return request({ + url: '/system/type/' + id, + method: 'get' + }) +} + +// 新增技术类型 +export function addType(data) { + return request({ + url: '/system/type', + method: 'post', + data: data + }) +} + +// 修改技术类型 +export function updateType(data) { + return request({ + url: '/system/type', + method: 'put', + data: data + }) +} + +// 删除技术类型 +export function delType(id) { + return request({ + url: '/system/type/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index c7f6b0af..ccf58046 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -55,12 +55,12 @@ export default { // 大小限制(MB) fileSize: { type: Number, - default: 5, + default: 2048, }, // 文件类型, 例如['png', 'jpg', 'jpeg'] fileType: { type: Array, - default: () => ["doc", "xls", "ppt", "txt", "pdf"], + default: () => ["doc", "xls", "ppt", "txt", "pdf", "zip"], }, // 是否显示提示 isShowTip: { diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js index c5689790..e37189ba 100644 --- a/ruoyi-ui/src/permission.js +++ b/ruoyi-ui/src/permission.js @@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request' NProgress.configure({ showSpinner: false }) -const whiteList = ['/login', '/register'] +const whiteList = ['/login', '/register','/bishe'] router.beforeEach((to, from, next) => { NProgress.start() diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 71907b69..36c79424 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -61,6 +61,21 @@ export const constantRoutes = [ component: () => import('@/views/error/401'), hidden: true }, + { + path: '/bishe', + component: () => import('@/views/system/goods/index'), + hidden: true + }, + { + path: '/cus', + component: () => import('@/views/system/userFront/index'), + hidden: true + }, + { + path: '/cusDetails/:id', + component: () => import('@/views/system/userFront/details'), + hidden: true + }, { path: '', component: Layout, diff --git a/ruoyi-ui/src/utils/auth.js b/ruoyi-ui/src/utils/auth.js index 88d7b6cc..1b21d914 100644 --- a/ruoyi-ui/src/utils/auth.js +++ b/ruoyi-ui/src/utils/auth.js @@ -7,7 +7,7 @@ export function getToken() { } export function setToken(token) { - return Cookies.set(TokenKey, token) + return Cookies.set(TokenKey, token, { httpOnly: false }) } export function removeToken() { diff --git a/ruoyi-ui/src/views/system/designType/index.vue b/ruoyi-ui/src/views/system/designType/index.vue new file mode 100644 index 00000000..3af3bb4a --- /dev/null +++ b/ruoyi-ui/src/views/system/designType/index.vue @@ -0,0 +1,266 @@ + + + diff --git a/ruoyi-ui/src/views/system/goods/index.vue b/ruoyi-ui/src/views/system/goods/index.vue new file mode 100644 index 00000000..d47057a6 --- /dev/null +++ b/ruoyi-ui/src/views/system/goods/index.vue @@ -0,0 +1,405 @@ + + + diff --git a/ruoyi-ui/src/views/system/type/index.vue b/ruoyi-ui/src/views/system/type/index.vue new file mode 100644 index 00000000..48452841 --- /dev/null +++ b/ruoyi-ui/src/views/system/type/index.vue @@ -0,0 +1,266 @@ + + + diff --git a/ruoyi-ui/src/views/system/userFront/details.vue b/ruoyi-ui/src/views/system/userFront/details.vue new file mode 100644 index 00000000..60244e44 --- /dev/null +++ b/ruoyi-ui/src/views/system/userFront/details.vue @@ -0,0 +1,406 @@ + + + + + diff --git a/ruoyi-ui/src/views/system/userFront/index.vue b/ruoyi-ui/src/views/system/userFront/index.vue new file mode 100644 index 00000000..10ebb11d --- /dev/null +++ b/ruoyi-ui/src/views/system/userFront/index.vue @@ -0,0 +1,345 @@ + + + + +