commit
e0c9d88e78
@ -0,0 +1,121 @@
|
|||||||
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.Customer;
|
||||||
|
import com.ruoyi.system.domain.vo.CustomerOrderVo;
|
||||||
|
import com.ruoyi.system.service.ICustomerService;
|
||||||
|
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.log.annotation.Log;
|
||||||
|
import com.ruoyi.common.log.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.ruoyi.system.domain.CustomerOrder;
|
||||||
|
import com.ruoyi.system.service.ICustomerOrderService;
|
||||||
|
import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户-订车Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-08-01
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/customerOrder")
|
||||||
|
public class CustomerOrderController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ICustomerOrderService customerOrderService;
|
||||||
|
@Autowired
|
||||||
|
private ICustomerService customerService;
|
||||||
|
/**
|
||||||
|
* 查询客户-订车列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customerOrder:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(CustomerOrder customerOrder)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<CustomerOrder> list = customerOrderService.selectCustomerOrderList(customerOrder);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getCustomerOrderPage")
|
||||||
|
public TableDataInfo getCustomerOrderPage(CustomerOrderVo customerOrder)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<CustomerOrderVo> list = customerOrderService.getCustomerOrderPage(customerOrder);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出客户-订车列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customerOrder:export")
|
||||||
|
@Log(title = "客户-订车", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, CustomerOrder customerOrder)
|
||||||
|
{
|
||||||
|
List<CustomerOrder> list = customerOrderService.selectCustomerOrderList(customerOrder);
|
||||||
|
ExcelUtil<CustomerOrder> util = new ExcelUtil<CustomerOrder>(CustomerOrder.class);
|
||||||
|
util.exportExcel(response, list, "客户-订车数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取客户-订车详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customerOrder:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(customerOrderService.selectCustomerOrderById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户-订车
|
||||||
|
*/
|
||||||
|
@Log(title = "客户-订车", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody CustomerOrder customerOrder)
|
||||||
|
{
|
||||||
|
Customer customer = new Customer();
|
||||||
|
customer.setId(customerOrder.getCustomerId());
|
||||||
|
customer.setStatus("order");
|
||||||
|
customerService.updateCustomer(customer);
|
||||||
|
return toAjax(customerOrderService.insertCustomerOrder(customerOrder));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户-订车
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customerOrder:edit")
|
||||||
|
@Log(title = "客户-订车", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody CustomerOrder customerOrder)
|
||||||
|
{
|
||||||
|
return toAjax(customerOrderService.updateCustomerOrder(customerOrder));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户-订车
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:customerOrder:remove")
|
||||||
|
@Log(title = "客户-订车", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(customerOrderService.deleteCustomerOrderByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户-订车对象 f_customer_order
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-08-01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CustomerOrder extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 客户id */
|
||||||
|
@Excel(name = "客户id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
/** 订车时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "订车时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date orderDate;
|
||||||
|
|
||||||
|
/** 车辆详细 */
|
||||||
|
@Excel(name = "车辆详细")
|
||||||
|
private String carInfo;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@Excel(name = "车辆VIN")
|
||||||
|
private String carVin;
|
||||||
|
|
||||||
|
/** 车辆状态 */
|
||||||
|
@Excel(name = "车辆状态")
|
||||||
|
private String carStatus;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "出库日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date outDate;
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.ruoyi.system.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 吴一博
|
||||||
|
* @date 2023年08月03日 8:36
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CustomerOrderVo extends CustomerVo{
|
||||||
|
|
||||||
|
/** 客户id */
|
||||||
|
@Excel(name = "客户id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
/** 订车时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "订车时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date orderDate;
|
||||||
|
|
||||||
|
/** 车辆详细 */
|
||||||
|
@Excel(name = "车辆详细")
|
||||||
|
private String carInfo;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@Excel(name = "车辆VIN")
|
||||||
|
private String carVin;
|
||||||
|
|
||||||
|
/** 车辆状态 */
|
||||||
|
@Excel(name = "车辆状态")
|
||||||
|
private String carStatus;
|
||||||
|
/** 车辆状态 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "出库日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private String outDate;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "计划跟进日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private String planFollowUpDate;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "实际跟进日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private String actualFollowUpDate;
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.system.domain.CustomerOrder;
|
||||||
|
import com.ruoyi.system.domain.vo.CustomerOrderVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户-订车Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-08-01
|
||||||
|
*/
|
||||||
|
public interface CustomerOrderMapper extends BaseMapper<CustomerOrder>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户-订车
|
||||||
|
*
|
||||||
|
* @param id 客户-订车主键
|
||||||
|
* @return 客户-订车
|
||||||
|
*/
|
||||||
|
public CustomerOrder selectCustomerOrderById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户-订车列表
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 客户-订车集合
|
||||||
|
*/
|
||||||
|
public List<CustomerOrder> selectCustomerOrderList(CustomerOrder customerOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户-订车
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertCustomerOrder(CustomerOrder customerOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户-订车
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateCustomerOrder(CustomerOrder customerOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户-订车
|
||||||
|
*
|
||||||
|
* @param id 客户-订车主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerOrderById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户-订车
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerOrderByIds(Long[] ids);
|
||||||
|
|
||||||
|
List<CustomerOrderVo> getCustomerOrderPage(CustomerOrderVo customerOrder);
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.system.domain.CustomerOrder;
|
||||||
|
import com.ruoyi.system.domain.vo.CustomerOrderVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户-订车Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-08-01
|
||||||
|
*/
|
||||||
|
public interface ICustomerOrderService extends IService<CustomerOrder>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询客户-订车
|
||||||
|
*
|
||||||
|
* @param id 客户-订车主键
|
||||||
|
* @return 客户-订车
|
||||||
|
*/
|
||||||
|
public CustomerOrder selectCustomerOrderById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户-订车列表
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 客户-订车集合
|
||||||
|
*/
|
||||||
|
public List<CustomerOrder> selectCustomerOrderList(CustomerOrder customerOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户-订车
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertCustomerOrder(CustomerOrder customerOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户-订车
|
||||||
|
*
|
||||||
|
* @param customerOrder 客户-订车
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateCustomerOrder(CustomerOrder customerOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户-订车
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的客户-订车主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerOrderByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户-订车信息
|
||||||
|
*
|
||||||
|
* @param id 客户-订车主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCustomerOrderById(Long id);
|
||||||
|
|
||||||
|
List<CustomerOrderVo> getCustomerOrderPage(CustomerOrderVo customerOrder);
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue