2025-12-02 17:58:16 +08:00
|
|
|
package com.klp.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
2025-12-03 10:32:06 +08:00
|
|
|
import com.klp.service.IWmsCostStandardConfigService;
|
2025-12-02 17:58:16 +08:00
|
|
|
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;
|
2025-12-03 10:32:06 +08:00
|
|
|
import com.klp.domain.vo.WmsCostStandardConfigVo;
|
|
|
|
|
import com.klp.domain.bo.WmsCostStandardConfigBo;
|
2025-12-02 17:58:16 +08:00
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 成本标准配置表
|
|
|
|
|
*
|
|
|
|
|
* @author klp
|
|
|
|
|
* @date 2025-11-25
|
|
|
|
|
*/
|
|
|
|
|
@Validated
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/wms/cost/standard")
|
2025-12-03 10:32:06 +08:00
|
|
|
public class WmsCostStandardConfigController extends BaseController {
|
2025-12-02 17:58:16 +08:00
|
|
|
|
2025-12-03 10:32:06 +08:00
|
|
|
private final IWmsCostStandardConfigService iWmsCostStandardConfigService;
|
2025-12-02 17:58:16 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询成本标准配置表列表
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/list")
|
2025-12-03 10:32:06 +08:00
|
|
|
public TableDataInfo<WmsCostStandardConfigVo> list(WmsCostStandardConfigBo bo, PageQuery pageQuery) {
|
|
|
|
|
return iWmsCostStandardConfigService.queryPageList(bo, pageQuery);
|
2025-12-02 17:58:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出成本标准配置表列表
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "成本标准配置表", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
2025-12-03 10:32:06 +08:00
|
|
|
public void export(WmsCostStandardConfigBo bo, HttpServletResponse response) {
|
|
|
|
|
List<WmsCostStandardConfigVo> list = iWmsCostStandardConfigService.queryList(bo);
|
|
|
|
|
ExcelUtil.exportExcel(list, "成本标准配置表", WmsCostStandardConfigVo.class, response);
|
2025-12-02 17:58:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取成本标准配置表详细信息
|
|
|
|
|
*
|
|
|
|
|
* @param configId 主键
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/{configId}")
|
2025-12-03 10:32:06 +08:00
|
|
|
public R<WmsCostStandardConfigVo> getInfo(@NotNull(message = "主键不能为空")
|
2025-12-02 17:58:16 +08:00
|
|
|
@PathVariable Long configId) {
|
2025-12-03 10:32:06 +08:00
|
|
|
return R.ok(iWmsCostStandardConfigService.queryById(configId));
|
2025-12-02 17:58:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询当前有效的成本标准
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/current")
|
2025-12-03 10:32:06 +08:00
|
|
|
public R<WmsCostStandardConfigVo> getCurrent() {
|
|
|
|
|
return R.ok(iWmsCostStandardConfigService.queryCurrentEffective());
|
2025-12-02 17:58:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增成本标准配置表
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "成本标准配置表", businessType = BusinessType.INSERT)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PostMapping()
|
2025-12-03 10:32:06 +08:00
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsCostStandardConfigBo bo) {
|
|
|
|
|
return toAjax(iWmsCostStandardConfigService.insertByBo(bo));
|
2025-12-02 17:58:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改成本标准配置表
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "成本标准配置表", businessType = BusinessType.UPDATE)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PutMapping()
|
2025-12-03 10:32:06 +08:00
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsCostStandardConfigBo bo) {
|
|
|
|
|
return toAjax(iWmsCostStandardConfigService.updateByBo(bo));
|
2025-12-02 17:58:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除成本标准配置表
|
|
|
|
|
*
|
|
|
|
|
* @param configIds 主键串
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "成本标准配置表", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{configIds}")
|
|
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
@PathVariable Long[] configIds) {
|
2025-12-03 10:32:06 +08:00
|
|
|
return toAjax(iWmsCostStandardConfigService.deleteWithValidByIds(Arrays.asList(configIds), true));
|
2025-12-02 17:58:16 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|