首页>代码>基于ssm+layui开发汽车租赁管理系统 >/carRental/src/main/java/com/alfred/bus/controller/CustomerController.java
package com.alfred.bus.controller; import com.alfred.bus.service.CustomerService; import com.alfred.bus.vo.CustomerVo; import com.alfred.sys.utils.DataGridView; import com.alfred.sys.utils.ResultObj; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Date; @RestController //以json形式响应数据 @RequestMapping("customer") public class CustomerController { @Autowired private CustomerService customerService; /** * 加载客户列表返回DataGridView * @param customerVo * @return */ @RequestMapping("loadAllCustomer") public DataGridView loadAllCustomer(CustomerVo customerVo){ return this.customerService.queryAllCustomer(customerVo); } /** * 添加一个客户 * @param customerVo * @return */ @RequestMapping("addCustomer") public ResultObj addCustomer(CustomerVo customerVo){ try{ customerVo.setCreatetime(new Date()); this.customerService.addCustomer(customerVo); return ResultObj.ADD_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.ADD_ERROR; } } /** * 修改一个客户 * @param customerVo * @return */ @RequestMapping("updateCustomer") public ResultObj updateCustomer(CustomerVo customerVo){ try{ this.customerService.updateCustomer(customerVo); return ResultObj.UPDATE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.UPDATE_ERROR; } } /** * 删除一个客户 * @param customerVo * @return */ @RequestMapping("deleteCustomer") public ResultObj deleteCustomer(CustomerVo customerVo){ try { this.customerService.deleteCustomer(customerVo.getIdentity()); return ResultObj.DELETE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 批量删除客户 * @param customerVo * @return */ @RequestMapping("deleteBatchCustomer") public ResultObj deleteBatchCustomer(CustomerVo customerVo){ try{ this.customerService.deleteBatchCustomer(customerVo.getIds()); return ResultObj.DELETE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.DELETE_ERROR; } } }

小松哥11 LV3
2024年10月24日
wuying8208 LV15
2024年10月23日
微信网友_6917967074955264 LV2
2024年3月30日
微信网友_6900009262157824 LV1
2024年3月9日
WBelong LV8
2023年12月25日
dzlwindy LV8
2023年12月18日
angel_yy LV2
2023年8月11日
homework333 LV1
2023年7月10日
sunshinemenfolk LV4
2023年7月5日
GJQ123 LV4
2023年6月5日

lkke23047 LV1
5月28日
niuwa666
4月3日
暂无贡献等级
ryadmin123 LV2
2月11日
Mhgfhjyrf LV3
2024年12月9日
zolscy LV24
2024年11月28日
微笑刺客 LV21
2024年11月22日
小松哥11 LV3
2024年10月24日
wuying8208 LV15
2024年10月23日
3339790961
2024年9月6日
暂无贡献等级
yyhrhv LV8
2024年9月3日