100 lines
3.5 KiB
Java
100 lines
3.5 KiB
Java
|
|
package com.klp.flow.controller;
|
||
|
|
|
||
|
|
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.flow.domain.vo.TsPlanExecuteRelVo;
|
||
|
|
import com.klp.flow.domain.bo.TsPlanExecuteRelBo;
|
||
|
|
import com.klp.flow.service.ITsPlanExecuteRelService;
|
||
|
|
import com.klp.common.core.page.TableDataInfo;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 最终方案下发部门及执行反馈
|
||
|
|
*
|
||
|
|
* @author klp
|
||
|
|
* @date 2026-06-18
|
||
|
|
*/
|
||
|
|
@Validated
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/flow/planExecuteRel")
|
||
|
|
public class TsPlanExecuteRelController extends BaseController {
|
||
|
|
|
||
|
|
private final ITsPlanExecuteRelService iTsPlanExecuteRelService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 查询最终方案下发部门及执行反馈列表
|
||
|
|
*/
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo<TsPlanExecuteRelVo> list(TsPlanExecuteRelBo bo, PageQuery pageQuery) {
|
||
|
|
return iTsPlanExecuteRelService.queryPageList(bo, pageQuery);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出最终方案下发部门及执行反馈列表
|
||
|
|
*/
|
||
|
|
@Log(title = "最终方案下发部门及执行反馈", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(TsPlanExecuteRelBo bo, HttpServletResponse response) {
|
||
|
|
List<TsPlanExecuteRelVo> list = iTsPlanExecuteRelService.queryList(bo);
|
||
|
|
ExcelUtil.exportExcel(list, "最终方案下发部门及执行反馈", TsPlanExecuteRelVo.class, response);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取最终方案下发部门及执行反馈详细信息
|
||
|
|
*
|
||
|
|
* @param relId 主键
|
||
|
|
*/
|
||
|
|
@GetMapping("/{relId}")
|
||
|
|
public R<TsPlanExecuteRelVo> getInfo(@NotNull(message = "主键不能为空")
|
||
|
|
@PathVariable Long relId) {
|
||
|
|
return R.ok(iTsPlanExecuteRelService.queryById(relId));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 新增最终方案下发部门及执行反馈
|
||
|
|
*/
|
||
|
|
@Log(title = "最终方案下发部门及执行反馈", businessType = BusinessType.INSERT)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PostMapping()
|
||
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody TsPlanExecuteRelBo bo) {
|
||
|
|
return toAjax(iTsPlanExecuteRelService.insertByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改最终方案下发部门及执行反馈
|
||
|
|
*/
|
||
|
|
@Log(title = "最终方案下发部门及执行反馈", businessType = BusinessType.UPDATE)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PutMapping()
|
||
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TsPlanExecuteRelBo bo) {
|
||
|
|
return toAjax(iTsPlanExecuteRelService.updateByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除最终方案下发部门及执行反馈
|
||
|
|
*
|
||
|
|
* @param relIds 主键串
|
||
|
|
*/
|
||
|
|
@Log(title = "最终方案下发部门及执行反馈", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{relIds}")
|
||
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||
|
|
@PathVariable Long[] relIds) {
|
||
|
|
return toAjax(iTsPlanExecuteRelService.deleteWithValidByIds(Arrays.asList(relIds), true));
|
||
|
|
}
|
||
|
|
}
|