添加耗材警告
This commit is contained in:
parent
d772c63ee5
commit
4d526525a5
|
|
@ -27,5 +27,5 @@ public interface TbUserShopMsgMapper {
|
||||||
TbUserShopMsg selectByShopId(@Param("shopId") String shopId);
|
TbUserShopMsg selectByShopId(@Param("shopId") String shopId);
|
||||||
|
|
||||||
|
|
||||||
List<TbUserShopMsg> selectByShopId(@Param("shopId") Integer shopId);
|
List<TbUserShopMsg> selectAllByShopId(@Param("shopId") Integer shopId);
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ public class ConsMsgConsumer {
|
||||||
String key = redisUtil.getMessage(RedisCst.ORDER_MESSAGE.concat(tbConsInfo.getShopId().toString()).concat("#").concat(tbConsInfo.getId().toString()));
|
String key = redisUtil.getMessage(RedisCst.ORDER_MESSAGE.concat(tbConsInfo.getShopId().toString()).concat("#").concat(tbConsInfo.getId().toString()));
|
||||||
|
|
||||||
if (Objects.isNull(key)) {
|
if (Objects.isNull(key)) {
|
||||||
List<TbUserShopMsg> tbUserShopMsgs = tbUserShopMsgMapper.selectByShopId(tbConsInfo.getShopId());
|
List<TbUserShopMsg> tbUserShopMsgs = tbUserShopMsgMapper.selectAllByShopId(tbConsInfo.getShopId());
|
||||||
if (Objects.nonNull(tbUserShopMsgs) && tbUserShopMsgs.size()>0) {
|
if (Objects.nonNull(tbUserShopMsgs) && tbUserShopMsgs.size()>0) {
|
||||||
|
|
||||||
for (TbUserShopMsg tbUserShopMsg : tbUserShopMsgs) {
|
for (TbUserShopMsg tbUserShopMsg : tbUserShopMsgs) {
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,9 @@ public class ConsService {
|
||||||
String orderId=jsonObject.getString("orderId");
|
String orderId=jsonObject.getString("orderId");
|
||||||
|
|
||||||
|
|
||||||
|
Thread.sleep(1000L);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<TbOrderDetail> orderDetails= tbOrderDetailMapper.selectAllByOrderId(Integer.valueOf(orderId));
|
List<TbOrderDetail> orderDetails= tbOrderDetailMapper.selectAllByOrderId(Integer.valueOf(orderId));
|
||||||
if(Objects.isNull(orderDetails)||orderDetails.size()<=0){
|
if(Objects.isNull(orderDetails)||orderDetails.size()<=0){
|
||||||
|
|
@ -71,17 +74,17 @@ public class ConsService {
|
||||||
amount=proskuCon.getSurplusStock().multiply(new BigDecimal(orderDetail.getNum()));
|
amount=proskuCon.getSurplusStock().multiply(new BigDecimal(orderDetail.getNum()));
|
||||||
|
|
||||||
flow.setAmount(amount);
|
flow.setAmount(amount);
|
||||||
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount));
|
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount).subtract(tbConsInfo.getStockConsume()));
|
||||||
flow.setBizCode("createCart");
|
flow.setBizCode("createCart");
|
||||||
flow.setBizName("加入购物车消耗");
|
flow.setBizName("销售扣除");
|
||||||
flow.setBizType("-");
|
flow.setBizType("-");
|
||||||
}else if("delete".equals(type)){
|
}else if("delete".equals(type)){
|
||||||
amount=proskuCon.getSurplusStock().multiply(new BigDecimal(orderDetail.getNum())).negate();
|
amount=proskuCon.getSurplusStock().multiply(new BigDecimal(orderDetail.getNum())).negate();
|
||||||
|
|
||||||
flow.setAmount(amount.abs());
|
flow.setAmount(amount.abs());
|
||||||
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount));
|
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount).subtract(tbConsInfo.getStockConsume()));
|
||||||
flow.setBizCode("cancelCart");
|
flow.setBizCode("cancelCart");
|
||||||
flow.setBizName("取消购物车返回");
|
flow.setBizName("退单返还");
|
||||||
flow.setBizType("+");
|
flow.setBizType("+");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -540,9 +540,6 @@ public class OrderService {
|
||||||
jsonObject.put("type","create");
|
jsonObject.put("type","create");
|
||||||
producer.cons(jsonObject.toString());
|
producer.cons(jsonObject.toString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS, orderInfo);
|
return Result.success(CodeEnum.SUCCESS, orderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectByShopId" resultMap="BaseResultMap">
|
<select id="selectAllByShopId" resultMap="BaseResultMap">
|
||||||
select * from tb_user_shop_msg where shop_id=#{shopId}
|
select * from tb_user_shop_msg where shop_id=#{shopId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue