feat(oa): 新增客户管理和资金日记账功能
- 添加客户管理相关实体、控制器、服务和映射 - 实现客户信息的增删改查功能 - 添加资金日记账相关实体、控制器、服务和映射 - 实现资金日记账的增删改查功能 - 优化数据库连接配置 - 更新 BOM 项关联的表名
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
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.GearOrderDetailVo;
|
||||
import com.gear.oa.domain.bo.GearOrderDetailBo;
|
||||
import com.gear.oa.service.IGearOrderDetailService;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 订单明细
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-02
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/orderDetail")
|
||||
public class GearOrderDetailController extends BaseController {
|
||||
|
||||
private final IGearOrderDetailService iGearOrderDetailService;
|
||||
/**
|
||||
* 根据订单ID查询订单明细列表
|
||||
*/
|
||||
@GetMapping("/listByOrderId/{orderId}")
|
||||
public R<List<GearOrderDetailVo>> listByOrderId(@PathVariable Long orderId) {
|
||||
List<GearOrderDetailVo> list = iGearOrderDetailService.queryListByOrderId(orderId);
|
||||
return R.ok(list);
|
||||
}
|
||||
/**
|
||||
* 查询订单明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GearOrderDetailVo> list(GearOrderDetailBo bo, PageQuery pageQuery) {
|
||||
return iGearOrderDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单明细列表
|
||||
*/
|
||||
@Log(title = "订单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GearOrderDetailBo bo, HttpServletResponse response) {
|
||||
List<GearOrderDetailVo> list = iGearOrderDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "订单明细", GearOrderDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单明细详细信息
|
||||
*
|
||||
* @param detailId 主键
|
||||
*/
|
||||
@GetMapping("/{detailId}")
|
||||
public R<GearOrderDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long detailId) {
|
||||
return R.ok(iGearOrderDetailService.queryById(detailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单明细
|
||||
*/
|
||||
@Log(title = "订单明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearOrderDetailBo bo) {
|
||||
return toAjax(iGearOrderDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单明细
|
||||
*/
|
||||
@Log(title = "订单明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearOrderDetailBo bo) {
|
||||
return toAjax(iGearOrderDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单明细
|
||||
*
|
||||
* @param detailIds 主键串
|
||||
*/
|
||||
@Log(title = "订单明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{detailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] detailIds) {
|
||||
return toAjax(iGearOrderDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user