|
|
|
@ -12,6 +12,9 @@ import com.glxp.api.constant.Constant;
|
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.api.constant.ConstantType;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.controller.inv.InvPreProductController;
|
|
|
|
|
import com.glxp.api.controller.inv.InvPreinProductController;
|
|
|
|
|
import com.glxp.api.controller.inv.InvProductController;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicBusTypeChangeEntity;
|
|
|
|
@ -26,23 +29,33 @@ import com.glxp.api.req.inout.AddReceiveDetailRequest;
|
|
|
|
|
import com.glxp.api.req.inout.FilterReceiveDetailRequest;
|
|
|
|
|
import com.glxp.api.req.inout.FilterReceiveRequest;
|
|
|
|
|
import com.glxp.api.req.inout.UpdateReceiveDetailRequest;
|
|
|
|
|
import com.glxp.api.req.purchase.*;
|
|
|
|
|
import com.glxp.api.req.inv.FilterInvPreProductRequest;
|
|
|
|
|
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
|
|
|
|
|
import com.glxp.api.req.inv.FilterInvProductRequest;
|
|
|
|
|
import com.glxp.api.req.purchase.purReceiveRequest;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.inout.ReceiveDetailResponse;
|
|
|
|
|
import com.glxp.api.res.inout.ReceiveResponse;
|
|
|
|
|
import com.glxp.api.res.inv.InvPreProductResponse;
|
|
|
|
|
import com.glxp.api.res.inv.InvPreinProductResponse;
|
|
|
|
|
import com.glxp.api.res.inv.InvProductResponse;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
|
import com.glxp.api.service.auth.InvWarehouseService;
|
|
|
|
|
import com.glxp.api.service.auth.WarehouseUserService;
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBusTypeChangeService;
|
|
|
|
|
import com.glxp.api.service.basic.UdiProductService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderDetailBizService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
|
import com.glxp.api.service.inout.ReceiveService;
|
|
|
|
|
import com.glxp.api.service.inout.ReceivedetailService;
|
|
|
|
|
import com.glxp.api.service.inv.InvPreProductService;
|
|
|
|
|
import com.glxp.api.service.inv.InvPreinProductService;
|
|
|
|
|
import com.glxp.api.service.inv.InvProductService;
|
|
|
|
|
import com.glxp.api.service.purchase.*;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
|
import com.glxp.api.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.util.OrderNoTypeBean;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
@ -88,6 +101,13 @@ public class PurOrderReceiveController extends BaseController {
|
|
|
|
|
IoOrderDetailBizService ioOrderDetailBizService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoPurChangeService purChangeService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvPreProductController invPreProductController;
|
|
|
|
|
@Resource
|
|
|
|
|
InvPreinProductController invPreinProductController;
|
|
|
|
|
@Resource
|
|
|
|
|
InvProductController invProductController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@ -199,12 +219,66 @@ public class PurOrderReceiveController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(orderNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
WarehouseUserService warehouseUserService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvPreProductService invPreProductService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvPreinProductService invPreinProductService;
|
|
|
|
|
@Resource
|
|
|
|
|
InvProductService invProductService;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/receive/detail/Update")
|
|
|
|
|
public BaseResponse updateReceiveDetail(@RequestBody UpdateReceiveDetailRequest updateReceiveDetailRequest, BindingResult bindingResult) {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
//判断库存
|
|
|
|
|
List<InvPreProductResponse> list = new ArrayList<>();
|
|
|
|
|
List<InvPreinProductResponse> listinvprein = new ArrayList<>();
|
|
|
|
|
List<InvProductResponse> listInv = new ArrayList<>();
|
|
|
|
|
if(updateReceiveDetailRequest.getAdvanceType() == 3){
|
|
|
|
|
//寄售
|
|
|
|
|
FilterInvPreProductRequest request = new FilterInvPreProductRequest();
|
|
|
|
|
// BeanUtils.copyProperties(updateReceiveDetailRequest,request);
|
|
|
|
|
request.setNameCode(updateReceiveDetailRequest.getNameCode());
|
|
|
|
|
request.setInvCode(updateReceiveDetailRequest.getTargetInvCode());
|
|
|
|
|
list = selectFilterInvPreProductRequest(request);
|
|
|
|
|
|
|
|
|
|
}else if(updateReceiveDetailRequest.getAdvanceType() == 2){
|
|
|
|
|
//预验收
|
|
|
|
|
FilterInvPreinProductRequest request = new FilterInvPreinProductRequest();
|
|
|
|
|
// BeanUtils.copyProperties(updateReceiveDetailRequest,request);
|
|
|
|
|
request.setNameCode(updateReceiveDetailRequest.getNameCode());
|
|
|
|
|
request.setInvCode(updateReceiveDetailRequest.getTargetInvCode());
|
|
|
|
|
listinvprein = selectfilterListStock(request);
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
FilterInvProductRequest request = new FilterInvProductRequest();
|
|
|
|
|
// BeanUtils.copyProperties(updateReceiveDetailRequest,request);
|
|
|
|
|
request.setNameCode(updateReceiveDetailRequest.getNameCode());
|
|
|
|
|
request.setInvCode(updateReceiveDetailRequest.getTargetInvCode());
|
|
|
|
|
listInv = selectFilterInvProductRequest(request);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(list != null && list.size()>0 ){
|
|
|
|
|
if( list.get(0).getReCount() < updateReceiveDetailRequest.getCount() ){
|
|
|
|
|
return ResultVOUtils.error(999, "库存不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(listinvprein != null && listinvprein.size()>0 ){
|
|
|
|
|
if(listinvprein.get(0).getReCount() < updateReceiveDetailRequest.getCount() ){
|
|
|
|
|
return ResultVOUtils.error(999, "库存不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(listInv != null && listInv.size()>0 ){
|
|
|
|
|
if(listInv.get(0).getReCount() < updateReceiveDetailRequest.getCount() ){
|
|
|
|
|
return ResultVOUtils.error(999, "库存不足!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean falg = receivedetailService.updateReceiveDetail(updateReceiveDetailRequest);
|
|
|
|
|
if (falg) {
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
@ -213,6 +287,59 @@ public class PurOrderReceiveController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<InvPreProductResponse> selectFilterInvPreProductRequest(FilterInvPreProductRequest filterInvPreProductRequest){
|
|
|
|
|
if (StrUtil.isNotBlank(filterInvPreProductRequest.getUdiCode())) {
|
|
|
|
|
filterInvPreProductRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvPreProductRequest.getUdiCode()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isBlank(filterInvPreProductRequest.getInvCode())) {
|
|
|
|
|
List<String> invCodes = warehouseUserService.selectCodeByUser(customerService.getUserIdStr());
|
|
|
|
|
if (CollUtil.isNotEmpty(invCodes)) {
|
|
|
|
|
filterInvPreProductRequest.setInvCodes(invCodes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<InvPreProductResponse> list = invPreProductService.filterListStock(filterInvPreProductRequest);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<InvPreinProductResponse> selectfilterListStock(FilterInvPreinProductRequest filterInvPreinProductRequest){
|
|
|
|
|
boolean showSup = false; //前端控制表格显示字段
|
|
|
|
|
if (StrUtil.isNotBlank(filterInvPreinProductRequest.getUdiCode())) {
|
|
|
|
|
filterInvPreinProductRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvPreinProductRequest.getUdiCode()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isBlank(filterInvPreinProductRequest.getInvCode())) {
|
|
|
|
|
List<String> invCodes = warehouseUserService.selectCodeByUser(customerService.getUserIdStr());
|
|
|
|
|
if (CollUtil.isNotEmpty(invCodes)) {
|
|
|
|
|
filterInvPreinProductRequest.setInvCodes(invCodes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<InvPreinProductResponse> list = invPreinProductService.filterListStock(filterInvPreinProductRequest);
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<InvProductResponse> selectFilterInvProductRequest(FilterInvProductRequest filterInvProductRequest){
|
|
|
|
|
boolean showSup = false; //前端控制表格显示列字段
|
|
|
|
|
if (StrUtil.isNotBlank(filterInvProductRequest.getUdiCode())) {
|
|
|
|
|
filterInvProductRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvProductRequest.getUdiCode()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isBlank(filterInvProductRequest.getInvCode())) {
|
|
|
|
|
List<String> invCodes = warehouseUserService.selectCodeByUser(customerService.getUserIdStr());
|
|
|
|
|
if (CollUtil.isNotEmpty(invCodes)) {
|
|
|
|
|
filterInvProductRequest.setInvCodes(invCodes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<InvProductResponse> list = invProductService.filterListStock(filterInvProductRequest);
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/receive/order/del")
|
|
|
|
|