物质摆放变更功能代码提交

pro
郑明梁 2 years ago
parent a4bf1e086c
commit f11e0fbb10

@ -80,6 +80,21 @@ public class InvPlaceController {
}
/**
*
*
* @param bindInvSpaceRequest
* @return
*/
@PostMapping("/spms/inv/product/bindCheckInvSpace")
public BaseResponse bindCheckInvSpace(@RequestBody BindInvSpaceRequest bindInvSpaceRequest) {
if (null == bindInvSpaceRequest) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invPlaceService.bindInvSpace(bindInvSpaceRequest);
}
/**
*
*
@ -141,6 +156,25 @@ public class InvPlaceController {
return invPlaceOrderService.bindInvSpaceAll(bindInvSpaceRequest);
}
/**
*
*
* @param bindInvSpaceRequest
* @return
*/
@GetMapping("/spms/inv/product/getCheckInvProductInfo")
private BaseResponse getCheckInvProductInfo(BindInvSpaceRequest bindInvSpaceRequest) {
//判断有没有库存
String msg=invPlaceService.checkCount(bindInvSpaceRequest);
if(StrUtil.isEmpty(msg)){
//有库存做插入货位号
return invPlaceOrderService.bindInvSpaceOne(bindInvSpaceRequest);
}else{
return ResultVOUtils.error(500, msg);
}
}
/**
*
*

@ -41,7 +41,7 @@ public class BindInvSpaceRequest {
private String code;
/**
* 1 2
* 1 2 3
*/
private Integer type;

@ -129,6 +129,9 @@ 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());
}
ew.last("limit 1");
InvPreInProductDetailEntity invPreInProductDetailEntity = invPreInProductDetailDao.selectOne(ew);
relId = invPreInProductDetailEntity.getRelId();
@ -141,6 +144,9 @@ 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());
}
ew.last("limit 1");
InvPreProductDetailEntity invPreInProductDetailEntity = invPreProductDetailDao.selectOne(ew);
relId = invPreInProductDetailEntity.getRelId();
@ -153,6 +159,9 @@ 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());
}
ew.last("limit 1");
InvProductDetailEntity invPreInProductDetailEntity = invProductDetailDao.selectOne(ew);
relId = invPreInProductDetailEntity.getRelId();
@ -194,7 +203,11 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
invPlaceOrderDetailEntity.setProduceDate(produceDate);
invPlaceOrderDetailEntity.setSupId(supId);
invPlaceOrderDetailEntity.setInvCode(bindInvSpaceRequest.getInvCode());
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode());
if(bindInvSpaceRequest.getType()==3){
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode());
}else{
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode());
}
invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode());
invPlaceOrderDetailEntity.setSerialNo(serialNo);
invPlaceOrderDetailEntity.setCount(1);
@ -221,7 +234,11 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
invPlaceOrderDetailEntity.setExpireDate(expireDate);
invPlaceOrderDetailEntity.setProduceDate(produceDate);
invPlaceOrderDetailEntity.setSupId(supId);
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode());
if(bindInvSpaceRequest.getType()==3){
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getChangeSpaceCode());
}else{
invPlaceOrderDetailEntity.setInvSpaceCode(bindInvSpaceRequest.getInvSpaceCode());
}
invPlaceOrderDetailEntity.setCode(bindInvSpaceRequest.getCode());
invPlaceOrderDetailEntity.setCount(1);
invPlaceOrderDetailEntity.setSerialNo(serialNo);

@ -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 "该产品库存不足!";
}

Loading…
Cancel
Save