毕设项目

This commit is contained in:
Lx 2024-10-24 11:38:25 +08:00
parent d3326987a4
commit e4e69912a6
37 changed files with 3717 additions and 23 deletions

View File

@ -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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.8.8</version>
@ -11,7 +11,7 @@
<name>ruoyi</name>
<url>http://www.ruoyi.vip</url>
<description>若依管理系统</description>
<properties>
<ruoyi.version>3.8.8</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -235,4 +235,4 @@
</pluginRepository>
</pluginRepositories>
</project>
</project>

View File

@ -60,6 +60,11 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
@ -80,17 +85,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>
</project>

View File

@ -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<BsDesignType> 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<BsDesignType> list = bsDesignTypeService.selectBsDesignTypeList(bsDesignType);
ExcelUtil<BsDesignType> util = new ExcelUtil<BsDesignType>(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));
}
}

View File

@ -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<BsGoods> 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<BsGoodsVO> list = bsGoodsService.selectAllList(bsGoodDTO);
ExcelUtil<BsGoodsVO> util = new ExcelUtil<BsGoodsVO>(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<BsGoodsVO> list = bsGoodsService.selectAllList(bsGoodDTO);
return getDataTable(list);
}
}

View File

@ -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<BsTechnicalType> 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<BsTechnicalType> list = bsTechnicalTypeService.selectBsTechnicalTypeList(bsTechnicalType);
ExcelUtil<BsTechnicalType> util = new ExcelUtil<BsTechnicalType>(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));
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<BsGoods> 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<BsGoodsVO> selectAllList(BsGoodDTO bsGoodDTO);
}

View File

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

View File

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

View File

@ -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<BsGoods> 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<BsGoodsVO> selectAllList(BsGoodDTO bsGoodDTO);
}

View File

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

View File

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

View File

@ -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<BsGoods> 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<BsGoodsVO> selectAllList(BsGoodDTO bsGoodDTO) {
return bsGoodsMapper.selectAllList(bsGoodDTO);
}
}

View File

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

View File

@ -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
multi-statement-allow: true

View File

@ -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 #支付回调地址

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BsDesignTypeMapper">
<resultMap type="BsDesignType" id="BsDesignTypeResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="createId" column="create_id" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBsDesignTypeVo">
select id, name, type, create_id, create_time from bs_design_type
</sql>
<select id="selectBsDesignTypeList" parameterType="BsDesignType" resultMap="BsDesignTypeResult">
<include refid="selectBsDesignTypeVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="type != null "> and type = #{type}</if>
</where>
</select>
<select id="selectBsDesignTypeById" parameterType="Long" resultMap="BsDesignTypeResult">
<include refid="selectBsDesignTypeVo"/>
where id = #{id}
</select>
<insert id="insertBsDesignType" parameterType="BsDesignType">
insert into bs_design_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="type != null">type,</if>
<if test="createId != null">create_id,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="type != null">#{type},</if>
<if test="createId != null">#{createId},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateBsDesignType" parameterType="BsDesignType">
update bs_design_type
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBsDesignTypeById" parameterType="Long">
delete from bs_design_type where id = #{id}
</delete>
<delete id="deleteBsDesignTypeByIds" parameterType="String">
delete from bs_design_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectBsDesignNameByType" parameterType="int" resultType="string">
SELECT name FROM bs_design_type WHERE type = #{type}
</select>
<!-- 根据名称查询设计类型 -->
<select id="selectByDesignTypeName" parameterType="string" resultType="com.ruoyi.system.domain.BsDesignType">
SELECT * FROM bs_design_type WHERE name = #{name}
</select>
<!-- 根据类型查询设计类型 -->
<select id="selectByDesignType" parameterType="integer" resultType="com.ruoyi.system.domain.BsDesignType">
SELECT * FROM bs_design_type WHERE type = #{type}
</select>
</mapper>

View File

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BsGoodsMapper">
<resultMap type="BsGoods" id="BsGoodsResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="cover" column="cover" />
<result property="technicalTypeId" column="technical_type_id" />
<result property="designTypeId" column="design_type_id" />
<result property="price" column="price" />
<result property="introduction" column="introduction" />
<result property="details" column="details" />
<result property="resource" column="resource" />
<result property="createTime" column="create_time" />
</resultMap>
<resultMap type="BsGoodsVO" id="BsGoodsVOResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="cover" column="cover" />
<result property="price" column="price" />
<result property="introduction" column="introduction" />
<result property="details" column="details" />
<result property="resource" column="resource" />
<result property="createName" column="create_name" />
<result property="createTime" column="create_time" />
<result property="designName" column="designName" />
<result property="technicalName" column="technicalName" />
</resultMap>
<sql id="selectBsGoodsVo">
select id, name, cover, technical_type_id, design_type_id, price, introduction, details, resource, create_id, create_time from bs_goods
</sql>
<select id="selectBsGoodsList" parameterType="BsGoods" resultMap="BsGoodsResult">
<include refid="selectBsGoodsVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="cover != null and cover != ''"> and cover = #{cover}</if>
<if test="technicalTypeId != null "> and technical_type_id = #{technicalTypeId}</if>
<if test="designTypeId != null "> and design_type_id like concat('%', #{designTypeId}, '%')</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if>
<if test="details != null and details != ''"> and details = #{details}</if>
<if test="resource != null and resource != ''"> and resource = #{resource}</if>
</where>
</select>
<select id="selectBsGoodsById" parameterType="Long" resultMap="BsGoodsResult">
<include refid="selectBsGoodsVo"/>
where id = #{id}
</select>
<insert id="insertBsGoods" parameterType="BsGoods">
insert into bs_goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="cover != null">cover,</if>
<if test="technicalTypeId != null">technical_type_id,</if>
<if test="designTypeId != null">design_type_id,</if>
<if test="price != null">price,</if>
<if test="introduction != null">introduction,</if>
<if test="details != null">details,</if>
<if test="resource != null">resource,</if>
<if test="createId != null">create_id,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="cover != null">#{cover},</if>
<if test="technicalTypeId != null">#{technicalTypeId},</if>
<if test="designTypeId != null">#{designTypeId},</if>
<if test="price != null">#{price},</if>
<if test="introduction != null">#{introduction},</if>
<if test="details != null">#{details},</if>
<if test="resource != null">#{resource},</if>
<if test="createId != null">#{createId},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateBsGoods" parameterType="BsGoods">
update bs_goods
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="cover != null">cover = #{cover},</if>
<if test="technicalTypeId != null">technical_type_id = #{technicalTypeId},</if>
<if test="designTypeId != null">design_type_id = #{designTypeId},</if>
<if test="price != null">price = #{price},</if>
<if test="introduction != null">introduction = #{introduction},</if>
<if test="details != null">details = #{details},</if>
<if test="resource != null">resource = #{resource},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBsGoodsById" parameterType="Long">
delete from bs_goods where id = #{id}
</delete>
<delete id="deleteBsGoodsByIds" parameterType="String">
delete from bs_goods where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectByGoodsName" resultType="com.ruoyi.system.domain.BsGoods">
SELECT * FROM bs_goods WHERE name = #{name}
</select>
<select id="selectAllList" parameterType="com.ruoyi.system.domain.dto.BsGoodDTO" resultMap="BsGoodsVOResult">
SELECT
bg.id,
bg.name,
bg.cover,
bg.price,
bg.introduction,
bg.details,
bg.resource,
bg.create_time,
bg.design_type_id,
bdt.name AS designName,
bg.technical_type_id,
btt.name AS technicalName
FROM
bs_goods AS bg
LEFT JOIN
bs_design_type AS bdt ON bdt.type = bg.design_type_id
LEFT JOIN
bs_technical_type AS btt ON btt.number = bg.technical_type_id
<where>
<if test="name != null and name != ''"> AND bg.name LIKE CONCAT('%', #{name}, '%') </if>
<if test="cover != null and cover != ''"> AND bg.cover = #{cover} </if>
<if test="technicalName != null"> AND btt.name LIKE CONCAT('%', #{technicalName}, '%') </if>
<if test="designName != null"> AND bdt.name LIKE CONCAT('%', #{designName}, '%') </if>
<if test="price != null and price != ''"> AND bg.price = #{price} </if>
<if test="introduction != null and introduction != ''"> AND bg.introduction = #{introduction} </if>
<if test="details != null and details != ''"> AND bg.details = #{details} </if>
<if test="resource != null and resource != ''"> AND bg.resource = #{resource} </if>
<if test="technicalTypeId != null and technicalTypeId != ''"> AND bg.technical_type_id = #{technicalTypeId} </if>
<if test="designTypeId != null and designTypeId != ''"> AND bg.design_type_id = #{designTypeId} </if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BsTechnicalTypeMapper">
<resultMap type="BsTechnicalType" id="BsTechnicalTypeResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="number" column="number" />
<result property="createId" column="create_id" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBsTechnicalTypeVo">
select id, name, number, create_id, create_time from bs_technical_type
</sql>
<select id="selectBsTechnicalTypeList" parameterType="BsTechnicalType" resultMap="BsTechnicalTypeResult">
<include refid="selectBsTechnicalTypeVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="number != null "> and number = #{number}</if>
</where>
</select>
<select id="selectBsTechnicalTypeById" parameterType="Long" resultMap="BsTechnicalTypeResult">
<include refid="selectBsTechnicalTypeVo"/>
where id = #{id}
</select>
<insert id="insertBsTechnicalType" parameterType="BsTechnicalType">
insert into bs_technical_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="number != null">number,</if>
<if test="createId != null">create_id,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="number != null">#{number},</if>
<if test="createId != null">#{createId},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateBsTechnicalType" parameterType="BsTechnicalType">
update bs_technical_type
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="number != null">number = #{number},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBsTechnicalTypeById" parameterType="Long">
delete from bs_technical_type where id = #{id}
</delete>
<delete id="deleteBsTechnicalTypeByIds" parameterType="String">
delete from bs_technical_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 检查名称是否存在 -->
<select id="existsByName" parameterType="String" resultType="boolean">
SELECT COUNT(1) > 0
FROM bs_technical_type
WHERE name = #{name}
</select>
<!-- 检查编号是否存在 -->
<select id="existsByNumber" parameterType="String" resultType="boolean">
SELECT COUNT(1) > 0
FROM bs_technical_type
WHERE number = #{number}
</select>
</mapper>

View File

@ -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",

View File

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

View File

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

View File

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

View File

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

View File

@ -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()

View File

@ -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,

View File

@ -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() {

View File

@ -0,0 +1,266 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="类型名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入设计类型名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类型编号" prop="type">
<el-input
v-model="queryParams.type"
placeholder="请输入设计类型编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:designType:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:designType:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:designType:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:designType:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="designTypeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="类型名称" align="center" prop="name" />
<el-table-column label="类型编号" align="center" prop="type" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:designType:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:designType:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设计类型对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类型名称" prop="name">
<el-input v-model="form.name" placeholder="请输入类型名称" />
</el-form-item>
<el-form-item label="类型编号" prop="type">
<el-input v-model="form.type" placeholder="请输入类型编号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listDesignType, getDesignType, delDesignType, addDesignType, updateDesignType } from "@/api/system/designType";
export default {
name: "DesignType",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
designTypeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
type: null,
},
//
form: {},
//
rules: {
name: [
{ required: true, message: "设计类型名称不能为空", trigger: "blur" }
],
type: [
{ required: true, message: "设计类型编号不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询设计类型列表 */
getList() {
this.loading = true;
listDesignType(this.queryParams).then(response => {
this.designTypeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
type: null,
createId: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设计类型";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDesignType(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设计类型";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDesignType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDesignType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除设计类型编号为"' + ids + '"的数据项?').then(function() {
return delDesignType(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/designType/export', {
...this.queryParams
}, `designType_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,405 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设计名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入设计名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设计类型" prop="designName">
<el-input
v-model="queryParams.designName"
placeholder="请输入设计类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:goods:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:goods:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:goods:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:goods:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="商品名称" align="center" prop="name" />
<el-table-column label="商品封面图片" align="center" prop="cover" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.cover" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="技术类型" align="center" prop="technicalName" >
<!-- <template slot-scope="scope">-->
<!-- {{ technicalTypeMapping[scope.row.technicalTypeId] || scope.row.technicalTypeId }}-->
<!-- </template>-->
</el-table-column>
<el-table-column label="设计类型" align="center" prop="designName" >
<!-- <template slot-scope="scope">-->
<!-- {{ designTypeMapping[scope.row.designTypeId] || scope.row.designTypeId }}-->
<!-- </template>-->
</el-table-column>
<el-table-column label="商品价格" align="center" prop="price" />
<el-table-column label="商品简介" align="center" prop="introduction" />
<el-table-column label="商品详情" align="center" prop="details" />
<el-table-column label="商品资源" align="center" prop="resource" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:goods:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:goods:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改商品对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="商品名称" prop="name">
<el-input v-model="form.name" placeholder="请输入商品名称" />
</el-form-item>
<el-form-item label="商品封面图片" prop="cover">
<image-upload v-model="form.cover"/>
</el-form-item>
<el-form-item label="商品价格" prop="price">
<el-input v-model="form.price" placeholder="请输入商品价格" />
</el-form-item>
<el-form-item label="技术类型" prop="technicalTypeId">
<el-select v-model="form.technicalTypeId" placeholder="请选择技术类型" clearable :style="{width: '100%'}">
<el-option v-for="(item, index) in technicalList" :key="item.number" :label="item.name"
:value="item.number" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item label="设计类型" prop="designTypeId">
<el-select v-model="form.designTypeId" placeholder="请选择设计类型" clearable :style="{width: '100%'}">
<el-option v-for="(item, index) in designList" :key="item.type" :label="item.name"
:value="item.type" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item label="商品简介" prop="introduction">
<el-input v-model="form.introduction" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="商品详情" prop="details">
<editor v-model="form.details" :min-height="192"/>
</el-form-item>
<el-form-item label="商品资源" prop="resource">
<file-upload v-model="form.resource"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listGoods, getGoods, delGoods, addGoods, updateGoods, listAllGoods} from "@/api/system/goods";
import {listDesignType} from "@/api/system/designType";
import {listType} from "@/api/system/type";
export default {
name: "Goods",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
goodsList: [],
getAlllist: [],
//
title: "",
//
open: false,
//
designList: [],
//
technicalList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
cover: null,
technicalTypeId: null,
designTypeId: null,
price: null,
introduction: null,
details: null,
resource: null,
technicalName: null,
designName: null,
createTime: null,
},
queryParams2: {
pageNum: 1,
pageSize: 10,
name: null,
cover: null,
technicalTypeId: null,
designTypeId: null,
price: null,
introduction: null,
details: null,
resource: null,
technicalName: null,
designName: null,
createTime: null,
},
//
form: {},
//
rules: {
name: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
cover: [{required: true, message: '请上传封面图片', trigger: 'blur'}],
price: [{required: true, message: '请输入价格', trigger: 'blur'}],
technicalTypeId: [{required: true, message: '请选择技术类型', trigger: 'blur'}],
designTypeId: [{required: true, message: '请选择设计类型', trigger: 'blur'}],
introduction: [{required: true, message: '请输入项目简介', trigger: 'blur'}],
details: [{required: true, message: '请输入项目详情', trigger: 'blur'}],
resource: [{required: true, message: '请上传项目资源', trigger: 'blur'}],
},
technicalTypeMapping: {},
designTypeMapping: {},
field101Options: [{
"label": "Java",
"value": 1
}, {
"label": "PHP",
"value": 2
}],
field102Options: [{
"label": "购物",
"value": 1
}, {
"label": "音乐",
"value": 2
}],
formData: {
field101: '',
field102: '',
},
};
},
created() {
this.getList();
this.getDesignList();
this.getTechnicalList();
this.gitAllGoods();
},
methods: {
/** 查询商品列表 */
getList() {
this.loading = true;
listAllGoods(this.queryParams).then(response => {
this.goodsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
cover: null,
technicalTypeId: null,
designTypeId: null,
price: null,
introduction: null,
details: null,
resource: null,
createId: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加商品";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getGoods(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改商品";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateGoods(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addGoods(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除商品编号为"' + ids + '"的数据项?').then(function() {
return delGoods(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/goods/export', {
...this.queryParams
}, `goods_${new Date().getTime()}.xlsx`)
},
/** 查询设计类型列表 */
getDesignList() {
listDesignType(this.queryParams).then(response => {
this.designList = response.rows;
this.designList = response.rows;
this.designTypeMapping = response.rows.reduce((acc, item) => {
acc[item.type] = item.name; // type
return acc;
}, {});
});
},
gitAllGoods(){
listAllGoods(this.queryParams).then(response => {
this.getAlllist = response.rows;
console.log('所有商品列表',this.getAlllist)
})
},
/** 查询技术类型列表 */
getTechnicalList() {
listType(this.queryParams).then(response => {
this.technicalList = response.rows;
this.technicalTypeMapping = response.rows.reduce((acc, item) => {
acc[item.number] = item.name;
return acc;
}, {});
});
},
}
};
</script>

View File

@ -0,0 +1,266 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="类型名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入技术类型名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类型编号" prop="number">
<el-input
v-model="queryParams.number"
placeholder="请输入技术类型编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:type:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:type:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:type:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:type:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="类型名称" align="center" prop="name" />
<el-table-column label="类型编号" align="center" prop="number" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:type:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:type:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改技术类型对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类型名称" prop="name">
<el-input v-model="form.name" placeholder="请输入技术类型名称" />
</el-form-item>
<el-form-item label="类型编号" prop="number">
<el-input v-model="form.number" placeholder="请输入技术类型编号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listType, getType, delType, addType, updateType } from "@/api/system/type";
export default {
name: "Type",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
number: null,
},
//
form: {},
//
rules: {
name: [
{ required: true, message: "技术类型名称不能为空", trigger: "blur" }
],
number: [
{ required: true, message: "技术类型编号不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询技术类型列表 */
getList() {
this.loading = true;
listType(this.queryParams).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
number: null,
createId: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加技术类型";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getType(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改技术类型";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除技术类型编号为"' + ids + '"的数据项?').then(function() {
return delType(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/type/export', {
...this.queryParams
}, `type_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,406 @@
<template>
<div id="app">
<!-- 顶部导航栏 -->
<el-header class="navbar">
<el-menu mode="horizontal" background-color="#333" text-color="#fff" active-text-color="#ffd04b">
<el-menu-item index="1">安装教程</el-menu-item>
<el-menu-item index="2">开发服务</el-menu-item>
<el-menu-item index="3">我的订单</el-menu-item>
</el-menu>
<div class="user-actions">
<el-button type="primary">立即登录</el-button>
<el-button type="success">快速注册</el-button>
</div>
</el-header>
<!-- 搜索区域 -->
<el-main class="search-section">
<h1>毕设网</h1>
<p>优质的设计资源共享平台</p>
<el-input placeholder="搜索设计"
v-model="queryParams.name"
clearable
@keyup.enter.native="handleQuery"
class="search-box">
<el-button slot="append" icon="el-icon-search" @click="handleQuery"></el-button>
</el-input>
</el-main>
<!-- 设计详情 -->
<el-main>
<div class="content">
<el-row>
<el-col :span="20">
<el-card class="details-card">
<h2>{{ goods.name }}</h2>
<span>{{ goods.introduction }}</span>
<div v-html="goods.details"></div>
</el-card>
</el-col>
<el-col :span="4">
<el-card class="right-card">
<div class="pay-guide">
<span style="text-align: center">购买前请点击了解购买须知</span></div>
<h3 style="text-align: center;color: rgb(82, 182, 106)">{{ goods.price }}</h3>
<div class="pay-but">
<el-button class="but-pay" @click="downloadFile(goods.resource)"><i class="el-icon-download"></i> 支付下载</el-button></div>
</el-card>
<el-card class="right-card">
<h3>价格: {{ goods.price }}</h3>
<el-button type="primary">立即购买</el-button>
<el-button type="success">加入收藏</el-button>
</el-card>
</el-col>
</el-row>
</div>
</el-main>
<!--页脚部分-->
<footer class="footer">
<div class="footer-content">
<p>© 2024 Company Name. All Rights Reserved.</p>
<p>联系我们: contact@example.com | 电话: 123-456-7890</p>
<nav>
<a href="/about">关于我们</a> |
<a href="/privacy">隐私政策</a> |
<a href="/terms">使用条款</a>
</nav>
</div>
</footer>
</div>
</template>
<script>
import axios from 'axios';
import {getGoods, listAllGoods} from "@/api/system/goods";
import {listType} from "@/api/system/type";
import {listDesignType} from "@/api/system/designType";
export default {
data() {
return {
//
total: 0,
//
goods: [],
//
queryParams: {
pageNum: 1,
pageSize: 12,
name: null,
cover: null,
technicalTypeId: null,
designTypeId: null,
price: null,
introduction: null,
details: null,
resource: null,
technicalName: null,
designName: null,
createTime: null,
},
goodsId: null, // ID
goodsDetail: '' //
};
},
mounted() {
},
created() {
this.goodsId = this.$route.params.id;
this.getGood(this.goodsId);
this.getTnList()
this.getDnList()
},
methods: {
/** 查询商品 */
getGood(id) {
getGoods(id).then(response => {
this.goods = response.data;
console.log('good',response)
});
},
/** 查询商品列表 */
getList() {
listAllGoods(this.queryParams).then(response => {
this.goodsList = response.rows;
this.total = response.total;
});
},
/** 查询技术类型列表 */
getTnList() {
listType(this.queryParamsTn).then(response => {
this.typeList = response.rows;
});
},
/** 查询设计类型列表 */
getDnList() {
listDesignType(this.queryParamsDn).then(response => {
this.designTypeList = response.rows;
this.total = response.total;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
// //
// download(fileName) {
// const baseURL = "http://127.0.0.1:8080";
// window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
// },
// /** */
// downloadFile(fileUrl) {
// console.log(':', fileUrl);
// if (!fileUrl) {
// this.$message.error('');
// return;
// }
// if (!fileUrl.startsWith('http')) {
// fileUrl = 'http://127.0.0.1:8080' + fileUrl;
// }
// axios({
// url: fileUrl,
// method: 'GET',
// responseType: 'blob'
// }).then(response => {
// const blob = new Blob([response.data], { type: 'application/octet-stream' });
// const link = document.createElement('a');
// link.href = URL.createObjectURL(blob);
// link.download = fileUrl.split('/').pop();
// link.click();
// URL.revokeObjectURL(link.href);
// }).catch(error => {
// console.error(':', error);
// this.$message.error('');
// });
// }
/** 下载文件 */
downloadFile(fileUrl) {
console.log('文件路径:', fileUrl);
if (!fileUrl) {
this.$message.error('文件路径为空,无法下载');
return;
}
if (!fileUrl.startsWith('http')) {
fileUrl = 'http://127.0.0.1:8080' + fileUrl;
}
axios({
url: fileUrl,
method: 'GET',
responseType: 'blob'
}).then(response => {
const blob = new Blob([response.data], { type: 'application/octet-stream' });
//
const originalFileName = fileUrl.split('/').pop();
const timestamp = new Date().toISOString().replace(/[:.-]/g, '');
const newFileName = `${timestamp}_${originalFileName}`;
// showSaveFilePicker API
if (window.showSaveFilePicker) {
// 使 showSaveFilePicker API
window.showSaveFilePicker({ suggestedName: newFileName }).then(handle => {
handle.createWritable().then(writer => {
writer.write(blob);
writer.close();
}).catch(error => {
console.error('创建文件写入器失败:', error);
this.$message.error('创建文件写入器失败,请联系管理员!');
});
}).catch(error => {
});
} else {
// 使 a
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = newFileName;
link.click();
URL.revokeObjectURL(link.href);
}
}).catch(error => {
console.error('下载文件出错:', error);
this.$message.error('下载文件出现错误,请联系管理员!');
});
}
}
};
</script>
<style scoped lang="scss">
.container {
width: 60%; /* 调整宽度,留出两边空白 */
margin: 0 auto; /* 自动左右边距居中 */
}
/* 卡片的布局样式 */
.card-container {
display: flex; /* 使用 flex 布局来水平排列卡片 */
justify-content: space-around; /* 在卡片之间留出空隙 */
}
.el-card1 {
width: 800px; /* 卡片宽度调整 */
height: auto;
text-align: center;
padding: 10px; /* 给卡片增加一些内边距 */
background-color: #f4f4f4; /* 设置背景颜色 */
border-radius: 8px; /* 圆角样式 */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
}
.details-card {
margin-right: 35px;
}
.right-card {
margin-bottom: 20px;
width: 300px;
}
.card img {
width: 100%; /* 图片占满卡片宽度 */
border-radius: 8px; /* 图片圆角和卡片保持一致 */
}
/* 样式和之前相同 */
.navbar {
background-color: #333;
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
}
.search-section {
text-align: center;
background-color: #333;
color: white;
padding: 50px 20px;
}
.search-box {
margin-top: 20px;
width: 400px;
}
.project-grid {
margin-top: 20px;
}
.image {
width: 100%;
height: 150px;
}
.price {
color: #ff9900;
font-weight: bold;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.button {
color: #409EFF;
cursor: pointer;
}
.tags-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
margin: 20px;
}
.tags-container span {
margin: 10px;
padding: 8px 15px;
border: 1px solid #ccc;
border-radius: 5px;
cursor: pointer;
background-color: #fff;
transition: background-color 0.3s;
}
.tags-container span:hover {
background-color: #eee;
}
/* 页脚样式 */
.footer {
background-color: #333;
color: white;
padding: 20px 0;
text-align: center;
margin-top: 20px;
}
.footer a {
color: #ddd;
margin: 0 10px;
text-decoration: none;
}
.footer a:hover {
color: white;
}
.footer-content p {
margin: 5px 0;
}
.el-menu {
border-bottom: none; /* 去掉底部的线条 */
}
.content {
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
width: 1250px;
}
.pay-guide {
width: 260px;
height: 40px;
background-color: #4AB7BD;
display: flex;
justify-content: center;
align-items: center;
}
.but-pay {
font-size: 16px;
width: 200px;
height: 40px;
box-shadow: 0 0 5px 1px rgba(0, 123, 255, 0.8); /* 蓝色发光边框 */
border-radius: 6px; /* 可选:添加圆角 */
transition: box-shadow 0.3s ease; /* 平滑过渡效果 */
}
.pay-but {
display: flex;
justify-content: center;
align-items: center;
width: 270px;
height: 60px;
}
.but-pay:hover {
background-color: #007bff;
box-shadow: 0 0 6px 2px rgba(0, 123, 255, 1); /* 鼠标悬停时增强发光效果 */
}
.pay-but:hover .el-button {
color: #ffffff;
}
</style>

View File

@ -0,0 +1,345 @@
<template>
<div id="app">
<!-- 顶部导航栏 -->
<el-header class="navbar">
<el-menu mode="horizontal" background-color="#333" text-color="#fff" active-text-color="#ffd04b">
<el-menu-item index="1">安装教程</el-menu-item>
<el-menu-item index="2">开发服务</el-menu-item>
<el-menu-item index="3">我的订单</el-menu-item>
</el-menu>
<div class="user-actions">
<el-button type="primary">立即登录</el-button>
<el-button type="success">快速注册</el-button>
</div>
</el-header>
<!-- 搜索区域 -->
<el-main class="search-section">
<h1>毕设网</h1>
<p>优质的设计资源共享平台</p>
<el-input placeholder="搜索设计"
v-model="queryParams.name"
clearable
@keyup.enter.native="handleQuery"
class="search-box">
<el-button slot="append" icon="el-icon-search" @click="handleQuery"></el-button>
</el-input>
</el-main>
<!-- 分类导航 -->
<!-- <el-main>-->
<!-- <el-menu mode="horizontal" class="categories">-->
<!-- <el-menu-item index="1">设计导航</el-menu-item>-->
<!-- <el-menu-item index="2">PHP设计</el-menu-item>-->
<!-- <el-menu-item index="3">Java设计</el-menu-item>-->
<!-- <el-menu-item index="4">微信小程序</el-menu-item>-->
<!-- </el-menu>-->
<!-- </el-main>-->
<el-main>
<el-menu mode="horizontal"
class="categories"
@select="handleQueryByType">
<el-menu-item
v-for="(item, index) in typeList"
:key="item.number"
:index="item.id"
@click="handleQueryByType(item.number)">
{{ item.name }}
</el-menu-item>
</el-menu>
</el-main>
<!-- 最新设计展示 -->
<el-main>
<h2 style="display: flex;justify-content: center;align-items: center">最新设计</h2>
<div class="wai">
<el-row :gutter="20" class="project-grid">
<el-col :span="6" v-for="(item, index) in goodsList" :key="index" style="margin-bottom: 30px">
<router-link :to="`/cusDetails/${item.id}`">
<el-card :body-style="{ padding: '5px' }">
<el-image :src="`http://127.0.0.1:8080${item.cover}`" class="image" style="width:100px;height:160px"/>
<div style="padding: 8px;">
<span>{{ item.name }}</span>
<div class="bottom clearfix">
<span class="price" >价格{{ item.price }}</span>
</div>
<div>
<span >项目简介{{item.introduction}}</span>
</div>
</div>
</el-card>
</router-link>
</el-col>
</el-row>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-main>
<!-- 标签部分 -->
<div class="tags-container">
<el-button
v-for="(tag, index) in designTypeList"
:key="tag.type"
:label="tag.name"
@click="handleQueryByType(tag.type)"
style="margin: 5px;">
{{ tag.name }}
</el-button>
</div>
<!--页脚部分-->
<footer class="footer">
<div class="footer-content">
<p>© 2024 Company Name. All Rights Reserved.</p>
<p>联系我们: contact@example.com | 电话: 123-456-7890</p>
<nav>
<a href="/about">关于我们</a> |
<a href="/privacy">隐私政策</a> |
<a href="/terms">使用条款</a>
</nav>
</div>
</footer>
</div>
</template>
<script>
import {listAllGoods} from "@/api/system/goods";
import {listType} from "@/api/system/type";
import {listDesignType} from "@/api/system/designType";
export default {
data() {
return {
searchQuery: '',
//
total: 0,
//
goodsList: [],
//
queryParams: {
pageNum: 1,
pageSize: 12,
name: null,
cover: null,
technicalTypeId: null,
designTypeId: null,
price: null,
introduction: null,
details: null,
resource: null,
technicalName: null,
designName: null,
createTime: null,
},
//
typeList: [],
queryParamsTn: {
pageNum: 1,
pageSize: 10,
name: null,
number: null,
},
//
designTypeList: [],
queryParamsDn: {
pageNum: 1,
pageSize: 10,
name: null,
type: null,
},
};
},
mounted() {
},
created() {
this.getList();
this.getTnList()
this.getDnList()
},
methods: {
/** 查询商品列表 */
getList() {
listAllGoods(this.queryParams).then(response => {
this.goodsList = response.rows;
this.total = response.total;
});
},
/** 查询技术类型列表 */
getTnList() {
listType(this.queryParamsTn).then(response => {
this.typeList = response.rows;
});
},
/** 查询设计类型列表 */
getDnList() {
listDesignType(this.queryParamsDn).then(response => {
this.designTypeList = response.rows;
this.total = response.total;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 根据type查询商品列表 */
handleQueryByType(type) {
this.queryParams.technicalTypeId = type;
listAllGoods(this.queryParams).then(response => {
this.goodsList = response.rows;
this.total = response.total;
});
},
}
};
</script>
<style scoped lang="scss">
.container {
width: 60%; /* 调整宽度,留出两边空白 */
margin: 0 auto; /* 自动左右边距居中 */
}
/* 卡片的布局样式 */
.card-container {
display: flex; /* 使用 flex 布局来水平排列卡片 */
justify-content: space-around; /* 在卡片之间留出空隙 */
}
.el-card {
width: 260px; /* 卡片宽度调整 */
height: 300px;
text-align: center;
padding: 10px; /* 给卡片增加一些内边距 */
background-color: #f4f4f4; /* 设置背景颜色 */
border-radius: 8px; /* 圆角样式 */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
}
.card img {
width: 100%; /* 图片占满卡片宽度 */
border-radius: 8px; /* 图片圆角和卡片保持一致 */
}
/* 样式和之前相同 */
.navbar {
background-color: #333;
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
}
.search-section {
text-align: center;
background-color: #333;
color: white;
padding: 50px 20px;
}
.search-box {
margin-top: 20px;
width: 400px;
}
.project-grid {
margin-top: 20px;
}
.image {
width: 100%;
height: 150px;
}
.price {
color: #ff9900;
font-weight: bold;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.button {
color: #409EFF;
cursor: pointer;
}
.tags-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
margin: 20px;
}
.tags-container span {
margin: 10px;
padding: 8px 15px;
border: 1px solid #ccc;
border-radius: 5px;
cursor: pointer;
background-color: #fff;
transition: background-color 0.3s;
}
.tags-container span:hover {
background-color: #eee;
}
/* 页脚样式 */
.footer {
background-color: #333;
color: white;
padding: 20px 0;
text-align: center;
margin-top: 20px;
}
.footer a {
color: #ddd;
margin: 0 10px;
text-decoration: none;
}
.footer a:hover {
color: white;
}
.footer-content p {
margin: 5px 0;
}
.wai{
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
width: 1200px;
}
.el-menu {
border-bottom: none; /* 去掉底部的线条 */
}
</style>