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