| | |
| | | } |
| | | |
| | | @Override |
| | | |
| | | public Integer updateCart(CartEntity cartEntity) { |
| | | String sql = " set nocount on ; \n" |
| | | + " update a set Quantity = ? from t710205 a where CartId = ? \n" |
| | |
| | | Integer ret = null; |
| | | try { |
| | | |
| | | ret = this.jdbcTemplate.queryForObject(sql, new Object[]{cartEntity.getQuantity(), cartEntity.getCartId()}, Integer.class); |
| | | ret = this.jdbcTemplate.queryForObject(sql, Integer.class,new Object[]{cartEntity.getQuantity(), cartEntity.getCartId()}); |
| | | } catch (DataAccessException e) { |
| | | if (e instanceof EmptyResultDataAccessException) { |
| | | return null; |
| | |
| | | throw new ApplicationException("保存购物车商品,删除原有商品不成功"); |
| | | } |
| | | } |
| | | |
| | | for (CartEntity cartEntity : carts) { |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | BeanUtils.copyProperties(cartEntity, cart); |
| | |
| | | //cart.set |
| | | //不刷新价格 |
| | | cart.setRefreshPrice(false); |
| | | map.put(cart.getMatCode(), cartIfc.addToCart(cart)); |
| | | cart.setShopCcCode(null); |
| | | |
| | | map.put(cart.getMatCode(), cartIfc.addToCartAndReturnCartId(cart)); |
| | | result.add(map); |
| | | } |
| | | return result; |