|
|
|
@ -247,8 +247,9 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 出库提交
|
|
|
|
|
*
|
|
|
|
|
* @param outstockRecord 数据
|
|
|
|
|
* @param wmsInventory 库存
|
|
|
|
|
* @param wmsInventory 库存
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
@ -256,8 +257,9 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
outStoreOperation(outstockRecord, wmsInventory);
|
|
|
|
|
// 修改子表出库数量
|
|
|
|
|
wmsOutstockDetailMapper.updateOutNumberByObjId(wmsInventory.getOutstockDetailId(), outstockRecord.getOutstockQty());
|
|
|
|
|
return null;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 出库操作
|
|
|
|
|
private void outStoreOperation(WmsOutstockRecord outstockRecord, WmsInventory wmsInventory) {
|
|
|
|
|
// 出库数量
|
|
|
|
@ -282,6 +284,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 特殊出库提交 少了子表操作
|
|
|
|
|
*
|
|
|
|
|
* @param outstockRecord
|
|
|
|
|
* @param wmsInventory
|
|
|
|
|
* @return
|
|
|
|
@ -290,7 +293,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
public Boolean specialOutSubmit(WmsOutstockRecord outstockRecord, WmsInventory wmsInventory) {
|
|
|
|
|
// 出库数量
|
|
|
|
|
outStoreOperation(outstockRecord, wmsInventory);
|
|
|
|
|
return null;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -298,7 +301,10 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public WmsInventory outSelectInVentoryByBatch(WmsOutstockRecord outstockRecord) {
|
|
|
|
|
MPJLambdaWrapper<WmsInventory> lqw = JoinWrappers.lambda(WmsInventory.class).rightJoin(WmsOutstockDetail.class, WmsOutstockDetail::getMaterialId, WmsInventory::getMaterialId).select(WmsOutstockDetail::getOutstockDetailId).eq(WmsOutstockDetail::getOutstockCode, outstockRecord.getOutstockCode()).eq(WmsInventory::getBatchCode, outstockRecord.getBatchCode()).eq(WmsInventory::getLocationCode, outstockRecord.getLocationCode());
|
|
|
|
|
MPJLambdaWrapper<WmsInventory> lqw = JoinWrappers.lambda(WmsInventory.class)
|
|
|
|
|
.rightJoin(WmsOutstockDetail.class, WmsOutstockDetail::getMaterialId, WmsInventory::getMaterialId).
|
|
|
|
|
select(WmsOutstockDetail::getOutstockDetailId).eq(WmsOutstockDetail::getOutstockCode, outstockRecord.getOutstockCode())
|
|
|
|
|
.eq(WmsInventory::getBatchCode, outstockRecord.getBatchCode()).eq(WmsInventory::getLocationCode, outstockRecord.getLocationCode());
|
|
|
|
|
return wmsInventoryMapper.selectOne(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -433,6 +439,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
public WmsOutstockRecordVo setHppOutRecord(String code) {
|
|
|
|
|
return apiMapper.setHppOutRecord(code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 上位机删除
|
|
|
|
|
@Override
|
|
|
|
|
public int semiDeleteErrorCode(String code) {
|
|
|
|
@ -441,20 +448,21 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生产入库接口
|
|
|
|
|
*
|
|
|
|
|
* @param vo 入库详情
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean productionSubmitInStoreInfo(ProdInStockApiVo vo) {
|
|
|
|
|
Date nowDate = new Date();
|
|
|
|
|
if (StringUtils.isEmpty(vo.getSecondConfirmFlag())){
|
|
|
|
|
if (StringUtils.isEmpty(vo.getSecondConfirmFlag())) {
|
|
|
|
|
throw new ServiceException("二次确认标识为空!");
|
|
|
|
|
}
|
|
|
|
|
String secondConfirmFlag = vo.getSecondConfirmFlag();// 二次确认标识(0否 1是)
|
|
|
|
|
Long locationId = vo.getLocationId() == null ? 3L : vo.getLocationId();
|
|
|
|
|
Long warehouseId = 4L;//默认仓库
|
|
|
|
|
BaseMaterialInfoVo materialInfoVo = baseMaterialInfoMapper.selectVoById(vo.getMaterialId());
|
|
|
|
|
if (StringUtils.isNull(materialInfoVo)){
|
|
|
|
|
if (StringUtils.isNull(materialInfoVo)) {
|
|
|
|
|
throw new ServiceException("此物料不存在!");
|
|
|
|
|
}
|
|
|
|
|
WmsInstockPrint print = new WmsInstockPrint();
|
|
|
|
@ -470,7 +478,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
print.setCodeYesNo("1");
|
|
|
|
|
print.setLocationId(locationId);
|
|
|
|
|
|
|
|
|
|
if (secondConfirmFlag.equals("0")){
|
|
|
|
|
if (secondConfirmFlag.equals("0")) {
|
|
|
|
|
print.setInboundStatus("1");
|
|
|
|
|
print.setActualInboundTime(nowDate);
|
|
|
|
|
WmsInstockRecord record = new WmsInstockRecord();
|
|
|
|
@ -478,7 +486,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
record.setMaterialId(vo.getMaterialId());
|
|
|
|
|
record.setWarehouseId(warehouseId);
|
|
|
|
|
WmsBaseLocationVo locationVo = wmsBaseLocationMapper.selectVoById(locationId);
|
|
|
|
|
if (locationVo == null){
|
|
|
|
|
if (locationVo == null) {
|
|
|
|
|
throw new ServiceException("此库位不存在!");
|
|
|
|
|
}
|
|
|
|
|
record.setLocationCode(locationVo.getLocationCode());
|
|
|
|
@ -507,10 +515,29 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
wmsInventoryMapper.updateById(inventory);
|
|
|
|
|
}
|
|
|
|
|
wmsInstockPrintMapper.insert(print);
|
|
|
|
|
} else if (secondConfirmFlag.equals("1")){
|
|
|
|
|
} else if (secondConfirmFlag.equals("1")) {
|
|
|
|
|
print.setInboundStatus("0");
|
|
|
|
|
wmsInstockPrintMapper.insert(print);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public WmsInventoryVo ledgerSelect(String batchCode, String locationCode) {
|
|
|
|
|
MPJLambdaWrapper<WmsInventory> lqw = JoinWrappers.lambda(WmsInventory.class)
|
|
|
|
|
.selectAll(WmsInventory.class)
|
|
|
|
|
.select(BaseMaterialInfo::getMaterialCode, BaseMaterialInfo::getMaterialName, BaseMaterialInfo::getMaterialUnit, BaseMaterialInfo::getMaterialSpec)
|
|
|
|
|
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsOutstockRecord::getMaterialId)
|
|
|
|
|
.eq(WmsInventory::getBatchCode, batchCode).eq(WmsInventory::getLocationCode, locationCode);
|
|
|
|
|
return wmsInventoryMapper.selectVoOne(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean moveSubmit(WmsInventoryVo vo) {
|
|
|
|
|
WmsInventory inventory = new WmsInventory();
|
|
|
|
|
inventory.setInventoryId(vo.getInventoryId());
|
|
|
|
|
inventory.setLocationCode(vo.getNewLocationCode());
|
|
|
|
|
int i = wmsInventoryMapper.updateById(inventory);
|
|
|
|
|
return i > 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|