package cn.stylefeng.guns.modular.sc.scannerConfig.controller; import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo; import cn.stylefeng.guns.modular.bs.locationInfo.entity.LocationInfo; import cn.stylefeng.guns.modular.bs.locationInfo.model.params.LocationInfoParam; import cn.stylefeng.guns.modular.sc.scannerConfig.entity.ScannerConfig; import cn.stylefeng.guns.modular.sc.scannerConfig.model.params.ScannerConfigParam; import cn.stylefeng.guns.modular.sc.scannerConfig.service.ScannerConfigService; import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.kernel.model.response.ResponseData; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; /** * 扫描枪配置表控制器 * * @author zrm * @Date 2023-07-11 14:13:27 */ @Controller @RequestMapping("/scannerConfig") public class ScannerConfigController extends BaseController { private String PREFIX = "/modular/sc/scannerConfig"; @Autowired private ScannerConfigService scannerConfigService; /** * 跳转到主页面 * * @author zrm * @Date 2023-07-11 */ @RequestMapping("") public String index() { return PREFIX + "/scannerConfig.html"; } /** * 新增页面 * * @author zrm * @Date 2023-07-11 */ @RequestMapping("/add") public String add() { return PREFIX + "/scannerConfig_add.html"; } /** * 编辑页面 * * @author zrm * @Date 2023-07-11 */ @RequestMapping("/edit") public String edit() { return PREFIX + "/scannerConfig_edit.html"; } /** * 新增接口 * * @author zrm * @Date 2023-07-11 */ @RequestMapping("/addItem") @ResponseBody public ResponseData addItem(ScannerConfigParam scannerConfigParam) { this.scannerConfigService.add(scannerConfigParam); return ResponseData.success(); } @RequestMapping("/getOneByLocationCode") @ResponseBody public ResponseData getOneByLocationCode(ScannerConfigParam scannerConfigParam) { ScannerConfig detail = this.scannerConfigService.getOne(new QueryWrapper().eq("location_code",scannerConfigParam.getLocationCode())); return ResponseData.success(detail); } /** * 编辑接口 * * @author zrm * @Date 2023-07-11 */ @RequestMapping("/editItem") @ResponseBody public ResponseData editItem(ScannerConfigParam scannerConfigParam) { this.scannerConfigService.update(scannerConfigParam); return ResponseData.success(); } /** * 删除接口 * * @author zrm * @Date 2023-07-11 */ @RequestMapping("/delete") @ResponseBody public ResponseData delete(ScannerConfigParam scannerConfigParam) { this.scannerConfigService.delete(scannerConfigParam); return ResponseData.success(); } /** * 查看详情接口 * * @author zrm * @Date 2023-07-11 */ @RequestMapping("/detail") @ResponseBody public ResponseData detail(ScannerConfigParam scannerConfigParam) { ScannerConfig detail = this.scannerConfigService.getById(scannerConfigParam.getId()); return ResponseData.success(detail); } /** * 查询列表 * * @author zrm * @Date 2023-07-11 */ @ResponseBody @RequestMapping("/list") public LayuiPageInfo list(ScannerConfigParam scannerConfigParam) { return this.scannerConfigService.findPageBySpec(scannerConfigParam); } }