¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.system.entity.SysBusinessCodeRule; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: ä¸å¡ç¼ç è§å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "ä¸å¡ç¼ç è§å") |
| | | @RestController |
| | | @RequestMapping("/sys/sysBusinessCodeRule") |
| | | public class SysBusinessCodeRuleController extends JeecgController<SysBusinessCodeRule, ISysBusinessCodeRuleService> { |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService sysBusinessCodeRuleService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param sysBusinessCodeRule |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | // @AutoLog(value = "ä¸å¡ç¼ç è§å-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "ä¸å¡ç¼ç è§å-å页å表æ¥è¯¢", notes = "ä¸å¡ç¼ç è§å-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(SysBusinessCodeRule sysBusinessCodeRule, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<SysBusinessCodeRule> queryWrapper = QueryGenerator.initQueryWrapper(sysBusinessCodeRule, req.getParameterMap()); |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | Page<SysBusinessCodeRule> page = new Page<SysBusinessCodeRule>(pageNo, pageSize); |
| | | IPage<SysBusinessCodeRule> pageList = sysBusinessCodeRuleService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param sysBusinessCodeRule |
| | | * @return |
| | | */ |
| | | // @AutoLog(value = "ä¸å¡ç¼ç è§å-æ·»å ") |
| | | @ApiOperation(value = "ä¸å¡ç¼ç è§å-æ·»å ", notes = "ä¸å¡ç¼ç è§å-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody SysBusinessCodeRule sysBusinessCodeRule) { |
| | | sysBusinessCodeRule.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | sysBusinessCodeRuleService.save(sysBusinessCodeRule); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param sysBusinessCodeRule |
| | | * @return |
| | | */ |
| | | // @AutoLog(value = "ä¸å¡ç¼ç è§å-ç¼è¾") |
| | | @ApiOperation(value = "ä¸å¡ç¼ç è§å-ç¼è¾", notes = "ä¸å¡ç¼ç è§å-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody SysBusinessCodeRule sysBusinessCodeRule) { |
| | | sysBusinessCodeRuleService.updateById(sysBusinessCodeRule); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | // @AutoLog(value = "ä¸å¡ç¼ç è§å-éè¿idå é¤") |
| | | @ApiOperation(value = "ä¸å¡ç¼ç è§å-éè¿idå é¤", notes = "ä¸å¡ç¼ç è§å-éè¿idå é¤") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | | sysBusinessCodeRuleService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | // @AutoLog(value = "ä¸å¡ç¼ç è§å-æ¹éå é¤") |
| | | @ApiOperation(value = "ä¸å¡ç¼ç è§å-æ¹éå é¤", notes = "ä¸å¡ç¼ç è§å-æ¹éå é¤") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.sysBusinessCodeRuleService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | // @AutoLog(value = "ä¸å¡ç¼ç è§å-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "ä¸å¡ç¼ç è§å-éè¿idæ¥è¯¢", notes = "ä¸å¡ç¼ç è§å-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | SysBusinessCodeRule sysBusinessCodeRule = sysBusinessCodeRuleService.getById(id); |
| | | return Result.OK(sysBusinessCodeRule); |
| | | } |
| | | |
| | | /** |
| | | * çæä¸å¡ç¼ç 对åºçæµæ°´å· |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "ä¸å¡ç¼ç è§å-çæä¸å¡ç¼ç 对åºçæµæ°´å·", notes = "ä¸å¡ç¼ç è§å-çæä¸å¡ç¼ç 对åºçæµæ°´å·") |
| | | @GetMapping(value = "/generateBusinessCodeSeq") |
| | | public Result<?> generateBusinessCodeSeq(@RequestParam(name = "businessCode", required = true) String businessCode) { |
| | | String result = sysBusinessCodeRuleService.generateBusinessCodeSeq(businessCode); |
| | | return Result.OK(result); |
| | | } |
| | | |
| | | } |