Commit d018db35 authored by 罗林杰's avatar 罗林杰

修改bug

parent 845e0c71
......@@ -56,8 +56,9 @@ public class WmsGoodsServiceImpl extends ServiceImpl<WmsGoodsRepository, WmsGood
// 批量插入
String goodsCode = wmsGoods.getGoodsCode();
String[] goodStr = goodsCode.split(":");
if(goodStr.length < 2)
if(goodStr.length < 2) {
throw new CyServiceException(1001, "数据不合法");
}
String[] itemCode = goodStr[1].split(",");
// 循环
for (int i = 0; i < itemCode.length; i++) {
......@@ -245,8 +246,9 @@ public class WmsGoodsServiceImpl extends ServiceImpl<WmsGoodsRepository, WmsGood
@Override
public WmsGoods findByOss(int id) {
WmsGoods goods = baseMapper.selectById(id);
if(goods != null)
if(goods != null) {
goods.setOssInfoList(baseMapper.findOss(goods));
}
return goods;
}
......@@ -261,13 +263,15 @@ public class WmsGoodsServiceImpl extends ServiceImpl<WmsGoodsRepository, WmsGood
param.setActualGoodsCode(wmsGoods.getGoodsCode());
// 1. 查询 goodsNumber
List<WmsGoods> result = baseMapper.queryWmsGoods(param);
if(CollectionUtils.isEmpty(result) || result.size() > 1)
if(CollectionUtils.isEmpty(result) || result.size() > 1) {
throw new CyServiceException(500, "商品不存在!");
}
WmsGoods goods = result.get(0);
// 2. 查询 kwh
WmsGoodsStock wmsGoodsStock = wmsGoodsStockRepository.selectByIdOut(goods.getBusinessId());
if(wmsGoodsStock != null)
if(wmsGoodsStock != null) {
goods.setGoodsNumber(wmsGoodsStock.getGoodsNumber());
}
return goods;
}
}
......@@ -127,8 +127,9 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
// 3.2 库存满足 => 减库存,日志
// 4. 批量插入日志
// 1. 集合空 判断
if (CollectionUtil.isEmpty(addwmsGoodsApply.getBoxList()))
if (CollectionUtil.isEmpty(addwmsGoodsApply.getBoxList())) {
throw new CyServiceException(1001, "入库商品为空!");
}
// 出库
WmsGoodsApply wmsGoodsApplyOut = new WmsGoodsApply();
BeanUtils.copyProperties(addwmsGoodsApply, wmsGoodsApplyOut);
......@@ -146,8 +147,9 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
WmsGoodsStock goodsStock = wmsGoodsStockRepository.selectById(box.getBusinessId());
// 库存不存在
if (goodsStock == null)
if (goodsStock == null) {
throw new CyServiceException(1001, "库存数量不足");
}
// 库存不足
if (box.getOutCounts() > goodsStock.getGoodsCounts()) {
throw new CyServiceException(1001, "库存数量不足");
......
......@@ -160,8 +160,9 @@ public class WmsGoodsStockServiceImpl extends ServiceImpl<WmsGoodsStockRepositor
stock.setActualGtGoodsCounts(0);
// 1. 查询 goodsNumber
List<WmsGoodsStock> result = baseMapper.queryWmsGoodsStocks(stock);
if(CollectionUtils.isEmpty(result) || result.size() > 1 || result.get(0).getGoodsCounts() < 1)
if(CollectionUtils.isEmpty(result) || result.size() > 1 || result.get(0).getGoodsCounts() < 1) {
throw new CyServiceException(500, "商品不存在或库存不足!");
}
return result.get(0);
}
......
......@@ -174,3 +174,6 @@ logging:
level:
root: info
com.alibaba.nacos: info
system:
goods_h5: value
\ No newline at end of file
......@@ -56,6 +56,9 @@
<if test="entity.storeId !=null and entity.storeId != '' ">
and store_id like concat('%',#{entity.storeId},'%')
</if>
<if test="entity.createName !=null and entity.createName != '' ">
and create_tb.name like concat('%',#{entity.createName},'%')
</if>
ORDER BY cio.business_id DESC
</select>
......@@ -95,6 +98,9 @@
<if test="entity.storeId !=null and entity.storeId != '' ">
and store_id like concat('%',#{entity.storeId},'%')
</if>
<if test="entity.createName !=null and entity.createName != '' ">
and create_tb.name like concat('%',#{entity.createName},'%')
</if>
ORDER BY cio.business_id DESC
</select>
</mapper>
\ No newline at end of file
......@@ -61,6 +61,9 @@
<if test="entity.isRecharge !=null and entity.isRecharge != '' ">
and is_recharge = #{entity.isRecharge}
</if>
<if test="entity.createName !=null and entity.createName != '' ">
and create_tb.name like concat('%',#{entity.createName},'%')
</if>
ORDER BY cre.business_id DESC
</select>
......@@ -103,6 +106,9 @@
<if test="entity.isRecharge !=null and entity.isRecharge != '' ">
and is_recharge = #{entity.isRecharge}
</if>
<if test="entity.createName !=null and entity.createName != '' ">
and create_tb.name like concat('%',#{entity.createName},'%')
</if>
ORDER BY cre.business_id DESC
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment