| | |
| | | List<OrderDetail> OrderDetails = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("detail")), OrderDetail.class); |
| | | List<OrderOtherMoney> orderOtherMoneyList = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("otherMoney")), OrderOtherMoney.class); |
| | | if(orderOtherMoneyList != null ){ |
| | | orderOtherMoneyList = orderOtherMoneyList.stream().filter(o -> o.getColumn().indexOf("M")==0).collect(Collectors.toList()); |
| | | orderOtherMoneyList = orderOtherMoneyList.stream().filter(o -> o.getColumn()==null || o.getColumn().indexOf("M")==0).collect(Collectors.toList()); |
| | | } |
| | | |
| | | boolean saveState = true; |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | |
| | | //先把其他金额副表的金额与数量置0 |
| | | if(orderOtherMoneyList!=null){ |
| | | orderOtherMoneyList.forEach(orderOtherMoney -> { |
| | | orderOtherMoney.setQuantity(0.0); |
| | | if(orderOtherMoney.getColumn()!=null){ |
| | | orderOtherMoney.setQuantity(0.0); |
| | | }else{ |
| | | orderOtherMoney.setMoney(orderOtherMoney.getPrice()*orderOtherMoney.getQuantity()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | List<OrderOtherMoney> orderOtherMoneyList = JSONArray.parseArray(JSONObject.toJSONString(jsonObject.get("otherMoney")), OrderOtherMoney.class); |
| | | |
| | | if(orderOtherMoneyList != null ){ |
| | | orderOtherMoneyList = orderOtherMoneyList.stream().filter(o -> o.getColumn().indexOf("M")==0).collect(Collectors.toList()); |
| | | orderOtherMoneyList = orderOtherMoneyList.stream().filter(o -> (o.getColumn()==null && o.getDeliveryState()==0 ) || o.getColumn().indexOf("M")==0).collect(Collectors.toList()); |
| | | } |
| | | if(orderOtherMoneyList!=null){ |
| | | orderOtherMoneyList.forEach(orderOtherMoney -> { |
| | | orderOtherMoney.setQuantity(0.0); |
| | | if(orderOtherMoney.getColumn()!=null){ |
| | | orderOtherMoney.setQuantity(0.0); |
| | | }else{ |
| | | orderOtherMoney.setMoney(orderOtherMoney.getPrice()*orderOtherMoney.getQuantity()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //删除其他金额明细表 |
| | | orderOtherMoneyMapper.delete(new LambdaQueryWrapper<OrderOtherMoney>().eq(OrderOtherMoney::getOrderId, order.getOrderId())); |
| | | orderOtherMoneyMapper.delete(new LambdaQueryWrapper<OrderOtherMoney>() |
| | | .eq(OrderOtherMoney::getOrderId, order.getOrderId()) |
| | | .eq(OrderOtherMoney::getDeliveryState, 0) |
| | | ); |
| | | List<OrderOtherMoney> orderOtherMoneyLists=orderOtherMoneyList; |
| | | |
| | | double money = 0; |
| | |
| | | |
| | | if(value!=null && !value.equals("") && key.contains("M")) { |
| | | orderOtherMoneyLists.forEach(orderOtherMoney -> { |
| | | if (orderOtherMoney.getColumn().equals(key)) { |
| | | if (orderOtherMoney.getColumn()!=null&&orderOtherMoney.getColumn().equals(key)) { |
| | | orderOtherMoney.setQuantity( |
| | | orderOtherMoney.getQuantity()+(Double.parseDouble((String) value) * finalOrderDetail.getQuantity())); |
| | | } |