| | |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | //判断传入id参数是否为空,未传入id为空插入订单表,传入更新表 |
| | | try{ |
| | | Log log = new Log(); |
| | | log.setOperator(order.getCreator()); |
| | | log.setOperatorId(order.getCreatorId()); |
| | | log.setContent(orderMap.toString()); |
| | | log.setFunction("saveOrderTitle保存表头:"+order.getOrderId()); |
| | | |
| | | LambdaUpdateWrapper<Order> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Order::getOrderId, order.getOrderId()); |
| | | order.setCreateTime(null); |
| | | orderMapper.update(order,updateWrapper); |
| | | //修改订单主表面积与周长以及重量 |
| | | orderMapper.updateOrderParameter(order.getOrderId()); |
| | | logService.saveLog(log); |
| | | |
| | | }catch (Exception e){ |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | |
| | | } |
| | | |
| | | Map<String,Object> otherColumns = JSON.parseObject(OrderDetails.get(i).getOtherColumns(), new TypeReference<Map<String, Object>>(){}); |
| | | otherColumns.values().removeIf(value -> value == null || value.equals("")); |
| | | OrderDetails.get(i).setOtherColumns(JSON.toJSONString(otherColumns)); |
| | | |
| | | int finalI = i; |
| | | otherColumns.forEach((key, value) ->{ |
| | | if(otherColumns!=null){ |
| | | otherColumns.values().removeIf(value -> value == null || value.equals("")); |
| | | OrderDetails.get(i).setOtherColumns(JSON.toJSONString(otherColumns)); |
| | | |
| | | if(value!=null && !value.equals("") && key.contains("M")) { |
| | | orderOtherMoneyList.forEach(orderOtherMoney -> { |
| | | if (orderOtherMoney.getColumn().equals(key)) { |
| | | orderOtherMoney.setQuantity( |
| | | orderOtherMoney.getQuantity()+(Double.parseDouble((String) value) * OrderDetails.get(finalI).getQuantity())); |
| | | } |
| | | }); |
| | | } |
| | | otherColumns.forEach((key, value) ->{ |
| | | |
| | | }); |
| | | if(value!=null && !value.equals("") && key.contains("M")) { |
| | | orderOtherMoneyList.forEach(orderOtherMoney -> { |
| | | if (orderOtherMoney.getColumn().equals(key)) { |
| | | orderOtherMoney.setQuantity( |
| | | orderOtherMoney.getQuantity()+(Double.parseDouble((String) value) * OrderDetails.get(finalI).getQuantity())); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | }else{ |
| | | OrderDetails.get(i).setOtherColumns("{}"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | BigDecimal getGrossAmount= BigDecimal.valueOf(orderDetail.getGrossAmount()); |
| | | money+=getGrossAmount.doubleValue(); |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperator(order.getCreator()); |
| | | log.setOperatorId(order.getCreatorId()); |
| | | log.setContent(jsonObject.toString()); |
| | | log.setFunction("updateOrderMoney金额重置:"+order.getOrderId()); |
| | | |
| | | orderOtherMoneyList.forEach(orderOtherMoney -> { |
| | | if(orderOtherMoney.getQuantity()!=null && orderOtherMoney.getPrice()!=null){ |
| | |
| | | order.setOtherMoney(orderOtherMoneyMapper.selectGrossAmount(order.getOrderId())); |
| | | orderMapper.updateMoney(order); |
| | | orderDetailMapper.updateOrderMoney(OrderDetails); |
| | | logService.saveLog(log); |
| | | return false; |
| | | } |
| | | |