添加耗材警告

This commit is contained in:
韩鹏辉 2024-07-05 14:22:21 +08:00
parent d772c63ee5
commit 4d526525a5
5 changed files with 11 additions and 11 deletions

View File

@ -27,5 +27,5 @@ public interface TbUserShopMsgMapper {
TbUserShopMsg selectByShopId(@Param("shopId") String shopId);
List<TbUserShopMsg> selectByShopId(@Param("shopId") Integer shopId);
List<TbUserShopMsg> selectAllByShopId(@Param("shopId") Integer shopId);
}

View File

@ -116,7 +116,7 @@ public class ConsMsgConsumer {
String key = redisUtil.getMessage(RedisCst.ORDER_MESSAGE.concat(tbConsInfo.getShopId().toString()).concat("#").concat(tbConsInfo.getId().toString()));
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) {
for (TbUserShopMsg tbUserShopMsg : tbUserShopMsgs) {

View File

@ -44,6 +44,9 @@ public class ConsService {
String orderId=jsonObject.getString("orderId");
Thread.sleep(1000L);
List<TbOrderDetail> orderDetails= tbOrderDetailMapper.selectAllByOrderId(Integer.valueOf(orderId));
if(Objects.isNull(orderDetails)||orderDetails.size()<=0){
@ -71,17 +74,17 @@ public class ConsService {
amount=proskuCon.getSurplusStock().multiply(new BigDecimal(orderDetail.getNum()));
flow.setAmount(amount);
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount));
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount).subtract(tbConsInfo.getStockConsume()));
flow.setBizCode("createCart");
flow.setBizName("加入购物车消耗");
flow.setBizName("销售扣除");
flow.setBizType("-");
}else if("delete".equals(type)){
amount=proskuCon.getSurplusStock().multiply(new BigDecimal(orderDetail.getNum())).negate();
flow.setAmount(amount.abs());
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount));
flow.setBalance(tbConsInfo.getStockNumber().subtract(amount).subtract(tbConsInfo.getStockConsume()));
flow.setBizCode("cancelCart");
flow.setBizName("取消购物车返回");
flow.setBizName("退单返还");
flow.setBizType("+");
}

View File

@ -540,9 +540,6 @@ public class OrderService {
jsonObject.put("type","create");
producer.cons(jsonObject.toString());
return Result.success(CodeEnum.SUCCESS, orderInfo);
}

View File

@ -115,7 +115,7 @@
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByShopId" resultMap="BaseResultMap">
<select id="selectAllByShopId" resultMap="BaseResultMap">
select * from tb_user_shop_msg where shop_id=#{shopId}
</select>
</select>
</mapper>