103 lines
3.3 KiB
Java
103 lines
3.3 KiB
Java
|
|
package com.klp.pocket.controller;
|
||
|
|
|
||
|
|
|
||
|
|
import java.util.Date;
|
||
|
|
import java.util.List;
|
||
|
|
import java.util.Arrays;
|
||
|
|
|
||
|
|
|
||
|
|
import lombok.RequiredArgsConstructor;
|
||
|
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
import javax.validation.constraints.*;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import com.klp.common.annotation.RepeatSubmit;
|
||
|
|
import com.klp.common.annotation.Log;
|
||
|
|
import com.klp.common.core.controller.BaseController;
|
||
|
|
import com.klp.common.core.domain.PageQuery;
|
||
|
|
import com.klp.common.core.domain.R;
|
||
|
|
import com.klp.common.core.validate.AddGroup;
|
||
|
|
import com.klp.common.core.validate.EditGroup;
|
||
|
|
import com.klp.common.enums.BusinessType;
|
||
|
|
import com.klp.common.utils.poi.ExcelUtil;
|
||
|
|
import com.klp.pocket.domain.vo.Klptcm1ProPlantStateCurrentVo;
|
||
|
|
import com.klp.pocket.domain.bo.Klptcm1ProPlantStateCurrentBo;
|
||
|
|
import com.klp.pocket.service.IKlptcm1ProPlantStateCurrentService;
|
||
|
|
import com.klp.common.core.page.TableDataInfo;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 当前
|
||
|
|
*
|
||
|
|
* @author klp
|
||
|
|
* @date 2025-10-27
|
||
|
|
*/
|
||
|
|
@Validated
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/pocket/proPlantStateCurrent")
|
||
|
|
public class Klptcm1ProPlantStateCurrentController extends BaseController {
|
||
|
|
|
||
|
|
private final IKlptcm1ProPlantStateCurrentService iKlptcm1ProPlantStateCurrentService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 查询当前列表
|
||
|
|
*/
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo<Klptcm1ProPlantStateCurrentVo> list(Klptcm1ProPlantStateCurrentBo bo, PageQuery pageQuery) {
|
||
|
|
return iKlptcm1ProPlantStateCurrentService.queryPageList(bo, pageQuery);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出当前列表
|
||
|
|
*/
|
||
|
|
@Log(title = "当前", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(Klptcm1ProPlantStateCurrentBo bo, HttpServletResponse response) {
|
||
|
|
List<Klptcm1ProPlantStateCurrentVo> list = iKlptcm1ProPlantStateCurrentService.queryList(bo);
|
||
|
|
ExcelUtil.exportExcel(list, "当前", Klptcm1ProPlantStateCurrentVo.class, response);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取当前详细信息
|
||
|
|
*
|
||
|
|
* @param INSDATE 主键
|
||
|
|
*/
|
||
|
|
@GetMapping("/{INSDATE}")
|
||
|
|
public R<Klptcm1ProPlantStateCurrentVo> getInfo(@NotNull(message = "主键不能为空")
|
||
|
|
@PathVariable Date INSDATE) {
|
||
|
|
return R.ok(iKlptcm1ProPlantStateCurrentService.queryById(INSDATE));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 新增当前
|
||
|
|
*/
|
||
|
|
@Log(title = "当前", businessType = BusinessType.INSERT)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PostMapping()
|
||
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody Klptcm1ProPlantStateCurrentBo bo) {
|
||
|
|
return toAjax(iKlptcm1ProPlantStateCurrentService.insertByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改当前
|
||
|
|
*/
|
||
|
|
@Log(title = "当前", businessType = BusinessType.UPDATE)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PutMapping()
|
||
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody Klptcm1ProPlantStateCurrentBo bo) {
|
||
|
|
return toAjax(iKlptcm1ProPlantStateCurrentService.updateByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除当前
|
||
|
|
*
|
||
|
|
* @param INSDATEs 主键串
|
||
|
|
*/
|
||
|
|
@Log(title = "当前", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{INSDATEs}")
|
||
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||
|
|
@PathVariable Date[] INSDATEs) {
|
||
|
|
return toAjax(iKlptcm1ProPlantStateCurrentService.deleteWithValidByIds(Arrays.asList(INSDATEs), true));
|
||
|
|
}
|
||
|
|
}
|