提交 1c6d3fb7 authored 作者: huyufan's avatar huyufan

修改BUG

上级 17b592c6
......@@ -66,6 +66,8 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int
Integer updateOrderGoodsSetResidueWeightAndAlreadyWeight(BigDecimal residueWeight, BigDecimal alreadyWeight, Integer id);
Integer updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(BigDecimal residueWeight, BigDecimal alreadyWeight, Integer status, Integer id);
OrderGoodsVO findOrderGoodsById(Integer id);
......
......@@ -174,6 +174,11 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
return baseMapper.updateOrderGoodsSetResidueWeightAndAlreadyWeight(residueWeight,alreadyWeight,id);
}
@Override
public Integer updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(BigDecimal residueWeight, BigDecimal alreadyWeight, Integer status, Integer id) {
return baseMapper.updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(residueWeight,alreadyWeight,status,id);
}
@Override
public OrderGoodsVO findOrderGoodsById(Integer id) {
return baseMapper.findOrderGoodsById(id);
......
......@@ -67,4 +67,7 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@UpdateProvider(type = OrderGoodsSqlProvider.class, method = "updateOrderGoods")
Integer updateOrderGoods(@Param(value = "param") OrderGoodsEditParams orderGoodsEditParams);
@UpdateProvider(type = OrderGoodsSqlProvider.class, method = "updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus")
Integer updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(@Param(value = "residueWeight") BigDecimal residueWeight,@Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value = "status") Integer status,@Param(value = "id") Integer id);
}
......@@ -446,11 +446,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
orderChildDao.batchUpdateOrderChildStatus(OrderChildEnum.Status.PLATFORM_CANCEL.getCode(), orderChildList.stream().map(OrderChild::getId).collect(Collectors.toList()));
log.info("取消货单,参数:{}", JSONUtil.parse(param));
if (orderFeign.rollbackOrderWeight(param).succeed()) {
OrderGoods update = new OrderGoods();
update.setId(orderGoods.getId());
update.setOrderGoodsStatus(OrderGoodsStatusEnum.Status.CANCEL.getCode());
update.setResidueTransportWeight(BigDecimal.ZERO);
orderGoodsDao.updateEntityByKey(update);
orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(BigDecimal.ZERO, sum, OrderGoodsStatusEnum.Status.CANCEL.getCode(), orderGoods.getId());
}
return;
default:
......
......@@ -244,4 +244,17 @@ public class OrderGoodsSqlProvider {
return sql;
}
public String updateOrderGoodsSetResidueWeightAndAlreadyWeightAndStatus(@Param(value ="residueWeight") BigDecimal residueWeight, @Param(value = "alreadyWeight") BigDecimal alreadyWeight,@Param(value ="status") Integer status,@Param(value ="id") Integer id){
String sql = new SQL() {{
UPDATE("order_goods")
.SET("residue_transport_weight = residue_transport_weight + #{residueWeight}")
.SET("already_transport_weight = already_transport_weight + #{alreadyWeight}")
.SET("status = #{status}")
.WHERE("id = #{id}");
}}.toString();
return sql;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论