首页>代码>基于ssm+layui开发汽车租赁管理系统 >/carRental/src/main/java/com/alfred/bus/controller/CheckController.java
package com.alfred.bus.controller; import com.alfred.bus.domain.Rent; import com.alfred.bus.service.CheckService; import com.alfred.bus.service.RentService; import com.alfred.bus.vo.CheckVo; 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; import java.util.Map; /** * @author Alfred * @date 2020/3/16 10:27 */ @RestController @RequestMapping("check") public class CheckController { @Autowired private RentService rentService; @Autowired private CheckService checkService; @RequestMapping("checkRentExist") public Rent checkRentExist(String rentid){ //出租单号不存在,返回一个null,出租单号存在,返回一个rent对象 Rent rent = rentService.queryRentByRentId(rentid); return rent; } /** * 根据出租单号加载检查单的表单数据 * @param rentid * @return */ @RequestMapping("initCheckFormData") public Map<String,Object> initCheckFormData(String rentid){ return this.checkService.initCheckFormData(rentid); } /** * 保存检查单数据 * @param checkVo * @return */ @RequestMapping("saveCheck") public ResultObj saveCheck(CheckVo checkVo){ try{ checkVo.setCreatetime(new Date()); this.checkService.addCheck(checkVo); return ResultObj.ADD_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.ADD_ERROR; } } /** * 查询所有检查单 * @param checkVo * @return */ @RequestMapping("loadAllCheck") public DataGridView loadAllCheck(CheckVo checkVo){ return this.checkService.queryAllCheck(checkVo); } /** * 删除一个检查单 * @param checkVo * @return */ @RequestMapping("deleteCheck") public ResultObj deleteCheck(CheckVo checkVo){ try{ this.checkService.deleteCheck(checkVo); return ResultObj.DELETE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 批量删除检查单 * @return */ @RequestMapping("deleteBatchCheck") public ResultObj deleteBatchCheck(CheckVo checkVo){ try{ this.checkService.deleteBatchCheck(checkVo.getIds()); return ResultObj.DELETE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.DELETE_ERROR; } } /** * 更新检查单 * @param checkVo * @return */ @RequestMapping("updateCheck") public ResultObj updateCheck(CheckVo checkVo){ try { this.checkService.updateCheck(checkVo); return ResultObj.UPDATE_SUCCESS; }catch (Exception e){ e.printStackTrace(); return ResultObj.UPDATE_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日