2025-07-18 10:12:48 +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 cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
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.WmsStockIoVo;
|
|
|
|
|
import com.klp.domain.bo.WmsStockIoBo;
|
|
|
|
|
import com.klp.service.IWmsStockIoService;
|
|
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 出入库单主
|
|
|
|
|
*
|
|
|
|
|
* @author Joshi
|
|
|
|
|
* @date 2025-07-18
|
|
|
|
|
*/
|
|
|
|
|
@Validated
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@RestController
|
2025-07-18 10:30:15 +08:00
|
|
|
@RequestMapping("/wms/stockIo")
|
2025-07-18 10:12:48 +08:00
|
|
|
public class WmsStockIoController extends BaseController {
|
|
|
|
|
|
|
|
|
|
private final IWmsStockIoService iWmsStockIoService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询出入库单主列表
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo<WmsStockIoVo> list(WmsStockIoBo bo, PageQuery pageQuery) {
|
|
|
|
|
return iWmsStockIoService.queryPageList(bo, pageQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出出入库单主列表
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "出入库单主", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(WmsStockIoBo bo, HttpServletResponse response) {
|
|
|
|
|
List<WmsStockIoVo> list = iWmsStockIoService.queryList(bo);
|
|
|
|
|
ExcelUtil.exportExcel(list, "出入库单主", WmsStockIoVo.class, response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取出入库单主详细信息
|
|
|
|
|
*
|
|
|
|
|
* @param stockIoId 主键
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/{stockIoId}")
|
|
|
|
|
public R<WmsStockIoVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
|
@PathVariable Long stockIoId) {
|
|
|
|
|
return R.ok(iWmsStockIoService.queryById(stockIoId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增出入库单主
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "出入库单主", businessType = BusinessType.INSERT)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PostMapping()
|
|
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsStockIoBo bo) {
|
|
|
|
|
return toAjax(iWmsStockIoService.insertByBo(bo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改出入库单主
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "出入库单主", businessType = BusinessType.UPDATE)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PutMapping()
|
|
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsStockIoBo bo) {
|
|
|
|
|
return toAjax(iWmsStockIoService.updateByBo(bo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除出入库单主
|
|
|
|
|
*
|
|
|
|
|
* @param stockIoIds 主键串
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "出入库单主", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{stockIoIds}")
|
|
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
@PathVariable Long[] stockIoIds) {
|
|
|
|
|
return toAjax(iWmsStockIoService.deleteWithValidByIds(Arrays.asList(stockIoIds), true));
|
|
|
|
|
}
|
2025-07-18 11:30:09 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 审核出入库/移库单
|
|
|
|
|
*/
|
|
|
|
|
@Log(title = "出入库单主", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PostMapping("/audit/{stockIoId}")
|
|
|
|
|
public R<Void> audit(@NotNull(message = "主键不能为空") @PathVariable Long stockIoId) {
|
|
|
|
|
return toAjax(iWmsStockIoService.auditStockIo(stockIoId));
|
|
|
|
|
}
|
2025-07-18 13:59:36 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 撤销出入库/移库单
|
|
|
|
|
*/
|
|
|
|
|
@SaCheckPermission("klp:stockIo:cancel")
|
|
|
|
|
@Log(title = "出入库单主", businessType = BusinessType.UPDATE)
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PostMapping("/cancel/{stockIoId}")
|
|
|
|
|
public R<Void> cancel(@NotNull(message = "主键不能为空") @PathVariable Long stockIoId) {
|
|
|
|
|
return toAjax(iWmsStockIoService.cancelStockIo(stockIoId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据ioType和stockIoId联查明细
|
|
|
|
|
*/
|
|
|
|
|
@SaCheckPermission("klp:stockIo:detail")
|
|
|
|
|
@GetMapping("/detailByTypeAndId")
|
|
|
|
|
public R<List<com.klp.domain.vo.WmsStockIoDetailVo>> detailByTypeAndId(@RequestParam String ioType, @RequestParam Long stockIoId) {
|
|
|
|
|
return R.ok(iWmsStockIoService.detailByTypeAndId(ioType, stockIoId));
|
|
|
|
|
}
|
2025-07-18 10:12:48 +08:00
|
|
|
}
|