| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.fw.detection.dto.FwEffectEvalDTO; |
| | | import org.sxkj.fw.detection.entity.FwEffectEvalEntity; |
| | | import org.sxkj.fw.detection.vo.FwEffectEvalVO; |
| | | import org.sxkj.fw.detection.excel.FwEffectEvalExcel; |
| | |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 反制效果评估表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2026-01-07 |
| | | * @since 2026-01-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | /** |
| | | * 反制效果评估表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入fwEffectEval") |
| | | public R<IPage<FwEffectEvalVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwEffectEval, Query query) { |
| | | IPage<FwEffectEvalEntity> pages = fwEffectEvalService.page(Condition.getPage(query), Condition.getQueryWrapper(fwEffectEval, FwEffectEvalEntity.class)); |
| | | return R.data(FwEffectEvalWrapper.build().pageVO(pages)); |
| | | } |
| | | // @GetMapping("/list") |
| | | // @ApiOperationSupport(order = 2) |
| | | // @ApiOperation(value = "分页", notes = "传入fwEffectEval") |
| | | // public R<IPage<FwEffectEvalVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwEffectEval, Query query) { |
| | | // IPage<FwEffectEvalEntity> pages = fwEffectEvalService.page(Condition.getPage(query), Condition.getQueryWrapper(fwEffectEval, FwEffectEvalEntity.class)); |
| | | // return R.data(FwEffectEvalWrapper.build().pageVO(pages)); |
| | | // } |
| | | |
| | | /** |
| | | * 反制效果评估表 自定义分页 |
| | |
| | | /** |
| | | * 反制效果评估表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入fwEffectEval") |
| | | public R save(@Valid @RequestBody FwEffectEvalEntity fwEffectEval) { |
| | | return R.status(fwEffectEvalService.save(fwEffectEval)); |
| | | } |
| | | // @PostMapping("/save") |
| | | // @ApiOperationSupport(order = 4) |
| | | // @ApiOperation(value = "新增", notes = "传入fwEffectEval") |
| | | // public R save(@Valid @RequestBody FwEffectEvalEntity fwEffectEval) { |
| | | // return R.status(fwEffectEvalService.save(fwEffectEval)); |
| | | // } |
| | | |
| | | /** |
| | | * 反制效果评估表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入fwEffectEval") |
| | | public R update(@Valid @RequestBody FwEffectEvalEntity fwEffectEval) { |
| | | return R.status(fwEffectEvalService.updateById(fwEffectEval)); |
| | | } |
| | | // @PostMapping("/update") |
| | | // @ApiOperationSupport(order = 5) |
| | | // @ApiOperation(value = "修改", notes = "传入fwEffectEval") |
| | | // public R update(@Valid @RequestBody FwEffectEvalEntity fwEffectEval) { |
| | | // return R.status(fwEffectEvalService.updateById(fwEffectEval)); |
| | | // } |
| | | |
| | | /** |
| | | * 反制效果评估表 新增或修改 |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入fwEffectEval") |
| | | public R submit(@Valid @RequestBody FwEffectEvalEntity fwEffectEval) { |
| | | return R.status(fwEffectEvalService.saveOrUpdate(fwEffectEval)); |
| | | public R submit(@Valid @RequestBody FwEffectEvalDTO fwEffectEval) { |
| | | FwEffectEvalEntity fwEffectEvalEntity = Objects.requireNonNull(BeanUtil.copy(fwEffectEval, FwEffectEvalEntity.class)); |
| | | return R.status(fwEffectEvalService.saveOrUpdate(fwEffectEvalEntity)); |
| | | } |
| | | |
| | | /** |