- 在 WmsPayableController 和 WmsPayableServiceImpl 中移除了未使用的 WmsReceivable 导入 - 优化了 WmsReceivableServiceImpl 中的代码格式
110 lines
3.6 KiB
Java
110 lines
3.6 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.WmsPayableVo;
|
|
import com.klp.domain.bo.WmsPayableBo;
|
|
import com.klp.service.IWmsPayableService;
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 应付款管理(宽松版)
|
|
*
|
|
* @author klp
|
|
* @date 2025-08-13
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/klp/payable")
|
|
public class WmsPayableController extends BaseController {
|
|
|
|
private final IWmsPayableService iWmsPayableService;
|
|
|
|
/**
|
|
* 查询应付款管理(宽松版)列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<WmsPayableVo> list(WmsPayableBo bo, PageQuery pageQuery) {
|
|
return iWmsPayableService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出应付款管理(宽松版)列表
|
|
*/
|
|
@Log(title = "应付款管理(宽松版)", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(WmsPayableBo bo, HttpServletResponse response) {
|
|
List<WmsPayableVo> list = iWmsPayableService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "应付款管理(宽松版)", WmsPayableVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取应付款管理(宽松版)详细信息
|
|
*
|
|
* @param payableId 主键
|
|
*/
|
|
@GetMapping("/{payableId}")
|
|
public R<WmsPayableVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long payableId) {
|
|
return R.ok(iWmsPayableService.queryById(payableId));
|
|
}
|
|
|
|
/**
|
|
* 新增应付款管理(宽松版)
|
|
*/
|
|
@Log(title = "应付款管理(宽松版)", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsPayableBo bo) {
|
|
return toAjax(iWmsPayableService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 更新应付款已付金额 & 新增资金日记账
|
|
*/
|
|
@Log(title = "应付款管理(宽松版)", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PostMapping("/updatePaidAmount")
|
|
public R<Void> updatePaidAmount(@RequestBody WmsPayableBo bo) {
|
|
return toAjax(iWmsPayableService.updatePaidAmountAndAddJournal(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改应付款管理(宽松版)
|
|
*/
|
|
@Log(title = "应付款管理(宽松版)", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsPayableBo bo) {
|
|
return toAjax(iWmsPayableService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除应付款管理(宽松版)
|
|
*
|
|
* @param payableIds 主键串
|
|
*/
|
|
@Log(title = "应付款管理(宽松版)", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{payableIds}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] payableIds) {
|
|
return toAjax(iWmsPayableService.deleteWithValidByIds(Arrays.asList(payableIds), true));
|
|
}
|
|
}
|