This commit is contained in:
cun-nan 2024-02-26 10:12:19 +08:00
parent 4af99bb62e
commit 7bda79899f
6 changed files with 43 additions and 4 deletions

View File

@ -319,7 +319,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio-group v-model="form.status" :disabled="form.stock==0">
<!-- <el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio label="qy" value="qy">上架</el-radio>
<el-radio label="jy" value="jy">下架</el-radio>

View File

@ -241,7 +241,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form1.status">
<el-radio-group v-model="form1.status" disabled="">
<!-- <el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio label="qy" value="qy">上架</el-radio>
<el-radio label="jy" value="jy">下架</el-radio>

View File

@ -386,7 +386,7 @@ export default {
<style scoped>
.app-container{
width: 100%;
height: 100vh;
height: 100%;
background: #f6f8f9;
}
.clearfix:before,

View File

@ -47,6 +47,16 @@ public interface StockStatisticService extends IService<StockStatistic> {
*/
public int insertStock(StockStatistic stock);
/**
* 修改库存统计信息,增加库存跟踪信息
* @param goodsId 商品id
* @param costAmount 成本金额
* @param document 商品提成来源商品出售
* @param changeNumber 商品变动数量
* @return
*/
public int insertStockStatisticTrack(Integer goodsId,Double costAmount,String document,Integer changeNumber);
/**
* 根据商品id删除库存统计信息
* @param goodsId

View File

@ -17,7 +17,7 @@ public interface StockTrackService extends IService<StockTrack> {
public IPage<StockTrack> selectStockTrackList(Page page,Integer stockId);
/**
* 增加供应商信息
* 增加库存跟踪信息
* @param stockTrack
* @return
*/

View File

@ -6,12 +6,18 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.entity.StockStatistic;
import com.fuint.business.convenienceSore.entity.StockTrack;
import com.fuint.business.convenienceSore.mapper.StockStatisticMapper;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.service.StockStatisticService;
import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.List;
@ -21,6 +27,13 @@ import java.util.List;
*/
@Service
public class StockStatisticServiceImpl extends ServiceImpl<StockStatisticMapper, StockStatistic> implements StockStatisticService {
@Autowired
@Lazy
private LJGoodsService goodsService;
@Autowired
@Lazy
private StockTrackService stockTrackService;
/**
* 根据条件分页查询库存统计信息
* @param page
@ -84,6 +97,22 @@ public class StockStatisticServiceImpl extends ServiceImpl<StockStatisticMapper,
return row;
}
@Override
public int insertStockStatisticTrack(Integer goodsId,Double costAmount,String document,Integer changeNumber) {
goodsService.subtractGoodesStockByLock(goodsId,changeNumber);
StockStatistic stockStatistic = selectStockByGoodsId(goodsId);
stockStatistic.setCostAmount(stockStatistic.getCostAmount()+costAmount);
int row = this.editStock(stockStatistic);
// 添加库存跟踪信息
StockTrack stockTrack = new StockTrack();
stockTrack.setStockId(stockStatistic.getId());
stockTrack.setStoreId(stockStatistic.getStoreId());
stockTrack.setDocument(document);
stockTrack.setChangeNumber(changeNumber);
stockTrackService.insertStockTrack(stockTrack);
return row;
}
/**
* 根据商品id删除库存统计信息
* @param goodsId