- 添加了会计科目、财务单据、日记账凭证等领域的实体类、控制器、服务接口、Mapper接口和XML映射文件 - 实现了基本的CRUD操作,包括查询、新增、修改和删除 - 优化了数据校验和批量删除逻辑
100 lines
3.3 KiB
Java
100 lines
3.3 KiB
Java
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.WmsJournalEntryVo;
|
|
import com.klp.domain.bo.WmsJournalEntryBo;
|
|
import com.klp.service.IWmsJournalEntryService;
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 日记账凭证(宽松版)
|
|
*
|
|
* @author klp
|
|
* @date 2025-08-13
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/klp/journalEntry")
|
|
public class WmsJournalEntryController extends BaseController {
|
|
|
|
private final IWmsJournalEntryService iWmsJournalEntryService;
|
|
|
|
/**
|
|
* 查询日记账凭证(宽松版)列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<WmsJournalEntryVo> list(WmsJournalEntryBo bo, PageQuery pageQuery) {
|
|
return iWmsJournalEntryService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出日记账凭证(宽松版)列表
|
|
*/
|
|
@Log(title = "日记账凭证(宽松版)", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(WmsJournalEntryBo bo, HttpServletResponse response) {
|
|
List<WmsJournalEntryVo> list = iWmsJournalEntryService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "日记账凭证(宽松版)", WmsJournalEntryVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取日记账凭证(宽松版)详细信息
|
|
*
|
|
* @param entryId 主键
|
|
*/
|
|
@GetMapping("/{entryId}")
|
|
public R<WmsJournalEntryVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long entryId) {
|
|
return R.ok(iWmsJournalEntryService.queryById(entryId));
|
|
}
|
|
|
|
/**
|
|
* 新增日记账凭证(宽松版)
|
|
*/
|
|
@Log(title = "日记账凭证(宽松版)", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsJournalEntryBo bo) {
|
|
return toAjax(iWmsJournalEntryService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改日记账凭证(宽松版)
|
|
*/
|
|
@Log(title = "日记账凭证(宽松版)", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsJournalEntryBo bo) {
|
|
return toAjax(iWmsJournalEntryService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除日记账凭证(宽松版)
|
|
*
|
|
* @param entryIds 主键串
|
|
*/
|
|
@Log(title = "日记账凭证(宽松版)", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{entryIds}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] entryIds) {
|
|
return toAjax(iWmsJournalEntryService.deleteWithValidByIds(Arrays.asList(entryIds), true));
|
|
}
|
|
}
|