初始化
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
package com.ruoyi.bas.BasCustomer.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
|
||||
import com.ruoyi.bas.BasCustomer.service.IBasCustomerService;
|
||||
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/BasCustomer")
|
||||
public class BasCustomerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasCustomerService basCustomerService;
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasCustomer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasCustomer basCustomer)
|
||||
{
|
||||
startPage();
|
||||
List<BasCustomer> list = basCustomerService.selectBasCustomerList(basCustomer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasCustomer:export')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasCustomer basCustomer)
|
||||
{
|
||||
List<BasCustomer> list = basCustomerService.selectBasCustomerList(basCustomer);
|
||||
ExcelUtil<BasCustomer> util = new ExcelUtil<BasCustomer>(BasCustomer.class);
|
||||
util.exportExcel(response, list, "客户管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasCustomer:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(basCustomerService.selectBasCustomerById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasCustomer:add')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasCustomer basCustomer)
|
||||
{
|
||||
// 使用雪花算法生成ID并转为字符串
|
||||
basCustomer.setId(String.valueOf(IdUtil.getSnowflake().nextId()));
|
||||
return toAjax(basCustomerService.insertBasCustomer(basCustomer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasCustomer:edit')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasCustomer basCustomer)
|
||||
{
|
||||
return toAjax(basCustomerService.updateBasCustomer(basCustomer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasCustomer:remove')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(basCustomerService.deleteBasCustomerByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
package com.ruoyi.bas.BasCustomer.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_customer
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public class BasCustomer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private String id;
|
||||
|
||||
/** 客户编号 */
|
||||
@Excel(name = "客户编号")
|
||||
private String customerNo;
|
||||
|
||||
/** 客户基本分类 */
|
||||
@Excel(name = "客户基本分类")
|
||||
private String customerGroupNo;
|
||||
|
||||
/** 客户名称 */
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
/** 客户简称 */
|
||||
@Excel(name = "客户简称")
|
||||
private String simpleName;
|
||||
|
||||
/** 是否可用 */
|
||||
@Excel(name = "是否可用",dictType = "is_available")
|
||||
private String useable;
|
||||
|
||||
/** 业务部门 */
|
||||
@Excel(name = "业务部门")
|
||||
private String businessDepartment;
|
||||
|
||||
/** 业务员 */
|
||||
@Excel(name = "业务员")
|
||||
private String salesman;
|
||||
|
||||
/** 助忆码 */
|
||||
@Excel(name = "助忆码")
|
||||
private String mnemonicCode;
|
||||
|
||||
/** 客户类型 */
|
||||
@Excel(name = "客户类型")
|
||||
private String type;
|
||||
|
||||
/** 纳税人登记号 */
|
||||
@Excel(name = "纳税人登记号")
|
||||
private String taxpayerRegistrationNumber;
|
||||
|
||||
/** 对应财务组织 */
|
||||
@Excel(name = "对应财务组织")
|
||||
private String organization;
|
||||
|
||||
/** 上级客户 */
|
||||
@Excel(name = "上级客户")
|
||||
private String supCustomer;
|
||||
|
||||
/** 散户 */
|
||||
@Excel(name = "散户")
|
||||
private String retailInvestor;
|
||||
|
||||
/** 国家/地区 */
|
||||
@Excel(name = "国家/地区")
|
||||
private String country;
|
||||
|
||||
/** 时区 */
|
||||
@Excel(name = "时区")
|
||||
private String timeZone;
|
||||
|
||||
/** 数据格式 */
|
||||
@Excel(name = "数据格式")
|
||||
private String dataFormat;
|
||||
|
||||
/** 联系人姓名 */
|
||||
@Excel(name = "联系人姓名")
|
||||
private String contactName;
|
||||
|
||||
/** 发货国家 */
|
||||
@Excel(name = "发货国家")
|
||||
private String shipment;
|
||||
|
||||
/** 税类 */
|
||||
@Excel(name = "税类")
|
||||
private String taxCategory;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setCustomerNo(String customerNo)
|
||||
{
|
||||
this.customerNo = customerNo;
|
||||
}
|
||||
|
||||
public String getCustomerNo()
|
||||
{
|
||||
return customerNo;
|
||||
}
|
||||
|
||||
public void setCustomerGroupNo(String customerGroupNo)
|
||||
{
|
||||
this.customerGroupNo = customerGroupNo;
|
||||
}
|
||||
|
||||
public String getCustomerGroupNo()
|
||||
{
|
||||
return customerGroupNo;
|
||||
}
|
||||
|
||||
public void setCustomerName(String customerName)
|
||||
{
|
||||
this.customerName = customerName;
|
||||
}
|
||||
|
||||
public String getCustomerName()
|
||||
{
|
||||
return customerName;
|
||||
}
|
||||
|
||||
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 setBusinessDepartment(String businessDepartment)
|
||||
{
|
||||
this.businessDepartment = businessDepartment;
|
||||
}
|
||||
|
||||
public String getBusinessDepartment()
|
||||
{
|
||||
return businessDepartment;
|
||||
}
|
||||
|
||||
public void setSalesman(String salesman)
|
||||
{
|
||||
this.salesman = salesman;
|
||||
}
|
||||
|
||||
public String getSalesman()
|
||||
{
|
||||
return salesman;
|
||||
}
|
||||
|
||||
public void setMnemonicCode(String mnemonicCode)
|
||||
{
|
||||
this.mnemonicCode = mnemonicCode;
|
||||
}
|
||||
|
||||
public String getMnemonicCode()
|
||||
{
|
||||
return mnemonicCode;
|
||||
}
|
||||
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setTaxpayerRegistrationNumber(String taxpayerRegistrationNumber)
|
||||
{
|
||||
this.taxpayerRegistrationNumber = taxpayerRegistrationNumber;
|
||||
}
|
||||
|
||||
public String getTaxpayerRegistrationNumber()
|
||||
{
|
||||
return taxpayerRegistrationNumber;
|
||||
}
|
||||
|
||||
public void setOrganization(String organization)
|
||||
{
|
||||
this.organization = organization;
|
||||
}
|
||||
|
||||
public String getOrganization()
|
||||
{
|
||||
return organization;
|
||||
}
|
||||
|
||||
public void setSupCustomer(String supCustomer)
|
||||
{
|
||||
this.supCustomer = supCustomer;
|
||||
}
|
||||
|
||||
public String getSupCustomer()
|
||||
{
|
||||
return supCustomer;
|
||||
}
|
||||
|
||||
public void setRetailInvestor(String retailInvestor)
|
||||
{
|
||||
this.retailInvestor = retailInvestor;
|
||||
}
|
||||
|
||||
public String getRetailInvestor()
|
||||
{
|
||||
return retailInvestor;
|
||||
}
|
||||
|
||||
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 setContactName(String contactName)
|
||||
{
|
||||
this.contactName = contactName;
|
||||
}
|
||||
|
||||
public String getContactName()
|
||||
{
|
||||
return contactName;
|
||||
}
|
||||
|
||||
public void setShipment(String shipment)
|
||||
{
|
||||
this.shipment = shipment;
|
||||
}
|
||||
|
||||
public String getShipment()
|
||||
{
|
||||
return shipment;
|
||||
}
|
||||
|
||||
public void setTaxCategory(String taxCategory)
|
||||
{
|
||||
this.taxCategory = taxCategory;
|
||||
}
|
||||
|
||||
public String getTaxCategory()
|
||||
{
|
||||
return taxCategory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("customerNo", getCustomerNo())
|
||||
.append("customerGroupNo", getCustomerGroupNo())
|
||||
.append("customerName", getCustomerName())
|
||||
.append("simpleName", getSimpleName())
|
||||
.append("useable", getUseable())
|
||||
.append("remark", getRemark())
|
||||
.append("businessDepartment", getBusinessDepartment())
|
||||
.append("salesman", getSalesman())
|
||||
.append("mnemonicCode", getMnemonicCode())
|
||||
.append("type", getType())
|
||||
.append("taxpayerRegistrationNumber", getTaxpayerRegistrationNumber())
|
||||
.append("organization", getOrganization())
|
||||
.append("supCustomer", getSupCustomer())
|
||||
.append("retailInvestor", getRetailInvestor())
|
||||
.append("country", getCountry())
|
||||
.append("timeZone", getTimeZone())
|
||||
.append("dataFormat", getDataFormat())
|
||||
.append("contactName", getContactName())
|
||||
.append("shipment", getShipment())
|
||||
.append("taxCategory", getTaxCategory())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.bas.BasCustomer.mapper;
|
||||
|
||||
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户管理Mapper接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface BasCustomerMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户管理
|
||||
*
|
||||
* @param id 客户管理主键
|
||||
* @return 客户管理
|
||||
*/
|
||||
public BasCustomer selectBasCustomerById(String id);
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 客户管理集合
|
||||
*/
|
||||
public List<BasCustomer> selectBasCustomerList(BasCustomer basCustomer);
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasCustomer(BasCustomer basCustomer);
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasCustomer(BasCustomer basCustomer);
|
||||
|
||||
/**
|
||||
* 删除客户管理
|
||||
*
|
||||
* @param id 客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasCustomerById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除客户管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasCustomerByIds(String[] ids);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.bas.BasCustomer.service;
|
||||
|
||||
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户管理Service接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-05-20
|
||||
*/
|
||||
public interface IBasCustomerService
|
||||
{
|
||||
/**
|
||||
* 查询客户管理
|
||||
*
|
||||
* @param id 客户管理主键
|
||||
* @return 客户管理
|
||||
*/
|
||||
public BasCustomer selectBasCustomerById(String id);
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 客户管理集合
|
||||
*/
|
||||
public List<BasCustomer> selectBasCustomerList(BasCustomer basCustomer);
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasCustomer(BasCustomer basCustomer);
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasCustomer(BasCustomer basCustomer);
|
||||
|
||||
/**
|
||||
* 批量删除客户管理
|
||||
*
|
||||
* @param ids 需要删除的客户管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasCustomerByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除客户管理信息
|
||||
*
|
||||
* @param id 客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasCustomerById(String id);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.ruoyi.bas.BasCustomer.service.impl;
|
||||
|
||||
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
|
||||
import com.ruoyi.bas.BasCustomer.mapper.BasCustomerMapper;
|
||||
import com.ruoyi.bas.BasCustomer.service.IBasCustomerService;
|
||||
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 BasCustomerServiceImpl implements IBasCustomerService
|
||||
{
|
||||
@Autowired
|
||||
private BasCustomerMapper basCustomerMapper;
|
||||
|
||||
/**
|
||||
* 查询客户管理
|
||||
*
|
||||
* @param id 客户管理主键
|
||||
* @return 客户管理
|
||||
*/
|
||||
@Override
|
||||
public BasCustomer selectBasCustomerById(String id)
|
||||
{
|
||||
return basCustomerMapper.selectBasCustomerById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 客户管理
|
||||
*/
|
||||
@Override
|
||||
public List<BasCustomer> selectBasCustomerList(BasCustomer basCustomer)
|
||||
{
|
||||
return basCustomerMapper.selectBasCustomerList(basCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasCustomer(BasCustomer basCustomer)
|
||||
{
|
||||
return basCustomerMapper.insertBasCustomer(basCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*
|
||||
* @param basCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasCustomer(BasCustomer basCustomer)
|
||||
{
|
||||
return basCustomerMapper.updateBasCustomer(basCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户管理
|
||||
*
|
||||
* @param ids 需要删除的客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasCustomerByIds(String[] ids)
|
||||
{
|
||||
return basCustomerMapper.deleteBasCustomerByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户管理信息
|
||||
*
|
||||
* @param id 客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasCustomerById(String id)
|
||||
{
|
||||
return basCustomerMapper.deleteBasCustomerById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user