¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.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.aspect.annotation.AutoLog; |
| | | 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.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.entity.EamPrecisionParameters; |
| | | import org.jeecg.modules.eam.entity.EamProcessParameters; |
| | | import org.jeecg.modules.eam.service.IEamPrecisionParametersService; |
| | | 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 javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: ç²¾åº¦åæ°ç»´æ¤ |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-03-17 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "ç²¾åº¦åæ°ç»´æ¤") |
| | | @RestController |
| | | @RequestMapping("/eam/precisionParameters") |
| | | public class EamPrecisionParametersController extends JeecgController<EamPrecisionParameters, IEamPrecisionParametersService> { |
| | | @Autowired |
| | | private IEamPrecisionParametersService eamPrecisionParametersService; |
| | | |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamPrecisionParameters |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "ç²¾åº¦åæ°ç»´æ¤-å页å表æ¥è¯¢", notes = "ç²¾åº¦åæ°ç»´æ¤-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamPrecisionParameters eamPrecisionParameters, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<EamPrecisionParameters> queryWrapper = QueryGenerator.initQueryWrapper(eamPrecisionParameters, req.getParameterMap()); |
| | | Page<EamPrecisionParameters> page = new Page<EamPrecisionParameters>(pageNo, pageSize); |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | IPage<EamPrecisionParameters> pageList = eamPrecisionParametersService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param eamPrecisionParameters |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "ç²¾åº¦åæ°ç»´æ¤-æ·»å ", notes = "ç²¾åº¦åæ°ç»´æ¤-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamPrecisionParameters eamPrecisionParameters) { |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.PRECISION_PARAMETERS_RULE); |
| | | eamPrecisionParameters.setParameterCode(codeSeq); |
| | | eamPrecisionParameters.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | eamPrecisionParametersService.save(eamPrecisionParameters); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamPrecisionParameters |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "ç²¾åº¦åæ°ç»´æ¤-ç¼è¾", notes = "ç²¾åº¦åæ°ç»´æ¤-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamPrecisionParameters eamPrecisionParameters) { |
| | | eamPrecisionParametersService.updateById(eamPrecisionParameters); |
| | | 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) { |
| | | eamPrecisionParametersService.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.eamPrecisionParametersService.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) { |
| | | EamPrecisionParameters eamPrecisionParameters = eamPrecisionParametersService.getById(id); |
| | | return Result.OK(eamPrecisionParameters); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamPrecisionParameters |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamPrecisionParameters eamPrecisionParameters) { |
| | | return super.exportXls(request, eamPrecisionParameters, EamPrecisionParameters.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, EamPrecisionParameters.class); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç²¾åº¦åæ°ç»´æ¤-æ¥è¯¢ææ", notes = "ç²¾åº¦åæ°ç»´æ¤-æ¥è¯¢ææ") |
| | | @GetMapping(value = "/listAll") |
| | | public Result<?> listAll() { |
| | | QueryWrapper<EamPrecisionParameters> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | List<EamPrecisionParameters> list = eamPrecisionParametersService.list(queryWrapper); |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | } |