|
|
|
|
@ -46,6 +46,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
private final BaseMaterialInfoMapper baseMaterialInfoMapper;//物料基础信息
|
|
|
|
|
private final WmsHppTransferMapper wmsHppTransferMapper;
|
|
|
|
|
private final WmsBaseLocationMapper wmsBaseLocationMapper;
|
|
|
|
|
private final WmsAllocateTaskMapper wmsAllocateTaskMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public WmsOutstockRecordVo returnSelectCode(String code) {
|
|
|
|
|
@ -264,14 +265,48 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean rawOutSubmit(WmsOutstockRecord outstockRecord, WmsInventory wmsInventory) {
|
|
|
|
|
outStoreOperation(outstockRecord, wmsInventory,"5");
|
|
|
|
|
// 修改子表出库数量
|
|
|
|
|
wmsOutstockDetailMapper.updateOutNumberByObjId(wmsInventory.getOutstockDetailId(), outstockRecord.getOutstockQty());
|
|
|
|
|
String type = outstockRecord.getSpecialType();
|
|
|
|
|
outStoreOperation(outstockRecord, wmsInventory, type);
|
|
|
|
|
|
|
|
|
|
if (type.equals("7")) {
|
|
|
|
|
// outstockCode = "AL250905152403002"
|
|
|
|
|
String outstockCode = outstockRecord.getOutstockCode();
|
|
|
|
|
// batchCode = "IN20250903001WMS-003001"
|
|
|
|
|
String batchCode = outstockRecord.getBatchCode();
|
|
|
|
|
// locationCode = "DJ-01"
|
|
|
|
|
BigDecimal outstockQty = outstockRecord.getOutstockQty();
|
|
|
|
|
|
|
|
|
|
//修改调拨子表出库数量
|
|
|
|
|
apiMapper.updateAllocate(wmsInventory.getAoDId(), outstockRecord.getOutstockQty());
|
|
|
|
|
//查询调拨入库任务
|
|
|
|
|
MPJLambdaWrapper<WmsAllocateTask> lqw = JoinWrappers.lambda(WmsAllocateTask.class)
|
|
|
|
|
.selectAll(WmsAllocateTask.class);
|
|
|
|
|
// lqw.eq(WmsAllocateTask::getAoDId, wmsInventory.getAoDId());
|
|
|
|
|
lqw.eq(WmsAllocateTask::getAllocateCode,outstockCode);//单号
|
|
|
|
|
lqw.eq(WmsAllocateTask::getBatchCode,batchCode);//批次码
|
|
|
|
|
WmsAllocateTask WmsAllocateTask =wmsAllocateTaskMapper.selectOne(lqw);
|
|
|
|
|
if (WmsAllocateTask == null) {
|
|
|
|
|
WmsAllocateTask=new WmsAllocateTask();
|
|
|
|
|
BeanUtils.copyProperties(wmsInventory, WmsAllocateTask);
|
|
|
|
|
WmsAllocateTask.setAoDId(wmsInventory.getAoDId());
|
|
|
|
|
WmsAllocateTask.setAllocateCode(outstockCode);
|
|
|
|
|
// WmsAllocateTask.setBatchCode(batchCode);
|
|
|
|
|
WmsAllocateTask.setMaterialQty(outstockQty);
|
|
|
|
|
|
|
|
|
|
wmsAllocateTaskMapper.insert(WmsAllocateTask);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (type.equals("5")) {
|
|
|
|
|
// 修改子表出库数量
|
|
|
|
|
wmsOutstockDetailMapper.updateOutNumberByObjId(wmsInventory.getOutstockDetailId(), outstockRecord.getOutstockQty());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 出库操作
|
|
|
|
|
private void outStoreOperation(WmsOutstockRecord outstockRecord, WmsInventory wmsInventory,String type) {
|
|
|
|
|
private void outStoreOperation(WmsOutstockRecord outstockRecord, WmsInventory wmsInventory, String type) {
|
|
|
|
|
// 出库数量
|
|
|
|
|
BigDecimal outstockQty = outstockRecord.getOutstockQty();
|
|
|
|
|
// 库存
|
|
|
|
|
@ -291,6 +326,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
outstockRecord.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
outstockRecord.setSpecialType(type);
|
|
|
|
|
wmsOutstockRecordMapper.insert(outstockRecord);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -303,7 +339,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean specialOutSubmit(WmsOutstockRecord outstockRecord, WmsInventory wmsInventory) {
|
|
|
|
|
// 出库数量
|
|
|
|
|
outStoreOperation(outstockRecord, wmsInventory,"6");
|
|
|
|
|
outStoreOperation(outstockRecord, wmsInventory, "6");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -321,6 +357,20 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
return wmsInventoryMapper.selectOne(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 出库连子表查物料库存
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public WmsInventory outAllocateSelectInVentory(WmsOutstockRecord outstockRecord) {
|
|
|
|
|
MPJLambdaWrapper<WmsInventory> lqw = JoinWrappers.lambda(WmsInventory.class)
|
|
|
|
|
.selectAll(WmsInventory.class)
|
|
|
|
|
.rightJoin(WmsAllocateOrderDetail.class, WmsAllocateOrderDetail::getMaterialId, WmsInventory::getMaterialId)
|
|
|
|
|
.select(WmsAllocateOrderDetail::getAoDId)
|
|
|
|
|
.eq(WmsAllocateOrderDetail::getAllocateCode, outstockRecord.getOutstockCode())
|
|
|
|
|
.eq(WmsInventory::getBatchCode, outstockRecord.getBatchCode()).eq(WmsInventory::getLocationCode, outstockRecord.getLocationCode());
|
|
|
|
|
return wmsInventoryMapper.selectOne(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<StoreInfoVo> selectStoreInfo(String type) {
|
|
|
|
|
if (type.equals("盘点")) {
|
|
|
|
|
|