¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | 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.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentProcessParameters; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentProcessParametersService; |
| | | 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-04-27 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="设å¤å·¥èºåæ°") |
| | | @RestController |
| | | @RequestMapping("/eam/equipmentProcessParameters") |
| | | public class EamEquipmentProcessParametersController extends JeecgController<EamEquipmentProcessParameters, IEamEquipmentProcessParametersService> { |
| | | @Autowired |
| | | private IEamEquipmentProcessParametersService eamEquipmentProcessParametersService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param equipmentId |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å·¥èºåæ°-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="设å¤å·¥èºåæ°-å页å表æ¥è¯¢", notes="设å¤å·¥èºåæ°-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(String equipmentId, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | Page<EamEquipmentProcessParameters> page = new Page<>(pageNo, pageSize); |
| | | IPage<EamEquipmentProcessParameters> pageList = eamEquipmentProcessParametersService.queryPageList(equipmentId, page); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å·¥èºåæ°-æ·»å ") |
| | | @ApiOperation(value="设å¤å·¥èºåæ°-æ·»å ", notes="设å¤å·¥èºåæ°-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamEquipmentProcessParameters req) { |
| | | EamEquipmentProcessParameters entity = eamEquipmentProcessParametersService.queryByEquipmentIdAndParameterId(req.getEquipmentId(), req.getParameterId()); |
| | | if(entity != null){ |
| | | return Result.error("åæ°å·²åå¨ï¼ä¸è½é夿·»å ï¼"); |
| | | } |
| | | eamEquipmentProcessParametersService.save(req); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤å·¥èºåæ°-ç¼è¾") |
| | | @ApiOperation(value="设å¤å·¥èºåæ°-ç¼è¾", notes="设å¤å·¥èºåæ°-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamEquipmentProcessParameters req) { |
| | | EamEquipmentProcessParameters entity = eamEquipmentProcessParametersService.getById(req.getId()); |
| | | if(entity == null){ |
| | | return Result.error("è¦ç¼è¾çåæ°ä¸åå¨ï¼è¯·å·æ°éè¯!"); |
| | | } |
| | | eamEquipmentProcessParametersService.updateById(req); |
| | | 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) { |
| | | eamEquipmentProcessParametersService.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.eamEquipmentProcessParametersService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | | } |