You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.4 KiB
Java
72 lines
2.4 KiB
Java
2 years ago
|
package com.glxp.api.controller.inv;
|
||
|
|
||
|
import cn.hutool.core.util.StrUtil;
|
||
|
import com.github.pagehelper.PageInfo;
|
||
|
import com.glxp.api.common.enums.ResultEnum;
|
||
|
import com.glxp.api.common.res.BaseResponse;
|
||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||
|
import com.glxp.api.req.inv.FilterInvPlaceRequest;
|
||
|
import com.glxp.api.res.inv.BindInvSpaceRequest;
|
||
|
import com.glxp.api.res.inv.InvPlaceDetailResponse;
|
||
|
import com.glxp.api.service.inv.InvPlaceService;
|
||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
import javax.annotation.Resource;
|
||
|
import javax.validation.Valid;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* 库存摆放接口
|
||
|
*/
|
||
|
@RestController
|
||
|
public class InvPlaceController {
|
||
|
|
||
|
@Resource
|
||
|
private InvPlaceService invPlaceService;
|
||
|
|
||
|
/**
|
||
|
* 查询库存摆放记录
|
||
|
*
|
||
|
* @return
|
||
|
*/
|
||
|
@GetMapping("/spms/inv/product/getPlaceDetailList")
|
||
|
public BaseResponse getPlaceDetailList(FilterInvPlaceRequest filterInvPlaceRequest) {
|
||
|
List<InvPlaceDetailResponse> list = invPlaceService.getPlaceDetailList(filterInvPlaceRequest);
|
||
|
PageInfo<InvPlaceDetailResponse> pageInfo = new PageInfo<>(list);
|
||
|
return ResultVOUtils.page(pageInfo);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 绑定货位接口
|
||
|
*
|
||
|
* @param bindInvSpaceRequest
|
||
|
* @return
|
||
|
*/
|
||
|
@PostMapping("/spms/inv/product/bindInvSpace")
|
||
|
public BaseResponse bindInvSpace(@RequestBody @Valid BindInvSpaceRequest bindInvSpaceRequest) {
|
||
|
if (null == bindInvSpaceRequest) {
|
||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||
|
}
|
||
|
invPlaceService.bindInvSpace(bindInvSpaceRequest);
|
||
|
return ResultVOUtils.success("绑定成功");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 校验库存详情绑定货位信息
|
||
|
*
|
||
|
* @param bindInvSpaceRequest
|
||
|
* @return
|
||
|
*/
|
||
|
@PostMapping("/spms/inv/product/checkCodeSpace")
|
||
|
public BaseResponse checkCodeSpace(@RequestBody BindInvSpaceRequest bindInvSpaceRequest) {
|
||
|
if (null == bindInvSpaceRequest || StrUtil.isBlank(bindInvSpaceRequest.getInvCode()) || StrUtil.isBlank(bindInvSpaceRequest.getInvSpaceCode()) || StrUtil.isBlank(bindInvSpaceRequest.getCode())) {
|
||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||
|
}
|
||
|
return invPlaceService.checkCodeSpace(bindInvSpaceRequest);
|
||
|
}
|
||
|
|
||
|
}
|