|
|
|
@ -154,13 +154,21 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
|
|
|
|
|
for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) {
|
|
|
|
|
//拆解库存表
|
|
|
|
|
InvPreProductDetailEntity invPreInProductDetailEntity=new InvPreProductDetailEntity();
|
|
|
|
|
QueryWrapper<InvPreProductDetailEntity> ew=new QueryWrapper<>();
|
|
|
|
|
ew.eq("code",invPlaceOrderDetailEntity.getCode());
|
|
|
|
|
ew.and(o-> o.isNull("invSpaceCode").or().eq("invSpaceCode",""));
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
ew.eq("code",invPlaceOrderDetailEntity.getCode());
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
invPreInProductDetailEntity=invPreProductDetailDao.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=invPreProductDetailDao.selectOne(ew);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ew.gt("inCount",0);
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
InvPreProductDetailEntity invPreInProductDetailEntity=invPreProductDetailDao.selectOne(ew);
|
|
|
|
|
if(invPreInProductDetailEntity.getInCount()>0){
|
|
|
|
|
String nameCode=invPreInProductDetailEntity.getNameCode();
|
|
|
|
|
int reCount=getActCount(nameCode);
|
|
|
|
@ -172,7 +180,11 @@ 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());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InvPreProductDetailEntity invPreInProductDetailEntity1=invPreProductDetailDao.selectOne(ew);
|
|
|
|
|
if(invPreInProductDetailEntity1!=null){
|
|
|
|
@ -185,8 +197,12 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
invPreInProductDetailEntity.setInCount(1);
|
|
|
|
|
invPreInProductDetailEntity.setCount(1);
|
|
|
|
|
invPreInProductDetailEntity.setOutCount(0);
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
invPreInProductDetailEntity.setReCount(reCount);
|
|
|
|
|
if (bindInvSpaceRequest.getType()==3){
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode());
|
|
|
|
|
}else{
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
invPreProductDetailDao.insert(invPreInProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -199,13 +215,20 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
|
|
|
|
|
for (Integer i = 0; i < invPlaceOrderDetailEntity.getCount(); i++) {
|
|
|
|
|
//拆解库存表
|
|
|
|
|
InvProductDetailEntity invPreInProductDetailEntity=new InvProductDetailEntity();
|
|
|
|
|
QueryWrapper<InvProductDetailEntity> 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");
|
|
|
|
|
InvProductDetailEntity invPreInProductDetailEntity=invProductDetailDao.selectOne(ew);
|
|
|
|
|
if(bindInvSpaceRequest.getType()==3){
|
|
|
|
|
ew.eq("code",invPlaceOrderDetailEntity.getCode());
|
|
|
|
|
ew.eq("invSpaceCode",bindInvSpaceRequest.getInvSpaceCode());
|
|
|
|
|
ew.last("limit 1");
|
|
|
|
|
invPreInProductDetailEntity=invProductDetailDao.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=invProductDetailDao.selectOne(ew);
|
|
|
|
|
}
|
|
|
|
|
if(invPreInProductDetailEntity.getInCount()>0){
|
|
|
|
|
String nameCode=invPreInProductDetailEntity.getNameCode();
|
|
|
|
|
int reCount=getActCount(nameCode);
|
|
|
|
@ -217,7 +240,11 @@ 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());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InvProductDetailEntity invPreInProductDetailEntity1=invProductDetailDao.selectOne(ew);
|
|
|
|
|
if(invPreInProductDetailEntity1!=null){
|
|
|
|
@ -231,7 +258,11 @@ public class InvPlaceServiceImpl implements InvPlaceService {
|
|
|
|
|
invPreInProductDetailEntity.setCount(1);
|
|
|
|
|
invPreInProductDetailEntity.setOutCount(0);
|
|
|
|
|
invPreInProductDetailEntity.setReCount(reCount);
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
if (bindInvSpaceRequest.getType()==3){
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode());
|
|
|
|
|
}else{
|
|
|
|
|
invPreInProductDetailEntity.setInvSpaceCode(invPlaceOrderDetailEntity.getInvSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
invProductDetailDao.insert(invPreInProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|