package com.yuanchu.mom.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yuanchu.mom.annotation.CustomClazzName; import com.yuanchu.mom.annotation.ValueAuth; import com.yuanchu.mom.dto.FePowerStableAddDto; import com.yuanchu.mom.dto.FePowerStableDto; import com.yuanchu.mom.pojo.FeMeasuredQuantity; import com.yuanchu.mom.pojo.FePowerStable; import com.yuanchu.mom.service.FeMeasuredQuantityService; import com.yuanchu.mom.service.FePowerStableService; import com.yuanchu.mom.vo.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; /** *
* 设施和环境条件-设施和环境条件要求-电源稳定性 前端控制器 *
* * @author * @since 2024-11-07 04:16:52 */ @Api(tags = "设施和环境条件-设施和环境条件要求-电源稳定性") @RestController @RequestMapping("/fePowerStable") public class FePowerStableController { @Autowired private FeMeasuredQuantityService feMeasuredQuantityService; @Autowired private FePowerStableService fePowerStableService; @PostMapping("addLaboratoryFacilityPowerStable") @ApiOperation("电源稳定性新增/修改") public Result> addLaboratoryFacilityPowerStable(@RequestBody FePowerStableAddDto fePowerStableAddDto) { FePowerStable fePowerStable = new FePowerStable(); BeanUtils.copyProperties(fePowerStableAddDto, fePowerStable); fePowerStableService.saveOrUpdate(fePowerStable); fePowerStableAddDto.getFeMeasuredQuantityList().forEach(i -> i.setPowerStableId(fePowerStable.getPowerStableId())); feMeasuredQuantityService.saveOrUpdateBatch(fePowerStableAddDto.getFeMeasuredQuantityList()); return Result.success(); } @DeleteMapping("deleteLaboratoryFacilityPowerStable") @ApiOperation("电源稳定性删除") public Result