- 新增其他收支实体类WmsOtherIncome及其相关VO、BO类 - 实现其他收支的增删改查接口IWmsOtherIncomeService - 添加其他收支控制器WmsOtherIncomeController支持RESTful请求 - 配置MyBatis映射文件及Mapper接口支持数据库操作 - 在应付和应收业务中增加时间范围筛选字段和逻辑
100 lines
3.1 KiB
Java
100 lines
3.1 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.WmsOtherIncomeVo;
|
|
import com.klp.domain.bo.WmsOtherIncomeBo;
|
|
import com.klp.service.IWmsOtherIncomeService;
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 其他收支
|
|
*
|
|
* @author Joshi
|
|
* @date 2025-09-26
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/klp/otherIncome")
|
|
public class WmsOtherIncomeController extends BaseController {
|
|
|
|
private final IWmsOtherIncomeService iWmsOtherIncomeService;
|
|
|
|
/**
|
|
* 查询其他收支列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<WmsOtherIncomeVo> list(WmsOtherIncomeBo bo, PageQuery pageQuery) {
|
|
return iWmsOtherIncomeService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出其他收支列表
|
|
*/
|
|
@Log(title = "其他收支", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(WmsOtherIncomeBo bo, HttpServletResponse response) {
|
|
List<WmsOtherIncomeVo> list = iWmsOtherIncomeService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "其他收支", WmsOtherIncomeVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取其他收支详细信息
|
|
*
|
|
* @param otherIncomeId 主键
|
|
*/
|
|
@GetMapping("/{otherIncomeId}")
|
|
public R<WmsOtherIncomeVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long otherIncomeId) {
|
|
return R.ok(iWmsOtherIncomeService.queryById(otherIncomeId));
|
|
}
|
|
|
|
/**
|
|
* 新增其他收支
|
|
*/
|
|
@Log(title = "其他收支", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsOtherIncomeBo bo) {
|
|
return toAjax(iWmsOtherIncomeService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改其他收支
|
|
*/
|
|
@Log(title = "其他收支", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsOtherIncomeBo bo) {
|
|
return toAjax(iWmsOtherIncomeService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除其他收支
|
|
*
|
|
* @param otherIncomeIds 主键串
|
|
*/
|
|
@Log(title = "其他收支", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{otherIncomeIds}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] otherIncomeIds) {
|
|
return toAjax(iWmsOtherIncomeService.deleteWithValidByIds(Arrays.asList(otherIncomeIds), true));
|
|
}
|
|
}
|