初始化
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
package com.ruoyi.bas.BasSupplier.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
|
||||
import com.ruoyi.bas.BasSupplier.service.IBasSupplierService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
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 jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 供应商管理Controller
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/BasSupplier")
|
||||
public class BasSupplierController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasSupplierService basSupplierService;
|
||||
|
||||
/**
|
||||
* 查询供应商管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasSupplier:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasSupplier basSupplier)
|
||||
{
|
||||
startPage();
|
||||
List<BasSupplier> list = basSupplierService.selectBasSupplierList(basSupplier);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供应商管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasSupplier:export')")
|
||||
@Log(title = "供应商管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasSupplier basSupplier)
|
||||
{
|
||||
List<BasSupplier> list = basSupplierService.selectBasSupplierList(basSupplier);
|
||||
ExcelUtil<BasSupplier> util = new ExcelUtil<BasSupplier>(BasSupplier.class);
|
||||
util.exportExcel(response, list, "供应商管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasSupplier:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(basSupplierService.selectBasSupplierById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasSupplier:add')")
|
||||
@Log(title = "供应商管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasSupplier basSupplier)
|
||||
{
|
||||
// 使用雪花算法生成ID并转为字符串
|
||||
basSupplier.setId(String.valueOf(IdUtil.getSnowflake().nextId()));
|
||||
return toAjax(basSupplierService.insertBasSupplier(basSupplier));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasSupplier:edit')")
|
||||
@Log(title = "供应商管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasSupplier basSupplier)
|
||||
{
|
||||
return toAjax(basSupplierService.updateBasSupplier(basSupplier));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasSupplier:remove')")
|
||||
@Log(title = "供应商管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(basSupplierService.deleteBasSupplierByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package com.ruoyi.bas.BasSupplier.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 供应商管理对象 bas_supplier
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public class BasSupplier extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** fid()主键 */
|
||||
private String id;
|
||||
|
||||
/** 供应商编号 */
|
||||
@Excel(name = "供应商编号")
|
||||
private String supplierNo;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String supplierGroupNo;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
/** 简称 */
|
||||
@Excel(name = "简称")
|
||||
private String simpleName;
|
||||
|
||||
/** 是否可用 */
|
||||
@Excel(name = "是否可用",dictType = "is_available")
|
||||
private String useable;
|
||||
|
||||
/** 地区分类 */
|
||||
@Excel(name = "地区分类")
|
||||
private String supplierArae;
|
||||
|
||||
/** 纳税人登记号 */
|
||||
@Excel(name = "纳税人登记号")
|
||||
private String taxpayerRegistrationNumber;
|
||||
|
||||
/** 国家 */
|
||||
@Excel(name = "国家")
|
||||
private String country;
|
||||
|
||||
/** 时区 */
|
||||
@Excel(name = "时区")
|
||||
private String timeZone;
|
||||
|
||||
/** 数据格式 */
|
||||
@Excel(name = "数据格式")
|
||||
private String dataFormat;
|
||||
|
||||
/** 收货国家 */
|
||||
@Excel(name = "收货国家")
|
||||
private String receivingCountry;
|
||||
|
||||
/** 税类 */
|
||||
@Excel(name = "税类")
|
||||
private String taxCategory;
|
||||
|
||||
/** 法人 */
|
||||
@Excel(name = "法人")
|
||||
private String legalPerson;
|
||||
|
||||
/** 注册资金 */
|
||||
@Excel(name = "注册资金")
|
||||
private String registeredCapital;
|
||||
|
||||
/** 企业地址 */
|
||||
@Excel(name = "企业地址")
|
||||
private String address;
|
||||
|
||||
/** 联系人姓名 */
|
||||
@Excel(name = "联系人姓名")
|
||||
private String contactName;
|
||||
|
||||
/** 联系电话 */
|
||||
@Excel(name = "联系电话")
|
||||
private String contactNumber;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSupplierNo(String supplierNo)
|
||||
{
|
||||
this.supplierNo = supplierNo;
|
||||
}
|
||||
|
||||
public String getSupplierNo()
|
||||
{
|
||||
return supplierNo;
|
||||
}
|
||||
|
||||
public void setSupplierGroupNo(String supplierGroupNo)
|
||||
{
|
||||
this.supplierGroupNo = supplierGroupNo;
|
||||
}
|
||||
|
||||
public String getSupplierGroupNo()
|
||||
{
|
||||
return supplierGroupNo;
|
||||
}
|
||||
|
||||
public void setSupplierName(String supplierName)
|
||||
{
|
||||
this.supplierName = supplierName;
|
||||
}
|
||||
|
||||
public String getSupplierName()
|
||||
{
|
||||
return supplierName;
|
||||
}
|
||||
|
||||
public void setSimpleName(String simpleName)
|
||||
{
|
||||
this.simpleName = simpleName;
|
||||
}
|
||||
|
||||
public String getSimpleName()
|
||||
{
|
||||
return simpleName;
|
||||
}
|
||||
|
||||
public void setUseable(String useable)
|
||||
{
|
||||
this.useable = useable;
|
||||
}
|
||||
|
||||
public String getUseable()
|
||||
{
|
||||
return useable;
|
||||
}
|
||||
|
||||
public void setSupplierArae(String supplierArae)
|
||||
{
|
||||
this.supplierArae = supplierArae;
|
||||
}
|
||||
|
||||
public String getSupplierArae()
|
||||
{
|
||||
return supplierArae;
|
||||
}
|
||||
|
||||
public void setTaxpayerRegistrationNumber(String taxpayerRegistrationNumber)
|
||||
{
|
||||
this.taxpayerRegistrationNumber = taxpayerRegistrationNumber;
|
||||
}
|
||||
|
||||
public String getTaxpayerRegistrationNumber()
|
||||
{
|
||||
return taxpayerRegistrationNumber;
|
||||
}
|
||||
|
||||
public void setCountry(String country)
|
||||
{
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getCountry()
|
||||
{
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setTimeZone(String timeZone)
|
||||
{
|
||||
this.timeZone = timeZone;
|
||||
}
|
||||
|
||||
public String getTimeZone()
|
||||
{
|
||||
return timeZone;
|
||||
}
|
||||
|
||||
public void setDataFormat(String dataFormat)
|
||||
{
|
||||
this.dataFormat = dataFormat;
|
||||
}
|
||||
|
||||
public String getDataFormat()
|
||||
{
|
||||
return dataFormat;
|
||||
}
|
||||
|
||||
public void setReceivingCountry(String receivingCountry)
|
||||
{
|
||||
this.receivingCountry = receivingCountry;
|
||||
}
|
||||
|
||||
public String getReceivingCountry()
|
||||
{
|
||||
return receivingCountry;
|
||||
}
|
||||
|
||||
public void setTaxCategory(String taxCategory)
|
||||
{
|
||||
this.taxCategory = taxCategory;
|
||||
}
|
||||
|
||||
public String getTaxCategory()
|
||||
{
|
||||
return taxCategory;
|
||||
}
|
||||
|
||||
public void setLegalPerson(String legalPerson)
|
||||
{
|
||||
this.legalPerson = legalPerson;
|
||||
}
|
||||
|
||||
public String getLegalPerson()
|
||||
{
|
||||
return legalPerson;
|
||||
}
|
||||
|
||||
public void setRegisteredCapital(String registeredCapital)
|
||||
{
|
||||
this.registeredCapital = registeredCapital;
|
||||
}
|
||||
|
||||
public String getRegisteredCapital()
|
||||
{
|
||||
return registeredCapital;
|
||||
}
|
||||
|
||||
public void setAddress(String address)
|
||||
{
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setContactName(String contactName)
|
||||
{
|
||||
this.contactName = contactName;
|
||||
}
|
||||
|
||||
public String getContactName()
|
||||
{
|
||||
return contactName;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber)
|
||||
{
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactNumber()
|
||||
{
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("supplierNo", getSupplierNo())
|
||||
.append("supplierGroupNo", getSupplierGroupNo())
|
||||
.append("supplierName", getSupplierName())
|
||||
.append("simpleName", getSimpleName())
|
||||
.append("useable", getUseable())
|
||||
.append("remark", getRemark())
|
||||
.append("supplierArae", getSupplierArae())
|
||||
.append("taxpayerRegistrationNumber", getTaxpayerRegistrationNumber())
|
||||
.append("country", getCountry())
|
||||
.append("timeZone", getTimeZone())
|
||||
.append("dataFormat", getDataFormat())
|
||||
.append("receivingCountry", getReceivingCountry())
|
||||
.append("taxCategory", getTaxCategory())
|
||||
.append("legalPerson", getLegalPerson())
|
||||
.append("registeredCapital", getRegisteredCapital())
|
||||
.append("address", getAddress())
|
||||
.append("contactName", getContactName())
|
||||
.append("contactNumber", getContactNumber())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.bas.BasSupplier.mapper;
|
||||
|
||||
import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商管理Mapper接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface BasSupplierMapper
|
||||
{
|
||||
/**
|
||||
* 查询供应商管理
|
||||
*
|
||||
* @param id 供应商管理主键
|
||||
* @return 供应商管理
|
||||
*/
|
||||
public BasSupplier selectBasSupplierById(String id);
|
||||
|
||||
/**
|
||||
* 查询供应商管理列表
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 供应商管理集合
|
||||
*/
|
||||
public List<BasSupplier> selectBasSupplierList(BasSupplier basSupplier);
|
||||
|
||||
/**
|
||||
* 新增供应商管理
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasSupplier(BasSupplier basSupplier);
|
||||
|
||||
/**
|
||||
* 修改供应商管理
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasSupplier(BasSupplier basSupplier);
|
||||
|
||||
/**
|
||||
* 删除供应商管理
|
||||
*
|
||||
* @param id 供应商管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasSupplierById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除供应商管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasSupplierByIds(String[] ids);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.bas.BasSupplier.service;
|
||||
|
||||
import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商管理Service接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface IBasSupplierService
|
||||
{
|
||||
/**
|
||||
* 查询供应商管理
|
||||
*
|
||||
* @param id 供应商管理主键
|
||||
* @return 供应商管理
|
||||
*/
|
||||
public BasSupplier selectBasSupplierById(String id);
|
||||
|
||||
/**
|
||||
* 查询供应商管理列表
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 供应商管理集合
|
||||
*/
|
||||
public List<BasSupplier> selectBasSupplierList(BasSupplier basSupplier);
|
||||
|
||||
/**
|
||||
* 新增供应商管理
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasSupplier(BasSupplier basSupplier);
|
||||
|
||||
/**
|
||||
* 修改供应商管理
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasSupplier(BasSupplier basSupplier);
|
||||
|
||||
/**
|
||||
* 批量删除供应商管理
|
||||
*
|
||||
* @param ids 需要删除的供应商管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasSupplierByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除供应商管理信息
|
||||
*
|
||||
* @param id 供应商管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasSupplierById(String id);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.ruoyi.bas.BasSupplier.service.impl;
|
||||
|
||||
import com.ruoyi.bas.BasSupplier.domain.BasSupplier;
|
||||
import com.ruoyi.bas.BasSupplier.mapper.BasSupplierMapper;
|
||||
import com.ruoyi.bas.BasSupplier.service.IBasSupplierService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商管理Service业务层处理
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
@Service
|
||||
public class BasSupplierServiceImpl implements IBasSupplierService
|
||||
{
|
||||
@Autowired
|
||||
private BasSupplierMapper basSupplierMapper;
|
||||
|
||||
/**
|
||||
* 查询供应商管理
|
||||
*
|
||||
* @param id 供应商管理主键
|
||||
* @return 供应商管理
|
||||
*/
|
||||
@Override
|
||||
public BasSupplier selectBasSupplierById(String id)
|
||||
{
|
||||
return basSupplierMapper.selectBasSupplierById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商管理列表
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 供应商管理
|
||||
*/
|
||||
@Override
|
||||
public List<BasSupplier> selectBasSupplierList(BasSupplier basSupplier)
|
||||
{
|
||||
return basSupplierMapper.selectBasSupplierList(basSupplier);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商管理
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasSupplier(BasSupplier basSupplier)
|
||||
{
|
||||
return basSupplierMapper.insertBasSupplier(basSupplier);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商管理
|
||||
*
|
||||
* @param basSupplier 供应商管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasSupplier(BasSupplier basSupplier)
|
||||
{
|
||||
return basSupplierMapper.updateBasSupplier(basSupplier);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除供应商管理
|
||||
*
|
||||
* @param ids 需要删除的供应商管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasSupplierByIds(String[] ids)
|
||||
{
|
||||
return basSupplierMapper.deleteBasSupplierByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商管理信息
|
||||
*
|
||||
* @param id 供应商管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasSupplierById(String id)
|
||||
{
|
||||
return basSupplierMapper.deleteBasSupplierById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user