package com.ruoyi.tms.controller;
|
|
import java.util.List;
|
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.utils.file.DownloadExportUtil;
|
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.tms.domain.TmsCustomerInfo;
|
import com.ruoyi.tms.service.ITmsCustomerInfoService;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
/**
|
* 客户信息Controller
|
*
|
* @author ruoyi
|
* @date 2025-11-02
|
*/
|
@RestController
|
@RequestMapping("/tms/tmsCustomerInfo")
|
public class TmsCustomerInfoController extends BaseController
|
{
|
@Autowired
|
private ITmsCustomerInfoService tmsCustomerInfoService;
|
|
|
|
/**
|
* 查询客户信息列表
|
*/
|
@PreAuthorize("@ss.hasPermi('tms:tmsCustomerInfo:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(TmsCustomerInfo tmsCustomerInfo)
|
{
|
startPage();
|
List<TmsCustomerInfo> list = tmsCustomerInfoService.selectTmsCustomerInfoList(tmsCustomerInfo);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出客户信息列表
|
* @param tmsCustomerInfo 查询条件对象
|
*/
|
@PreAuthorize("@ss.hasPermi('tms:tmsCustomerInfo:export')")
|
@Log(title = "客户信息", businessType = BusinessType.EXPORT)
|
@GetMapping("/export")
|
public AjaxResult export(TmsCustomerInfo tmsCustomerInfo,String exportKey)
|
{
|
tmsCustomerInfoService.export(tmsCustomerInfo,exportKey);
|
return AjaxResult.success("导出请求成功,请稍后点击下载...!");
|
}
|
|
|
|
/**
|
* 获取客户信息详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('tms:tmsCustomerInfo:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Integer id)
|
{
|
return AjaxResult.success(tmsCustomerInfoService.selectTmsCustomerInfoById(id));
|
}
|
|
/**
|
* 新增客户信息
|
*/
|
@PreAuthorize("@ss.hasPermi('tms:tmsCustomerInfo:add')")
|
@Log(title = "客户信息", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody TmsCustomerInfo tmsCustomerInfo)
|
{
|
return toAjax(tmsCustomerInfoService.insertTmsCustomerInfo(tmsCustomerInfo));
|
}
|
|
/**
|
* 修改客户信息
|
*/
|
@PreAuthorize("@ss.hasPermi('tms:tmsCustomerInfo:edit')")
|
@Log(title = "客户信息", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody TmsCustomerInfo tmsCustomerInfo)
|
{
|
return toAjax(tmsCustomerInfoService.updateTmsCustomerInfo(tmsCustomerInfo));
|
}
|
|
/**
|
* 删除客户信息
|
*/
|
@PreAuthorize("@ss.hasPermi('tms:tmsCustomerInfo:remove')")
|
@Log(title = "客户信息", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable Integer[] ids)
|
{
|
return toAjax(tmsCustomerInfoService.deleteTmsCustomerInfoByIds(ids));
|
}
|
}
|