feat(wms): 新增资金日记账功能
- 添加资金日记账相关实体类、Mapper、Service、Controller - 实现资金日记账的增删改查功能 - 添加资金日记账的导出功能
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
package com.klp.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.domain.vo.WmsJournalVo;
|
||||
import com.klp.domain.bo.WmsJournalBo;
|
||||
import com.klp.service.IWmsJournalService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 资金日记账
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/klp/journal")
|
||||
public class WmsJournalController extends BaseController {
|
||||
|
||||
private final IWmsJournalService iWmsJournalService;
|
||||
|
||||
/**
|
||||
* 查询资金日记账列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsJournalVo> list(WmsJournalBo bo, PageQuery pageQuery) {
|
||||
return iWmsJournalService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资金日记账列表
|
||||
*/
|
||||
@Log(title = "资金日记账", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsJournalBo bo, HttpServletResponse response) {
|
||||
List<WmsJournalVo> list = iWmsJournalService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "资金日记账", WmsJournalVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资金日记账详细信息
|
||||
*
|
||||
* @param journalId 主键
|
||||
*/
|
||||
@GetMapping("/{journalId}")
|
||||
public R<WmsJournalVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long journalId) {
|
||||
return R.ok(iWmsJournalService.queryById(journalId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资金日记账
|
||||
*/
|
||||
@Log(title = "资金日记账", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsJournalBo bo) {
|
||||
return toAjax(iWmsJournalService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资金日记账
|
||||
*/
|
||||
@Log(title = "资金日记账", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsJournalBo bo) {
|
||||
return toAjax(iWmsJournalService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资金日记账
|
||||
*
|
||||
* @param journalIds 主键串
|
||||
*/
|
||||
@Log(title = "资金日记账", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{journalIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] journalIds) {
|
||||
return toAjax(iWmsJournalService.deleteWithValidByIds(Arrays.asList(journalIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user