|
|
|
@ -83,7 +83,6 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
// String deptCode = invWarehouseDao.selectParentIdByCode(bindInvSpaceRequest.getInvCode());
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.filterGroupInvSubAndcode(bindInvSpaceRequest.getInvCode());
|
|
|
|
|
List<InvPlaceOrderDetailEntity> invPlaceOrderDetailEntityList=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
|
|
|
|
|
invPlaceOrderDetailEntityList=invPlaceOrderDetailDao.selectList(new QueryWrapper<InvPlaceOrderDetailEntity>().eq("recordId",bindInvSpaceRequest.getOrderId()));
|
|
|
|
|
for (InvPlaceOrderDetailEntity invPlaceOrderDetailEntity : invPlaceOrderDetailEntityList) {
|
|
|
|
@ -91,11 +90,20 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) {
|
|
|
|
|
//拆解库存表
|
|
|
|
|
QueryWrapper<InvPreInProductDetailEntity> ew=new QueryWrapper<>();
|
|
|
|
|
ew.eq("code",invPlaceOrderDetailEntity.getCode());
|
|
|
|
|
ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode",""));
|
|
|
|
|
ew.gt("inCount",0);
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
InvPreInProductDetailEntity invPreInProductDetailEntity=invPreInProductDetailDao.selectOne(ew);
|
|
|
|
|
InvPreInProductDetailEntity invPreInProductDetailEntity=new InvPreInProductDetailEntity();
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
ew.eq("code",invPlaceOrderDetailEntity.getCode());
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
invPreInProductDetailEntity=invPreInProductDetailDao.selectOne(ew);
|
|
|
|
|
}else{
|
|
|
|
|
ew.eq("code",invPlaceOrderDetailEntity.getCode());
|
|
|
|
|
ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode",""));
|
|
|
|
|
ew.gt("inCount",0);
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
invPreInProductDetailEntity=invPreInProductDetailDao.selectOne(ew);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(invPreInProductDetailEntity.getInCount()>0){
|
|
|
|
|
String nameCode=invPreInProductDetailEntity.getNameCode();
|
|
|
|
@ -108,7 +116,12 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
|
|
|
|
|
ew.clear();
|
|
|
|
|
ew.eq("code",invPlaceOrderDetailEntity.getCode());
|
|
|
|
|
ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getChangeSpaceCode());
|
|
|
|
|
}else{
|
|
|
|
|
ew.eq("invSpaceCode",invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InvPreInProductDetailEntity invPreInProductDetailEntity1=invPreInProductDetailDao.selectOne(ew);
|
|
|
|
|
if(invPreInProductDetailEntity1!=null){
|
|
|
|
@ -122,7 +135,11 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
invPreInProductDetailEntity.setCount(1);
|
|
|
|
|
invPreInProductDetailEntity.setReCount(reCount);
|
|
|
|
|
invPreInProductDetailEntity.setOutCount(0);
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
if (bindInvSpaceRequest.getType()==3){
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode());
|
|
|
|
|
}else{
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
invPreInProductDetailDao.insert(invPreInProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -432,8 +449,17 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
@Override
|
|
|
|
|
public String checkCount(BindInvSpaceRequest bindInvSpaceRequest) {
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOne(new QueryWrapper<InvWarehouseEntity>().eq("code", bindInvSpaceRequest.getInvCode()));
|
|
|
|
|
Integer count=0;
|
|
|
|
|
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
|
|
|
|
|
Integer count = invPreInProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
QueryWrapper<InvPreInProductDetailEntity> ew=new QueryWrapper<>();
|
|
|
|
|
ew.eq("code",bindInvSpaceRequest.getCode());
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
InvPreInProductDetailEntity invPreInProductDetailEntity=invPreInProductDetailDao.selectOne(ew);
|
|
|
|
|
count=invPreInProductDetailEntity.getInCount();
|
|
|
|
|
}else{
|
|
|
|
|
count = invPreInProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode());
|
|
|
|
|
}
|
|
|
|
|
if(count==null || count<=0){
|
|
|
|
|
return "该产品库存不足!";
|
|
|
|
|
}
|
|
|
|
@ -442,12 +468,25 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
ew.eq("recordId",bindInvSpaceRequest.getOrderId());
|
|
|
|
|
ew.eq("code",bindInvSpaceRequest.getCode());
|
|
|
|
|
InvPlaceOrderDetailEntity invPlaceOrderDetailEntity =invPlaceOrderDetailDao.selectOne(ew);
|
|
|
|
|
if(invPlaceOrderDetailEntity==null){
|
|
|
|
|
invPlaceOrderDetailEntity=new InvPlaceOrderDetailEntity();
|
|
|
|
|
invPlaceOrderDetailEntity.setCount(0);
|
|
|
|
|
}
|
|
|
|
|
if(invPlaceOrderDetailEntity.getCount()>=count){
|
|
|
|
|
return "该产品库存不足!";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
|
|
|
|
|
Integer count = invPreProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
QueryWrapper<InvPreProductDetailEntity> ew=new QueryWrapper<>();
|
|
|
|
|
ew.eq("code",bindInvSpaceRequest.getCode());
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
InvPreProductDetailEntity invPreProductDetailEntity=invPreProductDetailDao.selectOne(ew);
|
|
|
|
|
count=invPreProductDetailEntity.getInCount();
|
|
|
|
|
}else{
|
|
|
|
|
count = invPreProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(count==null || count<=0){
|
|
|
|
|
return "该产品库存不足!";
|
|
|
|
|
}
|
|
|
|
@ -456,12 +495,25 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
ew.eq("recordId",bindInvSpaceRequest.getOrderId());
|
|
|
|
|
ew.eq("code",bindInvSpaceRequest.getCode());
|
|
|
|
|
InvPlaceOrderDetailEntity invPlaceOrderDetailEntity =invPlaceOrderDetailDao.selectOne(ew);
|
|
|
|
|
if(invPlaceOrderDetailEntity==null){
|
|
|
|
|
invPlaceOrderDetailEntity=new InvPlaceOrderDetailEntity();
|
|
|
|
|
invPlaceOrderDetailEntity.setCount(0);
|
|
|
|
|
}
|
|
|
|
|
if(invPlaceOrderDetailEntity.getCount()>=count){
|
|
|
|
|
return "该产品库存不足!";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL){
|
|
|
|
|
Integer count = invProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode());
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
QueryWrapper<InvProductDetailEntity> ew=new QueryWrapper<>();
|
|
|
|
|
ew.eq("code",bindInvSpaceRequest.getCode());
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity=invProductDetailDao.selectOne(ew);
|
|
|
|
|
count=invProductDetailEntity.getInCount();
|
|
|
|
|
}else{
|
|
|
|
|
count = invProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(count==null || count<=0){
|
|
|
|
|
return "该产品库存不足!";
|
|
|
|
|
}
|
|
|
|
@ -470,6 +522,10 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
ew.eq("recordId",bindInvSpaceRequest.getOrderId());
|
|
|
|
|
ew.eq("code",bindInvSpaceRequest.getCode());
|
|
|
|
|
InvPlaceOrderDetailEntity invPlaceOrderDetailEntity =invPlaceOrderDetailDao.selectOne(ew);
|
|
|
|
|
if(invPlaceOrderDetailEntity==null){
|
|
|
|
|
invPlaceOrderDetailEntity=new InvPlaceOrderDetailEntity();
|
|
|
|
|
invPlaceOrderDetailEntity.setCount(0);
|
|
|
|
|
}
|
|
|
|
|
if(invPlaceOrderDetailEntity.getCount()>=count){
|
|
|
|
|
return "该产品库存不足!";
|
|
|
|
|
}
|
|
|
|
|