初步 提交客户/供应商管理
This commit is contained in:
+170
@@ -0,0 +1,170 @@
|
||||
package com.ruoyi.web.controller.customer.customerinfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment;
|
||||
import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
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.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.customer.customerinfo.domain.BmsCustomer;
|
||||
import com.ruoyi.customer.customerinfo.service.IBmsCustomerService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 客户管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/customersupplier/customerinfo")
|
||||
public class BmsCustomerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsCustomerService bmsCustomerService;
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsCustomer bmsCustomer)
|
||||
{
|
||||
startPage();
|
||||
List<BmsCustomer> list = bmsCustomerService.selectBmsCustomerList(bmsCustomer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:export')")
|
||||
@Log(title = "客户信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsCustomer bmsCustomer)
|
||||
{
|
||||
List<BmsCustomer> list = bmsCustomerService.selectBmsCustomerList(bmsCustomer);
|
||||
ExcelUtil<BmsCustomer> util = new ExcelUtil<BmsCustomer>(BmsCustomer.class);
|
||||
util.exportExcel(response, list, "客户主数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:query')")
|
||||
@GetMapping(value = "/{customerId}")
|
||||
public AjaxResult getInfo(@PathVariable("customerId") String customerId)
|
||||
{
|
||||
return success(bmsCustomerService.selectBmsCustomerByCustomerId(customerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:add')")
|
||||
@Log(title = "客户信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsCustomer bmsCustomer)
|
||||
{
|
||||
return toAjax(bmsCustomerService.insertBmsCustomer(bmsCustomer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:edit')")
|
||||
@Log(title = "客户信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsCustomer bmsCustomer)
|
||||
{
|
||||
return toAjax(bmsCustomerService.updateBmsCustomer(bmsCustomer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:remove')")
|
||||
@Log(title = "客户信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{customerIds}")
|
||||
public AjaxResult remove(@PathVariable String[] customerIds)
|
||||
{
|
||||
return toAjax(bmsCustomerService.deleteBmsCustomerByCustomerIds(customerIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看附件列表数据
|
||||
*/
|
||||
// @PreAuthorize("")
|
||||
|
||||
@GetMapping("/attachment/list")
|
||||
public TableDataInfo showattachmentlist(BmsCustomerAttachment bmsCustomerAttachment)
|
||||
{
|
||||
startPage();
|
||||
List<BmsCustomerAttachment> list = bmsCustomerService.selectBmsCustomerAttachmentList(bmsCustomerAttachment);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户公司主体列表
|
||||
*/
|
||||
@GetMapping("/company/list")
|
||||
public TableDataInfo companyList(BmsCustomerCompany bmsCustomerCompany)
|
||||
{
|
||||
startPage();
|
||||
List<BmsCustomerCompany> list = bmsCustomerService.selectBmsCustomerCompanyList(bmsCustomerCompany);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户公司主体详细信息
|
||||
*/
|
||||
@GetMapping("/company/{companyId}")
|
||||
public AjaxResult getCompanyInfo(@PathVariable("companyId") Long companyId)
|
||||
{
|
||||
return success(bmsCustomerService.selectBmsCustomerCompanyByCompanyId(companyId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户公司主体(可关联客户主表,可不关联)
|
||||
*/
|
||||
@Log(title = "客户公司主体", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/company")
|
||||
public AjaxResult addCompany(@RequestBody BmsCustomerCompany bmsCustomerCompany)
|
||||
{
|
||||
return toAjax(bmsCustomerService.insertBmsCustomerCompany(bmsCustomerCompany));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户公司主体
|
||||
*/
|
||||
@Log(title = "客户公司主体", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/company")
|
||||
public AjaxResult editCompany(@RequestBody BmsCustomerCompany bmsCustomerCompany)
|
||||
{
|
||||
return toAjax(bmsCustomerService.updateBmsCustomerCompany(bmsCustomerCompany));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户公司主体
|
||||
*/
|
||||
@Log(title = "客户公司主体", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/company/{companyIds}")
|
||||
public AjaxResult removeCompany(@PathVariable Long[] companyIds)
|
||||
{
|
||||
return toAjax(bmsCustomerService.deleteBmsCustomerCompanyByCompanyIds(companyIds));
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package com.ruoyi.web.controller.customer.supplierinfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.customer.customerinfo.domain.BmsCustomerAttachment;
|
||||
import com.ruoyi.customer.customerinfo.domain.BmsCustomerCompany;
|
||||
import com.ruoyi.customer.supplierinfo.domain.BmsSupplier;
|
||||
import com.ruoyi.customer.supplierinfo.service.IBmsSupplierService;
|
||||
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.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
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.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.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 供应商管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-09-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/customersupplier/supplierinfo")
|
||||
public class BmsSupplierController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBmsSupplierService bmsSupplierService;
|
||||
|
||||
/** 查询供应商列表 */
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmsSupplier bmsSupplier)
|
||||
{
|
||||
startPage();
|
||||
List<BmsSupplier> list = bmsSupplierService.selectBmsSupplierList(bmsSupplier);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/** 导出供应商列表 */
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:export')")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmsSupplier bmsSupplier)
|
||||
{
|
||||
List<BmsSupplier> list = bmsSupplierService.selectBmsSupplierList(bmsSupplier);
|
||||
ExcelUtil<BmsSupplier> util = new ExcelUtil<BmsSupplier>(BmsSupplier.class);
|
||||
util.exportExcel(response, list, "供应商数据");
|
||||
}
|
||||
|
||||
/** 获取供应商详细信息 */
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:query')")
|
||||
@GetMapping(value = "/{supplierId}")
|
||||
public AjaxResult getInfo(@PathVariable("supplierId") String supplierId)
|
||||
{
|
||||
return success(bmsSupplierService.selectBmsSupplierBySupplierId(supplierId));
|
||||
}
|
||||
|
||||
/** 新增供应商 */
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:add')")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BmsSupplier bmsSupplier)
|
||||
{
|
||||
return toAjax(bmsSupplierService.insertBmsSupplier(bmsSupplier));
|
||||
}
|
||||
|
||||
/** 修改供应商 */
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:edit')")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BmsSupplier bmsSupplier)
|
||||
{
|
||||
return toAjax(bmsSupplierService.updateBmsSupplier(bmsSupplier));
|
||||
}
|
||||
|
||||
/** 删除供应商 */
|
||||
@PreAuthorize("@ss.hasPermi('customersupplier:supplierinfo:remove')")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{supplierIds}")
|
||||
public AjaxResult remove(@PathVariable String[] supplierIds)
|
||||
{
|
||||
return toAjax(bmsSupplierService.deleteBmsSupplierBySupplierIds(supplierIds));
|
||||
}
|
||||
|
||||
/** 查看供应商附件列表(子表共用) */
|
||||
@GetMapping("/attachment/list")
|
||||
public TableDataInfo attachmentList(BmsCustomerAttachment bmsCustomerAttachment)
|
||||
{
|
||||
startPage();
|
||||
List<BmsCustomerAttachment> list = bmsSupplierService.selectBmsSupplierAttachmentList(bmsCustomerAttachment);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/** 查看供应商公司主体列表(子表共用) */
|
||||
@GetMapping("/company/list")
|
||||
public TableDataInfo companyList(BmsCustomerCompany bmsCustomerCompany)
|
||||
{
|
||||
startPage();
|
||||
List<BmsCustomerCompany> list = bmsSupplierService.selectBmsSupplierCompanyList(bmsCustomerCompany);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user