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

修改bug

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