- 修改所有实体类中的ID字段类型从String改为Long - 更新所有服务接口和实现类的方法参数类型 - 调整控制器中的路径变量类型以匹配新的ID类型 - 修正查询条件判断逻辑,从字符串非空检查改为数值非空检查 - 更新数据传输对象中的ID字段类型保持一致性
100 lines
3.2 KiB
Java
100 lines
3.2 KiB
Java
package com.klp.perf.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.perf.domain.vo.PerfDeptSummaryVo;
|
|
import com.klp.perf.domain.bo.PerfDeptSummaryBo;
|
|
import com.klp.perf.service.IPerfDeptSummaryService;
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 车间月度汇总
|
|
*
|
|
* @author klp
|
|
* @date 2026-07-07
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/perf/deptSummary")
|
|
public class PerfDeptSummaryController extends BaseController {
|
|
|
|
private final IPerfDeptSummaryService iPerfDeptSummaryService;
|
|
|
|
/**
|
|
* 查询车间月度汇总列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<PerfDeptSummaryVo> list(PerfDeptSummaryBo bo, PageQuery pageQuery) {
|
|
return iPerfDeptSummaryService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出车间月度汇总列表
|
|
*/
|
|
@Log(title = "车间月度汇总", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(PerfDeptSummaryBo bo, HttpServletResponse response) {
|
|
List<PerfDeptSummaryVo> list = iPerfDeptSummaryService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "车间月度汇总", PerfDeptSummaryVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取车间月度汇总详细信息
|
|
*
|
|
* @param id 主键
|
|
*/
|
|
@GetMapping("/{id}")
|
|
public R<PerfDeptSummaryVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long id) {
|
|
return R.ok(iPerfDeptSummaryService.queryById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增车间月度汇总
|
|
*/
|
|
@Log(title = "车间月度汇总", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody PerfDeptSummaryBo bo) {
|
|
return toAjax(iPerfDeptSummaryService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改车间月度汇总
|
|
*/
|
|
@Log(title = "车间月度汇总", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PerfDeptSummaryBo bo) {
|
|
return toAjax(iPerfDeptSummaryService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除车间月度汇总
|
|
*
|
|
* @param ids 主键串
|
|
*/
|
|
@Log(title = "车间月度汇总", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ids}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] ids) {
|
|
return toAjax(iPerfDeptSummaryService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
}
|
|
}
|