首页>代码>基于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; } } }
最近下载更多
微信网友_6917967074955264 LV2
3月30日
微信网友_6900009262157824 LV1
3月9日
WBelong LV7
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日
飞翔的面包片 LV12
2023年5月8日
daviskren LV2
2023年4月17日
最近浏览更多
微信网友_6499276356636672 LV1
4月2日
微信网友_6917967074955264 LV2
3月30日
全栈小白 LV33
3月26日
songsmm LV1
3月11日
微信网友_6900009262157824 LV1
3月9日
zzynbnb
3月9日
暂无贡献等级
eagerwujin LV4
3月5日
微信网友_6004852372836352
2月20日
暂无贡献等级
admin_z LV22
1月29日
雪小鼬
1月3日
暂无贡献等级