feat(oa): 新增月度记账、采购计划明细和供应商信息功能
- 添加了月度记账、采购计划明细和供应商信息的实体类、BO类、控制器、Mapper接口和XML文件- 实现了基本的CRUD操作,包括列表查询、导出、详情获取、新增、修改和删除 - 为采购计划明细和供应商信息添加了关联查询
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
package com.gear.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.core.validate.QueryGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.vo.GearPurchasePlanDetailVo;
|
||||
import com.gear.oa.domain.bo.GearPurchasePlanDetailBo;
|
||||
import com.gear.oa.service.IGearPurchasePlanDetailService;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 采购计划明细
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/purchasePlanDetail")
|
||||
public class GearPurchasePlanDetailController extends BaseController {
|
||||
|
||||
private final IGearPurchasePlanDetailService iGearPurchasePlanDetailService;
|
||||
|
||||
/**
|
||||
* 查询采购计划明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GearPurchasePlanDetailVo> list(GearPurchasePlanDetailBo bo, PageQuery pageQuery) {
|
||||
return iGearPurchasePlanDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出采购计划明细列表
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GearPurchasePlanDetailBo bo, HttpServletResponse response) {
|
||||
List<GearPurchasePlanDetailVo> list = iGearPurchasePlanDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "采购计划明细", GearPurchasePlanDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采购计划明细详细信息
|
||||
*
|
||||
* @param detailId 主键
|
||||
*/
|
||||
@GetMapping("/{detailId}")
|
||||
public R<GearPurchasePlanDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long detailId) {
|
||||
return R.ok(iGearPurchasePlanDetailService.queryById(detailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采购计划明细
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearPurchasePlanDetailBo bo) {
|
||||
return toAjax(iGearPurchasePlanDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采购计划明细
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearPurchasePlanDetailBo bo) {
|
||||
return toAjax(iGearPurchasePlanDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除采购计划明细
|
||||
*
|
||||
* @param detailIds 主键串
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{detailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] detailIds) {
|
||||
return toAjax(iGearPurchasePlanDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user