|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.api.service.inv.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
@ -18,6 +19,7 @@ import com.glxp.api.req.inv.FilterInvPlaceOrderRequest;
|
|
|
|
|
import com.glxp.api.req.inv.FilterInvPlaceRequest;
|
|
|
|
|
import com.glxp.api.res.inout.IoOrderResponse;
|
|
|
|
|
import com.glxp.api.res.inv.BindInvSpaceRequest;
|
|
|
|
|
import com.glxp.api.res.inv.InvPlaceDetailResponse;
|
|
|
|
|
import com.glxp.api.res.inv.InvPlaceOrderDetailResponse;
|
|
|
|
|
import com.glxp.api.res.inv.InvPlaceOrderResponse;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
@ -26,6 +28,7 @@ import com.glxp.api.service.inv.InvPlaceOrderService;
|
|
|
|
|
import com.glxp.api.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.util.OrderNoTypeBean;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
@ -34,6 +37,7 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Service
|
|
|
|
@ -129,8 +133,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
|
|
|
|
|
QueryWrapper<InvPreInProductDetailEntity> ew = new QueryWrapper<>();
|
|
|
|
|
ew.eq("code", bindInvSpaceRequest.getCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
if (bindInvSpaceRequest.getType() == 3) {
|
|
|
|
|
ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew);
|
|
|
|
@ -144,8 +148,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
|
|
|
|
|
QueryWrapper<InvPreProductDetailEntity> ew = new QueryWrapper<>();
|
|
|
|
|
ew.eq("code", bindInvSpaceRequest.getCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
if (bindInvSpaceRequest.getType() == 3) {
|
|
|
|
|
ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
InvPreProductDetailEntity invPreInProductDetailEntity = invPreProductDetailDao.selectOne(ew);
|
|
|
|
@ -159,8 +163,8 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) {
|
|
|
|
|
QueryWrapper<InvProductDetailEntity> ew = new QueryWrapper<>();
|
|
|
|
|
ew.eq("code", bindInvSpaceRequest.getCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
if (bindInvSpaceRequest.getType() == 3) {
|
|
|
|
|
ew.eq("invSpaceCode", bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
InvProductDetailEntity invPreInProductDetailEntity = invProductDetailDao.selectOne(ew);
|
|
|
|
@ -203,9 +207,9 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
invPlaceOrderDetailEntity.setProduceDate(produceDate);
|
|
|
|
|
invPlaceOrderDetailEntity.setSupId(supId);
|
|
|
|
|
invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
if (bindInvSpaceRequest.getType() == 3) {
|
|
|
|
|
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode());
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode());
|
|
|
|
@ -234,9 +238,9 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
invPlaceOrderDetailEntity.setExpireDate(expireDate);
|
|
|
|
|
invPlaceOrderDetailEntity.setProduceDate(produceDate);
|
|
|
|
|
invPlaceOrderDetailEntity.setSupId(supId);
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
if (bindInvSpaceRequest.getType() == 3) {
|
|
|
|
|
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode());
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode());
|
|
|
|
@ -339,7 +343,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
invPlaceOrderDetailEntity.setRecordId(recordId);
|
|
|
|
|
invPlaceOrderDetailEntity.setBatchNo(filterInvPlaceOrderRequest.getBatchNo());
|
|
|
|
|
invPlaceOrderDetailEntity.setCode(filterInvPlaceOrderRequest.getCode());
|
|
|
|
|
invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId()+"");
|
|
|
|
|
invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId() + "");
|
|
|
|
|
invPlaceOrderDetailEntity.setNameCode(filterInvPlaceOrderRequest.getNameCode());
|
|
|
|
|
invPlaceOrderDetailEntity.setExpireDate(filterInvPlaceOrderRequest.getExpireDate());
|
|
|
|
|
invPlaceOrderDetailEntity.setProduceDate(filterInvPlaceOrderRequest.getProduceDate());
|
|
|
|
@ -358,7 +362,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
invPlaceOrderDetailEntity.setRecordId(recordId);
|
|
|
|
|
invPlaceOrderDetailEntity.setCode(filterInvPlaceOrderRequest.getCode());
|
|
|
|
|
invPlaceOrderDetailEntity.setBatchNo(filterInvPlaceOrderRequest.getBatchNo());
|
|
|
|
|
invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId()+"");
|
|
|
|
|
invPlaceOrderDetailEntity.setRelId(filterInvPlaceOrderRequest.getRelId() + "");
|
|
|
|
|
invPlaceOrderDetailEntity.setNameCode(filterInvPlaceOrderRequest.getNameCode());
|
|
|
|
|
invPlaceOrderDetailEntity.setExpireDate(filterInvPlaceOrderRequest.getExpireDate());
|
|
|
|
|
invPlaceOrderDetailEntity.setProduceDate(filterInvPlaceOrderRequest.getProduceDate());
|
|
|
|
@ -507,4 +511,33 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
|
|
|
|
|
}
|
|
|
|
|
return invPlaceOrderDetailDao.selectDetailList(filterInvPlaceOrderRequest.getOrderId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InvPlaceDetailResponse> filterProductList(FilterInvPlaceRequest filterInvPlaceRequest) {
|
|
|
|
|
|
|
|
|
|
List<InvPlaceDetailResponse> list = invPreInProductDetailDao.filterSpaceList(filterInvPlaceRequest);
|
|
|
|
|
List<InvPlaceDetailResponse> list2 = invPreProductDetailDao.filterSpaceList(filterInvPlaceRequest);
|
|
|
|
|
List<InvPlaceDetailResponse> list3 = invProductDetailDao.filterSpaceList(filterInvPlaceRequest);
|
|
|
|
|
|
|
|
|
|
list.addAll(list2);
|
|
|
|
|
list.addAll(list3);
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceRequest) {
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper<InvWarehouseEntity>().eq("code", filterInvPlaceRequest.getInvCode()));
|
|
|
|
|
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
|
|
|
|
|
List<InvPlaceDetailResponse> list = invPreInProductDetailDao.filterSpaceList(filterInvPlaceRequest);
|
|
|
|
|
return list;
|
|
|
|
|
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
|
|
|
|
|
List<InvPlaceDetailResponse> list = invPreProductDetailDao.filterSpaceList(filterInvPlaceRequest);
|
|
|
|
|
return list;
|
|
|
|
|
} else {
|
|
|
|
|
List<InvPlaceDetailResponse> list = invProductDetailDao.filterSpaceList(filterInvPlaceRequest);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|