增加 盘点接口

master
wanghao 2 weeks ago
parent dbfeb97eec
commit e2456f5503

@ -274,9 +274,15 @@ public class WmsPdaApiController extends BaseController {
}
return R.ok(list);
}
@PostMapping("/storeCheck/submitCheckRecord")
public R< Void> storeCheckSubmitCheckRecord(@RequestBody WmsInventoryCheckRecord wmsInventoryCheckRecord) {
Boolean result=apiService.storeCheckSubmitCheckRecord(wmsInventoryCheckRecord);
return result ? R.ok() : R.fail();
}
@PostMapping("/storeCheck/storeCheckWorkOver")
public R<Void> storeCheckStoreCheckWorkOver(String checkCode) {
Boolean result=apiService.storeCheckStoreCheckWorkOver(checkCode);
return result ? R.ok() : R.fail();
}
}

@ -2,6 +2,7 @@ package org.dromara.wms.mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.dromara.wms.domain.ShiftChange;
import org.dromara.wms.domain.WmsPsmInLoad;
import org.dromara.wms.domain.WmsPsmInLoadDetail;
@ -43,4 +44,7 @@ public interface WmsPdaApiMapper {
* @return
*/
List<WmsBaseLocationVo> selectRawCheckLocationList(@Param("storeId") Long storeId);
@Update("UPDATE wms_inventory_check SET check_status =#{status} ,end_time = getdate() WHERE check_code =#{checkCode} ")
int updateWmsInventoryCheck(@Param("checkCode") String checkCode,@Param("status") int status);
}

@ -50,4 +50,6 @@ public interface IWmsPdaApiService {
List<WmsInventoryVo> storeCheckSelectInventory(String locationCode);
Boolean storeCheckSubmitCheckRecord(WmsInventoryCheckRecord wmsInventoryCheckRecord);
Boolean storeCheckStoreCheckWorkOver(String checkCode);
}

@ -3,9 +3,11 @@ package org.dromara.wms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.github.yulichang.wrapper.UpdateJoinWrapper;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.satoken.utils.LoginHelper;
@ -33,15 +35,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
@Override
public WmsOutstockRecordVo returnSelectCode(String code) {
MPJLambdaWrapper<WmsOutstockRecord> lqw = JoinWrappers.lambda(WmsOutstockRecord.class)
.selectAll(WmsOutstockRecord.class)
.select(BaseMaterialInfo::getMaterialCode, BaseMaterialInfo::getMaterialName, BaseMaterialInfo::getMaterialUnit, BaseMaterialInfo::getMaterialSpec)
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsOutstockRecord::getMaterialId)
.select(WmsBaseLocation::getWarehouseId)
.leftJoin(WmsBaseLocation.class, WmsBaseLocation::getLocationCode, WmsOutstockRecord::getLocationCode)
.eq(WmsOutstockRecord::getBatchCode, code)
.eq(WmsOutstockRecord::getReturnFlag, 0)
.orderByDesc(WmsOutstockRecord::getCreateTime);
MPJLambdaWrapper<WmsOutstockRecord> lqw = JoinWrappers.lambda(WmsOutstockRecord.class).selectAll(WmsOutstockRecord.class).select(BaseMaterialInfo::getMaterialCode, BaseMaterialInfo::getMaterialName, BaseMaterialInfo::getMaterialUnit, BaseMaterialInfo::getMaterialSpec).leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsOutstockRecord::getMaterialId).select(WmsBaseLocation::getWarehouseId).leftJoin(WmsBaseLocation.class, WmsBaseLocation::getLocationCode, WmsOutstockRecord::getLocationCode).eq(WmsOutstockRecord::getBatchCode, code).eq(WmsOutstockRecord::getReturnFlag, 0).orderByDesc(WmsOutstockRecord::getCreateTime);
return wmsOutstockRecordMapper.selectVoOne(lqw);
}
@ -115,10 +109,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
@Override
public Boolean updataInStoreRecord(WmsHppInStockDetailVo vo) {
LambdaUpdateWrapper<WmsHppInStockDetail> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(WmsHppInStockDetail::getObjId, vo.getObjId())
.set(WmsHppInStockDetail::getStorePlaceId, vo.getStorePlaceId())
.set(WmsHppInStockDetail::getUpdateTime, DateUtils.getTime())
.set(WmsHppInStockDetail::getUpdateBy, LoginHelper.getUsername());
lambdaUpdateWrapper.eq(WmsHppInStockDetail::getObjId, vo.getObjId()).set(WmsHppInStockDetail::getStorePlaceId, vo.getStorePlaceId()).set(WmsHppInStockDetail::getUpdateTime, DateUtils.getTime()).set(WmsHppInStockDetail::getUpdateBy, LoginHelper.getUsername());
int rows = hppInStockDetailMapper.update(null, lambdaUpdateWrapper);
if (rows > 0) {
// System.out.println("更新成功");
@ -155,9 +146,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
hppStorageDetailMapper.deleteById(vo.getStorePlaceId());
} else {
LambdaUpdateWrapper<WmsHppStorageDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(WmsHppStorageDetail::getObjId, vo.getObjId())
.set(WmsHppStorageDetail::getStorageNum, vo.getStorageNum() - vo.getOutNumber())
.set(WmsHppStorageDetail::getUpdateTime, DateUtils.getTime());
updateWrapper.eq(WmsHppStorageDetail::getObjId, vo.getObjId()).set(WmsHppStorageDetail::getStorageNum, vo.getStorageNum() - vo.getOutNumber()).set(WmsHppStorageDetail::getUpdateTime, DateUtils.getTime());
hppStorageDetailMapper.update(updateWrapper);
}
WmsHppOutStockDetail outStockDetail = new WmsHppOutStockDetail();
@ -206,19 +195,14 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
@Override
public List<WmsOutstockDetailVo> outSelectByOrderCode(String orderCode) {
MPJLambdaWrapper<WmsOutstockDetail> lqw = JoinWrappers.lambda(WmsOutstockDetail.class)
.selectAll(WmsOutstockDetail.class)
.select(BaseMaterialInfo::getMaterialUnit, BaseMaterialInfo::getMaterialSpec)
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsOutstockDetail::getMaterialId)
.eq(WmsOutstockDetail::getOutstockCode, orderCode);
MPJLambdaWrapper<WmsOutstockDetail> lqw = JoinWrappers.lambda(WmsOutstockDetail.class).selectAll(WmsOutstockDetail.class).select(BaseMaterialInfo::getMaterialUnit, BaseMaterialInfo::getMaterialSpec).leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsOutstockDetail::getMaterialId).eq(WmsOutstockDetail::getOutstockCode, orderCode);
return wmsOutstockDetailMapper.selectVoList(lqw);
}
@Override
public WmsInventoryVo selectInVentoryByBatchCode(String bacthCode, String locationCode) {
LambdaQueryWrapper<WmsInventory> lqw = Wrappers.lambdaQuery();
lqw.eq(WmsInventory::getBatchCode, bacthCode)
.eq(WmsInventory::getLocationCode, locationCode);
lqw.eq(WmsInventory::getBatchCode, bacthCode).eq(WmsInventory::getLocationCode, locationCode);
return wmsInventoryMapper.selectVoOne(lqw);
}
@ -263,17 +247,13 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
/**
*
*
* @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());
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);
}
@ -291,6 +271,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
List<WmsBaseLocationVo> list = apiMapper.selectRawCheckLocationList(storeId);
return list;
}
private final WmsInventoryCheckMapper wmsInventoryCheckMapper;
// 查询盘点工单
@ -312,7 +293,7 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
insert.setPlanWarehouseId(storeId);
insert.setCreateBy(LoginHelper.getUserId());
wmsInventoryCheckMapper.insert(insert);
return wmsInventoryCheck;
return insert;
}
@Override
@ -321,13 +302,25 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
lqw.eq(WmsInventory::getLocationCode, locationCode);
return wmsInventoryMapper.selectVoList(lqw);
}
private final WmsInventoryCheckRecordMapper wmsInventoryCheckRecordMapper;
@Override
public Boolean storeCheckSubmitCheckRecord(WmsInventoryCheckRecord wmsInventoryCheckRecord) {
wmsInventoryCheckRecord.setCheckStatus(wmsInventoryCheckRecord.getInventoryQty().compareTo(wmsInventoryCheckRecord.getCheckQty())==0 ?"0":"1");
wmsInventoryCheckRecord.setCheckStatus(
wmsInventoryCheckRecord.getInventoryQty().compareTo(wmsInventoryCheckRecord.getCheckQty()) == 0 ? "0" : "1");
wmsInventoryCheckRecord.setCreateBy(LoginHelper.getUsername());
wmsInventoryCheckRecordMapper.insert(wmsInventoryCheckRecord);
return true;
}
@Override
public Boolean storeCheckStoreCheckWorkOver(String checkCode) {
// UpdateJoinWrapper<WmsInventoryCheck> updateWrapper = new UpdateJoinWrapper<>(WmsInventoryCheck.class);
// updateWrapper.eq(WmsInventoryCheck::getCheckCode,checkCode )
// .set(WmsInventoryCheck::getCheckStatus, "3")
// .set(WmsInventoryCheck::getEndTime, DateUtils.getNowDate());
return apiMapper.updateWmsInventoryCheck(checkCode,3) > 0;
}
}

Loading…
Cancel
Save