删掉了 ,spc不需要的模块
This commit is contained in:
@@ -31,10 +31,10 @@ import java.util.Map;
|
||||
* 产品类型 表 前端控制器
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-21
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/basic/productType")
|
||||
@RequestMapping("/code/productType")
|
||||
@Api(tags="产品类型 表")
|
||||
public class ProductTypeController {
|
||||
@Autowired
|
||||
@@ -43,12 +43,12 @@ public class ProductTypeController {
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
|
||||
})
|
||||
// @PreAuthorize("@ex.hasAuthority('basic:productType:page')")
|
||||
// @PreAuthorize("@ex.hasAuthority('code:productType:page')")
|
||||
public Result<PageData<ProductTypeDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<ProductTypeDTO> page = productTypeService.page(params);
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ProductTypeController {
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
// @PreAuthorize("@ex.hasAuthority('basic:productType:info')")
|
||||
// @PreAuthorize("@ex.hasAuthority('code:productType:info')")
|
||||
public Result<ProductTypeDTO> get(@PathVariable("id") Long id){
|
||||
ProductTypeDTO data = productTypeService.get(id);
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ProductTypeController {
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
// @PreAuthorize("@ex.hasAuthority('basic:productType:save')")
|
||||
// @PreAuthorize("@ex.hasAuthority('code:productType:save')")
|
||||
public Result save(@RequestBody ProductTypeDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
@@ -80,7 +80,7 @@ public class ProductTypeController {
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
// @PreAuthorize("@ex.hasAuthority('basic:productType:update')")
|
||||
// @PreAuthorize("@ex.hasAuthority('code:productType:update')")
|
||||
public Result update(@RequestBody ProductTypeDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
@@ -93,7 +93,7 @@ public class ProductTypeController {
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
// @PreAuthorize("@ex.hasAuthority('basic:productType:delete')")
|
||||
// @PreAuthorize("@ex.hasAuthority('code:productType:delete')")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
//效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
@@ -106,7 +106,7 @@ public class ProductTypeController {
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
// @PreAuthorize("@ex.hasAuthority('basic:productType:export')")
|
||||
// @PreAuthorize("@ex.hasAuthority('code:productType:export')")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<ProductTypeDTO> list = productTypeService.list(params);
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.cnbm.basic.controller;
|
||||
|
||||
import com.cnbm.admin.annotation.LogOperation;
|
||||
import com.cnbm.common.constant.Constant;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.utils.ExcelUtils;
|
||||
import com.cnbm.common.utils.Result;
|
||||
import com.cnbm.common.validator.AssertUtils;
|
||||
import com.cnbm.common.validator.ValidatorUtils;
|
||||
import com.cnbm.common.validator.group.AddGroup;
|
||||
import com.cnbm.common.validator.group.DefaultGroup;
|
||||
import com.cnbm.common.validator.group.UpdateGroup;
|
||||
import com.cnbm.basic.dto.UnitDTO;
|
||||
import com.cnbm.basic.excel.UnitExcel;
|
||||
import com.cnbm.basic.service.IUnitService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 单位 表 前端控制器
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/code/unit")
|
||||
@Api(tags="单位 表")
|
||||
public class UnitController {
|
||||
@Autowired
|
||||
private IUnitService unitService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
|
||||
})
|
||||
@PreAuthorize("@ex.hasAuthority('code:unit:page')")
|
||||
public Result<PageData<UnitDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<UnitDTO> page = unitService.page(params);
|
||||
|
||||
return new Result<PageData<UnitDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
@PreAuthorize("@ex.hasAuthority('code:unit:info')")
|
||||
public Result<UnitDTO> get(@PathVariable("id") Long id){
|
||||
UnitDTO data = unitService.get(id);
|
||||
|
||||
return new Result<UnitDTO>().ok(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
@PreAuthorize("@ex.hasAuthority('code:unit:save')")
|
||||
public Result save(@RequestBody UnitDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
unitService.save(dto);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
@PreAuthorize("@ex.hasAuthority('code:unit:update')")
|
||||
public Result update(@RequestBody UnitDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
|
||||
unitService.update(dto);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
@PreAuthorize("@ex.hasAuthority('code:unit:delete')")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
//效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
|
||||
unitService.delete(ids);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
@PreAuthorize("@ex.hasAuthority('code:unit:export')")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<UnitDTO> list = unitService.list(params);
|
||||
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, UnitExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
|
||||
* 产品类型 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-21
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "产品类型 表DTO对象")
|
||||
|
||||
67
ym-baisc/src/main/java/com/cnbm/basic/dto/UnitDTO.java
Normal file
67
ym-baisc/src/main/java/com/cnbm/basic/dto/UnitDTO.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.cnbm.basic.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 单位 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "单位 表DTO对象")
|
||||
public class UnitDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private BigDecimal id;
|
||||
|
||||
@ApiModelProperty(value = "单位 名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "单位 编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "单位类型,1 可计数,2 不可计数")
|
||||
private BigDecimal type;
|
||||
|
||||
@ApiModelProperty(value = "1 可用,0 不可用")
|
||||
private BigDecimal status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
|
||||
private BigDecimal valid;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private BigDecimal creatorId;
|
||||
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String creatorName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private BigDecimal updaterId;
|
||||
|
||||
@ApiModelProperty(value = "更新人姓名")
|
||||
private String updaterName;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private BigDecimal version;
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
|
||||
* </p>
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-21
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Data
|
||||
@TableName("product_type")
|
||||
@@ -34,7 +34,7 @@ public class ProductType implements Serializable {
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String desc;
|
||||
private String descs;
|
||||
|
||||
@ApiModelProperty("1 可用,0 不可用")
|
||||
private BigDecimal status;
|
||||
|
||||
68
ym-baisc/src/main/java/com/cnbm/basic/entity/Unit.java
Normal file
68
ym-baisc/src/main/java/com/cnbm/basic/entity/Unit.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.cnbm.basic.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 单位 表
|
||||
* </p>
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Unit对象", description = "单位 表")
|
||||
public class Unit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
private BigDecimal id;
|
||||
|
||||
@ApiModelProperty("单位 名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("单位 编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("单位类型,1 可计数,2 不可计数")
|
||||
private BigDecimal type;
|
||||
|
||||
@ApiModelProperty("1 可用,0 不可用")
|
||||
private BigDecimal status;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
|
||||
private BigDecimal valid;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private BigDecimal creatorId;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
private String creatorName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private BigDecimal updaterId;
|
||||
|
||||
@ApiModelProperty("更新人姓名")
|
||||
private String updaterName;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("版本号")
|
||||
private BigDecimal version;
|
||||
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import java.time.LocalDateTime;
|
||||
* 产品类型 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-21
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Data
|
||||
public class ProductTypeExcel {
|
||||
|
||||
46
ym-baisc/src/main/java/com/cnbm/basic/excel/UnitExcel.java
Normal file
46
ym-baisc/src/main/java/com/cnbm/basic/excel/UnitExcel.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.cnbm.basic.excel;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 单位 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Data
|
||||
public class UnitExcel {
|
||||
@Excel(name = "ID")
|
||||
private BigDecimal id;
|
||||
@Excel(name = "单位 名")
|
||||
private String name;
|
||||
@Excel(name = "单位 编码")
|
||||
private String code;
|
||||
@Excel(name = "单位类型,1 可计数,2 不可计数")
|
||||
private BigDecimal type;
|
||||
@Excel(name = "1 可用,0 不可用")
|
||||
private BigDecimal status;
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
|
||||
private BigDecimal valid;
|
||||
@Excel(name = "创建人")
|
||||
private BigDecimal creatorId;
|
||||
@Excel(name = "创建人姓名")
|
||||
private String creatorName;
|
||||
@Excel(name = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@Excel(name = "更新人")
|
||||
private BigDecimal updaterId;
|
||||
@Excel(name = "更新人姓名")
|
||||
private String updaterName;
|
||||
@Excel(name = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
@Excel(name = "版本号")
|
||||
private BigDecimal version;
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* 产品类型 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-21
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductTypeMapper extends BaseDao<ProductType> {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cnbm.generator.code.mapper.ProductTypeMapper">
|
||||
|
||||
</mapper>
|
||||
16
ym-baisc/src/main/java/com/cnbm/basic/mapper/UnitMapper.java
Normal file
16
ym-baisc/src/main/java/com/cnbm/basic/mapper/UnitMapper.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.cnbm.basic.mapper;
|
||||
|
||||
import com.cnbm.common.dao.BaseDao;
|
||||
import com.cnbm.basic.entity.Unit;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 单位 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Mapper
|
||||
public interface UnitMapper extends BaseDao<Unit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cnbm.generator.code.mapper.UnitMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -8,7 +8,7 @@ import com.cnbm.basic.entity.ProductType;
|
||||
* 产品类型 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-21
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
public interface IProductTypeService extends CrudService<ProductType, ProductTypeDTO> {
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.cnbm.basic.service;
|
||||
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.basic.dto.UnitDTO;
|
||||
import com.cnbm.basic.entity.Unit;
|
||||
|
||||
/**
|
||||
* 单位 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
public interface IUnitService extends CrudService<Unit, UnitDTO> {
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import java.util.Map;
|
||||
* 产品类型 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-21
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Service
|
||||
public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, ProductType, ProductTypeDTO> implements IProductTypeService {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cnbm.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.UnitDTO;
|
||||
import com.cnbm.basic.entity.Unit;
|
||||
import com.cnbm.basic.mapper.UnitMapper;
|
||||
import com.cnbm.basic.service.IUnitService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 单位 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-06-30
|
||||
*/
|
||||
@Service
|
||||
public class UnitServiceImpl extends CrudServiceImpl<UnitMapper, Unit, UnitDTO> implements IUnitService {
|
||||
|
||||
@Override
|
||||
public QueryWrapper<Unit> getWrapper(Map<String, Object> params){
|
||||
String id = (String)params.get("id");
|
||||
|
||||
QueryWrapper<Unit> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user