package com.stylefeng.guns.modular.system.controller.checkCar; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.shiro.ShiroKit; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TCheckCarExplain; import com.stylefeng.guns.modular.system.service.ITCheckCarExplainService; /** * 代检车说明内容管理控制器 * * @author fengshuonan * @Date 2025-07-27 22:45:42 */ @Controller @RequestMapping("/tCheckCarExplain") public class TCheckCarExplainController extends BaseController { private String PREFIX = "/system/tCheckCarExplain/"; @Autowired private ITCheckCarExplainService tCheckCarExplainService; /** * 跳转到代检车说明内容管理首页 */ @RequestMapping("") public String index(Model model) { Integer branchOfficeId = -1; if (!ShiroKit.isAdmin()) { branchOfficeId = ShiroKit.getUser().getObjectId(); } TCheckCarExplain tCheckCarExplain = tCheckCarExplainService.selectOne(new EntityWrapper() .eq("branchOfficeId", branchOfficeId).last("limit 1")); model.addAttribute("item", tCheckCarExplain); return PREFIX + "tCheckCarExplain.html"; } /** * 跳转到添加代检车说明内容管理 */ @RequestMapping("/tCheckCarExplain_add") public String tCheckCarExplainAdd() { return PREFIX + "tCheckCarExplain.html"; } /** * 跳转到修改代检车说明内容管理 */ @RequestMapping("/tCheckCarExplain_update/{tCheckCarExplainId}") public String tCheckCarExplainUpdate(@PathVariable Integer tCheckCarExplainId, Model model) { TCheckCarExplain tCheckCarExplain = tCheckCarExplainService.selectById(tCheckCarExplainId); model.addAttribute("item",tCheckCarExplain); LogObjectHolder.me().set(tCheckCarExplain); return PREFIX + "tCheckCarExplain_edit.html"; } /** * 获取代检车说明内容管理列表 */ @RequestMapping(value = "/list") @ResponseBody public Object list(String condition) { return tCheckCarExplainService.selectList(null); } /** * 保存代检车说明内容管理 */ @RequestMapping(value = "/save") @ResponseBody public Object save(TCheckCarExplain tCheckCarExplain) { tCheckCarExplainService.saveOrUpdate(tCheckCarExplain); return SUCCESS_TIP; } /** * 新增代检车说明内容管理 */ @RequestMapping(value = "/add") @ResponseBody public Object add(TCheckCarExplain tCheckCarExplain) { tCheckCarExplainService.insert(tCheckCarExplain); return SUCCESS_TIP; } /** * 删除代检车说明内容管理 */ @RequestMapping(value = "/delete") @ResponseBody public Object delete(@RequestParam Integer tCheckCarExplainId) { tCheckCarExplainService.deleteById(tCheckCarExplainId); return SUCCESS_TIP; } /** * 修改代检车说明内容管理 */ @RequestMapping(value = "/update") @ResponseBody public Object update(TCheckCarExplain tCheckCarExplain) { tCheckCarExplainService.updateById(tCheckCarExplain); return SUCCESS_TIP; } /** * 代检车说明内容管理详情 */ @RequestMapping(value = "/detail/{tCheckCarExplainId}") @ResponseBody public Object detail(@PathVariable("tCheckCarExplainId") Integer tCheckCarExplainId) { return tCheckCarExplainService.selectById(tCheckCarExplainId); } }