2025-08-13 10:33:03 +08:00
|
|
|
|
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.WmsReceivableVo;
|
|
|
|
|
|
import com.klp.domain.bo.WmsReceivableBo;
|
|
|
|
|
|
import com.klp.service.IWmsReceivableService;
|
|
|
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 应收款管理(宽松版)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author klp
|
|
|
|
|
|
* @date 2025-08-13
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Validated
|
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/klp/receivable")
|
|
|
|
|
|
public class WmsReceivableController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private final IWmsReceivableService iWmsReceivableService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询应收款管理(宽松版)列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
|
public TableDataInfo<WmsReceivableVo> list(WmsReceivableBo bo, PageQuery pageQuery) {
|
|
|
|
|
|
return iWmsReceivableService.queryPageList(bo, pageQuery);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 导出应收款管理(宽松版)列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "应收款管理(宽松版)", businessType = BusinessType.EXPORT)
|
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
|
public void export(WmsReceivableBo bo, HttpServletResponse response) {
|
|
|
|
|
|
List<WmsReceivableVo> list = iWmsReceivableService.queryList(bo);
|
|
|
|
|
|
ExcelUtil.exportExcel(list, "应收款管理(宽松版)", WmsReceivableVo.class, response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取应收款管理(宽松版)详细信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param receivableId 主键
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/{receivableId}")
|
|
|
|
|
|
public R<WmsReceivableVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
|
|
@PathVariable Long receivableId) {
|
|
|
|
|
|
return R.ok(iWmsReceivableService.queryById(receivableId));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 新增应收款管理(宽松版)
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "应收款管理(宽松版)", businessType = BusinessType.INSERT)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping()
|
|
|
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReceivableBo bo) {
|
|
|
|
|
|
return toAjax(iWmsReceivableService.insertByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-13 15:34:09 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 更新应收款已收金额 & 新增资金日记账
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "应收款管理(宽松版)", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping("/updatePaidAmount")
|
|
|
|
|
|
public R<Void> updatePaidAmount(@RequestBody WmsReceivableBo bo) {
|
|
|
|
|
|
return toAjax(iWmsReceivableService.updatePaidAmountAndAddJournal(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-13 10:33:03 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 修改应收款管理(宽松版)
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "应收款管理(宽松版)", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PutMapping()
|
|
|
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReceivableBo bo) {
|
|
|
|
|
|
return toAjax(iWmsReceivableService.updateByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 删除应收款管理(宽松版)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param receivableIds 主键串
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "应收款管理(宽松版)", businessType = BusinessType.DELETE)
|
|
|
|
|
|
@DeleteMapping("/{receivableIds}")
|
|
|
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
|
@PathVariable Long[] receivableIds) {
|
|
|
|
|
|
return toAjax(iWmsReceivableService.deleteWithValidByIds(Arrays.asList(receivableIds), true));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|