Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system
This commit is contained in:
commit
967e66a7da
@ -0,0 +1,119 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.controller.admin;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||||
|
import cn.iocoder.yudao.module.project.service.RepairWaresService;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresSaveReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 配件库")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/repair/wares")
|
||||||
|
@Validated
|
||||||
|
public class RepairWaresController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RepairWaresService waresService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建配件库
|
||||||
|
*
|
||||||
|
* @param createReqVO RepairWaresSaveReqVO实体
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.String>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:20 2024/9/14
|
||||||
|
**/
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建配件库")
|
||||||
|
@PreAuthorize("@ss.hasPermission('repair:wares:create')")
|
||||||
|
public CommonResult<String> createWares(@Valid @RequestBody RepairWaresSaveReqVO createReqVO) {
|
||||||
|
return success(waresService.createWares(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新配件库
|
||||||
|
*
|
||||||
|
* @param updateReqVO RepairWaresSaveReqVO实体
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:21 2024/9/14
|
||||||
|
**/
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新配件库")
|
||||||
|
@PreAuthorize("@ss.hasPermission('repair:wares:update')")
|
||||||
|
public CommonResult<Boolean> updateWares(@Valid @RequestBody RepairWaresSaveReqVO updateReqVO) {
|
||||||
|
waresService.updateWares(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件库
|
||||||
|
*
|
||||||
|
* @param id 产品id
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:21 2024/9/14
|
||||||
|
**/
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除配件库")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('repair:wares:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWares(@RequestParam("id") String id) {
|
||||||
|
waresService.deleteWares(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得配件库
|
||||||
|
*
|
||||||
|
* @param id 产品id
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.project.vo.RepairWaresRespVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:21 2024/9/14
|
||||||
|
**/
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得配件库")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('repair:wares:query')")
|
||||||
|
public CommonResult<RepairWaresRespVO> getWares(@RequestParam("id") String id) {
|
||||||
|
RepairWares wares = waresService.getWares(id);
|
||||||
|
return success(BeanUtils.toBean(wares, RepairWaresRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得配件库分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO RepairWaresPageReqVO 实体
|
||||||
|
* @param pageNo 分页参数
|
||||||
|
* @param pageSize 分页参数
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < ?>>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:30 2024/9/14
|
||||||
|
**/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得配件库分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('repair:wares:query')")
|
||||||
|
public CommonResult<IPage<?>> getWaresPage(RepairWaresPageReqVO pageReqVO,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<RepairWaresRespVO> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(waresService.getWaresPage(pageReqVO, page));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.entity;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修配件库
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@TableName("dl_repair_wares")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RepairWares extends TenantBaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键标识
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 条形码
|
||||||
|
*/
|
||||||
|
private String barCode;
|
||||||
|
/**
|
||||||
|
* 商品编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
private String model;
|
||||||
|
/**
|
||||||
|
* 销售价格
|
||||||
|
*/
|
||||||
|
private String price;
|
||||||
|
/**
|
||||||
|
* 所属分类
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 默认仓库
|
||||||
|
*/
|
||||||
|
private String warehouse;
|
||||||
|
/**
|
||||||
|
* 最低库存
|
||||||
|
*/
|
||||||
|
private BigDecimal miniStock;
|
||||||
|
/**
|
||||||
|
* 最高库存
|
||||||
|
*/
|
||||||
|
private BigDecimal maxStock;
|
||||||
|
/**
|
||||||
|
* 当前库存
|
||||||
|
*/
|
||||||
|
private BigDecimal stock;
|
||||||
|
/**
|
||||||
|
* 产品图片
|
||||||
|
*/
|
||||||
|
private String img;
|
||||||
|
/**
|
||||||
|
* 配件属性
|
||||||
|
*/
|
||||||
|
private String attribute;
|
||||||
|
/**
|
||||||
|
* 适用子公司
|
||||||
|
*/
|
||||||
|
private String corpId;
|
||||||
|
/**
|
||||||
|
* 封面图片
|
||||||
|
*/
|
||||||
|
private String coverImg;
|
||||||
|
/**
|
||||||
|
* 适用车型
|
||||||
|
*/
|
||||||
|
private String carModel;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件库 Mapper
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RepairWaresMapper extends BaseMapper<RepairWares> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询配件库
|
||||||
|
*
|
||||||
|
* @param pageReqVO RepairWaresPageReqVO实体
|
||||||
|
* @param page RepairWaresRespVO实体
|
||||||
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.project.vo.RepairWaresRespVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 10:35 2024/9/14
|
||||||
|
**/
|
||||||
|
IPage<RepairWaresRespVO> queryListPage(@Param("entity") RepairWaresPageReqVO pageReqVO, Page<RepairWaresRespVO> page);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresSaveReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件库 Service 接口
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
public interface RepairWaresService extends IService<RepairWares> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建配件库
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
String createWares(RepairWaresSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新配件库
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateWares(RepairWaresSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除配件库
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteWares(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得配件库
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 配件库
|
||||||
|
*/
|
||||||
|
RepairWares getWares(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得配件库分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 配件库分页
|
||||||
|
*/
|
||||||
|
IPage<RepairWaresRespVO> getWaresPage(RepairWaresPageReqVO pageReqVO, Page<RepairWaresRespVO> page);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||||
|
import cn.iocoder.yudao.module.project.mapper.RepairWaresMapper;
|
||||||
|
import cn.iocoder.yudao.module.project.service.RepairWaresService;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO;
|
||||||
|
import cn.iocoder.yudao.module.project.vo.RepairWaresSaveReqVO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件库 Service 实现类
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class RepairWaresServiceImpl extends ServiceImpl<RepairWaresMapper, RepairWares> implements RepairWaresService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RepairWaresMapper waresMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createWares(RepairWaresSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
RepairWares wares = BeanUtils.toBean(createReqVO, RepairWares.class);
|
||||||
|
waresMapper.insert(wares);
|
||||||
|
// 返回
|
||||||
|
return wares.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWares(RepairWaresSaveReqVO updateReqVO) {
|
||||||
|
// 更新
|
||||||
|
RepairWares updateObj = BeanUtils.toBean(updateReqVO, RepairWares.class);
|
||||||
|
waresMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteWares(String id) {
|
||||||
|
// 删除
|
||||||
|
waresMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RepairWares getWares(String id) {
|
||||||
|
return waresMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<RepairWaresRespVO> getWaresPage(RepairWaresPageReqVO pageReqVO, Page<RepairWaresRespVO> page) {
|
||||||
|
return waresMapper.queryListPage(pageReqVO,page);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,23 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.project.vo;
|
package cn.iocoder.yudao.module.project.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.project.entity.RepairProject;
|
import cn.iocoder.yudao.module.project.entity.RepairProject;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 维修项目 Response VO")
|
@Schema(description = "管理后台 - 维修项目 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class RepairProjectRespVO extends RepairProject {
|
public class RepairProjectRespVO extends RepairProject {
|
||||||
|
|
||||||
/**所属分类*/
|
/**所属分类*/
|
||||||
private String typeName;
|
private String typeName;
|
||||||
}
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.project.entity.RepairProject;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 配件库分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class RepairWaresPageReqVO extends RepairProject {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.project.entity.RepairProject;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 配件库 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class RepairWaresRespVO extends RepairProject {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.project.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.project.entity.RepairProject;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 配件库新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class RepairWaresSaveReqVO extends RepairProject {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
<?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="cn.iocoder.yudao.module.project.mapper.RepairWaresMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
<select id="queryListPage" resultType="cn.iocoder.yudao.module.project.vo.RepairWaresRespVO">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user