|
|
|
@ -14,6 +14,7 @@ import org.dromara.common.translation.annotation.Translation;
|
|
|
|
|
import org.dromara.wms.domain.*;
|
|
|
|
|
import org.dromara.wms.domain.vo.*;
|
|
|
|
|
import org.dromara.wms.mapper.*;
|
|
|
|
|
import org.dromara.wms.service.IWmsOutstockRecordService;
|
|
|
|
|
import org.dromara.wms.service.IWmsPdaApiService;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -28,7 +29,6 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
private final WmsOutstockRecordMapper wmsOutstockRecordMapper;
|
|
|
|
|
private final WmsPdaApiMapper apiMapper;
|
|
|
|
|
private final WmsHppInStockDetailMapper baseMapper;
|
|
|
|
|
|
|
|
|
|
private final WmsPsmInStockMapper wmsPsmInStockMapper;
|
|
|
|
|
private final WmsPsmInLoadDetailMapper wmsPsmInLoadDetailMapper;
|
|
|
|
|
|
|
|
|
@ -224,4 +224,63 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
|
|
|
|
|
return wmsInventoryMapper.selectVoOne(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<TeamInfoVo> selectTeams() {
|
|
|
|
|
return apiMapper.selectTeams();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean shiftChangeSubmit(ShiftChange shiftChange) {
|
|
|
|
|
shiftChange.setUserId(LoginHelper.getUserId());
|
|
|
|
|
int i = apiMapper.shiftChangeSubmit(shiftChange);
|
|
|
|
|
return i > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean rawOutSubmit(WmsOutstockRecord outstockRecord, WmsInventory wmsInventory) {
|
|
|
|
|
// 出库数量
|
|
|
|
|
BigDecimal outstockQty = outstockRecord.getOutstockQty();
|
|
|
|
|
// 库存
|
|
|
|
|
BigDecimal inventoryQty = wmsInventory.getInventoryQty();
|
|
|
|
|
inventoryQty = inventoryQty.subtract(outstockQty);
|
|
|
|
|
if (inventoryQty.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
|
wmsInventoryMapper.deleteById(wmsInventory.getInventoryId());
|
|
|
|
|
}else {
|
|
|
|
|
WmsInventory inventory = new WmsInventory();
|
|
|
|
|
inventory.setInventoryId(wmsInventory.getInventoryId());
|
|
|
|
|
inventory.setInventoryQty(inventoryQty);
|
|
|
|
|
wmsInventoryMapper.updateById(inventory);
|
|
|
|
|
}
|
|
|
|
|
// 插入记录
|
|
|
|
|
outstockRecord.setMaterialId(wmsInventory.getMaterialId());
|
|
|
|
|
outstockRecord.setCreateBy(LoginHelper.getUserId());
|
|
|
|
|
outstockRecord.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
wmsOutstockRecordMapper.insert(outstockRecord);
|
|
|
|
|
// 修改子表出库数量
|
|
|
|
|
wmsOutstockDetailMapper.updateOutNumberByObjId(wmsInventory.getOutstockDetailId(),outstockRecord.getOutstockQty());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 出库连子表查物料库存
|
|
|
|
|
* @param outstockRecord
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@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());
|
|
|
|
|
return wmsInventoryMapper.selectOne(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<StoreInfoVo> selectStoreInfo(String type) {
|
|
|
|
|
return List.of();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|